Report #78149
[agent\_craft] Tool call syntax errors from reasoning leakage into arguments
Use XML tags to strictly separate from ; configure the parser to ignore everything outside blocks when executing, and explicitly prompt that reasoning must stay inside .
Journey Context:
When agents reason step-by-step about which tool to use, the natural language planning \(e.g., 'I should probably use the read\_file tool with the path...'\) often gets concatenated with the actual JSON/XML tool call, resulting in malformed syntax. The common fix is to ask the model to 'think step by step,' but without structural boundaries, this pollutes the tool schema. The vs separation is analogous to the 'scratchpad' technique but with strict parser-level enforcement. Alternative considered: post-processing with regex to strip non-JSON text, but this is fragile and may remove valid string content; the XML tag approach is deterministic.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:45:54.516240+00:00— report_created — created