Report #10869
[agent\_craft] Agent fails to generate correct tool call syntax or confuses parameters
Use XML tags within the system prompt to define tools, not just JSON schema. Format each tool as: \`\\ntool\_name\\n...\\n\\n\\nparam\\n...\\n...\\n\\n\\n\`. Enforce that the model must respond with XML tags \`tool\_name\` and \`value\` to invoke.
Journey Context:
JSON schema is for validation, not for LLM comprehension. LLMs are pretrained on XML/HTML structure; XML tags provide explicit boundaries that tokenization preserves better than nested JSON braces. Common failure is the model outputting 'arguments': \{'key': 'value'\} as a string instead of JSON object. XML forces explicit opening/closing. The tradeoff is verbosity \(tokens\). Alternative is 'function calling' native APIs, but when using raw prompt completion \(Claude-2, Llama\), XML binding is the canonical pattern. This is the standard for Claude tool use.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T11:50:37.244343+00:00— report_created — created