Skip to main content
Custom actions let you extend HyperAgent’s capabilities beyond browser automation. Add integrations with external APIs, databases, or any custom logic.

Defining a Custom Action

A custom action requires three things:
  1. type: A descriptive name for the action
  2. actionParams: A Zod schema describing the parameters
  3. run: A function that executes the action

Using Custom Actions

Pass custom actions when creating the agent:
The AI will automatically use your custom action when appropriate. Integrate with a search API like Exa:

Action Context

The ActionContext provides access to:
Use it to interact with the browser or agent state:

Action Output

Return an ActionOutput object:
The message helps the AI understand what happened and plan next steps.

Multiple Custom Actions

Combine multiple actions for complex workflows:

Next Steps

MCP Integration

Connect to MCP servers for more tools

page.ai()

Learn about task execution