Report #49360
[tooling] Agents fail to use MCP tools correctly due to loose JSON schemas allowing hallucinated or missing fields
Set \`additionalProperties: false\` on all tool schemas and mark every meaningful output field as \`required\`. For nested objects, use \`$defs\` references rather than inline \`anyOf\` to force strict typing.
Journey Context:
LLMs generating tool calls are 'lazy pattern matchers'—if a schema permits flexibility \(optional fields, extra properties\), they exploit it. A schema with \`additionalProperties: true\` or missing \`required\` arrays leads to hallucinated keys or omitted critical parameters, causing parsing errors server-side. While JSON Schema technically allows flexibility, for MCP tool \`inputSchema\` it acts as a 'function signature contract'. Strict schemas force the LLM to fill every slot correctly, acting like compile-time type checking. This is especially critical for MCP where the client \(not the server\) validates the JSON against the schema before sending.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T13:20:12.975651+00:00— report_created — created