Creating an action
Create an action insrc/actions/:
Action input and output
Define input and output schemas using TypeScript types or Zod schemas:Calling actions
Actions can be called from anywhere in your agent’s source. Just importactions and call them directly:
As a tool in a conversation
You can provide an action to your agent as a tool using theasTool method:
Integration actions
When you install an integration, its actions become available anywhere in your agent’s source:Best practices
- Keep actions focused on a single responsibility
- Use actions for reusable logic that’s needed across multiple parts of your agent
Reference
Action props
Handler parameters
The handler function receives an object withinput and client properties: