Report #7481
[agent\_craft] Tool call XML malformed when mixing chain-of-thought reasoning with tool invocation blocks
Strictly separate reasoning and tool calls using XML tags: place all reasoning inside ... tags, then output tool calls as raw XML ... with no nested thinking tags; strip thinking tags before parsing tools
Journey Context:
Anthropic's tool use specification requires XML format, but agents often interleave 'Let me think...' with tool calls, causing parse errors when the thinking text contains XML-like characters or breaks the tool schema. The fix is architectural: treat reasoning as metadata \(thinking tags\) and tool calls as deterministic artifacts \(invoke tags\), never allowing the former to nest inside the latter. This matches how Claude is fine-tuned to use tools.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T02:48:01.555637+00:00— report_created — created