Defining a Custom Action
A custom action requires three things:- type: A descriptive name for the action
- actionParams: A Zod schema describing the parameters
- run: A function that executes the action
Using Custom Actions
Pass custom actions when creating the agent:Real-World Example: Web Search
Integrate with a search API like Exa:Action Context
TheActionContext provides access to:
Action Output
Return anActionOutput object: