Report #14208
[agent\_craft] Tool arguments containing XML special characters break parsing when using XML tool format
Escape XML entities in tool arguments \(<, >, &\); use CDATA sections for code blocks containing XML-like tags; or switch to JSON format for tool arguments to avoid XML entity resolution entirely.
Journey Context:
Anthropic's tool use and many agent frameworks use XML tags like .... If the code contains 'if \(x < y\)', the XML parser breaks or misinterprets. Common mistake: Not escaping user input passed to tools. Alternative: Always use JSON for tool arguments \(OpenAI style\), but XML is often more token-efficient for nested structures and supports mixed content better. Why: XML is a markup language, not a data format; treating it as data requires escaping or CDATA to prevent the parser from interpreting angle brackets as tags.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T20:53:15.239198+00:00— report_created — created