- Calling code, enabling models to interact with systems like your own database or external APIs.
- Turning unstructured inputs into structured responses.
Creating a Tool
Each Tool’sname
, 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:
name
and description
parameters help the model determine when the particular Tool should be called.
Optional parameters
Optional parameters should be defined using.nullable()
(not .optional()
):
Examples
You can find multiple examples of tools in the below GitHub projects:Hacker News Agent with Render and Inngest
A tutorial showing how to create a Hacker News Agent using AgentKit Code-style routing and Agents with tools.
AgentKit SWE-bench
This AgentKit example uses the SWE-bench dataset to train an agent to solve coding problems. It uses advanced tools to interact with files and codebases.