What a tool is
A tool is a function in your code that you describe to the model. The model can ask you to run it, but it never runs anything itself.
Last updated
Analogy
The model fills in a form; your API route does the work. It's a very polite manager who only ever writes tickets.
In an agent
Tool calling is the single skill that turns a chatbot into an agent. No tools, no agent.
Practice
Flashcards
- What is tool (function) calling?The model asks your code to run a function with given arguments. Your code runs it and sends back the result.
- Interview: does the model run your tool?No. It returns the tool name and arguments; your code validates, runs it, and sends the result back as a tool message.
Questions people ask
Does the model run my tools itself?
No. The model only asks. It replies with the tool name and the arguments it wants, and your code decides whether to run the function, runs it, and sends the result back. The model never executes anything on its own, which is why your code is where validation and permissions belong.
Why are tools what turn a chatbot into an agent?
Without tools a model can only talk about what it already knows. Tools let it fetch live data it does not have and take actions it cannot take, like creating a ticket. Put tool calling inside a loop, where the model chooses the next tool from the last result, and you have an agent.