Overview
Request types represent messages sent from clients to agents that expect a response. Each request has a corresponding response type.Initialize
Establishes the connection with a client and negotiates protocol capabilities.InitializeRequest
The protocol version the client supports
Information about the client implementation
Capabilities advertised by the client
Optional metadata for the request
Authentication
AuthenticateRequest
Authenticates the client using the specified authentication method.The ID of the authentication method to use (from the agent’s advertised auth methods)
Optional metadata
Session Management
NewSessionRequest
Creates a new conversation session with the agent.The current working directory for the session
List of MCP servers to connect to. Can be
HttpMcpServer, SseMcpServer, or StdioMcpServerOptional metadata
LoadSessionRequest
Loads an existing session to resume a previous conversation.The ID of the session to load
The current working directory for the session
List of MCP servers to connect to
Optional metadata
ListSessionsRequest
Lists existing sessions from the agent.Pagination cursor for fetching the next page of results
Filter sessions by current working directory
Optional metadata
ForkSessionRequest
Forks an existing session to create a new independent session.The ID of the session to fork
The current working directory for the new session
Optional list of MCP servers for the forked session
Optional metadata
ResumeSessionRequest
Resumes an existing session without replaying previous messages.The ID of the session to resume
The current working directory for the session
Optional list of MCP servers
Optional metadata
SetSessionModeRequest
Sets the operational mode for a session.The ID of the session
The ID of the mode to set (must be from availableModes)
Optional metadata
SetSessionConfigOptionRequest
Sets the current value for a session configuration option.The ID of the session
The ID of the configuration option to set
The new value for the configuration option
Optional metadata
SetSessionModelRequest
Selects the model for a given session.The ID of the session
The ID of the model to use
Optional metadata
Prompt
PromptRequest
Processes a user prompt within a session. See User Message.The ID of the session this prompt belongs to
Structured content blocks representing the user’s message. Can include text, images, audio, resources, etc.
Optional metadata
File System
WriteTextFileRequest
Writes content to a text file in the client’s file system.The ID of the session
The file path to write to
The text content to write
Optional metadata
ReadTextFileRequest
Reads content from a text file in the client’s file system.The ID of the session
The file path to read from
Optional starting line number (0-based)
Optional maximum number of lines to read
Optional metadata
Permissions
RequestPermissionRequest
Requests permission from the user for a tool call operation.The ID of the session
Available permission options to present to the user
Information about the tool call requesting permission
Optional metadata
Terminal
CreateTerminalRequest
Creates a new terminal and executes a command.The ID of the session
The command to execute in the terminal
Arguments to pass to the command
Working directory for the command (defaults to current directory)
Environment variables to set for the command
Optional limit for terminal output bytes returned in responses
Optional metadata
TerminalOutputRequest
Gets the current output and exit status of a terminal.The ID of the session
The ID of the terminal
Optional metadata
ReleaseTerminalRequest
Releases a terminal and frees all associated resources.The ID of the session
The ID of the terminal to release
Optional metadata
WaitForTerminalExitRequest
Waits for a terminal command to exit and returns its exit status.The ID of the session
The ID of the terminal
Optional metadata
KillTerminalCommandRequest
Kills a terminal command without releasing the terminal.The ID of the session
The ID of the terminal
Optional metadata
MCP Server Types
HttpMcpServer
HTTP-based MCP server configuration.Server type (always “http”)
Name of the MCP server
The HTTP URL for the server
HTTP headers to include with requests
SseMcpServer
Server-Sent Events based MCP server configuration.Server type (always “sse”)
Name of the MCP server
The SSE URL for the server
HTTP headers to include with the SSE connection
StdioMcpServer
Stdio-based MCP server configuration.Name of the MCP server
The command to execute
Arguments for the command
Environment variables for the command