Action Structure
Every action has a name, description, andexecute handler. Add inputSchema when the action needs arguments:
Descriptions Matter
The assistant uses descriptions to decide when to call an action. Be specific:- Good
- Bad
Discovering Actions
Aim for 20-50+ actions. The more actions you define, the more capable the assistant becomes.Where to Look
Search your codebase for user interactions:| Look For | Example Actions |
|---|---|
| Buttons | openModal, submitForm, toggleSidebar |
| Forms | createItem, updateSettings, changePassword |
| Links/Navigation | navigateTo, openPage, goBack |
| Toggles | toggleDarkMode, enableNotifications |
| Filters/Sorting | applyFilter, sortBy, search |
| Bulk Operations | selectAll, deleteSelected, exportData |
| Context Menus | duplicate, rename, share |
Common Action Patterns
execute handler.
Input Schemas
inputSchema supports three formats:
- Legacy option schema (
{ field: { type, required, description } }) - JSON Schema object
- Zod schema (
z.object(...)) converted to JSON Schema automatically
String
Number
Boolean
Handling Actions
TheonAction callback receives executed actions as a fallback:
Approval Required
Mark destructive or irreversible actions withapprovalRequired: true:
When to Require Approval
- Delete operations
- Sending emails or messages
- Publishing content
- Financial transactions
- Changing permissions
- Any irreversible action
Next Steps
Documentation Assistance
What happens when no action matches
Context
Help the agent understand what’s on screen