Report #94970
[agent\_craft] Agent hallucinates tool arguments or ignores tool schema when using non-native tool models
Inline the JSON schema inside the user prompt wrapped in XML tags \(e.g., ...\) rather than placing it in the system prompt; explicitly instruct the model to respond with tags.
Journey Context:
System prompts are 'soft' instructions that models easily overlook when focused on user tasks. Inlining tool schemas in the user prompt creates a stronger contextual anchor. Alternatives like native function-calling APIs \(OpenAI \`tools\` parameter\) are preferred when available, but for open-source models or older APIs, XML tagging in the user prompt reduces hallucination vs JSON schema in system text. Tradeoff: increases token count in user prompt vs system prompt.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:59:16.184845+00:00— report_created — created