The flow
Receive a TOOL_CALL event
The agent requests a tool. The event payload carries a
ToolCallData describing what to render.Render the component
Branch on
details.component (a SYNAPSE_COMPONENTS value) and show the matching UI.Collect input and reply
When the user responds, call
sendMessage({ toolCalled: true, tool_result, ... }) — or callTool() to execute a tool directly.Handling a TOOL_CALL event
Component types
details.component is one of SYNAPSE_COMPONENTS:
| Value | Component |
|---|---|
MOBILE (mobile_number) | Mobile number input |
OTP (otp) | One-time-passcode input |
EMAIL (email_address) | Email input |
PILL (pills) | Single-choice pills |
MULTI (multi) | Multi-select |
DOCTOR_CARD (doctor_card) | Doctor selection card |
CARD (card) | Generic card |
MEDIA_CARD (media_card) | Media card |
Elicitation status
A tool call moves throughSYNAPSE_EICITATION_STATUS states, carried on details.status:
| Status | Meaning |
|---|---|
PROGRESS (progress) | Awaiting user input — render the component. |
SUCCESS (success) | The tool completed successfully. |
FAILURE (failure) | The tool failed. |
Replying
Once the user responds, send the result. UsesendMessage with the elicitation flags:
callTool:
TOOL_CALL event with an updated status.
If the user dismisses a suggested tool, send
sendMessage({ tool_declined: true, tool_id }) so the agent knows to move on.Message feedback
Let users rate a message; report it withsendFeedback and the USER_FEEDBACK enum:
Next steps
API reference
Full signatures for
sendMessage, callTool, sendFeedback, and the related types.
