Understanding Tools
Give your agents superpowers by adding tools to interact with APIs, perform calculations, and more.
Tools are the way to give your Agents superpowers: they allow your agent to interact with the outside world, call APIs, perform calculations, and much more.
What is a Tool?
A Tool is a function (or callable) that your agent can invoke. You can use:
- Your own Python functions
- Pre-built tools provided by Timbal
- Tools defined as objects or dictionaries
How to Create a Tool
1. Define a Python Function
You can start with a simple function:
2. Wrap it as a Tool
You can wrap your function as a Tool object, or just pass the function directly:
Or, you can use a dictionary:
3. Add the Tool to Your Agent
Using Built-in Tools
Timbal comes with many built-in tools, such as search
using Perplexity or send_message
using Slack.
You can add them directly:
Find more in the Integrations section.
Customizing Tool Parameters
You can control which parameters are visible to the LLM and how they are described.
Field Descriptions and Choices
Use Field
to add descriptions and choices to your function parameters:
Controlling Parameter Visibility
- params_mode:
"all"
(default) exposes all params,"required"
exposes only required ones. - include_params: List of param names to always include.
- exclude_params: List of param names to exclude.
Only show required params
Include extra params
Exclude params
Dictionary style
Adding Descriptions
Always add a description
to your tool! This helps the LLM understand when and how to use it.
Using Tools in Agents
You can combine multiple tools, both custom and built-in:
Summary
- Tools let your agent interact with the world.
- You can use your own functions, built-in tools, or dictionaries.
- Customize which parameters are visible and how they are described.
- Add clear descriptions for best results.
For more, see the Integrations and Advanced Tools docs!