Skip to main content
The Tools class is a registry that manages all actions (tools) available to the agent. It includes built-in browser actions and supports custom tool registration.

Constructor

Parameters

list[str] | None
List of default action names to exclude from the registry. Examples: ['search', 'wait', 'screenshot']
type[BaseModel] | None
Pydantic model class for structured output. Used for the done action.
bool
default:"True"
Show file information in task completion messages.

Methods

action() Decorator

Register a custom action (tool) that the agent can call.
str
required
Description of what the tool does. The LLM uses this to decide when to call it.
type[BaseModel]
Pydantic model defining the tool’s parameters. Auto-generated from function signature if not provided.
list[str]
List of domains where tool can run. Format: ['*.example.com']. Defaults to all domains.
bool
default:"False"
If True, this action terminates the current action sequence.

exclude_action()

Exclude a specific action from the registry.
str
required
Name of the action to exclude.

set_coordinate_clicking()

Enable or disable coordinate-based clicking.
bool
required
Whether to enable coordinate clicking.

get_output_model()

Get the output model schema if configured.
type[BaseModel] | None
Output model class, or None if not configured.

use_structured_output_action()

Register a structured output action with a specific schema.
type[BaseModel]
required
Pydantic model class for structured output.

Properties

registry

Registry[Context]
The underlying action registry that stores all registered tools.

Built-in Actions

  • search - Search queries (DuckDuckGo, Google, Bing)
  • navigate - Navigate to URLs
  • go_back - Go back in browser history
  • wait - Wait for specified seconds

Page Interaction

  • click - Click elements by their index
  • input - Input text into form fields
  • upload_file - Upload files to file inputs
  • scroll - Scroll the page up/down
  • find_text - Scroll to specific text on page
  • send_keys - Send special keys (Enter, Escape, etc.)

JavaScript Execution

  • evaluate - Execute custom JavaScript code on the page

Tab Management

  • switch - Switch between browser tabs
  • close - Close browser tabs

Content Extraction

  • extract - Extract data from webpages using LLM
  • search_page - Search page text for patterns (zero LLM cost)
  • find_elements - Query DOM elements by CSS selector (zero LLM cost)

Visual Analysis

  • screenshot - Request a screenshot for visual confirmation

Form Controls

  • dropdown_options - Get dropdown option values
  • select_dropdown - Select dropdown options

File Operations

  • write_file - Write content to files
  • read_file - Read file contents
  • replace_file - Replace text in files

Task Completion

  • done - Complete the task (always available)

Custom Tool Parameters

Tools can access special parameters by name:
BrowserSession
The current browser session for deterministic Actor actions.
list[str]
List of file paths available to the agent.
FileSystem
Agent’s file system instance.
BaseChatModel
LLM for page content extraction.
bool
Whether sensitive data is configured.
dict[str, str | dict[str, str]]
Dictionary of sensitive data.
dict | None
Schema for structured extraction.
Parameter names must match exactly! The agent injects parameters by name matching. Using browser: Browser instead of browser_session: BrowserSession will cause your tool to fail silently.

Example Usage

Basic Custom Tool

Tool with Browser Access

Tool with Parameters

Tool with File Access

Domain-Restricted Tool

ActionResult Response

Tools should return ActionResult for structured responses:
Or return a simple string:

See Also