Tool use (a.k.a. function calling) is how an LLM reaches outside its context window — to search the web, query a database, call an API, or run code.
The mechanics
- You give the model a list of tool schemas (name, description, JSON Schema for arguments).
- The model responds with either text or a structured tool call.
- Your code executes the tool and returns the result as a new message.
- The model reads the result and continues.
Provider docs
- OpenAI — Function calling
- Anthropic — Tool use
- Google — Gemini function calling
Model Context Protocol (MCP)
MCP is Anthropic's open standard for exposing tools, resources, and prompts to any LLM client. Instead of re-implementing a Gmail tool for every framework, you run an MCP server once and every MCP-aware client (Claude Desktop, Cursor, OpenAI Agents SDK, etc.) can use it. See the reference servers for filesystem, GitHub, Postgres, Slack, and more.