What is tool use in AI? Explained with a calculator in an exam
Tool use, or function calling, lets an AI model ask your software to run a tool, like a lookup or a calculator, and use the result. Explained with a student allowed a calculator in an exam.
- Author
Umair Mateen- Published
- Reading time
- 5 min
- Category
- AI
In one sentence: Tool use, also called function calling, lets an AI model ask your software to run a specific tool, such as a calculator, a database lookup or an email sender, and then use the result in its answer.
The everyday picture
Picture a student sitting an exam. Some questions need exact sums, and doing long multiplication in your head is where mistakes creep in. So the exam rules say a calculator is allowed. The rules also list what else is on offer: a dictionary, a table of formulas.
In this exam hall, the equipment sits on the invigilator's desk at the front. When the student needs it, they write a slip: "Calculator, please: 347 times 29." The invigilator checks the slip, presses the buttons and passes back the number. The student copies it into their working and finishes the answer.
The student is still the one thinking. They decide when a tool would help and what to ask it. The calculator just makes sure the number is right.
The model reads the question and writes a request for a tool. Your software runs the tool and passes the result back, and the model uses it to write the answer.
How it works, step by step
- The app lists the tools (the exam rules list the allowed equipment). Along with the question, your software sends the AI model a short description of each tool: its name, what it does and what inputs it needs, like a city name or an order number.
- The model decides whether it needs a tool (the student reaches for the calculator only when a sum is hard). For a simple chat it just answers. For today's stock level or a customer's order, it asks for a tool.
- The model writes a tool call (the slip to the invigilator). This is a small, structured request: which tool, and the exact inputs. The model does not run anything itself. Anthropic's documentation says the model never runs anything on its own.
- Your software runs the tool (the invigilator presses the buttons). It can check the request first, then looks up the database, calls the weather service or sends the email.
- The result goes back to the model (the number is passed back). The model reads it and writes its final answer, or asks for another tool. This loop repeats until the job is done.
Try it · Put it in order
Put the tool use loop in the right order
Tap the steps in the order they happen.
Where the picture stops
- An exam calculator can only show a number. Real tools can also do things: send emails, update records or issue refunds. That makes choosing which tools to allow far more important than in an exam.
- The student usually types the sum correctly. An AI model can fill in a tool call with the wrong inputs, such as the wrong customer number. Good software checks each request before acting on it.
- In the exam, the invigilator always does the pressing. With AI, some tools are run by the AI provider itself, such as web search, while others are run by your own software.
Why it matters for your business
- Answers based on today's facts. A model only knows what it learned in training. A lookup tool lets it check live prices, stock or account details instead of guessing.
- Work gets done, not just described. Tools let an assistant create a ticket or update a record in the systems you already use, rather than telling a person to do it.
- Clean data for your other systems. Because a tool call has a fixed shape, its output can go straight into a form, a spreadsheet or another app.
- Each tool is a permission. Give the AI only the tools it needs, and ask a person to approve anything costly or hard to undo.
Try it · What would you do?
Which tools would you give a shop's chat assistant?
You are adding an AI assistant to your online shop's support chat. It should tell customers where their order is, and sometimes offer refunds. How do you set up its tools?
Pick what you would do. You can change your mind.
An example
Imagine a small online shop that sells kitchenware. Customers often ask, "Where is my order?" The shop gives its chat assistant two tools: one that looks up an order by number, and one that drafts a refund for a staff member to approve. A customer asks about order 4417. The assistant calls the lookup tool, gets back "shipped Tuesday, out for delivery today", and replies in plain words. When another customer reports a broken pan, the assistant drafts a refund, and a staff member clicks approve.
Frequently asked questions
Is tool use the same as function calling?
Yes. Anthropic calls it tool use and OpenAI calls it function calling. Both describe the same loop: the model asks for a tool, your software runs it and sends back the result.
Does the AI run the code itself?
No. The model only writes a request saying which tool to use and with what inputs. Your software, or the AI provider for its own built-in tools, does the actual work.
How does the AI know which tool to use?
It reads the name and description you give each tool and matches them to the request. Clear, specific descriptions lead to better choices, and developers can also force or block tool use.
What is the difference between tool use and an AI agent?
Tool use is the basic skill of asking for a tool. An AI agent uses that skill again and again, choosing its own next steps until a larger task is finished.
Related explainers
- What is an AI agent? Explained with an assistant you send on errands
- What is MCP? Explained with an office of service counters
- What is an API? Explained with a waiter in a restaurant
- What is human-in-the-loop? Explained with a manager signing cheques
The DevDrift builds AI automation with approvals and audit trails: see how.
Sources
Could you explain this to a colleague now?
Mark it and posts that mention it will show a tick. Saved in this browser only.