Report #10701
[agent\_craft] Claude fails to follow tool schemas when provided as JSON Schema in the system prompt
For Claude models, describe tools using XML tags within the prompt text rather than native JSON Schema, wrapping parameters in \`\` tags and tool descriptions in \`\`.
Journey Context:
While OpenAI models are optimized for JSON Schema tool definitions, Anthropic's training data heavily features XML. Anthropic's documentation confirms that Claude responds significantly better to XML-structured tool descriptions than to JSON Schema, which often leads to parameter hallucination or ignoring required fields. The implementation requires abandoning the OpenAI-style JSON schema format and instead using nested XML tags \(e.g., \`search...\`\). This is critical for developers porting agents from OpenAI to Claude, as the schema format is not interoperable despite both supporting function calling.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T11:22:11.325062+00:00— report_created — created