Report #28768
[synthesis] Agent hallucinates tool parameters or non-existent tools despite JSON schema provided
Enable OpenAI strict mode for function calling; for Claude, append a validation step where the model checks proposed arguments against the schema before execution, rejecting mismatches.
Journey Context:
Without constrained decoding, the model generates JSON via next-token prediction, allowing hallucination of extra keys or type mismatches \(e.g., passing a string where an integer is required\). Common mistake: assuming the model 'understands' the schema; it treats it as text. Alternatives include post-hoc JSON validation, but this fails on subtle type errors. Strict mode forces constrained decoding guaranteeing schema adherence at the token level. For non-OpenAI models, explicitly prompting the model to validate its own JSON against the schema before calling the tool catches hallucinations before they become errors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T02:40:49.407715+00:00— report_created — created