Skip to main content

Tools Module

The tools module provides a comprehensive system for creating and using tools with agents. It includes built-in tools, a decorator for creating custom tools, and a plugin system for extensibility.

Installation

Quick Start

Using the @tool Decorator

Using Built-in Tools

Classes

BaseTool

Abstract base class for creating custom tools.

Attributes

Methods


FunctionTool

A BaseTool wrapper for plain functions, created automatically by the @tool decorator.

ToolResult

Wrapper for tool execution results.

Attributes


ToolValidationError

Exception raised when a tool fails validation.

Decorators

@tool

Convert a function into a tool.

Parameters

Built-in Tools

Search Tools

Knowledge Tools

Web Crawling Tools

File Tools

Data Tools

Calculator Tools

Shell Tools

Code Tools

Usage Examples

Creating Custom Tools

Using Multiple Built-in Tools

Tool Registry

Tool Validation

  • Agent - Using tools with agents
  • Task - Task configuration