Repository navigation
fix(agent/tool): translate MCP tool inputSchema.properties in Info() - #19244
Conversation
MCPToolAdapter.Info() iterated the top-level inputSchema keys
("type"/"properties"/"required") instead of the real parameter names
under "properties", so eino advertised wrong parameter names to the
model and tools/call would receive invalid arguments.
Read parameter names from inputSchema["properties"], mapping each
property's type/description/required into an eino ParameterInfo, and
fall back to free-form args when no properties are present. Update the
Info test to feed the real wire shape and assert parameter names, types
and required flags.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthrough
ChangesMCP JSON Schema preservation
Estimated code review effort: 3 (Moderate) | ~20 minutes Severity of issue fixed: Low Sequence Diagram(s)sequenceDiagram
participant MCPToolAdapter
participant JSONSchema
participant EinoToolInfo
MCPToolAdapter->>JSONSchema: Convert inputSchema
JSONSchema->>EinoToolInfo: Store complete parameter schema
EinoToolInfo-->>MCPToolAdapter: Return ToolInfo
Merge Risk: ⚪ Minimal · up to MCP tool metadata now reads parameter definitions from the wire-format input schema and preserves richer schemas, with coverage for populated, empty, and absent input schemas. No concrete merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks each schema field Comment |
|
@coderabbitai review |
|
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
MCPToolAdapter.Info() iterated the top-level inputSchema keys ("type"/"properties"/"required") instead of the real parameter names under "properties", so eino advertised wrong parameter names to the model and tools/call would receive invalid arguments.
Read parameter names from inputSchema["properties"], mapping each property's type/description/required into an eino ParameterInfo, and fall back to free-form args when no properties are present. Update the Info test to feed the real wire shape and assert parameter names, types and required flags.
e.g.
{ "type": "object", "properties": { "query": {"type": "string", "description": "the search query", "default": "abc"}, "mode": {"type": "string", "enum": ["fast", "slow"], "default": "fast"}, "limit": {"type": "integer", "description": "max results"}, "tags": {"type": "array", "items": {"type": "string"}}, "filter": {"type": "object", "properties": {"year": {"type": "integer"}}} }, "required": ["query"] }Before:
{ "type": "object", "properties": { "query": {"type": "string", "description": "the search query"}, "mode": {"type": "string", "description": "MCP tool parameter: mode"}, "limit": {"type": "integer", "description": "max results"}, "tags": {"type": "array", "description": "MCP tool parameter: tags"}, "filter": {"type": "object", "description": "MCP tool parameter: filter"} }, "required": ["query"] }Now:
{ "type": "object", "properties": { "query": {"type": "string", "description": "the search query", "default": "abc"}, "mode": {"type": "string", "enum": ["fast", "slow"], "default": "fast"}, "limit": {"type": "integer", "description": "max results"}, "tags": {"type": "array", "items": {"type": "string"}}, "filter": {"type": "object", "properties": {"year": {"type": "integer"}}} }, "required": ["query"] }