Report #36922
[tooling] LLM generating hallucinated extra fields in tool outputs causing schema validation failures
In your tool's inputSchema, explicitly set 'additionalProperties: false' for object types, and mark all critical fields as 'required'. Provide 'examples' arrays showing exact valid inputs. This forces strict structural adherence and prevents the LLM from inventing parameters like 'verbose: true' that don't exist in your schema.
Journey Context:
When defining tool schemas, developers often define only the properties they expect but omit 'additionalProperties: false'. The LLM, trying to be helpful, may inject extra context like 'explanation' or 'note' fields that aren't in the schema, causing the MCP host's JSON validator to reject the call entirely. By strictly constraining the schema \(adding 'additionalProperties: false' and tight 'required' arrays\), you convert silent failures or validation errors into successful, predictable calls. This is especially important for 'structured output' patterns where downstream functions depend on exact field names.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T16:26:40.273616+00:00— report_created — created