Add ExecPlan: translate tool schemas per backend (2.3.3)#69
Conversation
…er backend Introduce a comprehensive execution plan document for roadmap item 2.3.3 that outlines the design, constraints, risks, progress, and staged plan for implementing schema translation from canonical MCP tool definitions to backend-specific formats. This new doc establishes the missing contract seam between tool discovery and backend runtime execution, including plans for translation profiles, validation strategies, testing, and orchestration integration to enable consistent tool schema supply across multiple backends. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Reviewer's GuideAdds a new ExecPlan document for roadmap item 2.3.3 that defines how canonical MCP tool definitions will be translated and validated into backend-specific tool schemas, including staged implementation, constraints, risks, testing and documentation gates. Sequence diagram for tool discovery, translation, and runtime executionsequenceDiagram
participant Orchestrator as AgentTurnOrchestratorService
participant AvToolsPort as AvailableToolsPort
participant ToolReg as ToolRegistryReadPort
participant ProfileSel as BackendProfileSelector
participant Translator as ToolTranslationService
participant Validator as ToolValidationService
participant RuntimePort as RuntimePort
participant Runtime as AgentRuntimeAdapter
Orchestrator->>AvToolsPort: list_available_tools(backend_id)
AvToolsPort->>ToolReg: fetch_canonical_tools(backend_id)
ToolReg-->>AvToolsPort: canonical_tools
AvToolsPort-->>Orchestrator: canonical_tools
Orchestrator->>ProfileSel: select_profile(backend_metadata)
ProfileSel-->>Orchestrator: translation_profile
loop for each canonical_tool
Orchestrator->>Translator: translate_tool(canonical_tool, translation_profile)
Translator-->>Orchestrator: translated_tool_schema
Orchestrator->>Validator: validate_translation(canonical_tool, translated_tool_schema, translation_profile)
Validator-->>Orchestrator: validation_result
Orchestrator-->>Orchestrator: collect_translated_tool(translated_tool_schema)
end
Orchestrator->>RuntimePort: execute_turn(turn_execution_request_with_translated_tools)
RuntimePort->>Runtime: execute_turn(turn_execution_request_with_translated_tools)
Runtime-->>RuntimePort: turn_result
RuntimePort-->>Orchestrator: turn_result
Class diagram for planned translation and runtime contractsclassDiagram
class AgentTurnOrchestratorService {
+execute_turn(conversation_id, prompt, backend_id) TurnResult
-load_available_tools(backend_id) CanonicalToolList
-build_turn_request(conversation_id, prompt, backend_id, translated_tools) TurnExecutionRequest
-handle_translation_failure(error) OrchestrationError
}
class AvailableToolsPort {
<<interface>>
+list_available_tools(backend_id) CanonicalToolList
}
class ToolRegistryReadPort {
<<interface>>
+fetch_canonical_tools(backend_id) CanonicalToolList
}
class RuntimePort {
<<interface>>
+execute_turn(request) TurnResult
}
class ToolRouterPort {
<<interface>>
+route_tool_call(tool_call) ToolCallResult
}
class BackendProfileSelector {
+select_profile(backend_metadata) TranslationProfile
}
class ToolTranslationService {
+translate_tool(canonical_tool, profile) TranslatedToolSchema
}
class ToolValidationService {
+validate_translation(canonical_tool, translated_tool, profile) ValidationResult
}
class TurnExecutionRequest {
+conversation_id: Uuid
+prompt: String
+tool_calls: ToolCallList
+available_tools: TranslatedToolSchemaList
}
class McpToolDefinition {
+name: String
+description: String
+input_schema: JsonValue
+output_schema: JsonValue
}
class TranslatedToolSchema {
+backend_profile: TranslationProfile
+name: String
+description: String
+schema_payload: JsonValue
}
class TranslationProfile {
+id: String
+backend_name: String
+provider: String
}
class TranslationError {
+kind: TranslationErrorKind
+message: String
}
class ValidationResult {
+is_valid: bool
+errors: ValidationErrorList
}
class AgentRuntimeAdapter {
<<interface>>
+execute_turn(request) TurnResult
}
class InMemoryAgentRuntimeAdapter {
+last_received_tools: TranslatedToolSchemaList
+execute_turn(request) TurnResult
}
class PostgresBackedAgentRuntimeAdapter {
+execute_turn(request) TurnResult
}
AgentTurnOrchestratorService --> AvailableToolsPort : uses
AvailableToolsPort --> ToolRegistryReadPort : backed_by
AgentTurnOrchestratorService --> BackendProfileSelector : uses
AgentTurnOrchestratorService --> ToolTranslationService : uses
AgentTurnOrchestratorService --> ToolValidationService : uses
AgentTurnOrchestratorService --> RuntimePort : uses
RuntimePort --> AgentRuntimeAdapter : implemented_by
AgentRuntimeAdapter <|-- InMemoryAgentRuntimeAdapter
AgentRuntimeAdapter <|-- PostgresBackedAgentRuntimeAdapter
ToolRouterPort ..> McpToolDefinition : routes_calls_for
McpToolDefinition --> TurnExecutionRequest : referenced_in
TranslatedToolSchema --> TurnExecutionRequest : attached_as_available_tools
BackendProfileSelector --> TranslationProfile : returns
ToolTranslationService --> McpToolDefinition : input
ToolTranslationService --> TranslatedToolSchema : output
ToolValidationService --> ValidationResult : output
TranslationError --> TranslationProfile : may_reference
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary
Changes
Rationale
Plan of work (high level)
Success criteria / observable outcomes
Risks and mitigations
Testing / gate plan
Impact on docs and users
◳ Generated by DevBoxer ◰
ℹ️ Tag @devboxerhub to ask questions and address PR feedback
📎 Task: https://www.devboxer.com/task/678da699-ed9e-45c7-a9cd-d3254db4544a
Summary by Sourcery
Documentation: