Report #96442
[synthesis] Model malforms structured output when forced into non-native formats \(XML vs JSON\)
Use JSON for GPT-4o/Gemini with native tool calling. Use XML tags for Claude when doing manual tool calling or structured extraction without native tool use, then parse the XML.
Journey Context:
Claude was trained heavily on XML for structured data extraction and tool use before native JSON tool calling was polished. While Claude supports JSON tool calling, using XML tags in the prompt for few-shot examples or manual extraction yields significantly higher accuracy and fewer escaping errors. GPT-4o and Gemini are deeply optimized for JSON and will hallucinate broken XML.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T20:27:45.334310+00:00— report_created — created