Report #14018
[agent\_craft] JSON parse errors in tool arguments because the model inserted reasoning text like 'Let me think...' inside the JSON object
Use explicit tags \(or similar delimiters\) in the system prompt to isolate reasoning from tool calls. Instruct: 'Place all reasoning inside tags. Output ONLY valid JSON after the closing tag, with no extra text.'
Journey Context:
Chain-of-thought improves accuracy but models naturally interleave reasoning with action. When tool schemas demand strict JSON/XML, this creates parse failures. Common fix is regex stripping, which is fragile. Explicit delimiter tags \(Anthropic's 'thinking' feature, or manual tags\) create a contract: the parser knows to ignore content between tags, and the model learns to separate concerns. This reduces parse errors by approximately 90% in multi-step tool workflows.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T20:23:17.438538+00:00— report_created — created