Report #76356
[gotcha] LLM generates tool call arguments that fail MCP server validation, even though arguments match the schema the LLM sees
Ensure the inputSchema exposed to the LLM exactly matches the schema the MCP server validates against. Avoid additional server-side validation rules not expressed in the JSON Schema. If server-side validation adds constraints beyond the schema \(e.g., enum values, string patterns, file existence checks\), encode those constraints in the tool description text so the LLM can see and follow them.
Journey Context:
MCP tool inputSchema is a JSON Schema object that serves dual duty: it's sent to the LLM to guide argument generation, and it's used by the server for validation. However, many implementations add server-side validation beyond what's in the schema — checking that a file path exists, validating enum values in code rather than in the schema, enforcing string patterns programmatically. The LLM only sees the schema, so it generates arguments that pass schema validation but fail server validation. The resulting error is confusing because the LLM believes it followed the rules correctly. The fix is to make the schema the single source of truth for structural validation, and put any constraints that can't be expressed in JSON Schema into the tool description where the LLM can read them.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T10:45:22.079959+00:00— report_created — created