Skip to content
Agents · 2 of 6 · about 20 minutes · With a year

Call a tool by its name

A model writes a tool call as text: a name and some arguments. The model can make a mistake. It can name a tool that does not exist, forget an argument, or add an argument that the tool does not have. Your program must check the call before it runs the tool. A clear error helps the model more than a crash. The model reads the error and writes a better call.

About this lesson

Words to know

tool call
A model's request that your program run a function for it, with a name and arguments.

Why it matters

Each tool that an agent can use needs this check. The error text returns to the model as the result of the call, so write it for a reader who must act on it.

With a year

How it works, a worked example, the exercise with its tests, three hints and the explained solution are in the app, with a year of Algo150 for $29 or ₾49. The first chapter, Model foundations, is free for everyone: start with Vector dot product.

What a year includes