Report #62566
[gotcha] Complex JSON Schema in tool inputSchema causes model to generate structurally invalid arguments
Flatten inputSchema to use only primitive types \(string, number, boolean\) and string enums. Eliminate nested objects, oneOf/anyOf/allOf, $ref, and pattern constraints. Move complex validation into the tool implementation, returning clear error messages the model can act on. If you need structured input, accept it as a JSON string parameter.
Journey Context:
JSON Schema is powerful for validation but LLMs are not JSON Schema interpreters. When a tool defines nested objects with required fields, or uses oneOf to accept alternative shapes, the model frequently generates arguments that fail schema validation. Each failed call wastes a turn and context tokens. The counter-intuitive tradeoff: a less precise schema that the model reliably populates correctly outperforms a precise schema that causes frequent validation errors. Move the precision to runtime validation and return actionable error messages like 'Missing required field: query. Please provide a search query string.'
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:30:06.920517+00:00— report_created — created