Scenario
You want a “store locator” feature: the agent callsfind_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
- Start a voice session
- Ask the agent to find nearby stores
- Verify RPC fires, UI renders, agent receives
SUCCESSdata
Error handling
ERROR (not throw) so the agent can explain the failure to the user.
Tips
- Keep
response.dataconcise — it’s sent to the LLM - Put rich UI data in
componentData— it’s for your React component only - Match feature
typein Cockpit to registry key exactly - No UI panel needed? Skip the registry and pass the handler directly via the
toolsoption ofuseScenaroSession— it receives(args, context)and returns the result, no request IDs or response wrapping