Tool call
Also called Function calling
A tool call is a structured request in which a language model names a function and supplies its arguments, so that a host program can run it. It lets the text a model produces drive actions in the world. The arguments are values such as a file path or a search query, filled in by the model. A model may make several calls in one reply, or none at all.
A language model only produces text. The model writes the request in a fixed format, the host program reads it and does the work, and the result goes back to the model. This split keeps every effect in code that people wrote and can inspect. The model never learns how a tool works inside, only what it returns.
Tool calls are how an AI agent reads files and runs code. Each call is one step of the loop of the agent, and its result shapes the step after it. Searching the web and calling other services work the same way. A long task can take many calls, each adding a round trip to the model.
Tool schemas
A tool schema is the description of a tool that a host program gives the model, naming the tool and the arguments it takes. It is usually written in JSON Schema, along with a short explanation of what the tool does. The model reads these descriptions as part of its input, so their wording affects when it picks each tool. Vague names or tools that overlap lead to wrong choices.
When the model decides a tool would help, it replies with the name of the tool and its arguments instead of an answer. The host runs the matching function and sends the output back as a new message. Each call carries an identifier, so the host can match every result to the call that asked for it. The model then continues with the result in view.
Models are trained to produce well-formed calls, and many model interfaces can force the arguments to match the schema. Matching the schema says nothing about whether the call is a good idea. A model can still pick the wrong tool or pass a path it should never touch. Checking what a call may do therefore stays with the host.
Call execution
Call execution is the job of the host program, never of the model. The host decides which tools exist, and whether a call runs at once or waits for a person to approve it. Tools that only read are often allowed to run at once, while tools that change things wait for approval. Errors from a tool go back to the model as results, so it can try again.
A tool that runs shell commands is as powerful as the machine it runs on. Hosts usually run such tools inside a sandbox, and limit what traffic can leave it with egress control. A shell on a developer's laptop can read their keys and delete their files. Running it on a separate machine with no secrets limits the damage of a bad call.
Arguments come from the model, and the input of the model may include text from web pages or the output of other tools. Arguments should therefore be treated like any other untrusted code. Arguments that end up in a database query or a shell command can inject code, as untrusted input always could. Passing them as data, never as text to run, closes that path.
Model Context Protocol
The Model Context Protocol is an open protocol that standardizes how a host finds and calls tools offered by separate servers. Each model provider still has its own format for describing tools and returning calls. A host translates between the protocol and the format of its model, so one tool server works with any model. Servers describe their tools with schemas, which the host passes on to the model.
A single server for a database can serve any host that speaks the protocol, without custom code for each pairing. The same holds for a file system or any other service that offers tools. Before the protocol, each host needed its own integration for each service. Servers can run on the same machine as the host or on a remote one.
The protocol defines how calls travel, not where they run. Isolation stays the job of whoever runs the server, so a server that runs commands needs the same limits as any other tool. A server that runs locally has the permissions of whoever started it. Installing an untrusted server is therefore as risky as installing any untrusted program.