Tool and Function Calling
Tool calling is the mechanism that turns an LLM from a text generator into something that can act: look up an order, query a database, run a calculation, hit an internal API, search the web. Strip away the branding and it is a small, precise protocol — the model is given a menu of named, schema-described capabilities and, instead of executing anything itself, returns a structured request to call one. Your code runs the actual function and feeds the result back in as the next turn's input. Every agent, every RAG-with-actions system, and every "assistant that does things" is built on this loop repeated in a cycle.
The mechanism itself is simple enough to learn in an afternoon. What separates a reliable tool-using system from a flaky one is almost entirely tool design: how narrow each tool is, how clearly its name and parameters are described, what shape its results take, and how failures are surfaced back to the model. Two systems can run the same underlying model and the same orchestration loop and differ wildly in reliability purely because one team wrote manage_data(action, payload) and the other wrote get_order(order_id) and cancel_order(order_id, reason). Interviewers who ask about tool calling are usually testing whether you know this — that the bottleneck on agent reliability is very often tool design, not model capability.
This subject covers the mechanics end to end, the schema-design judgment that interviewers probe hardest, tool-choice modes, parallel calls, error handling, the safety boundary, and a practical Anthropic-vs-OpenAI comparison. It plugs directly into agent-architectures-and-the-agentic-loop (the loop this machinery runs inside), mcp-and-tool-integration-protocols (the protocol-level standardization of "here are my tools" across servers), and case-study-coding-agent (a full worked example of tool set and permission-model design for one concrete agent).