Tool calling
How an AI model gets things done in the real world. The model cannot act on its own, so it writes a request, such as "search the web for X," and the app running it carries that out and hands back the result. The "Searching the web…" line in a chat is tool calling at work.
In plain English
A model can only produce text. Tool calling lets it produce a very specific kind of text: “please run web search for X.” The app sees that, runs the search, and pastes the results back. The model reads them and carries on.1 It never touches anything itself.
In the real world
- The “Searching the web…” line in a chat answer.
- Claude or ChatGPT reading a file you attached, or running a bit of code to do math.
- Claude Code editing a file on your computer.
When to use it
- Anything that needs current information. Search is a tool.
- Anything that needs to be exact. Code execution is a tool.
- Anything that touches your systems. That’s what MCP standardizes.
When not to use it
Don’t hand a model twenty tools and hope. Which one it picks depends on how clearly each is described.2 Fewer, well-described tools beat a full toolbox.
Good, bad, ugly
- Good: the model stops guessing and goes and looks.
- Bad: every tool is something you have to set up, describe, and secure.
- Ugly: a tool that can send or delete, wired up to a model that read a malicious web page. See prompt injection.
Key facts
- Who acts
- The app, not the model. The model writes the request; the app executes it.
- Common tools
- Web search, file read and write, code execution, calendar, email, databases
- Quality depends on
- How well each tool is described to the model
Common questions
Does the model actually run things?
No. It outputs a structured request, like a form, saying which tool to use and with what. The app runs it and hands the result back.
Why does the AI sometimes use the wrong tool?
It picks based on the tool descriptions it was given. Vague descriptions mean wrong picks. This is a setup problem, not a model problem.
Is this what makes an agent?
It's the main ingredient. An agent is a model that calls tools in a loop until the task is done.
References
- Tool use with ClaudeAnthropic, Claude Platform DocsView source
- Tool CallingFighting With AIView source