What is tool-call hallucination, and how do you defend against it?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
The model emits calls to tools that don't exist, or real tools with fabricated arguments - invented file paths, guessed IDs, out-of-enum values, parameters from a similarly named tool it saw in training data or earlier in the conversation. It's the tool-use flavour of ordinary hallucination: the model produces a plausible completion rather than a grounded one.
Full worked answer
The model emits calls to tools that don't exist, or real tools with fabricated arguments - invented file paths, guessed IDs, out-of-enum values, parameters from a similarly named tool it saw in training data or earlier in the conversation. It's the tool-use flavour of ordinary hallucination: the model produces a plausible completion rather than a grounded one.
Where it comes from: training priors (the model has seen thousands of search_web tools, so it calls yours search_web even though you named it query_kb); context ghosts (a tool that was in the manifest earlier - or mentioned in conversation - gets called after removal); confusable tools (overlapping names/descriptions); forced tool choice on input that doesn't fit, which mandates fabricated arguments; and ID laundering (the model needs an ID it never retrieved, so it invents one that looks right - the most dangerous variant, since get_user("usr_4821") might hit a real other record).
Defences, in layers:
- Validate everything at the executor. Unknown tool → return an actionable error listing available tools (models recover from this well in one turn). Schema-check arguments - types, enums, formats - before execution; constrained decoding (strict/structured-output modes) can guarantee schema validity of arguments, though it can't guarantee they're true.
- Referential integrity for IDs. The schema can't know
usr_4821doesn't belong to this customer - the executor must check that IDs were actually returned by prior tool calls in this session, or scope credentials so out-of-scope IDs fail closed. This turns the worst variant into a safe error. - Prevention upstream: fewer, more distinct tools; names that don't collide with common training-data tool names or do (matching the canonical name helps the prior work for you); don't remove/rename tools mid-conversation; avoid forcing a specific tool unless the input is guaranteed to fit.
- Measure it: invalid-call rate per tool is a standing eval and production metric; a spike after a manifest change means your new descriptions are confusing.
What a good answer covers
- The model emits calls to tools that don't exist, or real tools with fabricated arguments - invented file…
- It's the tool-use flavour of ordinary hallucination
- Where it comes from: training priors (the model has seen thousands of search_web tools, so it calls…
- Validate everything at the executor
- Referential integrity for IDs
Key terms: training priors · context ghosts · confusable tools · forced tool choice · ID laundering · Validate everything at the executor · Referential integrity for IDs · Prevention upstream · Measure it
In the glossary: Hallucination · Constrained decoding · Tool call
Interviewer follow-ups to expect
Why is a fabricated-but-valid ID worse than a nonexistent tool call?
Does strict/constrained decoding eliminate this class of failure?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep