SendMessage lets a UI control continue the conversation on the user’s behalf. A button can ask the agent to explain a chart, compare selected items, or help with the next step. Its message can include the app’s current selection, so the user can ask about what they see without typing those details again.
The renderer sends the message with the user role. The MCP host controls how it appears in the conversation and whether it starts an agent response. To share a selection for a later turn, use Model Context.
Quick Action Buttons
Build a row of follow-up actions that save the user from typing:Dynamic Messages with State
Combine with state interpolation to include UI context in the message:API Reference
SendMessage Parameters
str
required
Message text to send to the conversation. Can be passed as a positional argument. Supports
{{ key }} interpolation.Protocol Reference
SendMessage