Skip to main content

Overview

Session updates are sent from agents to clients via SessionNotification to provide real-time feedback during prompt processing. Each update type carries different information about the agent’s progress. See Agent Reports Output in the protocol documentation.

Message Updates

UserMessageChunkSessionUpdate

Streams content that is part of the user’s message (typically when loading a session).
content
ContentBlock
required
A content block from the user’s message (text, image, audio, resource, etc.)

AgentMessageChunkSessionUpdate

Streams content that is part of the agent’s response.
content
ContentBlock
required
A content block from the agent’s message (text, image, audio, resource, etc.)

AgentThoughtChunkSessionUpdate

Streams the agent’s internal thoughts or reasoning process.
content
ContentBlock
required
A content block containing the agent’s internal thoughts (typically text)

Tool Call Updates

ToolCallSessionUpdate

Creates a new tool call. See Tool Calls.
toolCallId
String
required
Unique identifier for this tool call
title
String
required
Display title for the tool call
kind
ToolKind
The kind of operation: read, edit, delete, move, search, execute, think, fetch, switch_mode, or other
status
ToolCallStatus
Current status: pending, in_progress, completed, or failed
content
List<ToolCallContent>
Content produced by the tool call. Can include:
  • ContentToolCallContent - Standard content blocks (text, images, etc.)
  • DiffToolCallContent - File diffs
  • TerminalToolCallContent - Terminal output references
locations
List<ToolCallLocation>
File locations being accessed or modified
rawInput
Map<String, dynamic>
Raw input parameters for the tool
rawOutput
Map<String, dynamic>
Raw output from the tool
_meta
Map<String, dynamic>
Optional metadata

ToolCallUpdateSessionUpdate

Updates an existing tool call (identified by toolCallId).
toolCallId
String
required
The ID of the tool call to update
title
String
Updated display title
kind
ToolKind
Updated operation kind
status
ToolCallStatus
Updated status
content
List<ToolCallContent>
Additional or updated content
locations
List<ToolCallLocation>
Updated file locations
rawInput
Map<String, dynamic>
Updated raw input
rawOutput
Map<String, dynamic>
Updated raw output
_meta
Map<String, dynamic>
Optional metadata

Plan Updates

PlanSessionUpdate

Updates the agent’s execution plan. See Agent Plan.
entries
List<PlanEntry>
required
The complete list of plan entries
_meta
Map<String, dynamic>
Optional metadata

Commands Update

AvailableCommandsUpdateSessionUpdate

Updates the list of commands available to the user.
availableCommands
List<AvailableCommand>
required
List of available commands
_meta
Map<String, dynamic>
Optional metadata

Mode Update

CurrentModeUpdateSessionUpdate

Notifies about a mode change in the session.
currentModeId
String
required
The ID of the newly active mode
_meta
Map<String, dynamic>
Optional metadata

Configuration Update

ConfigOptionUpdate

Updates session configuration options.
configOptions
List<SessionConfigOption>
required
The updated list of configuration options
_meta
Map<String, dynamic>
Optional metadata

Session Info Update

SessionInfoUpdate

Updates metadata about the session itself.
title
String
Updated session title
updatedAt
String
When the session was last updated (ISO 8601 timestamp)
_meta
Map<String, dynamic>
Optional metadata

Usage Update

UsageUpdate

Provides information about resource usage (e.g., context window).
size
int
required
Total size of the resource (e.g., maximum context window size)
used
int
required
Amount currently used
cost
Cost
Associated cost information
_meta
Map<String, dynamic>
Optional metadata

Unknown Updates

UnknownSessionUpdate

A fallback type for session updates that don’t match any known type. This ensures forward compatibility when new update types are added to the protocol.
rawJson
Map<String, dynamic>
required
The raw JSON data for the unknown update type
Clients should handle UnknownSessionUpdate gracefully to maintain compatibility with future protocol versions.

Build docs developers (and LLMs) love