Member-only story
Clean Context
A Tool Call Is Just Text and a Loop You Own
Turns out tool calling is a calling convention: the model writes a request, and your code writes the result back. Real Ollama code, zero credits.
For a good couple of years now, LLMs have supported tool calling, the ability to call tools that we provide them to extend their capabilities. There are plenty of tutorials that teach you how to use it, and even libraries that abstract away what’s behind it and simplify the work. But they all leave it looking like magic. They cut us off from the real mechanism we need to understand about what we’re doing. At the end of the day, it’s very simple once you get it. The LLM makes no call, it generates no response. It's all us and a text file. And I’ll show it, with real Ollama code, so you can replicate it on your own computer while spending zero credits.
The basics
If we open any tutorial we’ll see that there are three different parts to setting up a tool call: the definition, the call, and the response.
The tool call definition exists so that the LLM knows which tools it can use. It amounts to a manifest listing what’s there. Normally we’ll find it in the call we make, or it will be configured in some…






