If you have read API docs for OpenAI and Anthropic, you have seen two terms that sound different but describe the same capability: function calling and tool use. Both let a language model reach beyond its training data to call external APIs, query databases, run calculations, or trigger actions — and both work by having the model emit structured instructions that your code executes. The naming difference is mostly branding.
What the mechanism actually does
A bare LLM only produces text. Function calling and tool use add a structured channel: you describe the functions available — name, description, and a JSON schema of parameters — and the model, instead of answering directly, can choose to “call” one by returning a JSON object of arguments. Crucially, the model does not run anything. It only says what it wants to call and with which inputs. Your application code performs the actual call and returns the result to the model, which then continues. This keeps execution under your control and lets you add authentication, validation, and rate limiting.
The request/response loop
The interaction is a loop, not a single call:
- You send the user’s message along with a list of tool/function definitions.
- The model replies with either a normal answer or a request to call a tool, including the arguments.
- Your code runs that tool and captures its output.
- You append the result to the conversation and call the model again.
- The model uses the result to answer — or requests another tool, repeating the loop.
This loop is the foundation of AI agents: chain enough tool calls together and the model can plan, act, observe, and adjust over many steps.
Where the two differ
The differences are in API shape, not concept:
- OpenAI accepts a
toolsarray of function definitions. When the model decides to call one, it returns atool_callsentry on the assistant message. You respond with a message of roletoolcontaining the result. - Anthropic accepts tools with an
input_schema. The model returns atool_usecontent block with the name and input. You respond with atool_resultcontent block referencing the call’s id.
Both use JSON Schema to describe parameters, both let the model call multiple tools, and both support forcing or disabling tool use. Code written for one ports to the other with mechanical changes to field names and message roles.
When and how to use it
Reach for tool use whenever the model needs current data (weather, stock prices, your database), needs to take an action (send an email, create a ticket), or needs reliable structured output (extract fields into a fixed schema). Good practice is the same across providers: write clear function descriptions because the model reads them to decide when to call, keep parameter schemas tight and validated, handle the case where the model hallucinates an argument, and cap the number of loop iterations so an agent cannot spin forever.
The takeaway
Function calling and tool use are one idea under two names: a schema-driven loop that lets an LLM request actions your code carries out. Understand the loop once and you can build with it on any major provider — the only thing that changes is the JSON the API expects.