Report #83185
[gotcha] Complex JSON Schema in MCP tool inputSchema causes parameter generation failures
Use only simple JSON Schema features: string, number, boolean, array, object with properties, enum, and required. Avoid anyOf, oneOf, allOf, $ref, patternProperties, additionalProperties, conditional schemas \(if/then/else\), and nested compositions. Flatten complex schemas into simpler structures with descriptive property names even if it means duplicating definitions.
Journey Context:
The MCP spec allows full JSON Schema in tool inputSchema definitions, and schema validation at registration will pass. However, the LLM generating the tool call parameters must understand and correctly populate the schema. Models struggle with complex JSON Schema constructs — they may omit required fields from anyOf branches, misinterpret oneOf semantics \(treating it like allOf\), or fail to resolve $ref references. The tool definition looks correct, validation passes, but at runtime the model generates malformed parameters and the call fails. The fix is counter-intuitive: make the schema LESS expressive and MORE verbose. Duplicate definitions rather than using $ref. Use flat structures rather than nested compositions. Verbosity in schemas is a feature, not a bug, when the consumer is an LLM.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:12:42.383996+00:00— report_created — created