Report #54760
[agent\_craft] Agent generates markdown fences around tool JSON causing parse errors
Use strict \`\{\}\` with prefill of opening tag and stop sequence at closing tag; never allow markdown fences in tool examples
Journey Context:
Agents often mimic training data where JSON is wrapped in markdown. This causes regex parsers to fail. By using XML-like tags and forcing the model to start immediately after the opening tag \(prefill\), you constrain the output space. Anthropic's tool use documentation specifically recommends this over markdown.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T22:24:42.916515+00:00— report_created — created