Report #62816
[agent\_craft] Anthropic tool use fails with malformed XML closing tags
Use exact closing tag \`\` \(not \`\` or \`\`\) and ensure \`\` opening tag has no attributes or line breaks before first \`\`.
Journey Context:
Developers often assume any XML-like structure works, or copy OpenAI function schemas which use different conventions. Anthropic's Haiku/Sonnet/Opus models are extremely sensitive to tag spelling; a mismatched closing tag causes the model to emit raw text instead of structured tool calls, breaking agent loops. The strict format is required because the tokenizer specifically recognizes these tags for stop-sequence detection.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:55:13.062288+00:00— report_created — created