TL;DR: The model never runs anything. The request includes tool definitions, each a name, a description and a JSON schema for its arguments. When the model decides a tool would help, its reply contains a structured call: the tool's name and arguments as JSON, with an id. The harness checks the name exists, validates the arguments against the schema, runs the real function, and appends the result as a message tagged with that id. The model reads the result on the next turn. So the tool's description and its error messages are prompt text, the schema is a validator, and a tool "call" is a proposal the harness may refuse.
How to approach it
Explain it as three artefacts and two directions. The artefacts: the definition the model reads, the call the model writes, the result the harness writes back. The directions: definitions and results go in, calls come out. Then say what the harness does between the call and the result, because that gap is where the engineering is.
A strong answer
Tool calling, also sold as function calling, is a convention between the harness and the model. The harness sends, alongside the conversation, a list of tool definitions:
tool definition (what the model reads)
name "get_order"
description "Fetch one order by id. Returns status, items and charges.
Use before answering any question about a specific order."
schema {"type": "object",
"properties": {"order_id": {"type": "string"}},
"required": ["order_id"]}
The model has been trained to answer, when it judges a tool useful, with a structured block instead of or alongside prose:
tool call (what the model writes)
id "call_7f3"
name "get_order"
arguments {"order_id": "4471"}
Nothing has happened yet. The harness now does the work the model cannot: it looks up get_order in its own table, validates the arguments against the schema, decides whether this call is allowed for this user, runs the function against the real system, and builds a result message:
tool result (what the harness writes back)
tool_call_id "call_7f3"
content {"status": "shipped", "charges": [...]}
Then it calls the model again with the transcript extended by the call and the result. The model reads the result as text and decides the next step.
Two consequences follow, and they are what the tool-design topic is about. First, the description is a prompt. The model picks tools by reading names and descriptions, so a vague description produces wrong selections and a precise one, with "use when" and "do not use for", steers it (Tool Contracts). Second, the result is an observation. If the function fails, the harness does not throw; it returns a result that says what went wrong and what would work, so the model can recover, retry with different arguments, or report back (Tool Errors as Observations). An exception that escapes to the user is the loop ending for a reason the model never saw.
The schema is a validator at the boundary, not documentation. Arguments that fail validation go back as a result describing the failure; they are never passed to the function with defaults filled in. And the id matters: a reply may contain several calls, and the model matches results to requests by id. A result without one, or in the wrong order, leaves the model reading a transcript that does not add up.
Authority line: the model chooses which tool and with what arguments; the harness decides whether that call runs at all, and for a payment or a deletion that decision may include a person.
What interviewers probe next
"The model calls a tool that is not in the list." It happens, especially after a long transcript or when a tool was removed. Return a result for that id saying the tool does not exist and naming the ones that do. Never guess a mapping.
"The reply contains three tool calls. Run them in parallel?" Only if each is read-only or the three are independent. Two writes to the same record in one reply need an order, and the model did not specify one. Run reads together, writes one at a time, and return every result by id.
"A tool returns forty thousand tokens." The harness owns the result size. Truncate or summarise before appending, keep the full payload where the model can request a page of it, and say in the result that it was shortened.
How it's scored
Weak: Says the model executes functions, or describes tool calling as the model "having access" to APIs.
Hire: Separates definition, call and result, has the harness validate and run the call, and returns errors as results the model can read.
Strong Hire: Also treats descriptions as prompt text, matches results to calls by id, explains why schema failures go back rather than being patched, and names the authority decision between call and execution.
Common mistakes
- Believing the tool runs inside the model.
- Descriptions that say what a tool is instead of when to use it.
- Letting exceptions escape instead of returning them as results.
- Dropping or reordering results for parallel calls.
- Filling in missing arguments silently instead of reporting the schema failure.