Agent runtime

Tool Calling

The mechanism by which a language model invokes external functions — APIs, databases, code execution, retrieval — and reads the results back to continue its work.

Operating principle

Production AI is not a prompt. It is a system of context, tools, permissions, traces, evals, and feedback loops.

What it is

Tool calling (also called function calling) is how a language model interacts with the world beyond text generation. The model is told which tools it can use, with what arguments. When it decides to call one, it emits a structured request; the runtime dispatches the actual call; the result is fed back into the model's context. The model can call multiple tools across a single task.

Why it matters

Tool calling is what turns a language model from a text generator into an agent that can do work. Without tools, the model can only describe actions; with tools, it can take them — read files, call APIs, run code, update records. Every meaningful agent capability passes through tool calling.

How it works

Tools are declared with typed schemas (JSON Schema is the de facto standard). The model receives the schemas as part of its context. When it generates a call, the runtime validates the arguments, dispatches the call, and feeds the response back. Modern best practice exposes tools through the MCP Tool Registry so governance, audit, and permission scopes apply uniformly.

Related resources