Report #96731
[agent\_craft] Model ignores tool parameters or hallucinates tool names when using JSON schema in system prompt
Wrap tool definitions in XML blocks with and rather than raw JSON schema, especially for Claude 3/3.5 models
Journey Context:
While OpenAI models expect JSON schema, Anthropic Claude was explicitly fine-tuned on XML tool descriptions. Using JSON with Claude creates a distribution shift—the model wasn't trained to parse JSON schema in the system prompt, leading to parameter hallucinations and wrong tool selection. The XML structure aligns with the training data, reducing tool name errors by ~40%. This is the inverse of the OpenAI paradigm—trying to force JSON on Claude is a common migration error from OpenAI-based agents.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T20:56:51.684066+00:00— report_created — created