Overview
Response types represent messages sent from agents to clients in reply to requests. Each response corresponds to a specific request type.Initialize
InitializeResponse
Response to an initialization request.The protocol version the agent will use
Information about the agent implementation
Capabilities advertised by the agent
Available authentication methods
Optional metadata
Authentication
AuthenticateResponse
Response to an authentication request.Optional metadata
Session Management
NewSessionResponse
Response to a new session request.The unique identifier for the created session
Available modes and current mode for the session
Available models and current model for the session
Available configuration options for the session
Optional metadata
LoadSessionResponse
Response to a load session request.Available modes and current mode for the session
Available models and current model for the session
Available configuration options for the session
Optional metadata
ListSessionsResponse
Response containing a list of sessions.List of session information
Pagination cursor for fetching the next page
Optional metadata
ForkSessionResponse
Response to a fork session request.The unique identifier for the forked session
Available modes and current mode
Available models and current model
Available configuration options
Optional metadata
ResumeSessionResponse
Response to a resume session request.Available modes and current mode
Available models and current model
Available configuration options
Optional metadata
SetSessionModeResponse
Response to a set session mode request.Optional metadata
SetSessionConfigOptionResponse
Response to a set session config option request.The updated configuration options
Optional metadata
SetSessionModelResponse
Response to a set session model request.Optional metadata
Prompt
PromptResponse
Response to a prompt request. See Stop Reasons.Indicates why the agent stopped processing the turn:
end_turn- The turn ended successfullymax_tokens- Reached the maximum number of tokensmax_turn_requests- Reached the maximum number of allowed agent requestsrefusal- The agent refused to continuecancelled- The turn was cancelled viasession/cancel
Token usage information for this prompt
Optional metadata
File System
WriteTextFileResponse
Response to a write text file request.Optional metadata
ReadTextFileResponse
Response to a read text file request.The text content read from the file
Optional metadata
Permissions
RequestPermissionResponse
Response to a permission request.The user’s decision, either
CancelledOutcome or SelectedOutcomeOptional metadata
Terminal
CreateTerminalResponse
Response to a create terminal request.The unique identifier for the created terminal
Optional metadata
TerminalOutputResponse
Response containing terminal output.The terminal output (stdout and stderr combined)
Whether the output was truncated due to size limits
The exit status if the command has completed
Optional metadata
ReleaseTerminalResponse
Response to a release terminal request.Optional metadata
WaitForTerminalExitResponse
Response containing terminal exit information.The exit code of the command
The signal that terminated the command (if applicable)
Optional metadata
KillTerminalCommandResponse
Response to a kill terminal command request.Optional metadata