---
title: "What is tool calling in LLMs? Function calling explained"
description: "Tool calling lets an LLM request a function call with JSON arguments that your code runs. How the loop works, tool calling vs function calling, and vs MCP."
type: "glossary-term"
canonical_url: "https://theaiengineering.com/glossary/tool-calling"
markdown_url: "https://theaiengineering.com/glossary/tool-calling.md"
topic: "Prompt and context engineering"
author: "The AI Engineering Editors"
publisher: "The AI Engineering"
updated: "2026-11-06"
keywords: ["Tool calling","function calling","tool use"]
citation: "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"
---

# What is tool calling in LLMs? Function calling explained

Also called function calling, tool use.

> **Definition of Tool calling:** 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](https://theaiengineering.com/glossary/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](https://theaiengineering.com/glossary/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:

**Figure 1: The model proposes calls; the application executes them.**

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.

Steps:

1. Application → LLM: prompt + tool schemas
2. LLM → Application: tool call: name, args
3. Application → Application: runs the tool
4. Application → LLM: tool result
5. LLM → Application: answer or next call

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](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview)). An [AI agent](https://theaiengineering.com/glossary/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](https://theaiengineering.com/glossary/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](https://theaiengineering.com/glossary/model-context-protocol) does not replace tool calling; it standardizes where tools come from. An [MCP server](https://theaiengineering.com/glossary/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](https://theaiengineering.com/glossary/prompt-injection). Give tools the narrowest permissions that work, and require confirmation for actions that are hard to undo. The [tool calling explainer](https://theaiengineering.com/articles/tool-calling) goes further into the request and response cycle.

## Related terms

- [Structured outputs](https://theaiengineering.com/glossary/structured-outputs): Structured outputs is an LLM API feature that constrains generation so the model's response always conforms to a developer-supplied JSON Schema, producing output that code can parse without retries.
- [Model Context Protocol (MCP)](https://theaiengineering.com/glossary/model-context-protocol): Model Context Protocol (MCP) is an open protocol, introduced by Anthropic in November 2024, that standardizes how AI applications connect to external tools, data sources, and prompts through MCP servers.
- [AI agent](https://theaiengineering.com/glossary/ai-agent): An AI agent is a software system in which a large language model runs in a loop, calling tools, reading their results, and repeating until the task is complete or a stop condition is reached.
- [MCP server](https://theaiengineering.com/glossary/mcp-server): An MCP server is a program that exposes tools, resources, and prompts to AI applications through the Model Context Protocol, running locally over stdio or remotely over Streamable HTTP.
- [Prompt injection](https://theaiengineering.com/glossary/prompt-injection): Prompt injection is an attack in which text supplied to a large language model, typed by a user or hidden in content the model reads, alters the application's intended behavior or output.
- [JSON Schema](https://theaiengineering.com/glossary/json-schema): JSON Schema is a declarative vocabulary, itself written in JSON, for describing the structure of JSON data; LLM APIs and MCP use it to define tool arguments and constrain model output.
- [ReAct agent](https://theaiengineering.com/glossary/react-agent): A ReAct agent is an AI agent that alternates a written reasoning step, an action such as a tool call, and an observation of the result, repeating the cycle until it can answer.

## Guides that cover tool calling

- [What is tool calling? How LLM function calling works](https://theaiengineering.com/articles/tool-calling): Tool calling lets an LLM request actions from your code through structured calls. Learn the request loop, parallel calls, structured outputs, security, and MCP.
- [What is the Model Context Protocol (MCP)? How it works](https://theaiengineering.com/articles/what-is-model-context-protocol): The Model Context Protocol (MCP) is an open standard for connecting AI apps to tools and data. Learn its architecture, transports, tool calls, and security.
- [What are AI agents? How agents work and when to use one](https://theaiengineering.com/articles/what-are-ai-agents): AI agents are LLM systems that call tools in a loop until a task is done. Learn how the loop works, agents vs agentic AI, examples, failure modes, and limits.
- [Agentic workflows: five patterns and when to use each](https://theaiengineering.com/articles/agentic-workflows): Agentic workflows run LLM and tool calls through steps fixed in code. Learn five patterns, their cost and latency, failure modes, and when to use an agent.
- [Semantic caching for LLMs: how it works and when it pays off](https://theaiengineering.com/articles/semantic-caching): Semantic caching returns a stored LLM response for prompts with similar meaning. Learn how a semantic cache works, how to tune it, and what never to cache.
- [How to build an MCP server: a Python and TypeScript tutorial](https://theaiengineering.com/articles/how-to-build-an-mcp-server): Learn how to build an MCP server with the official Python and TypeScript SDKs: tools, resources, transports, testing, client config, and production security.
- [How to build an AI agent: a step-by-step guide in Python](https://theaiengineering.com/articles/how-to-build-an-ai-agent): Learn how to build an AI agent from scratch in Python: when you need one, tool schemas, the agent loop, stop conditions, guardrails, evals, and tracing.
- [AI coding agents: how they work and how the major tools compare](https://theaiengineering.com/articles/ai-coding-agents): AI coding agents compared: how they differ from autocomplete, the four main categories, a comparison table of major tools, and how to evaluate and secure them.
- [vLLM vs Ollama vs llama.cpp vs SGLang: which engine to use](https://theaiengineering.com/articles/vllm-vs-ollama): vLLM vs Ollama compared with llama.cpp, SGLang, LM Studio, and TensorRT-LLM: scope, hardware, APIs, concurrency, and which engine fits local or production use.
- [AI agent frameworks compared: LangGraph, CrewAI, ADK, and more](https://theaiengineering.com/articles/ai-agent-frameworks): An AI agent frameworks comparison of LangGraph, LangChain, CrewAI, the OpenAI, Claude, and Google SDKs, Pydantic AI, Mastra, and more, by language and license.
- [AI agent evaluation: metrics, graders, and how to test agents](https://theaiengineering.com/articles/ai-agent-evaluation): AI agent evaluation guide: measure task success, tool use, safety, cost, and pass^k reliability with code graders, LLM judges, eval sets from traces, and CI.
- [Reasoning models: how they work and when to use them](https://theaiengineering.com/articles/reasoning-models): Reasoning models explained: how test-time compute and reinforcement learning produce chain-of-thought reasoning, when to use them, and their cost and latency.
- [LLM evaluation: a practical guide to evals, metrics, and judges](https://theaiengineering.com/articles/llm-evaluation): LLM evaluation for engineers: build eval datasets, pick metrics, calibrate LLM-as-a-judge, evaluate RAG and agents, and gate every release in CI.
- [What is retrieval-augmented generation (RAG)? How RAG works](https://theaiengineering.com/articles/what-is-rag): Retrieval-augmented generation (RAG) grounds LLM answers in your documents. Learn the RAG pipeline, hybrid search, agentic RAG, evaluation, and failure modes.
- [What is AI engineering? The discipline, the stack, and the work](https://theaiengineering.com/articles/what-is-ai-engineering): What is AI engineering? A plain definition, how it differs from ML and software engineering, the layers of the stack, and what AI engineers do day to day.

Part of the [Prompt and context engineering](https://theaiengineering.com/topics/prompt-engineering) topic hub.

## 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: 2026-11-06
- URL: https://theaiengineering.com/glossary/tool-calling
- Markdown: https://theaiengineering.com/glossary/tool-calling.md
