Tool use and function calling
- Agents
- Asked in most interview loops
- About 65 min to learn
- 4 vetted resources
What this topic covers
Tool calling lets a model ask your code to run a function: you describe each tool with a name, a description and a JSON schema, the model replies with a structured call instead of prose, your app executes it and sends the result back, and the loop repeats until the model answers. Under the hood the tool definitions are just extra prompt tokens, so they cost context and their wording steers behaviour. Interviews ask you to walk through that round trip, explain tool_choice (auto / required / forced / none), parallel calls and strict schema mode, and say what happens when arguments are missing or a tool errors. Strong candidates also talk about tool design: few, well-named tools with clear descriptions, and inputs shaped so the model can't easily get them wrong.
Leads to
- Agent loops: workflows vs agents
- Model Context Protocol (MCP)
- Guardrails and safety: prompt injection, jailbreaks, output filtering
- Structured outputs and validation
- LLM and agent security
- Voice and realtime agents
- Design an AI customer-support agent
- Design a ChatGPT-style assistant
- Computer-use and browser agents
You’re ready when you can
What interviewers check, from the resources below.
- Draw the full tool-calling loop and say who executes the function at each step
- Write a JSON schema for a small tool with required fields and a clear description
- Explain what each tool_choice setting does and when you'd force a call
- Explain what strict mode guarantees and why tool definitions consume input tokens
- Describe how to return a tool error so the model can recover
- Contrast client tools and server tools by where the code runs
- Trace a tool_use block to its matching tool_result by id
- Explain how the system prompt and tool_choice change how often a tool is called
- List what adds tokens to a tool-use request
- Explain why tool descriptions deserve as much prompt work as the main prompt
What to study, in order
Each link opened and checked by hand; the date says when.
Start here
Function calling (opens in a new tab)
OpenAI API docs · OpenAI · 40 min · Free · checked 21 Oct 2026
- Why
- Almost every applied LLM loop asks you to explain or code the request → tool call → execute → result round trip, and this guide covers each knob interviewers probe.
- What to read
- Read “How it works” (including “The tool calling flow”), “Function tool example”, “Defining functions”, “Best practices for defining functions”, “Token Usage”, “Handling function calls”, and “Additional configurations” (“Tool choice”, “Parallel function calling”, “Strict mode”).
- What to skip
- “Custom tools” and all its grammar subsections (Lark/Regex CFG), “Defining namespaces”, “Tool search”, and “Streaming” unless you're building a chat UI.
Free alternative
Tool use with Claude (opens in a new tab)
Claude Developer Platform docs · Anthropic · 20 min · Free · checked 21 Oct 2026
- Why
- Same loop from the other major vendor, plus the client-vs-server tool split and the hidden tool system prompt, which make good follow-up answers.
- What to read
- Read “How tool use works”, “When Claude uses tools” (including the missing-parameters note), and the prose of “Pricing”.
- What to skip
- The card lists under “Choose a tool” beyond noting which tools are client vs server, the per-model token table in “Pricing”, and the code tabs for languages you don't use.
Go deeper
Building effective agents (opens in a new tab)
Anthropic Engineering · Erik S., Barry Zhang · 25 min · Free · checked 21 Oct 2026
- Why
- Gives you the vocabulary for tool design questions (“how would you design the tools for this agent?”) that separates builders from API callers.
- What to read
- Read “Building block: The augmented LLM” and “Appendix 2: Prompt engineering your tools”; skim “When (and when not) to use agents”.
- What to skip
- The workflow patterns (prompt chaining through evaluator-optimizer) and “Appendix 1: Agents in practice”, which belong to the agent-patterns topic.
Go deeper
Toolformer: Language Models Can Teach Themselves to Use Tools (opens in a new tab)
arXiv · Timo Schick et al. · 30 min · Free · checked 22 Oct 2026
- Why
- Toolformer showed a model can learn when to call an API from its own filtered samples, and it’s the go-to reference when an interviewer asks how tool use is trained rather than prompted.
- What to read
- Read §2 with Figure 2 (sample API calls, execute them, keep only calls that lower the loss on later tokens), §3 on the five tools, and §4.4 on how tool use only pays off above a certain model size. Then read §7 on limitations.
- What to skip
- Skip §4.2 per-dataset results, §4.3 language modelling, §6 related work and Appendix C.
Companies that test Agents most
Put Tool use and function calling in your plan
Tell us your interview date and hours a day; it lands on the right day, in the right order.