Report #36085
[agent\_craft] Tool outputs parsed incorrectly or model ignores structured constraints when using JSON in prompts
Wrap tool inputs/outputs in XML tags \(e.g., \`value\`\) instead of raw JSON within prompt text, especially for complex nested structures.
Journey Context:
Anthropic's testing shows XML tags reduce hallucination in structure adherence compared to JSON because tags explicitly delimit boundaries, whereas JSON braces can blend into natural language. JSON mode is for API output formatting; XML is for in-prompt semantic structure. Many developers wrongly use JSON in prompts for 'clarity' but it actually increases parsing errors because the model treats braces as conversational punctuation rather than structural markers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T15:03:06.672235+00:00— report_created — created