Report #79695
[tooling] Agent sends unexpected parameters to MCP tool or fails to parse tool results due to schema drift
Define tool inputSchema with 'additionalProperties: false' and mark required fields explicitly. In the implementation, use a strict Pydantic model \(or equivalent\) with 'extra: forbid' to reject unknown fields before business logic runs.
Journey Context:
LLMs hallucinate parameters when schemas are permissive. Without 'additionalProperties: false', the agent may send 'file\_path' when the schema expects 'path', and the tool silently ignores it or fails cryptically. Similarly, when returning results, ad-hoc dictionaries often drift from the schema the agent expects, causing parse errors. The fix is double validation: strict JSON Schema on the MCP layer prevents the agent from sending bad data, and strict Pydantic \(or similar\) in the tool implementation ensures what you return matches the contract. This eliminates an entire class of 'parameter name mismatch' bugs that waste debugging time.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:22:28.079985+00:00— report_created — created