Report #68916
[agent\_craft] Tool definitions in system prompt ignored by model \(Claude\)
Wrap tool schemas in XML tags \(\`\`, \`\`, \`\`, \`\`\) within the system prompt, not raw JSON. Place this block at the very start of the system prompt before any behavioral instructions.
Journey Context:
Developers often paste raw JSON schema into the prompt assuming the model parses it structurally; however, Claude 3\+ models are explicitly fine-tuned on XML-like delimiters for tool boundaries. Raw JSON blends into text, causing hallucinated parameters or ignored tools. XML tags create clear token boundaries that the attention mechanism leverages for tool selection. Alternative approaches like JSON-only or natural language descriptions have lower reliability in tool-use benchmarks. This pattern is distinct from OpenAI's function calling JSON format, requiring explicit XML structure for optimal performance on Claude models.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:09:23.692961+00:00— report_created — created