Short answer
Tool calling, also called function calling, is when a language model asks an outside tool, such as an API, database or search, to fetch data or take an action, then uses the result in its reply. It lets an AI agent act, not only write.- Also called
- Function calling, tool use
- What it does
- Lets a model fetch live data or take an action through software
- Who runs the tool
- The application around the model, never the model itself
- Common tools
- Order lookups, refunds, search, databases, ticket updates
- Open standard
- Model Context Protocol (MCP), a shared way to offer tools to models
- Main risk
- An action taken on a wrong guess about the request
A language model on its own can only write text. It can explain how a refund works, but it cannot look up the order or issue the refund. Tool calling closes that gap: the model is given a list of tools it may use, and when a question needs one, it asks for that tool with the right inputs and reads the result before it answers.
How tool calling works
Every tool call follows the same loop.
- Describe. The application tells the model which tools exist, what each one does and what inputs it needs. A tool might be "look up order" with an order number as input.
- Decide. The model reads the request and decides whether a tool would help. If it would, it replies with a structured request instead of text: the tool's name and the inputs, usually as JSON.
- Run. The application, not the model, checks the request and runs the tool. This is the step where permissions and limits apply.
- Return. The tool's result goes back to the model.
- Answer. The model writes its reply from the result, or calls another tool if it needs one.
A customer writes "Where is my order 1042?" The model calls the order lookup with 1042, gets back the shipment and its tracking, and replies that the parcel is with the carrier and due Thursday. Without the tool, it could only guess.
The important detail is step 3. The model never touches the order system directly. It asks, and the software around it decides whether the request runs.
Tool calling vs function calling
They are the same thing. "Function calling" was the earlier name, because the tools were described as functions with typed inputs. "Tool calling" is the broader name now in common use, since a tool can be anything the application exposes: an API, a database query, a search, a script or another agent.
Some frameworks draw a small line between the two: function calling is the model's ability to produce a structured call, and tool use is the whole loop of choosing, running and reading the result. In practice the terms are interchangeable, and you will see both in the same documentation.
Tool calling in AI agents
Tool calling is what turns a chatbot into an agent. A chatbot answers. An agent pursues a goal across several steps, and each step usually involves a tool: look up the customer, check the order, change the address, confirm.
Agentic tool calling adds three things to the basic loop.
- Several calls in a row. The agent reads one result and decides the next call from it. If the lookup says the order has shipped, it should not offer to cancel it.
- Choosing between tools. With many tools available, picking the right one becomes part of the task, and wrong picks become a failure mode.
- Shared tool standards. The Model Context Protocol (MCP) gives agents a common way to discover and call tools from any service that offers an MCP server.
Aide works from both sides of this. Its own agent calls Shopify tools inside a conversation, and its MCP server lets any MCP client search Aide's knowledge, look up Shopify orders and, signed in as a teammate, refund or cancel orders under the same permissions, approval rules and rate limits as the API.
Examples of tool calls in customer service
In customer service, most tool calls fall into two groups: reading and doing.
Reading tools fetch facts the model could not know: an order's status, its tracking events, a customer's past conversations, the stock level of a product. They are low risk because they change nothing.
Doing tools change something in another system: cancel an order, issue a refund, change a shipping address, tag a ticket, add an internal note. These carry the real risk, because a wrong call has consequences outside the conversation.
In Aide, a shopper who asks to change the shipping address on an order that hasn't shipped is first verified, logged in or with the order number and matching email, and only then does Aide make the change in Shopify and confirm the new address in its reply. The same goes for cancelling, refunding, removing an unshipped item or adding a note. See address changes in Shopify for the full flow.
What can go wrong with tool calling
The popular practice this page rejects is connecting a model to every API a business has and treating the prompt as the only safeguard. "The agent can call any of our integrations" is a description of risk, not capability. A model that misreads one request can then act on the misreading.
The common failures are predictable:
- Calling the right tool with the wrong inputs, such as refunding the wrong order when the customer has several.
- Calling a tool that was not needed, such as cancelling when the customer only asked whether they could.
- Acting before checking who is asking, such as changing an address for someone who has not proved the order is theirs.
- Leaving no record, so nobody can see later why an action ran.
The fixes sit outside the model: decide which tools each kind of request may use, check identity before any doing tool runs, require a person's approval for costly actions, and log every call.
With Aide, how far the agent may act is set per topic. On a Drafts topic, an order change the shopper confirmed waits for a teammate to approve, and refunds wait for the team by default. Each action offered, run or sent for approval appears in the conversation's Action Trace.
Where Aide fits
Aide, the AI platform for customer service, gives its agent a short list of real tools for Shopify stores: cancel, refund, change the shipping address, remove an unshipped item, add a note and start a return. Every one waits until the shopper has proved the order is theirs, follows the topic's AI level and records what happened. WooCommerce stores are read-only: Aide reads orders, products and customers but takes no actions there. Teams that build their own agents can reach the same tools through the REST API or the MCP server. See Aide for Shopify.