Overview
Returns a function to send model context updates to the host. UnlikeuseAppState (which automatically syncs structured state), this hook gives direct control over when and what is sent to the model context — including text content blocks.
Each call overwrites the previous context. The host includes the last update in the model’s next turn.
Wraps updateModelContext
MCP Apps SDK reference
Import
Signature
UpdateModelContextParams
Array of content blocks to include in model context.
Structured data to include in model context. Serialized as JSON.
Returns
Function to push context updates to the host. Each call replaces the previous context.
Usage
Structured Content
Text Content
Comparison with useAppState
See Also
useAppState
Automatic state persistence and sync.