Skip to main content
Mid-conversation, the agent can call a tool — and many tools need input from the user first. This is elicitation: the server tells your UI which component to render (a set of pills, an OTP box, a doctor card…), you collect the input, and you send the result back. The agent continues with the answer.

The flow

1

Receive a TOOL_CALL event

The agent requests a tool. The event payload carries a ToolCallData describing what to render.
2

Render the component

Branch on details.component (a SYNAPSE_COMPONENTS value) and show the matching UI.
3

Collect input and reply

When the user responds, call sendMessage({ toolCalled: true, tool_result, ... }) — or callTool() to execute a tool directly.
4

Continue

The agent processes the result and streams its next message.

Handling a TOOL_CALL event

Component types

details.component is one of SYNAPSE_COMPONENTS:

Elicitation status

A tool call moves through SYNAPSE_EICITATION_STATUS states, carried on details.status:

Replying

Once the user responds, send the result. Use sendMessage with the elicitation flags:
To execute a tool directly with parameters — for example after the user picks a doctor — use callTool:
The response comes back as a 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 with sendFeedback and the USER_FEEDBACK enum:

Next steps

API reference

Full signatures for sendMessage, callTool, sendFeedback, and the related types.