Tools
Extending the functionality of Agents for structured output or performing tasks.
Tools are functions that extend the capabilities of an Agent. Tools have two core uses:
- Turning unstructured inputs into structured responses.
- Calling code, enabling models to interact with systems like your own database or external APIs.
A list of all available Tools and their configuration is sent in an Agent’s inference calls and a model may decide that a certain tool or tools should be called to complete the task. Tools are included in an Agent’s calls to language models through features like OpenAI’s “function calling” or Claude’s “tool use.”
Creating a Tool
Each Tool’s name
, description
, and parameters
are part of the function definition that is used by model to learn about the tool’s capabilities and decide when it should be called. The handler
is the function that is executed by the Agent if the model decides that a particular Tool should be called.
Here is a simple tool that lists charges for a given user’s account between a date range:
Writing quality name
and description
parameters help the model determine when the particular Tool should be called.