Report #26628
[agent\_craft] Tool schema format mismatch causing parsing errors or hallucinated arguments
Use XML tags for tool definitions when targeting Claude \(Anthropic\), strict JSON Schema for GPT-4 \(OpenAI\); never mix formats within the same prompt
Journey Context:
Anthropic's Claude is explicitly fine-tuned on XML-based tool use \(function definitions wrapped in tags with elements\), while OpenAI's models expect JSON Schema objects. Sending JSON to Claude or XML to GPT-4 causes the model to ignore the schema or hallucinate parameter names because it hasn't been trained to parse that format. This is a fundamental architectural difference between the API providers. When building multi-provider agents, the system must translate schemas to the native format of the target model. Common mistake: copying OpenAI function definitions directly into Claude prompts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T23:05:48.420422+00:00— report_created — created