What is tool calling in LLMs? Function calling explained

Also called function calling, tool use

Definition

Tool calling is an LLM capability in which the model, given a list of tool definitions, outputs a structured request naming a tool and its arguments, which the application executes and returns.

Tool calling is the mechanism that lets a large language model act on systems outside its weights: search an index, query a database, or send an email. The developer describes each tool with a name, a description, and a JSON Schema for its parameters. The model never runs the tool itself; it emits a structured call, and the application runs it. OpenAI introduced the feature as function calling on June 13, 2023, and the major model APIs now support an equivalent.

How tool calling works#

Tool calling is a loop between the application and the model:

The application sends a prompt with tool schemas, the LLM returns a tool call, the application runs it and sends the result, and the LLM answers or calls again. ApplicationRuns the tool, returns the resultLLMEmits calls, never runs tools1prompt + tool schemas2tool call: name, args3runs the tool4tool result5answer or next call
Figure 1: The model proposes calls; the application executes them.

On the Anthropic API, for example, a response that requests a tool ends with stop_reason: "tool_use" and contains a tool_use block; the application sends the tool's output back in a tool_result block (Anthropic tool use docs). An AI agent is this loop repeated until the task is complete. Setting strict: true on a tool definition, supported by both OpenAI and Anthropic, constrains the arguments to the schema using the same technique as structured outputs.

Tool calling vs function calling#

The two terms describe the same capability. OpenAI's original 2023 API used a functions parameter, later deprecated in favor of a more general tools parameter. Anthropic calls the feature tool use and lists function calling as another name for it. "Tool calling" has become the common vendor-neutral term.

Tool calling vs MCP#

The Model Context Protocol does not replace tool calling; it standardizes where tools come from. An MCP server publishes tool definitions that any MCP client can list and invoke, while the model still uses its native tool-calling format to request them. Tool calling is the model-level capability, and MCP is the integration protocol built on top of it.

Because tool results flow back into the prompt, every connected tool is also a path for prompt injection. Give tools the narrowest permissions that work, and require confirmation for actions that are hard to undo. The tool calling explainer goes further into the request and response cycle.

Cite this definition

The AI Engineering Editors. "What is tool calling in LLMs? Function calling explained." The AI Engineering, updated Nov 06, 2026. https://theaiengineering.com/glossary/tool-calling

Title
What is tool calling in LLMs? Function calling explained
Author
The AI Engineering Editors
Publisher
The AI Engineering
Updated
View as Markdown

Part of the Prompt and context engineering hub · Updated