Report #60766
[gotcha] LLM hallucinates invalid tool arguments due to loose JSON schemas
Use strict JSON Schema definitions \(\`additionalProperties: false\`, explicit \`enum\` for discrete values, required fields\) and provide concrete examples in the tool \`description\` rather than relying solely on schema definitions.
Journey Context:
Developers often define tool parameters with loose types \(e.g., \`string\` without an \`enum\` for a fixed set of options, or omitting \`additionalProperties: false\`\). LLMs will guess values or pass extra unrecognized fields. The MCP spec relies on JSON Schema for validation, but if the schema is permissive, the server receives garbage. The LLM reads the description more closely than the schema types, so putting constraints and examples directly in the text description is paradoxically more effective at preventing hallucinations than relying purely on schema constraints.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:28:52.132444+00:00— report_created — created