Report #41028
[agent\_craft] JSON schema hallucination in tool parameter generation
Replace JSON schema descriptions in system prompts with XML tag examples for each tool, specifically using \`\`, \`value\` format, as XML tags reduce parameter hallucination compared to JSON objects in the prompt description.
Journey Context:
Agents often describe tools using OpenAI-style JSON schemas in the system prompt, but LLMs \(especially Claude and earlier GPTs\) perform better with XML tag delimiters because the angled brackets act as strong structural markers that reduce boundary confusion. JSON braces are more common in natural code, so the model may hallucinate closing braces or commas. XML forces a hierarchical structure that mirrors the argument nesting.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:20:10.361043+00:00— report_created — created