# Custom Tools

Register custom tools that agents can invoke during task execution.

[Source](https://github.com/browser-use/template-library/blob/main/tools_template.py)

Getting Started By Browser Use

### 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](https://cloud.browser-use.com/new-api-key)

### Installation

```bash
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)
```
