← Explainers
3 min read

What is tool calling?

How a model asks your app to run a function, such as checking an order, and then answers with the result.

BuzzwordsAI basics

A model only knows what it learned in training and what is in the conversation. It cannot see today’s weather or where your parcel is. Tool calling lets it ask your app to find out.

Term
Tool calling
Also called function calling

The app tells the model which tools exist, such as “get order status”. When a question needs one, the model replies with a short request naming the tool and its inputs. The app runs the tool and sends the result back, and the model writes the answer.

Think of it like this

A shop assistant who does not know if a size is in stock does not guess. They ask the stockroom, wait for the answer, then tell you. The model is the assistant, the tool is the stockroom, and your app is the one who walks over and asks.

One round trip

Question to answer
  1. 01Question
  2. 02Model picks a tool
  3. 03App runs it
  4. 04Result goes back
  5. 05Answer
Who talks to whom
ModelAppOrder system
  1. Question + list of tools
  2. get_order_status(4417)
  3. Look up order 4417
  4. Shipped, arrives tomorrow
  5. Tool result
  6. Answer for the customer
Illustrative. The model never touches the order system; the app does.
You Where is my order 4417?
AI (to the app) get_order_status, order_id: 4417
AI It left the warehouse this morning and should arrive tomorrow.
Illustrative conversation

Who does what

The split that keeps it safe
  • The modelDecides a tool is needed and fills in the inputs
  • The appChecks the request, runs the tool, and can refuse
  • A personApproves anything that matters, such as a refund or a payment
In the real world

OpenAI added function calling to its API in June 2023, and the other major model providers offer the same feature. It is how an assistant checks your calendar before booking a meeting, or how a support bot looks up a real order instead of guessing where it is.

Its limits

  • The model can pick the wrong tool or fill in the wrong input. The app should check every request.
  • The model never runs anything itself. If a tool can spend money or delete data, that power sits in your app, so guard it there.
  • More tools, more confusion. Clear names and short descriptions help the model choose.

A common misunderstanding

“The AI connected to my database.” It did not. It asked, and your app ran the query. MCP is a standard way to offer those tools, and an AI agent is a model that keeps calling tools in a loop until a job is done.

MCP · AI agent · Harness · Guardrails