agents
Glossary ↗Tool Calling
Tool calling is the mechanism by which a language model invokes code. You describe the available functions and their parameters; the model, instead of answering in prose, emits a structured call naming one function and its arguments; your application runs it and passes the result back for the model to continue with. The distinction that matters is that the model never executes anything. It produces an intention, your code decides whether to honour it. That boundary is where authorisation, rate limiting and validation belong — a model that has been talked into requesting a refund is harmless if the refund tool checks the order first. Reliability comes from the descriptions more than the model. Tools with overlapping purposes get confused with each other, optional parameters get omitted, and a function described as "gets data" will be called for everything or nothing. Name one job per tool and describe when not to use it as well as when to. In production, log every call with its arguments and outcome. That log is how you discover the model is calling an expensive tool three times per conversation, and it is the dataset you evaluate future prompt changes against.
Related terms