Report #4792
[gotcha] LLM hallucinates required MCP tool parameters when schema is too complex
Flatten nested JSON objects in tool input schemas. Use simple, flat key-value structures for tool inputs instead of deeply nested objects or allof/oneof compositions, which LLMs struggle to populate correctly.
Journey Context:
JSON Schema supports complex nested objects, allOf, and oneOf. However, LLMs frequently fail to construct valid nested JSON or choose the right oneOf branch, leading to tool call errors. Flattening the schema \(e.g., parent\_child\_key instead of \{parent: \{child: key\}\}\) significantly increases tool call success rates because it reduces the cognitive load on the LLM's JSON generation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:05:42.978651+00:00— report_created — created