What Is Tool Calling: Letting AI Operate Real Systems
How tool calling works step by step, client versus server tools, and how to design tools that AI Agents use correctly and safely.
An online shop uses AI to answer customer chats on LINE OA. A customer asks, "Where is order #10482?" If the AI has no way into the delivery system, it has only two options: say it does not know, or worse, make up a status. What lets the AI give a real answer is a capability called Tool Calling, also known as Function Calling.
What is Tool Calling
Tool Calling is the mechanism that lets a language model say "which tool I want to call, with what data" in a format a program can read, while your system actually runs that tool. Claude's tool use documentation states plainly that "the model never runs anything on its own". It only emits a structured request, your code or the provider's servers do the work, and the result flows back into the conversation. This is the "Act" step of the Agent Loop.
The mechanism step by step
OpenAI's function calling guide summarises the flow in 5 steps, which apply to almost every provider:
- Send a request to the model with the list of tools it can call
- The model replies with a tool call made of a name and JSON arguments, for example check_order_status with order_id "10482"
- Your application actually runs the function, for example calling the courier's API
- Send the result back to the model in the next request
- The model gives a final answer, or asks for more tool calls
The same guide advises assuming that one response may contain "several" tool calls at once, so your code should always handle that case.
Client tools and server tools
Claude's documentation groups tools by who runs the code: tools you define and run in your own application, and server-side tools the provider runs for you, such as web search or code execution. The difference matters for security, because tools running in your system can reach your data.
Designing tools agents use correctly
The quality of tool calling depends on tool design more than many people expect. In Building effective agents, Anthropic says that while building its SWE-bench agent, the team spent more time optimising tools than the overall prompt. The article Writing effective tools for AI agents (September 2025) offers several principles.
1. Consolidate steps into one tool
Instead of separate list_users, list_events and create_event tools, offer a schedule_event tool that finds availability and books in one go. Many overlapping tools confuse agents.
2. Namespace your tools
Use prefixes that name the system and resource, such as crm_search_customer and erp_search_invoice, so the agent picks the right one.
3. Return meaningful information
Return the customer's name instead of a long UUID. Anthropic found that resolving IDs into readable language reduced hallucinations.
4. Control output size and write errors that help
Add pagination or filters, and write errors that explain the fix, such as "order_id must be a 5-digit number", instead of unreadable error codes.
5. Make mistakes hard
Anthropic calls this poka-yoke, for example requiring absolute file paths to avoid errors. OpenAI recommends using enums and object structure to prevent impossible values, and offers a soft suggestion to keep fewer than 20 tools available at a time.
Watch out for
- Arguments can be wrong: the model may send malformed or incorrect values. Validate on the server every time and never trust model values directly
- Excess permissions: OWASP lists Excessive Agency in its 2025 Top 10 risks for LLM applications. Give tools only the access the task needs
- Tools that write data: transferring money, deleting data or sending external email should require human approval. Read more in Guardrails and Human-in-the-loop
The prompt tells the agent what it should do. The tools decide what it can actually do.
How to get started
- List the questions customers or your team ask most, and identify which system holds the data
- Start with read-only tools, such as checking a status or searching records
- Write tool descriptions as if explaining to a new hire, including the format of every parameter
- Test with 20 to 30 real questions and check whether the right tool is called
- Only then add tools that write data, with an approval step
Designing tools for AI is a skill in demand across both developer and automation roles. Browse related openings on Plants.work Jobs, or get hands-on with the n8n Integrations course.