Skip to main content

Crate agent_client_protocol_schema

Crate agent_client_protocol_schema 

Source
Expand description

Agent Client Protocol

§Agent Client Protocol Schema

Strongly-typed Rust definitions of the Agent Client Protocol (ACP) wire format. ACP is a JSON-RPC based protocol that standardizes communication between code editors (IDEs, text-editors, etc.) and coding agents (programs that use generative AI to autonomously modify code).

This crate is only the schema: the request, response, and notification types, plus serde plumbing and JSON Schema generation. For the runtime pieces (transport, connection setup, the Agent / Client traits, etc.) use the higher-level agent-client-protocol crate, which builds on top of these types.

§What’s in this crate

§Versioning

The default surface re-exports the v1 (current stable) protocol types directly at the crate root, so most consumers can write agent_client_protocol_schema::SessionId (and so on) without thinking about versions.

For the complete protocol specification and documentation, visit https://agentclientprotocol.com.

Re-exports§

pub use crate::rpc::JsonRpcMessage;
pub use crate::rpc::Notification;
pub use crate::rpc::Request;
pub use crate::rpc::RequestId;

Modules§

rpc
v2unstable_protocol_v2
Agent Client Protocol version 2 draft types.

Structs§

AcceptNesNotificationunstable_nes
Notification sent when a suggestion is accepted.
AgentAuthCapabilities
Authentication-related capabilities supported by the agent.
AgentCapabilities
Capabilities supported by the agent.
AgentMethodNames
Names of all methods that agents handle.
Annotations
Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
AudioContent
Audio provided to or from an LLM.
AuthCapabilities
UNSTABLE
AuthEnvVar
UNSTABLE
AuthMethodAgent
Agent handles authentication itself.
AuthMethodEnvVar
UNSTABLE
AuthMethodId
AuthMethodTerminal
UNSTABLE
AuthenticateRequest
Request parameters for the authenticate method.
AuthenticateResponse
Response to the authenticate method.
AvailableCommand
Information about a command.
AvailableCommandsUpdate
Available commands are ready or have changed
BlobResourceContents
Binary resource contents.
BooleanPropertySchemaunstable_elicitation
Schema for boolean properties in an elicitation form.
CancelNotification
Notification to cancel ongoing operations for a session.
CancelRequestNotificationunstable_cancel_request
UNSTABLE
ClientCapabilities
Capabilities supported by the client.
ClientMethodNames
Names of all methods that clients handle.
ClientNesCapabilitiesunstable_nes
NES capabilities advertised by the client during initialization.
CloseNesRequestunstable_nes
Request to close an NES session.
CloseNesResponseunstable_nes
Response from closing an NES session.
CloseSessionRequest
Request parameters for closing an active session.
CloseSessionResponse
Response from closing a session.
CompleteElicitationNotificationunstable_elicitation
UNSTABLE
ConfigOptionUpdate
Session configuration options have been updated.
ConnectMcpRequestunstable_mcp_over_acp
UNSTABLE
ConnectMcpResponseunstable_mcp_over_acp
UNSTABLE
Content
Standard content block (text, images, resources).
ContentChunk
A streamed item of content
Cost
Cost information for a session.
CreateElicitationRequestunstable_elicitation
UNSTABLE
CreateElicitationResponseunstable_elicitation
UNSTABLE
CreateTerminalRequest
Request to create a new terminal and execute a command.
CreateTerminalResponse
Response containing the ID of the created terminal.
CurrentModeUpdate
The current mode of the session has changed
DeleteSessionRequest
Request parameters for deleting an existing session from session/list.
DeleteSessionResponse
Response from deleting a session.
DidChangeDocumentNotificationunstable_nes
Notification sent when a file is edited.
DidCloseDocumentNotificationunstable_nes
Notification sent when a file is closed.
DidFocusDocumentNotificationunstable_nes
Notification sent when a file becomes the active editor tab.
DidOpenDocumentNotificationunstable_nes
Notification sent when a file is opened in the editor.
DidSaveDocumentNotificationunstable_nes
Notification sent when a file is saved.
Diff
A diff representing file modifications.
DisableProviderRequest
UNSTABLE
DisableProviderResponse
UNSTABLE
DisconnectMcpRequestunstable_mcp_over_acp
UNSTABLE
DisconnectMcpResponseunstable_mcp_over_acp
UNSTABLE
ElicitationAcceptActionunstable_elicitation
UNSTABLE
ElicitationCapabilitiesunstable_elicitation
UNSTABLE
ElicitationFormCapabilitiesunstable_elicitation
UNSTABLE
ElicitationFormModeunstable_elicitation
UNSTABLE
ElicitationIdunstable_elicitation
UNSTABLE
ElicitationRequestScopeunstable_elicitation
UNSTABLE
ElicitationSchemaunstable_elicitation
Type-safe elicitation schema for requesting structured user input.
ElicitationSessionScopeunstable_elicitation
UNSTABLE
ElicitationUrlCapabilitiesunstable_elicitation
UNSTABLE
ElicitationUrlModeunstable_elicitation
UNSTABLE
EmbeddedResource
The contents of a resource, embedded into a prompt or tool call result.
EnumOptionunstable_elicitation
A titled enum option with a const value and human-readable title.
EnvVariable
An environment variable to set when launching an MCP server.
Error
JSON-RPC error object.
ExtNotification
Allows the Agent to send an arbitrary notification that is not part of the ACP spec. Extension notifications provide a way to send one-way messages for custom functionality while maintaining protocol compatibility.
ExtRequest
Allows for sending an arbitrary request that is not part of the ACP spec. Extension methods provide a way to add custom functionality while maintaining protocol compatibility.
ExtResponse
Allows for sending an arbitrary response to an ExtRequest that is not part of the ACP spec. Extension methods provide a way to add custom functionality while maintaining protocol compatibility.
FileSystemCapabilities
File system capabilities that a client may support.
ForkSessionRequest
UNSTABLE
ForkSessionResponse
UNSTABLE
GeneralMethodNamesunstable_cancel_request
Names of all methods that agents handle.
HttpHeader
An HTTP header to set when making requests to the MCP server.
ImageContent
An image provided to or from an LLM.
Implementation
Metadata about the implementation of the client or agent. Describes the name and version of an MCP implementation, with an optional title for UI representation.
InitializeRequest
Request parameters for the initialize method.
InitializeResponse
Response to the initialize method.
IntegerPropertySchemaunstable_elicitation
Schema for integer properties in an elicitation form.
KillTerminalRequest
Request to kill a terminal without releasing it.
KillTerminalResponse
Response to terminal/kill method
ListProvidersRequest
UNSTABLE
ListProvidersResponse
UNSTABLE
ListSessionsRequest
Request parameters for listing existing sessions.
ListSessionsResponse
Response from listing sessions.
LoadSessionRequest
Request parameters for loading an existing session.
LoadSessionResponse
Response from loading an existing session.
LogoutCapabilities
Logout capabilities supported by the agent.
LogoutRequest
Request parameters for the logout method.
LogoutResponse
Response to the logout method.
McpCapabilities
MCP capabilities supported by the agent
McpConnectionIdunstable_mcp_over_acp
UNSTABLE
McpServerAcp
UNSTABLE
McpServerAcpIdunstable_mcp_over_acp
UNSTABLE
McpServerHttp
HTTP transport configuration for MCP.
McpServerSse
SSE transport configuration for MCP.
McpServerStdio
Stdio transport configuration for MCP.
MessageId
Unique identifier for a message within a session.
MessageMcpNotificationunstable_mcp_over_acp
UNSTABLE
MessageMcpRequestunstable_mcp_over_acp
UNSTABLE
MessageMcpResponseunstable_mcp_over_acp
UNSTABLE
MultiSelectPropertySchemaunstable_elicitation
Schema for multi-select (array) properties in an elicitation form.
NesCapabilitiesunstable_nes
NES capabilities advertised by the agent during initialization.
NesContextCapabilitiesunstable_nes
Context capabilities the agent wants attached to each suggestion request.
NesDiagnosticunstable_nes
A diagnostic (error, warning, etc.).
NesDiagnosticsCapabilitiesunstable_nes
Capabilities for diagnostics context.
NesDocumentDidChangeCapabilitiesunstable_nes
Capabilities for document/didChange events.
NesDocumentDidCloseCapabilitiesunstable_nes
Marker for document/didClose capability support.
NesDocumentDidFocusCapabilitiesunstable_nes
Marker for document/didFocus capability support.
NesDocumentDidOpenCapabilitiesunstable_nes
Marker for document/didOpen capability support.
NesDocumentDidSaveCapabilitiesunstable_nes
Marker for document/didSave capability support.
NesDocumentEventCapabilitiesunstable_nes
Document event capabilities the agent wants to receive.
NesEditHistoryCapabilitiesunstable_nes
Capabilities for edit history context.
NesEditHistoryEntryunstable_nes
An entry in the edit history.
NesEditSuggestionunstable_nes
A text edit suggestion.
NesEventCapabilitiesunstable_nes
Event capabilities the agent can consume.
NesExcerptunstable_nes
A code excerpt from a file.
NesJumpCapabilitiesunstable_nes
Marker for jump suggestion support.
NesJumpSuggestionunstable_nes
A jump-to-location suggestion.
NesOpenFileunstable_nes
An open file in the editor.
NesOpenFilesCapabilitiesunstable_nes
Capabilities for open files context.
NesRecentFileunstable_nes
A recently accessed file.
NesRecentFilesCapabilitiesunstable_nes
Capabilities for recent files context.
NesRelatedSnippetunstable_nes
A related code snippet from a file.
NesRelatedSnippetsCapabilitiesunstable_nes
Capabilities for related snippets context.
NesRenameCapabilitiesunstable_nes
Marker for rename suggestion support.
NesRenameSuggestionunstable_nes
A rename symbol suggestion.
NesRepositoryunstable_nes
Repository metadata for an NES session.
NesSearchAndReplaceCapabilitiesunstable_nes
Marker for search and replace suggestion support.
NesSearchAndReplaceSuggestionunstable_nes
A search-and-replace suggestion.
NesSuggestContextunstable_nes
Context attached to a suggestion request.
NesTextEditunstable_nes
A text edit within a suggestion.
NesUserActionunstable_nes
A user action (typing, cursor movement, etc.).
NesUserActionsCapabilitiesunstable_nes
Capabilities for user actions context.
NewSessionRequest
Request parameters for creating a new session.
NewSessionResponse
Response from creating a new session.
NumberPropertySchemaunstable_elicitation
Schema for number (floating-point) properties in an elicitation form.
PermissionOption
An option presented to the user when requesting permission.
PermissionOptionId
Unique identifier for a permission option.
Plan
An execution plan for accomplishing complex tasks.
PlanCapabilities
UNSTABLE
PlanEntry
A single entry in the execution plan.
PlanFile
UNSTABLE
PlanIdunstable_plan_operations
UNSTABLE
PlanItems
UNSTABLE
PlanMarkdown
UNSTABLE
PlanRemoved
UNSTABLE
PlanUpdate
UNSTABLE
Positionunstable_nes
A zero-based position in a text document.
PromptCapabilities
Prompt capabilities supported by the agent in session/prompt requests.
PromptRequest
Request parameters for sending a user prompt to the agent.
PromptResponse
Response from processing a user prompt.
ProtocolVersion
Protocol version identifier.
ProviderCurrentConfigunstable_llm_providers
UNSTABLE
ProviderInfo
UNSTABLE
ProvidersCapabilities
UNSTABLE
Rangeunstable_nes
A range in a text document, expressed as start and end positions.
RawValue
Reference to a range of bytes encompassing a single valid JSON value in the input data.
ReadTextFileRequest
Request to read content from a text file.
ReadTextFileResponse
Response containing the contents of a text file.
RejectNesNotificationunstable_nes
Notification sent when a suggestion is rejected.
ReleaseTerminalRequest
Request to release a terminal and free its resources.
ReleaseTerminalResponse
Response to terminal/release method
RequestPermissionRequest
Request for user permission to execute a tool call.
RequestPermissionResponse
Response to a permission request.
ResourceLink
A resource that the server is capable of reading, included in a prompt or tool call result.
ResumeSessionRequest
Request parameters for resuming an existing session.
ResumeSessionResponse
Response from resuming an existing session.
SelectedPermissionOutcome
The user selected one of the provided options.
SessionAdditionalDirectoriesCapabilities
Capabilities for additional session directories support.
SessionCapabilities
Session capabilities supported by the agent.
SessionCloseCapabilities
Capabilities for the session/close method.
SessionConfigBooleanunstable_boolean_config
UNSTABLE
SessionConfigGroupId
Unique identifier for a session configuration option value group.
SessionConfigId
Unique identifier for a session configuration option.
SessionConfigOption
A session configuration option selector and its current state.
SessionConfigSelect
A single-value selector (dropdown) session configuration option payload.
SessionConfigSelectGroup
A group of possible values for a session configuration option.
SessionConfigSelectOption
A possible value for a session configuration option.
SessionConfigValueId
Unique identifier for a session configuration option value.
SessionDeleteCapabilities
Capabilities for the session/delete method.
SessionForkCapabilities
UNSTABLE
SessionId
A unique identifier for a conversation session between a client and agent.
SessionInfo
Information about a session returned by session/list
SessionInfoUpdate
Update to session metadata. All fields are optional to support partial updates.
SessionListCapabilities
Capabilities for the session/list method.
SessionMode
A mode the agent can operate in.
SessionModeId
Unique identifier for a Session Mode.
SessionModeState
The set of modes and the one currently active.
SessionNotification
Notification containing a session update from the agent.
SessionResumeCapabilities
Capabilities for the session/resume method.
SetProviderRequest
UNSTABLE
SetProviderResponse
UNSTABLE
SetSessionConfigOptionRequest
Request parameters for setting a session configuration option.
SetSessionConfigOptionResponse
Response to session/set_config_option method.
SetSessionModeRequest
Request parameters for setting a session mode.
SetSessionModeResponse
Response to session/set_mode method.
SkipListenertracing
Inspector passed to every VecSkipError<_, SkipListener> in the protocol types so that malformed list entries dropped during deserialization are surfaced to observability tooling rather than vanishing silently.
StartNesRequestunstable_nes
Request to start an NES session.
StartNesResponseunstable_nes
Response to nes/start.
StringPropertySchemaunstable_elicitation
Schema for string properties in an elicitation form.
SuggestNesRequestunstable_nes
Request for a code suggestion.
SuggestNesResponseunstable_nes
Response to nes/suggest.
Terminal
Embed a terminal created with terminal/create by its id.
TerminalExitStatus
Exit status of a terminal command.
TerminalId
TerminalOutputRequest
Request to get the current output and status of a terminal.
TerminalOutputResponse
Response containing the terminal output and exit status.
TextContent
Text provided to or from an LLM.
TextDocumentContentChangeEventunstable_nes
A content change event for a document.
TextResourceContents
Text-based resource contents.
TitledMultiSelectItemsunstable_elicitation
Items definition for titled multi-select enum properties.
ToolCall
Represents a tool call that the language model has requested.
ToolCallId
Unique identifier for a tool call within a session.
ToolCallLocation
A file location being accessed or modified by a tool.
ToolCallUpdate
An update to an existing tool call.
ToolCallUpdateFields
Optional fields that can be updated in a tool call.
UnstructuredCommandInput
All text that was typed after the command name is provided as input.
UntitledMultiSelectItemsunstable_elicitation
Items definition for untitled multi-select enum properties.
UrlElicitationRequiredDataunstable_elicitation
UNSTABLE
UrlElicitationRequiredItemunstable_elicitation
UNSTABLE
Usage
UNSTABLE
UsageUpdate
Context window and cost update for a session.
WaitForTerminalExitRequest
Request to wait for a terminal command to exit.
WaitForTerminalExitResponse
Response containing the exit status of a terminal command.
WorkspaceFolderunstable_nes
A workspace folder.
WriteTextFileRequest
Request to write content to a text file.
WriteTextFileResponse
Response to fs/write_text_file

Enums§

AgentNotification
All possible notifications that an agent can send to a client.
AgentRequest
All possible requests that an agent can send to a client.
AgentResponse
All possible responses that an agent can send to a client.
AuthMethod
Describes an available authentication method.
AvailableCommandInput
The input specification for a command.
ClientNotification
All possible notifications that a client can send to an agent.
ClientRequest
All possible requests that a client can send to an agent.
ClientResponse
All possible responses that a client can send to an agent.
ContentBlock
Content blocks represent displayable information in the Agent Client Protocol.
ElicitationActionunstable_elicitation
UNSTABLE
ElicitationContentValueunstable_elicitation
ElicitationModeunstable_elicitation
UNSTABLE
ElicitationPropertySchemaunstable_elicitation
Property schema for elicitation form fields.
ElicitationSchemaTypeunstable_elicitation
Type discriminator for elicitation schemas.
ElicitationScopeunstable_elicitation
UNSTABLE
ElicitationStringTypeunstable_elicitation
Items definition for untitled multi-select enum properties.
ElicitationUrlOnlyModeunstable_elicitation
Type discriminator for URL-only elicitation error items.
EmbeddedResourceResource
Resource content that can be embedded in a message.
ErrorCode
Predefined error codes for common JSON-RPC and ACP-specific errors.
LlmProtocolunstable_llm_providers
UNSTABLE
MaybeUndefined
Similar to Option, but it has three states, undefined, null and x.
McpServer
Configuration for connecting to an MCP (Model Context Protocol) server.
MultiSelectItemsunstable_elicitation
Items for a multi-select (array) property schema.
NesDiagnosticSeverityunstable_nes
Severity of a diagnostic.
NesRejectReasonunstable_nes
The reason a suggestion was rejected.
NesSuggestionunstable_nes
A suggestion returned by the agent.
NesTriggerKindunstable_nes
What triggered the suggestion request.
PermissionOptionKind
The type of permission option being presented to the user.
PlanEntryPriority
Priority levels for plan entries.
PlanEntryStatus
Status of a plan entry in the execution flow.
PlanUpdateContentunstable_plan_operations
UNSTABLE
PositionEncodingKindunstable_nes
The encoding used for character offsets in positions.
ProtocolLevelNotificationunstable_cancel_request
General protocol-level notifications that all sides are expected to implement.
RequestPermissionOutcome
The outcome of a permission request.
Role
The sender or recipient of messages and data in a conversation.
SessionConfigKind
Type-specific session configuration option payload.
SessionConfigOptionCategory
Semantic category for a session configuration option.
SessionConfigOptionValueunstable_boolean_config
UNSTABLE
SessionConfigSelectOptions
Possible values for a session configuration option.
SessionUpdate
Different types of updates that can be sent during session processing.
StopReason
Reasons why an agent stops processing a prompt turn.
StringFormatunstable_elicitation
String format types for string properties in elicitation schemas.
TextDocumentSyncKindunstable_nes
How the agent wants document changes delivered.
ToolCallContent
Content produced by a tool call.
ToolCallStatus
Execution status of a tool call.
ToolKind
Categories of tools that can be invoked.

Constants§

AGENT_METHOD_NAMES
Constant containing all agent method names.
CLIENT_METHOD_NAMES
Constant containing all client method names.
PROTOCOL_LEVEL_METHOD_NAMESunstable_cancel_request
Constant containing all agent method names.

Traits§

IntoMaybeUndefined
Utility trait for builder methods for optional values. This allows the caller to either pass in the value itself without wrapping it in Some, or to just pass in an Option if that is what they have, or set it back to undefined.
IntoOption
Utility trait for builder methods for optional values. This allows the caller to either pass in the value itself without wrapping it in Some, or to just pass in an Option if that is what they have.

Type Aliases§

Meta
Value attached to a given ACP type on the _meta field.
Response
Result