# Tool calling

Category: [Agents & Protocols](https://seo-geo-glossary.com/en/glossary/category/agents-protocols/) › [Agent protocols](https://seo-geo-glossary.com/en/glossary/category/agents-protocols/agent-protocols/) · Also known as: function calling, tool use

**Tool calling**, also called function calling or tool use, is the ability of a language model to answer with a structured request to run a function instead of plain text. The functions are ones that developers or providers make available, such as a database query or an API call. The model does not run the function itself. Your application or the model provider does.

## How does a tool call work?

OpenAI describes five steps. The application sends the model a request that includes the available tools. The model returns a tool call with arguments. The application runs the code with that input and sends the output back. The model then writes its final answer or makes further tool calls.

Each tool is defined with a name, a description and a JSON schema for its parameters. Anthropic distinguishes client tools, which run in your application, from server tools such as web search, which run on Anthropic's infrastructure. For a client tool, the response carries `stop_reason: "tool_use"` and a `tool_use` block, and the application replies with a `tool_result`. Tool definitions count as input tokens.

## Example

An application defines this tool:

```json
{
  "name": "get_weather",
  "description": "Get the current weather for a given location.",
  "input_schema": {
    "type": "object",
    "properties": {
      "location": { "type": "string" }
    },
    "required": ["location"]
  }
}
```

A user asks about the weather in San Francisco. The model responds with a `tool_use` block that names `get_weather` and the argument `San Francisco, CA`. The application looks up the weather and returns the result, and the model phrases the answer.

## Tool calling and MCP

Tool calling describes how a model expresses a function call. The Model Context Protocol (MCP) describes how an AI application finds and calls tools on external servers. In an MCP setup, the host takes a tool call produced by the model and forwards it to the right MCP server.

## Common mistakes

- **Vague names and descriptions.** OpenAI advises clear, detailed function names, parameter descriptions and instructions.
- **Too many tools at once.** OpenAI gives fewer than 20 initially available functions as a guideline. Tool definitions also count as input tokens.
- **Leaving required inputs open.** If a required parameter is missing, the model may infer a plausible value instead of asking, according to Anthropic's documentation.

## FAQ

**Does the model run the function?**
For client tools the application runs it. For server tools the provider does.

**Is function calling the same as tool calling?**
Providers use the terms for the same technique. Anthropic's documentation calls tool use "also called function calling".

## At a glance

- **Type:** ability of language models to output structured function calls
- **Used in:** OpenAI API, Anthropic API and others
- **Flow:** request with tools, tool call, execution by the application, result, answer
- **Docs:** [OpenAI: Function calling](https://developers.openai.com/api/docs/guides/function-calling)

Last checked: October 8, 2026

*Diagram: How MCP connects applications and tools.* According to the MCP specification, a host starts one client per server. Servers offer tools, resources and prompts and run locally (stdio) or remotely (Streamable HTTP). WebMCP is a draft by a W3C community group, not a W3C standard. Here the web page provides its tools inside the browser.

## Related terms

- [MCP (Model Context Protocol)](https://seo-geo-glossary.com/en/glossary/mcp/index.md)
- [MCP server](https://seo-geo-glossary.com/en/glossary/mcp-server/index.md)
- [API](https://seo-geo-glossary.com/en/glossary/api/index.md)
- [OpenAPI](https://seo-geo-glossary.com/en/glossary/openapi/index.md)
- [AI agent](https://seo-geo-glossary.com/en/glossary/ai-agent/index.md)
- [Large language model (LLM)](https://seo-geo-glossary.com/en/glossary/large-language-model/index.md)

## Sources

- [Function calling – OpenAI Developers](https://developers.openai.com/api/docs/guides/function-calling)
- [Tool use with Claude – Anthropic](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview)
- [Architecture overview – modelcontextprotocol.io](https://modelcontextprotocol.io/docs/learn/architecture)

---

Last updated: October 8, 2026
URL: https://seo-geo-glossary.com/en/glossary/tool-calling/
