Skip to content

Actions Reference

Complete reference for all action types in the Agent Host Protocol. Actions are the sole mutation mechanism for subscribable state.

JSON Schema: actions.schema.json

Action Envelope

Every action is wrapped in an ActionEnvelope:

typescript
interface ActionEnvelope {
  readonly action: StateAction;
  readonly serverSeq: number;
  readonly origin: { clientId: string; clientSeq: number } | undefined;
  readonly rejectionReason?: string;
}

Root Actions

Mutate RootState. All are server-only.

root/agentsChanged 📄

Fired when available agent backends or their models change.

FieldTypeDescription
typeActionType.RootAgentsChanged
agentsAgentInfo[]Updated agent list

Session Actions

Mutate SessionState. Scoped to a session URI.

session/ready 📄

Session backend initialized successfully.

FieldTypeDescription
typeActionType.SessionReady
sessionURISession URI

session/creationFailed 📄

Session backend failed to initialize.

FieldTypeDescription
typeActionType.SessionCreationFailed
sessionURISession URI
errorErrorInfoError details

session/turnStarted 📄

Client-dispatchable. User sent a message; server starts agent processing.

FieldTypeRequiredDescription
typeActionType.SessionTurnStartedYes
sessionURIYesSession URI
turnIdstringYesTurn identifier
userMessageUserMessageYesUser's message
queuedMessageIdstringNoIf this turn was auto-started from a queued message, the ID of that message

session/delta 📄

Streaming text chunk from the assistant, appended to a specific response part.

The server MUST first emit a session/responsePart to create the target part (markdown or reasoning), then use this action to append text to it.

FieldTypeDescription
typeActionType.SessionDelta
sessionURISession URI
turnIdstringTurn identifier
partIdstringIdentifier of the response part to append to
contentstringText chunk

session/responsePart 📄

Structured content appended to the response.

FieldTypeDescription
typeActionType.SessionResponsePart
sessionURISession URI
turnIdstringTurn identifier
partResponsePartResponse part (markdown or content ref)

session/toolCallStart 📄

A tool call begins — parameters are streaming from the LM.

For client-provided tools, the server sets toolClientId to identify the owning client. That client is responsible for executing the tool once it reaches the running state and dispatching session/toolCallComplete.

FieldTypeRequiredDescription
typeActionType.SessionToolCallStartYes
toolNamestringYesInternal tool name (for debugging/logging)
displayNamestringYesHuman-readable tool name
toolClientIdstringNoIf this tool is provided by a client, the clientId of the owning client.
Absent for server-side tools.

session/toolCallDelta 📄

Streaming partial parameters for a tool call.

FieldTypeRequiredDescription
typeActionType.SessionToolCallDeltaYes
contentstringYesPartial parameter content to append
invocationMessageStringOrMarkdownNoUpdated progress message

session/toolCallReady 📄

Tool call parameters are complete, or a running tool requires re-confirmation.

When dispatched for a streaming tool call, transitions to pending-confirmation or directly to running if confirmed is set.

When dispatched for a running tool call (e.g. mid-execution permission needed), transitions back to pending-confirmation. The invocationMessage and _meta SHOULD be updated to describe the specific confirmation needed. Clients use the standard session/toolCallConfirmed flow to approve or deny.

For client-provided tools, the server typically sets confirmed to 'not-needed' so the tool transitions directly to running, where the owning client can begin execution immediately.

FieldTypeRequiredDescription
typeActionType.SessionToolCallReadyYes
invocationMessageStringOrMarkdownYesMessage describing what the tool will do or what confirmation is needed
toolInputstringNoRaw tool input
confirmationTitleStringOrMarkdownNoShort title for the confirmation prompt (e.g. "Run in terminal", "Write file")
edits{ items: FileEdit[] }NoFile edits that this tool call will perform, for preview before confirmation
editablebooleanNoWhether the agent host allows the client to edit the tool's input parameters before confirming
confirmedToolCallConfirmationReasonNoIf set, the tool was auto-confirmed and transitions directly to running
optionsConfirmationOption[]NoOptions the server offers for this confirmation. When present, the client
SHOULD render these instead of a plain approve/deny UI. Each option
belongs to a {@link ConfirmationOptionGroup} so the client can still
categorise the choices.

session/toolCallConfirmed (approved) 📄

Client-dispatchable. Client approves a pending tool call. The tool transitions to running.

FieldTypeRequiredDescription
typeActionType.SessionToolCallConfirmedYes
approvedtrueYesThe tool call was approved
confirmedToolCallConfirmationReasonYesHow the tool was confirmed
editedToolInputstringNoEdited tool input parameters, if the client modified them before confirming
selectedOptionIdstringNoID of the selected confirmation option, if the server provided options

session/toolCallConfirmed (denied) 📄

Client-dispatchable. Client denies a pending tool call. The tool transitions to cancelled.

For client-provided tools, the owning client MUST dispatch this if it does not recognize the tool or cannot execute it.

FieldTypeRequiredDescription
typeActionType.SessionToolCallConfirmedYes
approvedfalseYesThe tool call was denied
reasonToolCallCancellationReason.Denied | ToolCallCancellationReason.SkippedYesWhy the tool was cancelled
userSuggestionUserMessageNoWhat the user suggested doing instead
reasonMessageStringOrMarkdownNoOptional explanation for the denial
selectedOptionIdstringNoID of the selected confirmation option, if the server provided options

session/toolCallComplete 📄

Tool execution finished. Transitions to completed or pending-result-confirmation if requiresResultConfirmation is true.

For client-provided tools (where toolClientId is set on the tool call state), the owning client dispatches this action with the execution result. The server SHOULD reject this action if the dispatching client does not match toolClientId.

Servers waiting on a client tool call MAY time out after a reasonable duration if the implementing client disconnects or becomes unresponsive, and dispatch this action with result.success = false and an appropriate error.

FieldTypeRequiredDescription
typeActionType.SessionToolCallCompleteYes
resultToolCallResultYesExecution result
requiresResultConfirmationbooleanNoIf true, the result requires client approval before finalizing

ToolCallResult 📄

FieldTypeRequiredDescription
successbooleanYesWhether the tool succeeded
pastTenseMessageStringOrMarkdownYesPast-tense description of what the tool did
contentToolResultContent[]NoUnstructured result content blocks.

This mirrors the content field of MCP CallToolResult. | | structuredContent | Record<string, unknown> | No | Optional structured result object.

This mirrors the structuredContent field of MCP CallToolResult. | | error | { message: string; code?: string } | No | Error details if the tool failed |

session/toolCallResultConfirmed 📄

Client-dispatchable. Client approves or denies a tool's result.

If approved is false, the tool transitions to cancelled with reason result-denied.

FieldTypeDescription
typeActionType.SessionToolCallResultConfirmed
approvedbooleanWhether the result was approved

session/turnComplete 📄

Turn finished — the assistant is idle.

FieldTypeDescription
typeActionType.SessionTurnComplete
sessionURISession URI
turnIdstringTurn identifier

session/turnCancelled 📄

Client-dispatchable. Turn was aborted; server stops processing.

FieldTypeDescription
typeActionType.SessionTurnCancelled
sessionURISession URI
turnIdstringTurn identifier

session/error 📄

Error during turn processing.

FieldTypeDescription
typeActionType.SessionError
sessionURISession URI
turnIdstringTurn identifier
errorErrorInfoError details

session/titleChanged 📄

Client-dispatchable. Session title updated. Fired by the server when the title is auto-generated from conversation, or dispatched by a client to rename a session.

FieldTypeDescription
typeActionType.SessionTitleChanged
sessionURISession URI
titlestringNew title

session/usage 📄

Token usage report for a turn.

FieldTypeDescription
typeActionType.SessionUsage
sessionURISession URI
turnIdstringTurn identifier
usageUsageInfoToken usage data

session/reasoning 📄

Reasoning/thinking text from the model, appended to a specific reasoning response part.

The server MUST first emit a session/responsePart to create the target reasoning part, then use this action to append text to it.

FieldTypeDescription
typeActionType.SessionReasoning
sessionURISession URI
turnIdstringTurn identifier
partIdstringIdentifier of the reasoning response part to append to
contentstringReasoning text chunk

session/modelChanged 📄

Client-dispatchable. Model changed for this session.

FieldTypeDescription
typeActionType.SessionModelChanged
sessionURISession URI
modelModelSelectionNew model selection

session/isReadChanged 📄

Client-dispatchable. The read state of the session changed.

Dispatched by a client to mark a session as read (e.g. after viewing it) or unread (e.g. after new activity since the client last looked at it).

FieldTypeDescription
typeActionType.SessionIsReadChanged
sessionURISession URI
isReadbooleanWhether the session has been read

session/isArchivedChanged 📄

Client-dispatchable. The archived state of the session changed.

Dispatched by a client to archive a session (e.g. the task is complete) or to unarchive it.

FieldTypeDescription
typeActionType.SessionIsArchivedChanged
sessionURISession URI
isArchivedbooleanWhether the session is archived

session/activityChanged 📄

The activity description of the session changed.

Dispatched by the server to indicate what the session is currently doing (e.g. running a tool, thinking). Clear activity by setting it to undefined.

FieldTypeDescription
typeActionType.SessionActivityChanged
sessionURISession URI
activitystring | undefinedHuman-readable description of current activity, or undefined to clear

Version Introduction

All actions listed above were introduced in protocol version 1.

Action TypeVersion
root/agentsChanged1
session/ready1
session/creationFailed1
session/turnStarted1
session/delta1
session/responsePart1
session/toolCallStart1
session/toolCallDelta1
session/toolCallReady1
session/toolCallConfirmed (approved)1
session/toolCallConfirmed (denied)1
session/toolCallComplete1
session/toolCallResultConfirmed1
session/turnComplete1
session/turnCancelled1
session/error1
session/titleChanged1
session/usage1
session/reasoning1
session/modelChanged1
session/isReadChanged1
session/isArchivedChanged1
session/activityChanged1

Released under the MIT License.