← All terms

Tool Calling

The mechanism that lets a model invoke external functions, like a search or a calculator, instead of only generating text.

Tool calling, sometimes called function calling, is how an agent acts. You describe a set of functions to the model with their names and parameters. When the model decides it needs one, it outputs a structured request to call that function with specific arguments. Your code runs the function and feeds the result back, and the model continues. This is the bridge between language and action. Without tools, a model can only describe what it would do. With a calculator tool it can compute exactly; with a database tool it can look up real data; with a code tool it can run a script. Reliable tool calling is the foundation every agent framework is built on. Frameworks differ in how they handle the details: validating arguments, retrying on bad calls, running tools in parallel, and sandboxing risky ones. Smolagents takes the unusual approach of having the model write code that calls tools directly, while most frameworks use the model's native structured tool-calling format.