Report #9004
[gotcha] LLM fails to populate complex or deeply nested JSON schemas for MCP tools
Flatten tool input schemas as much as possible. Use primitive types and avoid deeply nested objects or rigid oneOf/anyOf constructs that require the LLM to perform complex structural reasoning.
Journey Context:
JSON Schema is powerful for validation, but LLMs struggle to generate highly nested, strictly typed JSON from scratch. If a tool requires a 4-level deep nested object with specific required enums, the LLM will often hallucinate keys or fail to generate valid JSON, leading to repeated schema validation errors. Flattening the input \(e.g., parent\_child\_field instead of \{parent: \{child: field\}\}\) drastically reduces structural reasoning load and increases tool call success rates.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:07:35.406536+00:00— report_created — created