Skip to main content
Tools are what make agents powerful. They allow your agent to interact with the world - searching the web, processing files, analyzing images, and much more. In this guide, you’ll learn how to add tools to your agents. 💻 Code Examples

Basic Tools

Get started with agent tools

Selective Tools

Pick specific tools from groups

Tool Groups

Import and combine tool groups

Image Tools

Analyze images with agents

Understanding Tools in Slide

Tools in Slide follow the OpenAI function calling format. Each tool has:
  • A definition that describes what it does
  • An implementation that executes the action

Using Lye’s built-in tools

The easiest way to add tools is using Lye’s pre-built tool groups:

Tool Groups Explained

Web Tools

Perfect for research and information gathering:

Image Tools

For visual analysis and OCR:

File Tools

For reading and writing files:

Audio Tools

For speech processing:

Browser Tools

For web automation:

Selective Tool Usage

Sometimes you only need specific tools:

Creating custom tools

You can create your own tools by following the OpenAI function format:

Advanced Custom Tools

Here’s a more complex example with async support and error handling:

Tool Combinations for Common Tasks

Research assistant

Content Analyzer

Web Scraper

Tool Timeouts

For tools that might take a long time (API calls, database queries), you can set a timeout using the low-level tool runner:

Timeout Behavior

When a tool exceeds its timeout:
  1. A TimeoutError is raised with the message: Tool 'tool_name' timed out after X seconds
  2. The error is returned to the LLM as the tool result
  3. The LLM can then decide how to proceed (retry, try a different approach, or inform the user)
Timeouts work for both async and synchronous tools. For sync tools, the operation runs in a thread pool with the timeout applied to the entire operation.
For synchronous tools, the underlying thread cannot be forcibly stopped after a timeout—it will continue running in the background. For truly cancellable long-running operations, implement your tools as async functions.
You can also specify timeouts in the lye tool format:

Best practices

1. Tool Selection

Only give your agent the tools it needs:

2. Clear Tool Descriptions

When creating custom tools, write clear descriptions:

3. Error Handling

Always handle errors in custom tools:

4. Tool Composition

Combine tools for complex workflows:

Troubleshooting

For OCR support with image-based PDFs, install poppler:
  • macOS: brew install poppler
  • Ubuntu: sudo apt-get install poppler-utils

Next steps

Tool Patterns

Advanced patterns for tool usage

Testing with Tools

Test agents with mock tools

MCP Integration

Use MCP tools with your agents

Using Lye

Explore all built-in tools