Defines the interface that all ACP-compliant agents must implement.Agents are programs that use generative AI to autonomously modify code. They handle
requests from clients and execute tasks using language models and tools.
Authenticates the client using the specified authentication method.Called when the agent requires authentication before allowing session creation.
The client provides the authentication method ID that was advertised during initialization.After successful authentication, the client can proceed to create sessions with
new_session without receiving an auth_required error.See protocol docs: Initialization
Request parameters for the initialize method.Sent by the client to establish connection and negotiate capabilities.See protocol docs: InitializationType: ObjectProperties:
Response from the initialize method.Contains the negotiated protocol version and agent capabilities.See protocol docs: InitializationType: ObjectProperties:
The protocol version the client specified if supported by the agent,
or the latest protocol version supported by the agent.The client should disconnect, if it doesn’t support this version.
Cancels ongoing operations for a session.This is a notification sent by the client to cancel an ongoing prompt turn.Upon receiving this notification, the Agent SHOULD:
Stop all language model requests as soon as possible
Abort all tool call invocations in progress
Send any pending session/update notifications
Respond to the original session/prompt request with StopReason::Cancelled
Loads an existing session to resume a previous conversation.This method is only available if the agent advertises the loadSession capability.The agent should:
Restore the session context and conversation history
Connect to the specified MCP servers
Stream the entire conversation history back to the client via notifications
Request parameters for loading an existing session.Only available if the agent supports the loadSession capability.See protocol docs: Loading SessionsType: ObjectProperties:
Creates a new conversation session with the agent.Sessions represent independent conversation contexts with their own history and state.The agent should:
Create a new session context
Connect to any specified MCP servers
Return a unique session ID for future requests
May return an auth_required error if the agent requires authentication.See protocol docs: Session Setup
Request parameters for sending a user prompt to the agent.Contains the user’s message and any additional context.See protocol docs: User MessageType: ObjectProperties:
The blocks of content that compose the user’s message.As a baseline, the Agent MUST support ContentBlock::Text and ContentBlock::ResourceLink,
while other variants are optionally enabled via PromptCapabilities.The Client MUST adapt its interface according to PromptCapabilities.The client MAY include referenced pieces of context as either
ContentBlock::Resource or ContentBlock::ResourceLink.When available, ContentBlock::Resource is preferred
as it avoids extra round-trips and allows the message to include
pieces of context from sources the agent may not have access to.
Defines the interface that ACP-compliant clients must implement.Clients are typically code editors (IDEs, text editors) that provide the interface
between users and AI agents. They manage the environment, handle user interactions,
and control access to resources.
Reads content from a text file in the client’s file system.Only available if the client advertises the fs.readTextFile capability.
Allows the agent to access file contents within the client’s environment.See protocol docs: Client
Writes content to a text file in the client’s file system.Only available if the client advertises the fs.writeTextFile capability.
Allows the agent to create or modify files within the client’s environment.See protocol docs: Client
Requests permission from the user for a tool call operation.Called by the agent when it needs user authorization before executing
a potentially sensitive operation. The client should present the options
to the user and return their decision.If the client cancels the prompt turn via session/cancel, it MUST
respond to this request with RequestPermissionOutcome::Cancelled.See protocol docs: Requesting Permission
Request for user permission to execute a tool call.Sent when the agent needs authorization before performing a sensitive operation.See protocol docs: Requesting PermissionType: ObjectProperties:
Handles session update notifications from the agent.This is a notification endpoint (no response expected) that receives
real-time updates about session progress, including message chunks,
tool calls, and execution plans.Note: Clients SHOULD continue accepting tool call updates even after
sending a session/cancel notification, as the agent may send final
updates before responding with the cancelled stop reason.See protocol docs: Agent Reports Output
Notification containing a session update from the agent.Used to stream real-time progress and results during prompt processing.See protocol docs: Agent Reports OutputType: ObjectProperties:
Capabilities supported by the agent.Advertised during initialization to inform the client about
available features and content types.See protocol docs: Agent CapabilitiesType: ObjectProperties:
Capabilities supported by the client.Advertised during initialization to inform the agent about
available features and methods.See protocol docs: Client CapabilitiesType: ObjectProperties:
Content blocks represent displayable information in the Agent Client Protocol.They provide a structured way to handle various types of user-facing content—whether
it’s text from language models, images for analysis, or embedded resources for context.Content blocks appear in:
User prompts sent via session/prompt
Language model output streamed through session/update notifications
Progress updates and results from tool calls
This structure is compatible with the Model Context Protocol (MCP), enabling
agents to seamlessly forward content from MCP tool outputs without transformation.See protocol docs: ContentType: Union
Complete resource contents embedded directly in the message.Preferred for including context as it avoids extra round-trips.Requires the embeddedContext prompt capability when included in prompts.
Configuration for connecting to an MCP (Model Context Protocol) server.MCP servers provide tools and context that the agent can use when
processing prompts.See protocol docs: MCP ServersType: ObjectProperties:
An execution plan for accomplishing complex tasks.Plans consist of multiple entries representing individual tasks or goals.
Agents report plans to clients to provide visibility into their execution strategy.
Plans can evolve during execution as the agent discovers new requirements or completes tasks.See protocol docs: Agent PlanType: ObjectProperties:
The list of tasks to be accomplished.When updating a plan, the agent must send a complete list of all entries
with their current status. The client replaces the entire plan with each update.
A single entry in the execution plan.Represents a task or goal that the assistant intends to accomplish
as part of fulfilling the user’s request.
See protocol docs: Plan EntriesType: ObjectProperties:
Priority levels for plan entries.Used to indicate the relative importance or urgency of different
tasks in the execution plan.
See protocol docs: Plan EntriesType: Union
Status of a plan entry in the execution flow.Tracks the lifecycle of each task from planning through completion.
See protocol docs: Plan EntriesType: Union
Prompt capabilities supported by the agent in session/prompt requests.Baseline agent functionality requires support for ContentBlock::Text
and ContentBlock::ResourceLink in prompt requests.Other variants must be explicitly opted in to.
Capabilities for different types of content in prompt requests.Indicates which content types beyond the baseline (text and resource links)
the agent can process.See protocol docs: Prompt CapabilitiesType: ObjectProperties:
Agent supports embedded context in session/prompt requests.When enabled, the Client is allowed to include ContentBlock::Resource
in prompt requests for pieces of context that are referenced in the message.
Protocol version identifier.This version is only bumped for breaking changes.
Non-breaking changes should be introduced via capabilities.Type:integer (uint16)
The prompt turn was cancelled before the user responded.When a client sends a session/cancel notification to cancel an ongoing
prompt turn, it MUST respond to all pending session/request_permission
requests with this Cancelled outcome.See protocol docs: Cancellation
A unique identifier for a conversation session between a client and agent.Sessions maintain their own context, conversation history, and state,
allowing multiple independent interactions with the same agent.# Example
Copy
use agent_client_protocol::SessionId;use std::sync::Arc;let session_id = SessionId(Arc::from("sess_abc123def456"));
Different types of updates that can be sent during session processing.These updates provide real-time feedback about the agent’s progress.See protocol docs: Agent Reports OutputType: Union
The list of tasks to be accomplished.When updating a plan, the agent must send a complete list of all entries
with their current status. The client replaces the entire plan with each update.
The turn ended because the agent refused to continue. The user prompt and
everything that comes after it won’t be included in the next prompt, so this
should be reflected in the UI.
The turn was cancelled by the client via session/cancel.This stop reason MUST be returned when the client sends a session/cancel
notification, even if the cancellation causes exceptions in underlying operations.
Agents should catch these exceptions and return this semantically meaningful
response to confirm successful cancellation.
Represents a tool call that the language model has requested.Tool calls are actions that the agent executes on behalf of the language model,
such as reading files, executing code, or fetching data from external sources.See protocol docs: Tool CallsType: ObjectProperties:
Content produced by a tool call.Tool calls can produce different types of content including
standard content blocks (text, images) or file diffs.See protocol docs: ContentType: Union
A file location being accessed or modified by a tool.Enables clients to implement “follow-along” features that track
which files the agent is working with in real-time.See protocol docs: Following the AgentType: ObjectProperties:
An update to an existing tool call.Used to report progress and results as tools execute. All fields except
the tool call ID are optional - only changed fields need to be included.See protocol docs: UpdatingType: ObjectProperties:
Categories of tools that can be invoked.Tool kinds help clients choose appropriate icons and optimize how they
display tool execution progress.See protocol docs: CreatingType: Union