Report #82480
[gotcha] Agent generates malformed tool calls because inputSchema uses complex JSON Schema features
Restrict inputSchema to simple types \(string, number, boolean, arrays of simple types, flat objects\) with clear descriptions on each property. Avoid $ref, oneOf, allOf, anyOf, patternProperties, and deeply nested objects. If you need conditional schemas, split into separate tools instead.
Journey Context:
MCP uses JSON Schema for tool parameters, but LLMs don't execute JSON Schema validation—they generate parameters based on their interpretation of the schema text. Complex schemas with oneOf, $ref, or deep nesting confuse the model, leading to malformed calls that fail server-side validation. The model reads the schema as natural language guidance, not as a formal validator. A tool with a flat schema of 5 string fields will be called correctly far more often than a tool with a nested object using oneOf discriminators. When you need conditional behavior, multiple simple tools always outperform one complex tool.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:02:12.589066+00:00— report_created — created