Register custom tools that agents can invoke during task execution.

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.
You'll need one API Key:
uvx browser-use init --template tools
Build your own custom tools by following these steps:
Tools() instance to manage custom actions@tools.registry.action() decorator to register functionsActionResult objectsIn 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)