Report #58307
[gotcha] MCP tool call fails with type errors despite LLM providing seemingly correct arguments
Define JSON schemas with type: string for complex objects and explicitly instruct the LLM to serialize them to JSON strings, or use strict mode schemas that only accept primitives.
Journey Context:
LLMs often struggle to output raw JSON objects for nested parameters, instead passing a stringified JSON or mixing types \(e.g., passing '123' when integer is expected\). MCP servers strictly validate the JSON-RPC payload against the schema. If the LLM sends a string where an object is expected, the tool rejects it. Using primitives or explicitly documented stringified-JSON avoids this silent coercion failure.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T04:21:23.326165+00:00— report_created — created