Skip to main content
UpdateContext shares information from the app for the agent to use in future turns. When the user selects a product or filters a table, you can send the relevant details so their next question has that context. You choose which fields to share, and the MCP host decides how to include them in the model’s context. The update does not ask the agent to respond. Use Messages for a button that requests a follow-up, such as “Compare these products.”

When to Use It

UpdateContext is for situations where the UI interaction should inform the model’s future behavior without generating an immediate response:
  • User selects a preference or mode that should influence subsequent answers
  • A form submission captures structured data the model should reference later
  • Background state changes that provide context for the next conversation turn

Structured Content

For richer data, pass a dict instead of plain text:

API Reference

UpdateContext Parameters

str | None
default:"None"
Text content to add to the model’s context. Can be passed as a positional argument.
dict[str, Any] | None
default:"None"
Structured data to add to the model’s context.

Protocol Reference

UpdateContext
For the complete protocol schema, see UpdateContext.