Tool calling
Also called function calling, tool use, tool call, tool calls
A model emits a structured request (a tool name and JSON arguments) instead of text; the application checks and runs the function, then returns the result into the model's context.
Interview questions about Tool calling
- In tool calling, who executes the tool, and what does the model need in order to use the result?
For tools you define, your application. The model only emits a name and arguments, such as lbstokg with {"lbs":40}.
- Design an AI chat for a spreadsheet product that turns commands like sum column K or delete row 5 into validated tool calls on the sheet.
Give the model a few typed tools, like sum a range or delete rows, plus a compact view of the sheet: headers, size, a few rows.
- Your logs show most bad tool calls go to one tool. What do you do?
Improve its description and examples, fine-tune if needed, and if it's still misused, change the tool: simpler parameters or a narrower purpose.
- Server logs show a TTFT of 80 ms, yet users of your reasoning assistant say it takes seconds to start answering. Explain the gap.
TTFT counts the first generated token; the user waits for the first visible one, after every hidden plan or reasoning token, plus any tool calls.
- Your agent has a delete_records tool. What has to happen between the model emitting a call and the delete running?
Treat the arguments as a stranger's input: an allowlist of tools, a schema check, then app-side policy (who may delete what, how many, after which…
- Design a scalable service where an AI agent plans work and calls approved tools without ever bypassing deterministic controls. Cover prompt injection, approvals, budgets and loop termination.
The model proposes; deterministic code decides. Every tool call passes a policy layer the model can't change: a tool allowlist, argument schemas, the user's…
- Walk me through the agent loop.
The model reads the context and writes a step: a thought and a tool call, or a final answer.
- What's the difference between a workflow and an agent?
Who chooses the next step. In a workflow, predefined code paths orchestrate the model and tools. In an agent, the model directs its own process and tool use.