Actions

Overview

Once an action is authored and published in Agent Studio, developers must implement the handler code that executes the action in your application.
The agent routes user intent → your handler runs business logic → results return to the agent.


1. Accessing Actions

  • Pull action definitions and schemas via the Foldspace SDK.
  • Use MCP integrations (VS Code, Cursor, Windsurf) for autocompletion and schema-aware development.

➡ See: Vibe Coding


2. Implementing Handlers

Each action requires a handler function in your frontend codebase.

  • Accepts the action’s input parameters from the schema.
  • Executes your business logic (API calls, DB updates, navigation, etc.).
  • Returns output or error to the agent.

3. Example Flow

  1. Publish Action in Agent Studio → createUser with schema (email, organizationRoleType).
  2. Trigger → User says: “Invite Sarah as an account manager”.
  3. Agent → Calls createUser with extracted parameters.
  4. Handler → Your code executes backend API call.
  5. Response → Agent confirms success in conversation.

4. Code Examples

Choose the example that matches how your action should behave:


5. Testing

  • Run local dev mode with MCP to stub or mock actions.
  • Validate schema updates in the SDK.
  • Add unit tests for handlers to ensure reliability.

6. Deployment & Rollout

  • Wrap actions in feature flags for safe rollout.
  • Monitor telemetry: success/failure, latency.
  • Keep code handlers backward-compatible with multiple action versions.

Developer Checklist ✅

  • Pull action schemas via SDK or MCP
  • Implement handler functions for each action
  • Test locally with mocks
  • Deploy behind feature flag
  • Monitor action telemetry



Related Guides