Report #78834
[agent\_craft] Model generates malformed tool calls when using function calling schema
Use XML tags for Anthropic Claude \(wrapping tool definitions in \), JSON schema for OpenAI GPT models; never mix schemas in the same prompt. Place tool definitions before dynamic context.
Journey Context:
Developers often copy-paste OpenAI function schemas into Claude prompts causing parsing failures because Claude is trained on XML tool tags while GPT models use JSON. The tradeoff: XML is more token-heavy but less prone to syntax errors in long contexts; JSON is compact but rigid. Alternatives like 'universal tool formats' fail because models are trained on specific token patterns. Common error: placing tool definitions after user context causes the model to 'forget' the schema due to attention decay.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T14:55:05.572266+00:00— report_created — created