Add a custom feature that the voice agent can trigger via tool calls, with a React UI panel.

Scenario

You want a “store locator” feature: the agent calls find_nearby_stores, your frontend queries an API, shows a map, and returns results to the agent.

Step 1 — Define the handler

Step 2 — Build the component

Step 3 — Register in the map

Step 4 — Configure in Cockpit

In Cockpit, add a feature with:
  • Type: store:locator (must match registry key)
  • Tool name: find_nearby_stores
  • frontend_method: optional RPC override

Step 5 — Test

  1. Start a voice session
  2. Ask the agent to find nearby stores
  3. Verify RPC fires, UI renders, agent receives SUCCESS data

Error handling

Return ERROR (not throw) so the agent can explain the failure to the user.

Tips

  • Keep response.data concise — it’s sent to the LLM
  • Put rich UI data in componentData — it’s for your React component only
  • Match feature type in Cockpit to registry key exactly
  • No UI panel needed? Skip the registry and pass the handler directly via the tools option of useScenaroSession — it receives (args, context) and returns the result, no request IDs or response wrapping