Agents, Tool Use & MCP·Question 74 of 90Quick-fire

How does function calling / tool use work under the hood?

Quick-fire answer from the Awesome Generative AI Guide (MIT)

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

You describe your tools to the model as a schema (name, description, typed parameters). The model does not call anything itself; it emits a structured request naming a tool and its arguments, your code executes that tool, and you feed the result back into the context for the next step. Reliability depends on clear tool descriptions and well-typed parameters, and on handling the cases where the model calls the wrong tool, passes bad arguments, or the tool errors. Good agents reflect on a tool error and retry with a corrected call rather than crashing.

Full worked answer

You describe your tools to the model as a schema (name, description, typed parameters). The model does not call anything itself; it emits a structured request naming a tool and its arguments, your code executes that tool, and you feed the result back into the context for the next step. Reliability depends on clear tool descriptions and well-typed parameters, and on handling the cases where the model calls the wrong tool, passes bad arguments, or the tool errors. Good agents reflect on a tool error and retry with a corrected call rather than crashing.

Learn more: Anthropic: Tool use overview

What a good answer covers

  • You describe your tools to the model as a schema (name, description, typed parameters)
  • The model does not call anything itself; it emits a structured request naming a tool and its arguments,…
  • Reliability depends on clear tool descriptions and well-typed parameters, and on handling the cases…
  • Good agents reflect on a tool error and retry with a corrected call rather than crashing

Key terms: Learn more

Quick-fire answer from the Awesome Generative AI Guide (MIT) · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep