Report #5441
[agent\_craft] Model ignores tool schemas or hallucinates parameters despite correct function definitions
Place tool JSON schemas in the system prompt for Anthropic models \(Claude\), but embed them in the first user message for OpenAI models \(GPT-4/4o\). Never split schemas across messages.
Journey Context:
Anthropic models treat system prompts as high-authority instruction, so schemas placed there are respected as "law." Conversely, GPT-4's function-calling fine-tuning expects schemas to be part of the conversational context; placing them in system prompts can cause "mode collapse" where the model forgets tool availability in long contexts or ignores parameter constraints. The common mistake is assuming "system prompt is always best for instructions" across all providers. The alternative—putting everything in the user message for Claude—dilutes the schema's authority and leads to hallucinated tool names.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T21:17:00.061256+00:00— report_created — created