< BACK_TO_GRID
TEMPLATE_ID: TOOLS

Custom Tools

Register custom tools that agents can invoke during task execution.

Custom Tools

CREATED_BY

B
Browser Use Team

APPLICABLE_PROTOCOLS

Getting StartedBy Browser Use

CONFIGURATION

modelChatBrowserUse()
use_visionTRUE
>_

DOCUMENTATION

The Idea

Browser Use comes with powerful built-in actions for web automation, but what if you need domain-specific functionality?

The tools template shows you how to extend agent capabilities by registering a custom save_to_file tool.

Requirements

You'll need one API Key:

  • Browser Use
Get your Browser Use API Key here

Installation

uvx browser-use init --template tools

Customization

Build your own custom tools by following these steps:

  1. Create a Tools Registry - Initialize a Tools() instance to manage custom actions
  2. Define Custom Actions - Use the @tools.registry.action() decorator to register functions
  3. Return Action Results - Provide feedback to the agent with ActionResult objects
  4. Pass to Agent - Integrate your custom tools when initializing the Agent

In the end, this comes down to a few lines of code, like:

tools = Tools()
@tools.registry.action('my_function')
async def my_function(filename: str, content: str):
	# Do Something
 
    return ActionResult(extracted_content="...")
 
agent = Agent(task=task, llm=llm, tools=tools)