Skip to content

schema

Class info

Re-exported classes

Class Module Description
AcpMcpServer aclientp.schema.mcp UNSTABLE: MCP server reachable over the ACP connection itself (mcp/message).
AgentAuthCapabilities aclientp.schema.capabilities Authentication-related capabilities supported by the agent.
AgentCapabilities aclientp.schema.capabilities Capabilities supported by the agent.
AgentMessageChunk aclientp.schema.session_updates A chunk of the agent's response being streamed.
AgentMessageCursorAnchor aclientp.schema.cursors UNSTABLE: The cursor is next to an agent message.
AgentPlanUpdate aclientp.schema.session_updates The agent's execution plan for complex tasks.
AgentThoughtChunk aclientp.schema.session_updates A chunk of the agent's internal reasoning being streamed.
AgentThoughtCursorAnchor aclientp.schema.cursors UNSTABLE: The cursor is next to an agent thought.
AllowedOutcome aclientp.schema.tool_call The user selected one of the provided options.
Annotations aclientp.schema.content_blocks Optional annotations for the client.
ArchiveSessionRequest aclientp.schema.client_requests UNSTABLE: Request parameters for archiving a session.
ArchiveSessionResponse aclientp.schema.agent_responses UNSTABLE: Response to session/archive.
AudioContentBlock aclientp.schema.content_blocks Audio data for transcription or analysis.
AuthAccount aclientp.schema.common UNSTABLE: An account the agent has configured, for display.
AuthCapabilities aclientp.schema.capabilities Authentication capabilities supported by the client.
AuthMethodAgent aclientp.schema.common Agent handles authentication itself.
AuthMethodTerminal aclientp.schema.common Terminal authentication method.
AuthStatusCapabilities aclientp.schema.capabilities UNSTABLE: Support for auth/status and auth/status_update.
AuthStatusRequest aclientp.schema.client_requests UNSTABLE: Request the agent's current authentication state.
AuthStatusResponse aclientp.schema.agent_responses UNSTABLE: Response to auth/status.
AuthStatusUpdateNotification aclientp.schema.notifications UNSTABLE: The agent's authentication state changed (auth/status_update).
AuthenticateRequest aclientp.schema.client_requests Request parameters for the authenticate method.
AuthenticateResponse aclientp.schema.agent_responses Response to authenticate method.
AvailableCommand aclientp.schema.slash_commands Information about a command.
AvailableCommandInput aclientp.schema.slash_commands A container for the input specification for a command.
AvailableCommandsUpdate aclientp.schema.session_updates Available commands are ready or have changed.
BlobResourceContents aclientp.schema.content_blocks Binary resource contents.
BooleanConfigOptionCapabilities aclientp.schema.capabilities Capabilities for boolean session configuration options.
BooleanPropertySchema aclientp.schema.elicitation Schema for boolean properties in an elicitation form.
BooleanSessionConfigOption aclientp.schema.config_options UNSTABLE: This capability is not part of the spec yet.
CancelNotification aclientp.schema.notifications Notification to cancel ongoing operations for a session.
CancelRequestNotification aclientp.schema.notifications Notification to cancel an ongoing request ($/cancel_request).
ClientCapabilities aclientp.schema.capabilities Capabilities supported by the client.
ClientSessionCapabilities aclientp.schema.capabilities Session-related capabilities supported by the client.
CloseSessionRequest aclientp.schema.client_requests Request parameters for closing an active session.
CloseSessionResponse aclientp.schema.agent_responses Response from closing a session.
CommandInputHint aclientp.schema.slash_commands All text that was typed after the command name is provided as input.
CompactionCapabilities aclientp.schema.capabilities Client support for ID-addressed context compaction updates.
CompactionCursorAnchor aclientp.schema.cursors UNSTABLE: The cursor is next to a context compaction.
CompactionSummaryChunk aclientp.schema.session_updates A content block appended to a compaction's summary.
CompactionUpdate aclientp.schema.session_updates A context compaction upsert.
ConfigOptionUpdate aclientp.schema.session_updates A session configuration option value has changed.
ContentToolCallContent aclientp.schema.tool_call Standard content block (text, images, resources).
Cost aclientp.schema.session_updates Cost information for a session.
CreateTerminalRequest aclientp.schema.agent_requests Request to create a new terminal and execute a command.
CreateTerminalResponse aclientp.schema.client_responses Response containing the ID of the created terminal.
CurrentModeUpdate aclientp.schema.session_updates The current mode of the session has changed.
CursorCapabilities aclientp.schema.cursors UNSTABLE: The methods that currently accept a cursor.
CursorForkCapabilities aclientp.schema.cursors UNSTABLE: The cursor can be passed to session/fork as cursorId.
CursorMessageAnchor aclientp.schema.cursors UNSTABLE: A cursor anchored to a message; type names the kind of message.
CursorUpdate aclientp.schema.session_updates UNSTABLE: A session cursor was announced or its capabilities changed.
CustomRequest aclientp.schema.client_requests Request for custom/extension methods.
CustomResponse aclientp.schema.agent_responses Response for custom/extension methods.
DeleteSessionRequest aclientp.schema.client_requests Request parameters for deleting a session from session/list.
DeleteSessionResponse aclientp.schema.agent_responses Response to session/delete.
DeniedOutcome aclientp.schema.tool_call The prompt turn was cancelled before the user responded.
DisableProviderRequest aclientp.schema.providers Disable a non-required provider.
DisableProviderResponse aclientp.schema.providers Response to providers/disable.
ElicitationCapabilities aclientp.schema.elicitation Elicitation capabilities supported by the client.
ElicitationCompleteNotification aclientp.schema.elicitation Notification sent by the agent when a URL-based elicitation is complete.
ElicitationFormCapabilities aclientp.schema.elicitation Form-based elicitation capabilities.
ElicitationRequest aclientp.schema.elicitation Request from the agent to elicit structured user input (elicitation/create).
ElicitationResponse aclientp.schema.elicitation Response from the client to an elicitation request.
ElicitationSchema aclientp.schema.elicitation Type-safe elicitation schema for requesting structured user input.
ElicitationUrlCapabilities aclientp.schema.elicitation URL-based elicitation capabilities.
EmbeddedResourceContentBlock aclientp.schema.content_blocks Complete resource contents embedded directly in the message.
EnumOption aclientp.schema.elicitation A titled enum option with a const value, human-readable title and optional description.
EnvVariable aclientp.schema.common An environment variable to set when launching an MCP server.
Error aclientp.schema.common JSON-RPC error object.
ExtNotification aclientp.schema.notifications Extension notification from client or agent.
FileEditToolCallContent aclientp.schema.tool_call File modification shown as a diff.
FileSystemCapabilities aclientp.schema.capabilities File system capabilities that a client may support.
ForkSessionRequest aclientp.schema.client_requests UNSTABLE: Request parameters for forking an existing session.
ForkSessionResponse aclientp.schema.agent_responses UNSTABLE: Response from forking an existing session.
HttpHeader aclientp.schema.mcp An HTTP header to set when making requests to the MCP server.
HttpMcpServer aclientp.schema.mcp HTTP transport configuration.
IdleStateUpdate aclientp.schema.session_updates UNSTABLE: The child is ready to process another prompt.
ImageContentBlock aclientp.schema.content_blocks Images for visual context or analysis.
Implementation aclientp.schema.common Describes the name and version of an ACP implementation.
InitialSessionConfigOption aclientp.schema.config_options UNSTABLE: A config option value to apply when a session is set up.
InitializeProxyRequest aclientp.schema.proxy Request parameters for proxy/initialize. Same as initialize.
InitializeProxyResponse aclientp.schema.proxy Response to proxy/initialize. Same as the initialize response.
InitializeRequest aclientp.schema.client_requests Request parameters for the initialize method.
InitializeResponse aclientp.schema.agent_responses Response from the initialize method.
IntegerPropertySchema aclientp.schema.elicitation Schema for integer properties in an elicitation form.
KillTerminalRequest aclientp.schema.agent_requests Request to kill a terminal command without releasing the terminal.
KillTerminalResponse aclientp.schema.client_responses Response to the terminal/kill method.
ListProvidersRequest aclientp.schema.providers Request the configurable providers.
ListProvidersResponse aclientp.schema.providers Response to providers/list.
ListSessionsRequest aclientp.schema.client_requests Request parameters for listing existing sessions.
ListSessionsResponse aclientp.schema.agent_responses Response from listing sessions.
LoadSessionRequest aclientp.schema.client_requests Request parameters for loading an existing session.
LoadSessionResponse aclientp.schema.agent_responses Response from loading an existing session.
LogoutCapabilities aclientp.schema.capabilities Logout capabilities supported by the agent.
LogoutRequest aclientp.schema.client_requests Request parameters for the logout method.
LogoutResponse aclientp.schema.agent_responses Response to the logout method.
McpCapabilities aclientp.schema.capabilities MCP capabilities supported by the agent.
McpError aclientp.schema.mcp UNSTABLE: A structured inner MCP error. Never an ACP error code.
MessageMcpNotification aclientp.schema.mcp UNSTABLE: An inner MCP notification tied to an active inner MCP request.
MessageMcpRequest aclientp.schema.mcp UNSTABLE: An inner MCP request sent to an acp MCP server via mcp/message.
MessageMcpResponse aclientp.schema.mcp UNSTABLE: Response to mcp/message: exactly one inner MCP outcome.
MultiSelectPropertySchema aclientp.schema.elicitation Schema for multi-select (array) properties in an elicitation form.
NewSessionRequest aclientp.schema.client_requests Request parameters for creating a new session.
NewSessionResponse aclientp.schema.agent_responses Response from creating a new session.
Notice aclientp.schema.session_updates Fire-and-forget information for the user.
NoticeCapabilities aclientp.schema.capabilities Client support for presenting live notice session updates to the user.
NumberPropertySchema aclientp.schema.elicitation Schema for number (floating-point) properties in an elicitation form.
PermissionOption aclientp.schema.tool_call An option presented to the user when requesting permission.
PlanCapabilities aclientp.schema.capabilities UNSTABLE: Client support for ID-addressed plan_update / plan_removed updates.
PlanEntry aclientp.schema.agent_plan A single entry in the execution plan.
PlanItems aclientp.schema.agent_plan UNSTABLE: A plan made of structured entries.
PlanMarkdown aclientp.schema.agent_plan UNSTABLE: A plan made of raw markdown content.
PlanRemoved aclientp.schema.session_updates UNSTABLE: Remove an ID-addressed plan.
PlanUpdate aclientp.schema.session_updates UNSTABLE: Create or replace an ID-addressed plan.
PromptCapabilities aclientp.schema.capabilities Prompt capabilities supported by the agent in session/prompt requests.
PromptRequest aclientp.schema.client_requests Request parameters for sending a user prompt to the agent.
PromptResponse aclientp.schema.agent_responses Response from processing a user prompt.
PromptSuggestion aclientp.schema.session_updates UNSTABLE: A prompt the client can offer to the user.
PromptSuggestionsAudioCapabilities aclientp.schema.capabilities UNSTABLE: Prompt suggestions may include audio content blocks.
PromptSuggestionsCapabilities aclientp.schema.capabilities UNSTABLE: Client support for prompt_suggestions_update session updates.
PromptSuggestionsEmbeddedContextCapabilities aclientp.schema.capabilities UNSTABLE: Prompt suggestions may include resource content blocks.
PromptSuggestionsImageCapabilities aclientp.schema.capabilities UNSTABLE: Prompt suggestions may include image content blocks.
PromptSuggestionsUpdate aclientp.schema.session_updates UNSTABLE: Suggested next prompts, replacing any previous suggestions.
ProviderCurrentConfig aclientp.schema.providers Current effective non-secret routing config of a provider.
ProviderInfo aclientp.schema.providers A configurable provider with its current routing info, suitable for UI display.
ProvidersCapabilities aclientp.schema.capabilities UNSTABLE: Support for providers/list, providers/set and providers/disable.
ProxySuccessorNotification aclientp.schema.proxy A notification wrapped for delivery to the proxy's successor.
ProxySuccessorRequest aclientp.schema.proxy A request wrapped for delivery to the proxy's successor.
ReadTextFileRequest aclientp.schema.agent_requests Request to read content from a text file.
ReadTextFileResponse aclientp.schema.client_responses Response containing the contents of a text file.
ReleaseTerminalRequest aclientp.schema.agent_requests Request to release a terminal and free its resources.
ReleaseTerminalResponse aclientp.schema.client_responses Response to terminal/release method.
RequestPermissionRequest aclientp.schema.agent_requests Request for user permission to execute a tool call.
RequestPermissionResponse aclientp.schema.client_responses Response to a permission request.
RequiresActionStateUpdate aclientp.schema.session_updates UNSTABLE: Foreground work is blocked on user action.
ResourceContentBlock aclientp.schema.content_blocks References to resources that the agent can access.
ResumeSessionRequest aclientp.schema.client_requests Request parameters for resuming an existing session.
ResumeSessionResponse aclientp.schema.agent_responses Response from resuming an existing session.
RunningStateUpdate aclientp.schema.session_updates UNSTABLE: Foreground work is in progress.
SelectSessionConfigOption aclientp.schema.config_options A select-type session configuration option.
SessionAdditionalDirectoriesCapabilities aclientp.schema.capabilities Support for additionalDirectories on session lifecycle requests.
SessionArchiveCapabilities aclientp.schema.capabilities UNSTABLE: Support for session/archive and session/unarchive.
SessionCancelCapabilities aclientp.schema.capabilities UNSTABLE: Permits the client to cancel a subagent's current work.
SessionCapabilities aclientp.schema.capabilities Session capabilities supported by the agent.
SessionCloseCapabilities aclientp.schema.capabilities Capabilities for the session/close method.
SessionConfigOptionValueBoolean aclientp.schema.config_options A boolean value for setting a config option (type: "boolean").
SessionConfigOptionValueId aclientp.schema.config_options A SessionConfigValueId string value for setting a config option.
SessionConfigOptionsCapabilities aclientp.schema.capabilities Session configuration option capabilities supported by the client.
SessionConfigSelectGroup aclientp.schema.config_options A group of possible values for a configuration selector.
SessionConfigSelectOption aclientp.schema.config_options A possible value for a configuration selector.
SessionCursorsCapabilities aclientp.schema.capabilities UNSTABLE: Client support for cursor_update session updates.
SessionDeleteCapabilities aclientp.schema.capabilities Capabilities for the session/delete method.
SessionForkCapabilities aclientp.schema.capabilities Capabilities for the session/fork method.
SessionInfo aclientp.schema.session_state Information about a session returned by session/list.
SessionInfoUpdate aclientp.schema.session_updates Incremental update to session metadata.
SessionListCapabilities aclientp.schema.capabilities Capabilities for the session/list method.
SessionMessage aclientp.schema.session_updates UNSTABLE: A message exchanged between sessions (e.g. parent and subagent).
SessionMessageChunk aclientp.schema.session_updates UNSTABLE: A content block appended to a session_message.
SessionMessageCursorAnchor aclientp.schema.cursors UNSTABLE: The cursor is next to a session-directed message.
SessionMode aclientp.schema.session_state A mode the agent can operate in.
SessionModeState aclientp.schema.session_state The set of modes and the one currently active.
SessionNotification aclientp.schema.notifications Notification containing a session update from the agent.
SessionOptionsCapabilities aclientp.schema.capabilities UNSTABLE: Support for session/options.
SessionOptionsRequest aclientp.schema.client_requests UNSTABLE: Request the modes and config options a session would start with.
SessionOptionsResponse aclientp.schema.agent_responses UNSTABLE: The modes and config options a session would start with.
SessionReferenceToolCallContent aclientp.schema.tool_call UNSTABLE: Reference to another session, e.g. a subagent spawned by this tool call.
SessionResumeCapabilities aclientp.schema.capabilities Capabilities for the session/resume method.
SessionSetupRequest aclientp.schema.client_requests Fields shared by the session lifecycle requests (new, load, resume, fork).
SessionStatusCapabilities aclientp.schema.capabilities UNSTABLE: Support for session/status.
SessionStatusRequest aclientp.schema.client_requests UNSTABLE: Request parameters for checking whether the Agent has a session in memory.
SessionStatusResponse aclientp.schema.agent_responses UNSTABLE: Response to session/status.
SessionSystemPromptCapabilities aclientp.schema.capabilities Capabilities for client-provided system prompts.
SessionSystemPromptModeCapabilities aclientp.schema.capabilities System prompt delivery modes the agent supports in addition to append.
SessionSystemPromptOverrideCapabilities aclientp.schema.capabilities Support for the override system prompt mode.
SessionTitleCapabilities aclientp.schema.capabilities UNSTABLE: Support for session/set_title.
SetProviderRequest aclientp.schema.providers Configure a provider's routing.
SetProviderResponse aclientp.schema.providers Response to providers/set.
SetSessionConfigOptionRequest aclientp.schema.client_requests Request parameters for setting a session configuration option.
SetSessionConfigOptionResponse aclientp.schema.agent_responses Response to session/set_config_option method.
SetSessionModeRequest aclientp.schema.client_requests Request parameters for setting a session mode.
SetSessionModeResponse aclientp.schema.agent_responses Response to session/set_mode method.
SetSessionTitleRequest aclientp.schema.client_requests UNSTABLE: Request parameters for renaming a session.
SetSessionTitleResponse aclientp.schema.agent_responses UNSTABLE: Response to session/set_title.
SseMcpServer aclientp.schema.mcp SSE transport configuration.
StdioMcpServer aclientp.schema.mcp Stdio transport configuration.
StringPropertySchema aclientp.schema.elicitation Schema for string properties in an elicitation form.
SubagentCapabilities aclientp.schema.capabilities UNSTABLE: Client support for subagent_update session updates.
SubagentSessionCapabilities aclientp.schema.capabilities UNSTABLE: Capabilities of a subagent session.
SubagentUpdate aclientp.schema.session_updates UNSTABLE: A subagent session started by the parent, or a change to it.
SystemPrompt aclientp.schema.client_requests Client-provided system-level instructions for a session.
TerminalExitStatus aclientp.schema.terminal Exit status of a terminal command.
TerminalOutputRequest aclientp.schema.agent_requests Request to get the current output and status of a terminal.
TerminalOutputResponse aclientp.schema.client_responses Response containing the terminal output and exit status.
TerminalToolCallContent aclientp.schema.tool_call Embed a terminal created with terminal/create by its id.
TextContentBlock aclientp.schema.content_blocks Text content.
TextResourceContents aclientp.schema.content_blocks Text-based resource contents.
TitledMultiSelectItems aclientp.schema.elicitation Items definition for titled multi-select enum properties.
ToolCallCursorAnchor aclientp.schema.cursors UNSTABLE: The cursor is next to a tool call.
ToolCallLocation aclientp.schema.tool_call A file location being accessed or modified by a tool.
ToolCallProgress aclientp.schema.session_updates Update on the status or results of a tool call.
ToolCallStart aclientp.schema.session_updates Notification that a new tool call has been initiated.
ToolCallUpdate aclientp.schema.tool_call Details about the tool call requiring permission.
UnarchiveSessionRequest aclientp.schema.client_requests UNSTABLE: Request parameters for unarchiving a session.
UnarchiveSessionResponse aclientp.schema.agent_responses UNSTABLE: Response to session/unarchive.
UnknownCursorAnchor aclientp.schema.cursors UNSTABLE: A cursor anchored to a custom or future kind of entity.
UnknownStateUpdate aclientp.schema.session_updates UNSTABLE: The Agent cannot currently determine foreground activity.
UntitledMultiSelectItems aclientp.schema.elicitation Items definition for untitled multi-select enum properties.
Usage aclientp.schema.session_updates UNSTABLE: Token usage information for a prompt turn.
UsageUpdate aclientp.schema.session_updates Context window and cost update for a session.
UserMessageChunk aclientp.schema.session_updates A chunk of the user's message being streamed.
UserMessageCursorAnchor aclientp.schema.cursors UNSTABLE: The cursor is next to a user message.
WaitForTerminalExitRequest aclientp.schema.agent_requests Request to wait for a terminal command to exit.
WaitForTerminalExitResponse aclientp.schema.client_responses Response containing the exit status of a terminal command.
WriteTextFileRequest aclientp.schema.agent_requests Request to write content to a text file.
WriteTextFileResponse aclientp.schema.client_responses Response to fs/write_text_file.

🛈 DocStrings

Schema definitions for the ACP protocol.

AgentMethod module-attribute

AgentMethod = Literal[
    "auth/status",
    "authenticate",
    "initialize",
    "logout",
    "mcp/message",
    "providers/disable",
    "providers/list",
    "providers/set",
    "session/archive",
    "session/cancel",
    "session/close",
    "session/delete",
    "session/fork",
    "session/list",
    "session/load",
    "session/new",
    "session/options",
    "session/prompt",
    "session/resume",
    "session/set_config_option",
    "session/set_mode",
    "session/set_title",
    "session/status",
    "session/unarchive",
]

Methods handled by the agent.

AgentNotification module-attribute

All possible notifications that an agent can send to a client.

This is used internally for routing RPC notifications. Notifications do not expect a response.

AuthMethod module-attribute

AuthMethod = Annotated[
    Annotated[AuthMethodAgent, Tag("agent")] | Annotated[AuthMethodTerminal, Tag("terminal")],
    Discriminator(_auth_method_discriminator),
]

Describes an available authentication method.

The type field acts as the discriminator. When no type is present, the method is treated as agent.

AuthMethodId module-attribute

AuthMethodId = str

Unique identifier for an authentication method.

AuthState module-attribute

AuthState = Literal['authenticated', 'unauthenticated', 'not_required', 'unknown'] | str

UNSTABLE: Whether the agent can start sessions without the user signing in first.

ClientMethod module-attribute

ClientMethod = Literal[
    "auth/status_update",
    "elicitation/complete",
    "elicitation/create",
    "fs/read_text_file",
    "fs/write_text_file",
    "mcp/message",
    "session/request_permission",
    "session/update",
    "terminal/create",
    "terminal/kill",
    "terminal/output",
    "terminal/release",
    "terminal/wait_for_exit",
]

Methods handled by the client.

ClientNotification module-attribute

All possible notifications that a client can send to an agent.

This is used internally for routing RPC notifications. Notifications do not expect a response.

CompactionId module-attribute

CompactionId = str

Agent-owned ID of a context compaction, unique within the session.

CompactionStatus module-attribute

CompactionStatus = Literal['in_progress', 'completed', 'failed', 'cancelled'] | str

Lifecycle state of a context compaction.

CursorAnchor module-attribute

CursorAnchor = Annotated[
    Annotated[UserMessageCursorAnchor, Tag("user_message")]
    | Annotated[AgentMessageCursorAnchor, Tag("agent_message")]
    | Annotated[AgentThoughtCursorAnchor, Tag("agent_thought")]
    | Annotated[SessionMessageCursorAnchor, Tag("session_message")]
    | Annotated[ToolCallCursorAnchor, Tag("tool_call")]
    | Annotated[CompactionCursorAnchor, Tag("compaction")]
    | Annotated[UnknownCursorAnchor, Tag("unknown")],
    Discriminator(_anchor_discriminator),
]

UNSTABLE: Where a cursor is, relative to an entity the Client holds.

A known type with a malformed payload is an error; it does not fall back to :class:UnknownCursorAnchor.

CursorAnchorPosition module-attribute

CursorAnchorPosition = Literal['before', 'after'] | str

UNSTABLE: On which side of the anchored entity the cursor is.

before: the history before the cursor excludes the entity. after: it includes the entity and nothing that follows it. Values starting with _ are extensions; a Client that does not recognize the value cannot place the cursor.

CursorId module-attribute

CursorId = str

UNSTABLE: Agent-owned ID of a cursor, unique within its session.

Never reused for another position. Clients MUST NOT parse, change or construct it.

ElicitationActionType module-attribute

ElicitationActionType = Literal['accept', 'decline', 'cancel'] | str

User action in response to an elicitation.

ElicitationContentValue module-attribute

ElicitationContentValue = str | int | float | bool | Sequence[str]

Possible value types in elicitation content.

ElicitationModeType module-attribute

ElicitationModeType = Literal['form', 'url'] | str

Elicitation mode. Values beginning with _ are implementation-specific.

ElicitationPropertySchema module-attribute

ElicitationPropertySchema = Annotated[
    Annotated[StringPropertySchema, Tag("string")]
    | Annotated[NumberPropertySchema, Tag("number")]
    | Annotated[IntegerPropertySchema, Tag("integer")]
    | Annotated[BooleanPropertySchema, Tag("boolean")]
    | Annotated[MultiSelectPropertySchema, Tag("array")],
    Discriminator(_property_schema_discriminator),
]

Property schema for elicitation form fields.

Each variant corresponds to a JSON Schema "type" value.

ErrorCode module-attribute

ErrorCode = int

JSON-RPC error code. See the *_ERROR / *_REQUIRED constants for predefined codes.

LlmProtocol module-attribute

LlmProtocol = Literal['anthropic', 'openai', 'azure', 'vertex', 'bedrock'] | str

API protocol spoken by a provider endpoint.

McpRequestId module-attribute

McpRequestId = str

UNSTABLE: Caller-generated identifier for an inner MCP request.

McpServerAcpId module-attribute

McpServerAcpId = str

UNSTABLE: Identifier of an MCP server provided over ACP.

MultiSelectItems module-attribute

MultiSelectItems = Annotated[
    Annotated[UntitledMultiSelectItems, Tag("untitled")]
    | Annotated[TitledMultiSelectItems, Tag("titled")],
    Discriminator(_multi_select_items_discriminator),
]

Items for a multi-select (array) property schema.

NoticeSeverity module-attribute

NoticeSeverity = Literal['info', 'warning', 'error'] | str

Severity hint for a session notice.

PlanId module-attribute

PlanId = str

UNSTABLE: Agent-owned identifier of a plan, unique within the session.

PlanUpdateContent module-attribute

PlanUpdateContent = Annotated[PlanItems | PlanMarkdown, Field(discriminator='type')]

UNSTABLE: Content of an ID-addressed plan update.

ProtocolMethod module-attribute

ProtocolMethod = Literal['$/cancel_request']

Methods either side may send.

ProviderId module-attribute

ProviderId = str

Provider identifier, for example main or openai.

ProxyMethod module-attribute

ProxyMethod = Literal['proxy/initialize', 'proxy/successor']

UNSTABLE: Methods handled by proxies in a proxy chain.

SessionArchiveFilter module-attribute

SessionArchiveFilter = Literal['exclude', 'include', 'only'] | str

UNSTABLE: Which sessions session/list returns by archive state.

exclude (the default) returns only sessions that are not archived.

SessionConfigOption module-attribute

SessionConfigOption = Annotated[
    SelectSessionConfigOption | BooleanSessionConfigOption, Discriminator("type")
]

A session configuration option, discriminated by type.

For type: "select" the options and current_value (string) fields are present. For type: "boolean" only current_value (bool) is present.

SessionConfigOptionCategory module-attribute

SessionConfigOptionCategory = (
    Literal["mode", "model", "model_config", "speed", "thought_level", "other"] | str
)

Semantic category for a session configuration option.

This is intended to help Clients distinguish broadly common selectors (e.g. model selector vs session mode selector vs thought/reasoning level) for UX purposes (keyboard shortcuts, icons, placement). It MUST NOT be required for correctness. Clients MUST handle missing or unknown categories gracefully (treat as other).

speed is UNSTABLE.

SessionConfigOptionValue module-attribute

The value to set for a session configuration option.

When type is "boolean", carries a bool. Otherwise (or when type is absent), carries a SessionConfigValueId string.

SessionConfigSelectOptions module-attribute

SessionConfigSelectOptions = (
    Sequence[SessionConfigSelectOption] | Sequence[SessionConfigSelectGroup]
)

The possible values for a configuration selector, optionally organized into groups.

SessionStatus module-attribute

SessionStatus = Literal['open', 'saved'] | str

UNSTABLE: Whether the Agent has the session in memory.

  • open: The Agent has the session in memory, for any connection.
  • saved: The Agent knows the session and can resume it, but does not have it in memory.

StateUpdate module-attribute

StateUpdate = Annotated[
    Annotated[RunningStateUpdate, Tag("running")]
    | Annotated[IdleStateUpdate, Tag("idle")]
    | Annotated[RequiresActionStateUpdate, Tag("requires_action")]
    | Annotated[UnknownStateUpdate, Tag("unknown")],
    Discriminator(_state_discriminator),
]

UNSTABLE: State snapshot of a subagent session.

SystemPromptMode module-attribute

SystemPromptMode = Literal['append', 'override'] | str

How the Agent combines a client-provided system prompt with its own instructions.

  • append: Add the content to the Agent's own instructions.
  • override: Replace the Agent's built-in default instructions (requires session_capabilities.system_prompt.mode.override).

AcpMcpServer

Bases: BaseMcpServer

UNSTABLE: MCP server reachable over the ACP connection itself (mcp/message).

Only available when the Agent capabilities indicate mcp_capabilities.acp is true.

Source code in src/aclientp/schema/mcp.py
class AcpMcpServer(BaseMcpServer):
    """**UNSTABLE**: MCP server reachable over the ACP connection itself (``mcp/message``).

    Only available when the Agent capabilities indicate ``mcp_capabilities.acp`` is ``true``.
    """

    type: Literal["acp"] = Field(default="acp", init=False)
    """ACP transport type."""

    server_id: McpServerAcpId
    """Unique identifier for this MCP server, generated by the component providing it."""

server_id instance-attribute

server_id: McpServerAcpId

Unique identifier for this MCP server, generated by the component providing it.

type class-attribute instance-attribute

type: Literal['acp'] = Field(default='acp', init=False)

ACP transport type.

AgentAuthCapabilities

Bases: AnnotatedObject

Authentication-related capabilities supported by the agent.

Source code in src/aclientp/schema/capabilities.py
class AgentAuthCapabilities(AnnotatedObject):
    """Authentication-related capabilities supported by the agent."""

    logout: LogoutCapabilities | None = None
    """Whether the agent supports the logout method."""

    status: AuthStatusCapabilities | None = None
    """**UNSTABLE**: Whether the agent supports ``auth/status``."""

logout class-attribute instance-attribute

logout: LogoutCapabilities | None = None

Whether the agent supports the logout method.

status class-attribute instance-attribute

status: AuthStatusCapabilities | None = None

UNSTABLE: Whether the agent supports auth/status.

AgentCapabilities

Bases: AnnotatedObject

Capabilities supported by the agent.

Advertised during initialization to inform the client about available features and content types.

See protocol docs: Agent Capabilities

Source code in src/aclientp/schema/capabilities.py
class AgentCapabilities(AnnotatedObject):
    """Capabilities supported by the agent.

    Advertised during initialization to inform the client about
    available features and content types.

    See protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol/initialization#agent-capabilities)
    """

    auth: AgentAuthCapabilities | None = Field(default_factory=AgentAuthCapabilities)
    """Authentication-related capabilities supported by the agent."""

    providers: ProvidersCapabilities | None = None
    """**UNSTABLE**: LLM provider configuration support."""

    load_session: bool | None = False
    """Whether the agent supports `session/load`."""

    mcp_capabilities: McpCapabilities | None = Field(default_factory=McpCapabilities)
    """MCP capabilities supported by the agent."""

    prompt_capabilities: PromptCapabilities | None = Field(default_factory=PromptCapabilities)
    """Prompt capabilities supported by the agent."""

    session_capabilities: SessionCapabilities | None = Field(default_factory=SessionCapabilities)
    """Session capabilities supported by the agent."""

    @classmethod
    def create(
        cls,
        load_session: bool | None = False,
        http_mcp_servers: bool = False,
        sse_mcp_servers: bool = False,
        audio_prompts: bool = False,
        embedded_context_prompts: bool = False,
        image_prompts: bool = False,
        list_sessions: bool = False,
        resume_session: bool = False,
        close_session: bool = False,
    ) -> Self:
        """Create an instance of AgentCapabilities.

        Args:
            load_session: Whether the agent supports `session/load`.
            http_mcp_servers: Whether the agent supports HTTP MCP servers.
            sse_mcp_servers: Whether the agent supports SSE MCP servers.
            audio_prompts: Whether the agent supports audio prompts.
            embedded_context_prompts: Whether the agent supports embedded context prompts.
            image_prompts: Whether the agent supports image prompts.
            list_sessions: Whether the agent supports `session/list`.
            resume_session: Whether the agent supports `session/resume`.
            close_session: Whether the agent supports `session/close`.
        """
        session_caps = SessionCapabilities(
            list=SessionListCapabilities() if list_sessions else None,
            resume=SessionResumeCapabilities() if resume_session else None,
            close=SessionCloseCapabilities() if close_session else None,
        )
        return cls(
            load_session=load_session,
            mcp_capabilities=McpCapabilities(http=http_mcp_servers, sse=sse_mcp_servers),
            prompt_capabilities=PromptCapabilities(
                audio=audio_prompts,
                embedded_context=embedded_context_prompts,
                image=image_prompts,
            ),
            session_capabilities=session_caps,
        )

auth class-attribute instance-attribute

auth: AgentAuthCapabilities | None = Field(default_factory=AgentAuthCapabilities)

Authentication-related capabilities supported by the agent.

load_session class-attribute instance-attribute

load_session: bool | None = False

Whether the agent supports session/load.

mcp_capabilities class-attribute instance-attribute

mcp_capabilities: McpCapabilities | None = Field(default_factory=McpCapabilities)

MCP capabilities supported by the agent.

prompt_capabilities class-attribute instance-attribute

prompt_capabilities: PromptCapabilities | None = Field(default_factory=PromptCapabilities)

Prompt capabilities supported by the agent.

providers class-attribute instance-attribute

providers: ProvidersCapabilities | None = None

UNSTABLE: LLM provider configuration support.

session_capabilities class-attribute instance-attribute

session_capabilities: SessionCapabilities | None = Field(default_factory=SessionCapabilities)

Session capabilities supported by the agent.

create classmethod

create(
    load_session: bool | None = False,
    http_mcp_servers: bool = False,
    sse_mcp_servers: bool = False,
    audio_prompts: bool = False,
    embedded_context_prompts: bool = False,
    image_prompts: bool = False,
    list_sessions: bool = False,
    resume_session: bool = False,
    close_session: bool = False,
) -> Self

Create an instance of AgentCapabilities.

Parameters:

Name Type Description Default
load_session bool | None

Whether the agent supports session/load.

False
http_mcp_servers bool

Whether the agent supports HTTP MCP servers.

False
sse_mcp_servers bool

Whether the agent supports SSE MCP servers.

False
audio_prompts bool

Whether the agent supports audio prompts.

False
embedded_context_prompts bool

Whether the agent supports embedded context prompts.

False
image_prompts bool

Whether the agent supports image prompts.

False
list_sessions bool

Whether the agent supports session/list.

False
resume_session bool

Whether the agent supports session/resume.

False
close_session bool

Whether the agent supports session/close.

False
Source code in src/aclientp/schema/capabilities.py
@classmethod
def create(
    cls,
    load_session: bool | None = False,
    http_mcp_servers: bool = False,
    sse_mcp_servers: bool = False,
    audio_prompts: bool = False,
    embedded_context_prompts: bool = False,
    image_prompts: bool = False,
    list_sessions: bool = False,
    resume_session: bool = False,
    close_session: bool = False,
) -> Self:
    """Create an instance of AgentCapabilities.

    Args:
        load_session: Whether the agent supports `session/load`.
        http_mcp_servers: Whether the agent supports HTTP MCP servers.
        sse_mcp_servers: Whether the agent supports SSE MCP servers.
        audio_prompts: Whether the agent supports audio prompts.
        embedded_context_prompts: Whether the agent supports embedded context prompts.
        image_prompts: Whether the agent supports image prompts.
        list_sessions: Whether the agent supports `session/list`.
        resume_session: Whether the agent supports `session/resume`.
        close_session: Whether the agent supports `session/close`.
    """
    session_caps = SessionCapabilities(
        list=SessionListCapabilities() if list_sessions else None,
        resume=SessionResumeCapabilities() if resume_session else None,
        close=SessionCloseCapabilities() if close_session else None,
    )
    return cls(
        load_session=load_session,
        mcp_capabilities=McpCapabilities(http=http_mcp_servers, sse=sse_mcp_servers),
        prompt_capabilities=PromptCapabilities(
            audio=audio_prompts,
            embedded_context=embedded_context_prompts,
            image=image_prompts,
        ),
        session_capabilities=session_caps,
    )

AgentMessageChunk

Bases: BaseChunk

A chunk of the agent's response being streamed.

Source code in src/aclientp/schema/session_updates.py
class AgentMessageChunk(BaseChunk):
    """A chunk of the agent's response being streamed."""

    session_update: Literal["agent_message_chunk"] = Field(
        default="agent_message_chunk", init=False
    )
    """Agent message chunk."""

session_update class-attribute instance-attribute

session_update: Literal['agent_message_chunk'] = Field(default='agent_message_chunk', init=False)

Agent message chunk.

AgentMessageCursorAnchor

Bases: CursorMessageAnchor

UNSTABLE: The cursor is next to an agent message.

Source code in src/aclientp/schema/cursors.py
class AgentMessageCursorAnchor(CursorMessageAnchor):
    """**UNSTABLE**: The cursor is next to an agent message."""

    type: Literal["agent_message"] = Field(default="agent_message", init=False)

AgentPlanUpdate

Bases: AnnotatedObject

The agent's execution plan for complex tasks.

See protocol docs: Agent Plan.

Source code in src/aclientp/schema/session_updates.py
class AgentPlanUpdate(AnnotatedObject):
    """The agent's execution plan for complex tasks.

    See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan).
    """

    session_update: Literal["plan"] = Field(default="plan", init=False)

    entries: Sequence[PlanEntry]
    """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."""

entries instance-attribute

entries: Sequence[PlanEntry]

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.

AgentThoughtChunk

Bases: BaseChunk

A chunk of the agent's internal reasoning being streamed.

Source code in src/aclientp/schema/session_updates.py
class AgentThoughtChunk(BaseChunk):
    """A chunk of the agent's internal reasoning being streamed."""

    session_update: Literal["agent_thought_chunk"] = Field(
        default="agent_thought_chunk", init=False
    )
    """Agent thought chunk."""

session_update class-attribute instance-attribute

session_update: Literal['agent_thought_chunk'] = Field(default='agent_thought_chunk', init=False)

Agent thought chunk.

AgentThoughtCursorAnchor

Bases: CursorMessageAnchor

UNSTABLE: The cursor is next to an agent thought.

Source code in src/aclientp/schema/cursors.py
class AgentThoughtCursorAnchor(CursorMessageAnchor):
    """**UNSTABLE**: The cursor is next to an agent thought."""

    type: Literal["agent_thought"] = Field(default="agent_thought", init=False)

AllowedOutcome

Bases: AnnotatedObject

The user selected one of the provided options.

Source code in src/aclientp/schema/tool_call.py
class AllowedOutcome(AnnotatedObject):
    """The user selected one of the provided options."""

    option_id: str
    """The ID of the option the user selected."""

    outcome: Literal["selected"] = Field(default="selected", init=False)

option_id instance-attribute

option_id: str

The ID of the option the user selected.

Annotations

Bases: AnnotatedObject

Optional annotations for the client.

The client can use annotations to inform how objects are used or displayed.

Source code in src/aclientp/schema/content_blocks.py
class Annotations(AnnotatedObject):
    """Optional annotations for the client.

    The client can use annotations to inform how objects are used or displayed.
    """

    audience: Audience | None = None
    """Audience for the annotated resource."""

    last_modified: str | None = None
    """Last modified timestamp of the annotated resource."""

    priority: float | None = None
    """Priority of the annotated resource."""

    @classmethod
    def optionally_create(
        cls,
        audience: Audience | None = None,
        last_modified: datetime | str | None = None,
        priority: float | None = None,
    ) -> Self | None:
        """Create an annotations object if any value is given, otherwise return None."""
        if audience is None and last_modified is None and priority is None:
            return None
        if isinstance(last_modified, datetime):
            last_modified = last_modified.strftime("%Y-%m-%dT%H:%M:%SZ")
        return cls(audience=audience, last_modified=last_modified, priority=priority)

audience class-attribute instance-attribute

audience: Audience | None = None

Audience for the annotated resource.

last_modified class-attribute instance-attribute

last_modified: str | None = None

Last modified timestamp of the annotated resource.

priority class-attribute instance-attribute

priority: float | None = None

Priority of the annotated resource.

optionally_create classmethod

optionally_create(
    audience: Audience | None = None,
    last_modified: datetime | str | None = None,
    priority: float | None = None,
) -> Self | None

Create an annotations object if any value is given, otherwise return None.

Source code in src/aclientp/schema/content_blocks.py
@classmethod
def optionally_create(
    cls,
    audience: Audience | None = None,
    last_modified: datetime | str | None = None,
    priority: float | None = None,
) -> Self | None:
    """Create an annotations object if any value is given, otherwise return None."""
    if audience is None and last_modified is None and priority is None:
        return None
    if isinstance(last_modified, datetime):
        last_modified = last_modified.strftime("%Y-%m-%dT%H:%M:%SZ")
    return cls(audience=audience, last_modified=last_modified, priority=priority)

ArchiveSessionRequest

Bases: Request

UNSTABLE: Request parameters for archiving a session.

Only available if the Agent supports the session.archive capability.

Source code in src/aclientp/schema/client_requests.py
class ArchiveSessionRequest(Request):
    """**UNSTABLE**: Request parameters for archiving a session.

    Only available if the Agent supports the ``session.archive`` capability.
    """

    session_id: str
    """The ID of the session to archive."""

session_id instance-attribute

session_id: str

The ID of the session to archive.

ArchiveSessionResponse

Bases: Response

UNSTABLE: Response to session/archive.

Source code in src/aclientp/schema/agent_responses.py
class ArchiveSessionResponse(Response):
    """**UNSTABLE**: Response to ``session/archive``."""

AudioContentBlock

Bases: BaseContentBlock

Audio data for transcription or analysis.

Requires the audio prompt capability when included in prompts.

Source code in src/aclientp/schema/content_blocks.py
class AudioContentBlock(BaseContentBlock):
    """Audio data for transcription or analysis.

    Requires the `audio` prompt capability when included in prompts.
    """

    type: Literal["audio"] = Field(default="audio", init=False)

    data: str
    """Base64-encoded audio data."""

    mime_type: str
    """MIME type of the audio."""

data instance-attribute

data: str

Base64-encoded audio data.

mime_type instance-attribute

mime_type: str

MIME type of the audio.

AuthAccount

Bases: AnnotatedObject

UNSTABLE: An account the agent has configured, for display.

Source code in src/aclientp/schema/common.py
class AuthAccount(AnnotatedObject):
    """**UNSTABLE**: An account the agent has configured, for display."""

    label: str
    """Human-readable name for the account, e.g. ``Claude Max`` or ``OpenAI API key``."""

    description: str | None = None
    """Short text shown with the label, e.g. the credential source. MUST NOT contain secrets."""

    active: bool | None = None
    """Whether the agent currently uses this account by default."""

    name: str | None = None
    """Display name of the user."""

    email: str | None = None
    """Email address of the user."""

    organization: str | None = None
    """Display name of the organization, team, or workspace the account is using."""

active class-attribute instance-attribute

active: bool | None = None

Whether the agent currently uses this account by default.

description class-attribute instance-attribute

description: str | None = None

Short text shown with the label, e.g. the credential source. MUST NOT contain secrets.

email class-attribute instance-attribute

email: str | None = None

Email address of the user.

label instance-attribute

label: str

Human-readable name for the account, e.g. Claude Max or OpenAI API key.

name class-attribute instance-attribute

name: str | None = None

Display name of the user.

organization class-attribute instance-attribute

organization: str | None = None

Display name of the organization, team, or workspace the account is using.

AuthCapabilities

Bases: AnnotatedObject

Authentication capabilities supported by the client.

Advertised during initialization to inform the agent which authentication method types the client can handle.

Source code in src/aclientp/schema/capabilities.py
class AuthCapabilities(AnnotatedObject):
    """Authentication capabilities supported by the client.

    Advertised during initialization to inform the agent which authentication
    method types the client can handle.
    """

    terminal: bool = False
    """Whether the client supports ``terminal`` authentication methods."""

terminal class-attribute instance-attribute

terminal: bool = False

Whether the client supports terminal authentication methods.

AuthMethodAgent

Bases: AnnotatedObject

Agent handles authentication itself.

This is the default authentication method type. When no type field is present, the method is treated as agent.

Source code in src/aclientp/schema/common.py
class AuthMethodAgent(AnnotatedObject):
    """Agent handles authentication itself.

    This is the default authentication method type.
    When no ``type`` field is present, the method is treated as ``agent``.
    """

    type: Literal["agent"] = Field(default="agent", exclude=True)
    """Discriminator field.  Defaults to ``"agent"`` and is excluded from serialization
    for backward compatibility."""

    id: str
    """Unique identifier for this authentication method."""

    name: str
    """Human-readable name of the authentication method."""

    description: str | None = None
    """Optional description providing more details about this authentication method."""

description class-attribute instance-attribute

description: str | None = None

Optional description providing more details about this authentication method.

id instance-attribute

id: str

Unique identifier for this authentication method.

name instance-attribute

name: str

Human-readable name of the authentication method.

type class-attribute instance-attribute

type: Literal['agent'] = Field(default='agent', exclude=True)

Discriminator field. Defaults to "agent" and is excluded from serialization for backward compatibility.

AuthMethodTerminal

Bases: AnnotatedObject

Terminal authentication method.

Client runs the configured agent program as a separate interactive process for the user to authenticate.

Source code in src/aclientp/schema/common.py
class AuthMethodTerminal(AnnotatedObject):
    """Terminal authentication method.

    Client runs the configured agent program as a separate interactive process
    for the user to authenticate.
    """

    type: Literal["terminal"] = "terminal"
    """Discriminator field."""

    id: str
    """Unique identifier for this authentication method."""

    name: str
    """Human-readable name of the authentication method."""

    description: str | None = None
    """Optional description providing more details about this authentication method."""

    args: Sequence[str] = ()
    """Additional arguments to pass when running the agent binary for terminal auth."""

    env: dict[str, str] = Field(default_factory=dict)
    """Additional environment variables to set when running the agent binary for terminal auth."""

args class-attribute instance-attribute

args: Sequence[str] = ()

Additional arguments to pass when running the agent binary for terminal auth.

description class-attribute instance-attribute

description: str | None = None

Optional description providing more details about this authentication method.

env class-attribute instance-attribute

env: dict[str, str] = Field(default_factory=dict)

Additional environment variables to set when running the agent binary for terminal auth.

id instance-attribute

id: str

Unique identifier for this authentication method.

name instance-attribute

name: str

Human-readable name of the authentication method.

type class-attribute instance-attribute

type: Literal['terminal'] = 'terminal'

Discriminator field.

AuthStatusCapabilities

Bases: AnnotatedObject

UNSTABLE: Support for auth/status and auth/status_update.

Source code in src/aclientp/schema/capabilities.py
class AuthStatusCapabilities(AnnotatedObject):
    """**UNSTABLE**: Support for ``auth/status`` and ``auth/status_update``."""

AuthStatusRequest

Bases: Request

UNSTABLE: Request the agent's current authentication state.

Only available if the Agent supports the auth.status capability.

Source code in src/aclientp/schema/client_requests.py
class AuthStatusRequest(Request):
    """**UNSTABLE**: Request the agent's current authentication state.

    Only available if the Agent supports the ``auth.status`` capability.
    """

AuthStatusResponse

Bases: Response

UNSTABLE: Response to auth/status.

Source code in src/aclientp/schema/agent_responses.py
class AuthStatusResponse(Response):
    """**UNSTABLE**: Response to ``auth/status``."""

    state: AuthState
    """Whether the agent can start sessions without the user signing in first."""

    accounts: Sequence[AuthAccount] = Field(default_factory=list)
    """The accounts the agent has configured, for display."""

accounts class-attribute instance-attribute

accounts: Sequence[AuthAccount] = Field(default_factory=list)

The accounts the agent has configured, for display.

state instance-attribute

state: AuthState

Whether the agent can start sessions without the user signing in first.

AuthStatusUpdateNotification

Bases: AnnotatedObject

UNSTABLE: The agent's authentication state changed (auth/status_update).

Source code in src/aclientp/schema/notifications.py
class AuthStatusUpdateNotification(AnnotatedObject):
    """**UNSTABLE**: The agent's authentication state changed (``auth/status_update``)."""

    state: AuthState
    """Whether the agent can start sessions without the user signing in first."""

    accounts: Sequence[AuthAccount] = Field(default_factory=list)
    """The accounts the agent has configured, for display."""

accounts class-attribute instance-attribute

accounts: Sequence[AuthAccount] = Field(default_factory=list)

The accounts the agent has configured, for display.

state instance-attribute

state: AuthState

Whether the agent can start sessions without the user signing in first.

AuthenticateRequest

Bases: Request

Request parameters for the authenticate method.

Specifies which authentication method to use.

Source code in src/aclientp/schema/client_requests.py
class AuthenticateRequest(Request):
    """Request parameters for the authenticate method.

    Specifies which authentication method to use.
    """

    method_id: str
    """The ID of the authentication method to use.

    Must be one of the methods advertised in the initialize response.
    """

method_id instance-attribute

method_id: str

The ID of the authentication method to use.

Must be one of the methods advertised in the initialize response.

AuthenticateResponse

Bases: Response

Response to authenticate method.

Source code in src/aclientp/schema/agent_responses.py
class AuthenticateResponse(Response):
    """Response to authenticate method."""

AvailableCommand

Bases: AnnotatedObject

Information about a command.

Source code in src/aclientp/schema/slash_commands.py
class AvailableCommand(AnnotatedObject):
    """Information about a command."""

    description: str
    """Human-readable description of what the command does."""

    input: AvailableCommandInput | None = None
    """Input for the command if required."""

    name: str
    """Command name (e.g., `create_plan`, `research_codebase`)."""

    @classmethod
    def create(cls, name: str, description: str, input_hint: str | None = None) -> Self:
        """Create a new Command.

        Args:
            name: Name of the command.
            description: Description of the command.
            input_hint: Hint for the input.

        Returns:
            A new available command.
        """
        spec = AvailableCommandInput(root=CommandInputHint(hint=input_hint)) if input_hint else None
        return cls(name=name, description=description, input=spec)

description instance-attribute

description: str

Human-readable description of what the command does.

input class-attribute instance-attribute

input: AvailableCommandInput | None = None

Input for the command if required.

name instance-attribute

name: str

Command name (e.g., create_plan, research_codebase).

create classmethod

create(name: str, description: str, input_hint: str | None = None) -> Self

Create a new Command.

Parameters:

Name Type Description Default
name str

Name of the command.

required
description str

Description of the command.

required
input_hint str | None

Hint for the input.

None

Returns:

Type Description
Self

A new available command.

Source code in src/aclientp/schema/slash_commands.py
@classmethod
def create(cls, name: str, description: str, input_hint: str | None = None) -> Self:
    """Create a new Command.

    Args:
        name: Name of the command.
        description: Description of the command.
        input_hint: Hint for the input.

    Returns:
        A new available command.
    """
    spec = AvailableCommandInput(root=CommandInputHint(hint=input_hint)) if input_hint else None
    return cls(name=name, description=description, input=spec)

AvailableCommandInput

Bases: RootModel[CommandInputHint]

A container for the input specification for a command.

Source code in src/aclientp/schema/slash_commands.py
class AvailableCommandInput(RootModel[CommandInputHint]):
    """A container for the input specification for a command."""

    root: CommandInputHint
    """The input specification for a command."""

root instance-attribute

The input specification for a command.

AvailableCommandsUpdate

Bases: AnnotatedObject

Available commands are ready or have changed.

Source code in src/aclientp/schema/session_updates.py
class AvailableCommandsUpdate(AnnotatedObject):
    """Available commands are ready or have changed."""

    session_update: Literal["available_commands_update"] = Field(
        default="available_commands_update", init=False
    )
    """Available commands are ready or have changed."""

    available_commands: Sequence[AvailableCommand]
    """Commands the agent can execute"""

available_commands instance-attribute

available_commands: Sequence[AvailableCommand]

Commands the agent can execute

session_update class-attribute instance-attribute

session_update: Literal["available_commands_update"] = Field(
    default="available_commands_update", init=False
)

Available commands are ready or have changed.

BlobResourceContents

Bases: BaseResourceContents

Binary resource contents.

Source code in src/aclientp/schema/content_blocks.py
class BlobResourceContents(BaseResourceContents):
    """Binary resource contents."""

    blob: str
    """Base64-encoded binary content of the resource."""

blob instance-attribute

blob: str

Base64-encoded binary content of the resource.

BooleanConfigOptionCapabilities

Bases: AnnotatedObject

Capabilities for boolean session configuration options.

Source code in src/aclientp/schema/capabilities.py
class BooleanConfigOptionCapabilities(AnnotatedObject):
    """Capabilities for boolean session configuration options."""

BooleanPropertySchema

Bases: AnnotatedObject

Schema for boolean properties in an elicitation form.

Source code in src/aclientp/schema/elicitation.py
class BooleanPropertySchema(AnnotatedObject):
    """Schema for boolean properties in an elicitation form."""

    type: Literal["boolean"] = "boolean"
    """Type discriminator."""

    title: str | None = None
    """Optional title for the property."""

    description: str | None = None
    """Human-readable description."""

    default: bool | None = None
    """Default value."""

default class-attribute instance-attribute

default: bool | None = None

Default value.

description class-attribute instance-attribute

description: str | None = None

Human-readable description.

title class-attribute instance-attribute

title: str | None = None

Optional title for the property.

type class-attribute instance-attribute

type: Literal['boolean'] = 'boolean'

Type discriminator.

BooleanSessionConfigOption

Bases: BaseSessionConfigOption

UNSTABLE: This capability is not part of the spec yet.

A boolean on/off toggle session configuration option.

Advertised by the agent to describe an available boolean config option and its current state. See SessionConfigOptionValueBoolean for the value sent by the client when changing it.

Source code in src/aclientp/schema/config_options.py
class BooleanSessionConfigOption(BaseSessionConfigOption):
    """**UNSTABLE**: This capability is not part of the spec yet.

    A boolean on/off toggle session configuration option.

    Advertised by the agent to describe an available boolean config option and its current state.
    See ``SessionConfigOptionValueBoolean`` for the value sent by the client when changing it.
    """

    type: Literal["boolean"] = Field(default="boolean", init=False)
    """Discriminator for the config option type."""

    current_value: bool
    """The current value of the boolean option."""

current_value instance-attribute

current_value: bool

The current value of the boolean option.

type class-attribute instance-attribute

type: Literal['boolean'] = Field(default='boolean', init=False)

Discriminator for the config option type.

CancelNotification

Bases: AnnotatedObject

Notification to cancel 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

See protocol docs: Cancellation

Source code in src/aclientp/schema/notifications.py
class CancelNotification(AnnotatedObject):
    """Notification to cancel 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`

    See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)
    """

    session_id: str
    """The ID of the session to cancel operations for."""

session_id instance-attribute

session_id: str

The ID of the session to cancel operations for.

CancelRequestNotification

Bases: AnnotatedObject

Notification to cancel an ongoing request ($/cancel_request).

Either side may send it for a request it issued. The receiver should stop the work and may reply with a -32800 (request cancelled) error or a normal response. Unknown or already answered request IDs are ignored.

Source code in src/aclientp/schema/notifications.py
class CancelRequestNotification(AnnotatedObject):
    """Notification to cancel an ongoing request (``$/cancel_request``).

    Either side may send it for a request it issued. The receiver should stop
    the work and may reply with a ``-32800`` (request cancelled) error or a normal
    response. Unknown or already answered request IDs are ignored.
    """

    request_id: int | str | None
    """The ID of the request to cancel."""

request_id instance-attribute

request_id: int | str | None

The ID of the request to cancel.

ClientCapabilities

Bases: AnnotatedObject

Capabilities supported by the client.

Advertised during initialization to inform the agent about available features and methods.

See protocol docs: Client Capabilities

Source code in src/aclientp/schema/capabilities.py
class ClientCapabilities(AnnotatedObject):
    """Capabilities supported by the client.

    Advertised during initialization to inform the agent about
    available features and methods.

    See protocol docs: [Client Capabilities](https://agentclientprotocol.com/protocol/initialization#client-capabilities)
    """

    auth: AuthCapabilities | None = Field(default_factory=AuthCapabilities)
    """Authentication capabilities supported by the client."""

    elicitation: ElicitationCapabilities | None = None
    """Elicitation capabilities supported by the client.

    Determines which elicitation modes the agent may use.
    """

    session: ClientSessionCapabilities | None = None
    """Session-related capabilities supported by the client."""

    subagents: SubagentCapabilities | None = None
    """**UNSTABLE**: Client support for ``subagent_update`` session updates."""

    plan: PlanCapabilities | None = None
    """**UNSTABLE**: Client support for ID-addressed plan updates."""

    fs: FileSystemCapabilities | None = Field(default_factory=FileSystemCapabilities)
    """File system capabilities supported by the client.

    Determines which file operations the agent can request.
    """

    terminal: bool | None = False
    """Whether the Client support all `terminal/*` methods."""

    @classmethod
    def create(
        cls,
        read_text_file: bool | None = False,
        write_text_file: bool | None = False,
        terminal: bool | None = False,
        auth: AuthCapabilities | None = None,
    ) -> Self:
        """Create a new instance of ClientCapabilities.

        Args:
            read_text_file: Whether the Client supports `fs/read_text_file` requests.
            write_text_file: Whether the Client supports `fs/write_text_file` requests.
            terminal: Whether the Client supports all `terminal/*` methods.
            auth: Authentication capabilities supported by the client.

        Returns:
            A new instance of ClientCapabilities.
        """
        fs = FileSystemCapabilities(read_text_file=read_text_file, write_text_file=write_text_file)
        return cls(fs=fs, terminal=terminal, auth=auth)

auth class-attribute instance-attribute

auth: AuthCapabilities | None = Field(default_factory=AuthCapabilities)

Authentication capabilities supported by the client.

elicitation class-attribute instance-attribute

elicitation: ElicitationCapabilities | None = None

Elicitation capabilities supported by the client.

Determines which elicitation modes the agent may use.

fs class-attribute instance-attribute

fs: FileSystemCapabilities | None = Field(default_factory=FileSystemCapabilities)

File system capabilities supported by the client.

Determines which file operations the agent can request.

plan class-attribute instance-attribute

plan: PlanCapabilities | None = None

UNSTABLE: Client support for ID-addressed plan updates.

session class-attribute instance-attribute

session: ClientSessionCapabilities | None = None

Session-related capabilities supported by the client.

subagents class-attribute instance-attribute

subagents: SubagentCapabilities | None = None

UNSTABLE: Client support for subagent_update session updates.

terminal class-attribute instance-attribute

terminal: bool | None = False

Whether the Client support all terminal/* methods.

create classmethod

create(
    read_text_file: bool | None = False,
    write_text_file: bool | None = False,
    terminal: bool | None = False,
    auth: AuthCapabilities | None = None,
) -> Self

Create a new instance of ClientCapabilities.

Parameters:

Name Type Description Default
read_text_file bool | None

Whether the Client supports fs/read_text_file requests.

False
write_text_file bool | None

Whether the Client supports fs/write_text_file requests.

False
terminal bool | None

Whether the Client supports all terminal/* methods.

False
auth AuthCapabilities | None

Authentication capabilities supported by the client.

None

Returns:

Type Description
Self

A new instance of ClientCapabilities.

Source code in src/aclientp/schema/capabilities.py
@classmethod
def create(
    cls,
    read_text_file: bool | None = False,
    write_text_file: bool | None = False,
    terminal: bool | None = False,
    auth: AuthCapabilities | None = None,
) -> Self:
    """Create a new instance of ClientCapabilities.

    Args:
        read_text_file: Whether the Client supports `fs/read_text_file` requests.
        write_text_file: Whether the Client supports `fs/write_text_file` requests.
        terminal: Whether the Client supports all `terminal/*` methods.
        auth: Authentication capabilities supported by the client.

    Returns:
        A new instance of ClientCapabilities.
    """
    fs = FileSystemCapabilities(read_text_file=read_text_file, write_text_file=write_text_file)
    return cls(fs=fs, terminal=terminal, auth=auth)

ClientSessionCapabilities

Bases: AnnotatedObject

Session-related capabilities supported by the client.

Source code in src/aclientp/schema/capabilities.py
class ClientSessionCapabilities(AnnotatedObject):
    """Session-related capabilities supported by the client."""

    compaction: CompactionCapabilities | None = None
    """Support for ID-addressed context compaction updates."""

    config_options: SessionConfigOptionsCapabilities | None = None
    """Config option capabilities supported by the client."""

    notices: NoticeCapabilities | None = None
    """Support for live user-facing ``notice`` session updates."""

    prompt_suggestions: PromptSuggestionsCapabilities | None = None
    """**UNSTABLE**: Support for ``prompt_suggestions_update`` session updates."""

    cursors: SessionCursorsCapabilities | None = None
    """**UNSTABLE**: Support for ``cursor_update`` session updates."""

compaction class-attribute instance-attribute

compaction: CompactionCapabilities | None = None

Support for ID-addressed context compaction updates.

config_options class-attribute instance-attribute

config_options: SessionConfigOptionsCapabilities | None = None

Config option capabilities supported by the client.

cursors class-attribute instance-attribute

cursors: SessionCursorsCapabilities | None = None

UNSTABLE: Support for cursor_update session updates.

notices class-attribute instance-attribute

notices: NoticeCapabilities | None = None

Support for live user-facing notice session updates.

prompt_suggestions class-attribute instance-attribute

prompt_suggestions: PromptSuggestionsCapabilities | None = None

UNSTABLE: Support for prompt_suggestions_update session updates.

CloseSessionRequest

Bases: Request

Request parameters for closing an active session.

The agent must cancel any ongoing work related to the session (treat it as if session/cancel was called) and then free up any resources associated with the session.

Only available if the Agent supports the session.close capability.

Source code in src/aclientp/schema/client_requests.py
class CloseSessionRequest(Request):
    """Request parameters for closing an active session.

    The agent **must** cancel any ongoing work related to the session
    (treat it as if ``session/cancel`` was called) and then free up any resources
    associated with the session.

    Only available if the Agent supports the ``session.close`` capability.
    """

    session_id: str
    """The ID of the session to close."""

session_id instance-attribute

session_id: str

The ID of the session to close.

CloseSessionResponse

Bases: Response

Response from closing a session.

Source code in src/aclientp/schema/agent_responses.py
class CloseSessionResponse(Response):
    """Response from closing a session."""

CommandInputHint

Bases: AnnotatedObject

All text that was typed after the command name is provided as input.

Source code in src/aclientp/schema/slash_commands.py
class CommandInputHint(AnnotatedObject):
    """All text that was typed after the command name is provided as input."""

    hint: str
    """A hint to display when the input hasn't been provided yet."""

hint instance-attribute

hint: str

A hint to display when the input hasn't been provided yet.

CompactionCapabilities

Bases: AnnotatedObject

Client support for ID-addressed context compaction updates.

{} advertises the complete compaction contract.

Source code in src/aclientp/schema/capabilities.py
class CompactionCapabilities(AnnotatedObject):
    """Client support for ID-addressed context compaction updates.

    ``{}`` advertises the complete compaction contract.
    """

CompactionCursorAnchor

Bases: AnnotatedObject

UNSTABLE: The cursor is next to a context compaction.

Source code in src/aclientp/schema/cursors.py
class CompactionCursorAnchor(AnnotatedObject):
    """**UNSTABLE**: The cursor is next to a context compaction."""

    type: Literal["compaction"] = Field(default="compaction", init=False)

    compaction_id: str
    """The ID of the anchored compaction."""

    position: CursorAnchorPosition
    """On which side of the compaction the cursor is."""

compaction_id instance-attribute

compaction_id: str

The ID of the anchored compaction.

position instance-attribute

On which side of the compaction the cursor is.

CompactionSummaryChunk

Bases: AnnotatedObject

A content block appended to a compaction's summary.

A first-seen ID creates an in-progress compaction. Chunks append in receive order.

Source code in src/aclientp/schema/session_updates.py
class CompactionSummaryChunk(AnnotatedObject):
    """A content block appended to a compaction's summary.

    A first-seen ID creates an in-progress compaction. Chunks append in receive order.
    """

    session_update: Literal["compaction_summary_chunk"] = Field(
        default="compaction_summary_chunk", init=False
    )

    compaction_id: CompactionId
    """ID of the compaction whose summary receives this content."""

    content: ContentBlock
    """One content block to append."""

compaction_id instance-attribute

compaction_id: CompactionId

ID of the compaction whose summary receives this content.

content instance-attribute

content: ContentBlock

One content block to append.

CompactionUpdate

Bases: AnnotatedObject

A context compaction upsert.

The first notification fixes the compaction's timeline position. Later updates with the same ID patch that entity in place. Only sent if the client advertised session.compaction.

Source code in src/aclientp/schema/session_updates.py
class CompactionUpdate(AnnotatedObject):
    """A context compaction upsert.

    The first notification fixes the compaction's timeline position.
    Later updates with the same ID patch that entity in place.
    Only sent if the client advertised ``session.compaction``.
    """

    session_update: Literal["compaction_update"] = Field(default="compaction_update", init=False)

    compaction_id: CompactionId
    """The Agent-owned ID of this compaction."""

    status: CompactionStatus
    """Current lifecycle status."""

    summary: Sequence[ContentBlock] | None = None
    """Complete replacement user-displayable summary content for the compaction."""

    error: str | None = None
    """Human-readable error details for the compaction."""

compaction_id instance-attribute

compaction_id: CompactionId

The Agent-owned ID of this compaction.

error class-attribute instance-attribute

error: str | None = None

Human-readable error details for the compaction.

status instance-attribute

Current lifecycle status.

summary class-attribute instance-attribute

summary: Sequence[ContentBlock] | None = None

Complete replacement user-displayable summary content for the compaction.

ConfigOptionUpdate

Bases: AnnotatedObject

A session configuration option value has changed.

The full set of configuration options and their current values is sent on every change. Clients should replace their cached list entirely.

See protocol docs: Session Config Options <https://agentclientprotocol.com/protocol/session-config-options>_

Source code in src/aclientp/schema/session_updates.py
class ConfigOptionUpdate(AnnotatedObject):
    """A session configuration option value has changed.

    The full set of configuration options and their current values is sent
    on every change. Clients should replace their cached list entirely.

    See protocol docs: `Session Config Options <https://agentclientprotocol.com/protocol/session-config-options>`_
    """

    session_update: Literal["config_option_update"] = Field(
        default="config_option_update", init=False
    )

    config_options: Sequence[SessionConfigOption]
    """The full set of configuration options and their current values."""

config_options instance-attribute

config_options: Sequence[SessionConfigOption]

The full set of configuration options and their current values.

ContentToolCallContent

Bases: AnnotatedObject

Standard content block (text, images, resources).

Source code in src/aclientp/schema/tool_call.py
class ContentToolCallContent(AnnotatedObject):
    """Standard content block (text, images, resources)."""

    type: Literal["content"] = Field(default="content", init=False)
    """Standard content block (text, images, resources)."""

    content: ContentBlock
    """The actual content block."""

    @classmethod
    def text(
        cls,
        text: str,
        *,
        audience: Audience | None = None,
        last_modified: datetime | str | None = None,
        priority: float | None = None,
    ) -> Self:
        """Create a ToolCallContent containing text.

        Args:
            text: The text content.
            audience: The audience for the text.
            last_modified: The last modified date of the text.
            priority: The priority of the text.
        """
        annotations = Annotations.optionally_create(
            audience=audience,
            last_modified=last_modified,
            priority=priority,
        )
        return cls(content=TextContentBlock(text=text, annotations=annotations))

    @classmethod
    def image(
        cls,
        data: str | bytes,
        mime_type: str,
        uri: str | None = None,
        audience: Audience | None = None,
        last_modified: datetime | str | None = None,
        priority: float | None = None,
    ) -> Self:
        """Create a ToolCallContent containing an embedded image resource.

        Args:
            data: The image data.
            mime_type: The MIME type of the image.
            uri: The URI of the image.
            audience: The audience for the image.
            last_modified: The last modified date of the image.
            priority: The priority of the image.
        """
        if isinstance(data, bytes):
            data = base64.b64encode(data).decode()
        annotations = Annotations.optionally_create(
            audience=audience,
            last_modified=last_modified,
            priority=priority,
        )
        image = ImageContentBlock(data=data, mime_type=mime_type, uri=uri, annotations=annotations)
        return cls(content=image)

    @classmethod
    def audio(
        cls,
        data: str | bytes,
        mime_type: str,
        audience: Audience | None = None,
        last_modified: datetime | str | None = None,
        priority: float | None = None,
    ) -> Self:
        """Create a ToolCallContent containing audio content.

        Args:
            data: The audio data.
            mime_type: The MIME type of the audio data.
            audience: The audience for the audio chunk.
            last_modified: The last modified date of the audio chunk.
            priority: The priority of the audio chunk.
        """
        if isinstance(data, bytes):
            data = base64.b64encode(data).decode()
        annotations = Annotations.optionally_create(
            audience=audience,
            last_modified=last_modified,
            priority=priority,
        )
        content = AudioContentBlock(data=data, mime_type=mime_type, annotations=annotations)
        return cls(content=content)

    @classmethod
    def resource(
        cls,
        name: str,
        uri: str,
        description: str | None = None,
        mime_type: str | None = None,
        size: int | None = None,
        title: str | None = None,
        audience: Audience | None = None,
        last_modified: datetime | str | None = None,
        priority: float | None = None,
    ) -> Self:
        """Create a ToolCallContent containing a resource content block.

        Args:
            name: The name of the resource.
            uri: The URI of the resource.
            description: The description of the resource.
            mime_type: The MIME type of the resource.
            size: The size of the resource.
            title: The title of the resource.
            audience: The audience of the resource.
            last_modified: The last modified date of the resource.
            priority: The priority of the resource.
        """
        annotations = Annotations.optionally_create(
            audience=audience,
            last_modified=last_modified,
            priority=priority,
        )
        block = ResourceContentBlock(
            name=name,
            uri=uri,
            description=description,
            mime_type=mime_type,
            size=size,
            title=title,
            annotations=annotations,
        )
        return cls(content=block)

    @classmethod
    def embedded_text_resource(
        cls,
        text: str,
        uri: str,
        mime_type: str | None = None,
        audience: Audience | None = None,
        last_modified: datetime | str | None = None,
        priority: float | None = None,
    ) -> Self:
        """Create a ToolCallContent containing an embedded text resource.

        Args:
            text: The text to embed.
            uri: The URI of the resource.
            mime_type: The MIME type of the resource.
            audience: The audience to apply to the resource.
            last_modified: The last modified date of the resource.
            priority: The priority of the resource.
        """
        annotations = Annotations.optionally_create(
            audience=audience,
            last_modified=last_modified,
            priority=priority,
        )
        contents = TextResourceContents(text=text, mime_type=mime_type, uri=uri)
        content = EmbeddedResourceContentBlock(annotations=annotations, resource=contents)
        return cls(content=content)

    @classmethod
    def embedded_blob_resource(
        cls,
        data: bytes | str,
        uri: str,
        mime_type: str | None = None,
        audience: Audience | None = None,
        last_modified: datetime | str | None = None,
        priority: float | None = None,
    ) -> Self:
        """Create a ToolCallContent containing an embedded blob resource.

        Args:
            data: The data to embed.
            uri: The URI of the resource.
            mime_type: The MIME type of the resource.
            audience: The audience to apply to the resource.
            last_modified: The last modified date of the resource.
            priority: The priority of the resource.
        """
        if isinstance(data, bytes):
            data = base64.b64encode(data).decode()
        annotations = Annotations.optionally_create(
            audience=audience,
            last_modified=last_modified,
            priority=priority,
        )
        resource = BlobResourceContents(blob=data, mime_type=mime_type, uri=uri)
        content = EmbeddedResourceContentBlock(annotations=annotations, resource=resource)
        return cls(content=content)

content instance-attribute

content: ContentBlock

The actual content block.

type class-attribute instance-attribute

type: Literal['content'] = Field(default='content', init=False)

Standard content block (text, images, resources).

audio classmethod

audio(
    data: str | bytes,
    mime_type: str,
    audience: Audience | None = None,
    last_modified: datetime | str | None = None,
    priority: float | None = None,
) -> Self

Create a ToolCallContent containing audio content.

Parameters:

Name Type Description Default
data str | bytes

The audio data.

required
mime_type str

The MIME type of the audio data.

required
audience Audience | None

The audience for the audio chunk.

None
last_modified datetime | str | None

The last modified date of the audio chunk.

None
priority float | None

The priority of the audio chunk.

None
Source code in src/aclientp/schema/tool_call.py
@classmethod
def audio(
    cls,
    data: str | bytes,
    mime_type: str,
    audience: Audience | None = None,
    last_modified: datetime | str | None = None,
    priority: float | None = None,
) -> Self:
    """Create a ToolCallContent containing audio content.

    Args:
        data: The audio data.
        mime_type: The MIME type of the audio data.
        audience: The audience for the audio chunk.
        last_modified: The last modified date of the audio chunk.
        priority: The priority of the audio chunk.
    """
    if isinstance(data, bytes):
        data = base64.b64encode(data).decode()
    annotations = Annotations.optionally_create(
        audience=audience,
        last_modified=last_modified,
        priority=priority,
    )
    content = AudioContentBlock(data=data, mime_type=mime_type, annotations=annotations)
    return cls(content=content)

embedded_blob_resource classmethod

embedded_blob_resource(
    data: bytes | str,
    uri: str,
    mime_type: str | None = None,
    audience: Audience | None = None,
    last_modified: datetime | str | None = None,
    priority: float | None = None,
) -> Self

Create a ToolCallContent containing an embedded blob resource.

Parameters:

Name Type Description Default
data bytes | str

The data to embed.

required
uri str

The URI of the resource.

required
mime_type str | None

The MIME type of the resource.

None
audience Audience | None

The audience to apply to the resource.

None
last_modified datetime | str | None

The last modified date of the resource.

None
priority float | None

The priority of the resource.

None
Source code in src/aclientp/schema/tool_call.py
@classmethod
def embedded_blob_resource(
    cls,
    data: bytes | str,
    uri: str,
    mime_type: str | None = None,
    audience: Audience | None = None,
    last_modified: datetime | str | None = None,
    priority: float | None = None,
) -> Self:
    """Create a ToolCallContent containing an embedded blob resource.

    Args:
        data: The data to embed.
        uri: The URI of the resource.
        mime_type: The MIME type of the resource.
        audience: The audience to apply to the resource.
        last_modified: The last modified date of the resource.
        priority: The priority of the resource.
    """
    if isinstance(data, bytes):
        data = base64.b64encode(data).decode()
    annotations = Annotations.optionally_create(
        audience=audience,
        last_modified=last_modified,
        priority=priority,
    )
    resource = BlobResourceContents(blob=data, mime_type=mime_type, uri=uri)
    content = EmbeddedResourceContentBlock(annotations=annotations, resource=resource)
    return cls(content=content)

embedded_text_resource classmethod

embedded_text_resource(
    text: str,
    uri: str,
    mime_type: str | None = None,
    audience: Audience | None = None,
    last_modified: datetime | str | None = None,
    priority: float | None = None,
) -> Self

Create a ToolCallContent containing an embedded text resource.

Parameters:

Name Type Description Default
text str

The text to embed.

required
uri str

The URI of the resource.

required
mime_type str | None

The MIME type of the resource.

None
audience Audience | None

The audience to apply to the resource.

None
last_modified datetime | str | None

The last modified date of the resource.

None
priority float | None

The priority of the resource.

None
Source code in src/aclientp/schema/tool_call.py
@classmethod
def embedded_text_resource(
    cls,
    text: str,
    uri: str,
    mime_type: str | None = None,
    audience: Audience | None = None,
    last_modified: datetime | str | None = None,
    priority: float | None = None,
) -> Self:
    """Create a ToolCallContent containing an embedded text resource.

    Args:
        text: The text to embed.
        uri: The URI of the resource.
        mime_type: The MIME type of the resource.
        audience: The audience to apply to the resource.
        last_modified: The last modified date of the resource.
        priority: The priority of the resource.
    """
    annotations = Annotations.optionally_create(
        audience=audience,
        last_modified=last_modified,
        priority=priority,
    )
    contents = TextResourceContents(text=text, mime_type=mime_type, uri=uri)
    content = EmbeddedResourceContentBlock(annotations=annotations, resource=contents)
    return cls(content=content)

image classmethod

image(
    data: str | bytes,
    mime_type: str,
    uri: str | None = None,
    audience: Audience | None = None,
    last_modified: datetime | str | None = None,
    priority: float | None = None,
) -> Self

Create a ToolCallContent containing an embedded image resource.

Parameters:

Name Type Description Default
data str | bytes

The image data.

required
mime_type str

The MIME type of the image.

required
uri str | None

The URI of the image.

None
audience Audience | None

The audience for the image.

None
last_modified datetime | str | None

The last modified date of the image.

None
priority float | None

The priority of the image.

None
Source code in src/aclientp/schema/tool_call.py
@classmethod
def image(
    cls,
    data: str | bytes,
    mime_type: str,
    uri: str | None = None,
    audience: Audience | None = None,
    last_modified: datetime | str | None = None,
    priority: float | None = None,
) -> Self:
    """Create a ToolCallContent containing an embedded image resource.

    Args:
        data: The image data.
        mime_type: The MIME type of the image.
        uri: The URI of the image.
        audience: The audience for the image.
        last_modified: The last modified date of the image.
        priority: The priority of the image.
    """
    if isinstance(data, bytes):
        data = base64.b64encode(data).decode()
    annotations = Annotations.optionally_create(
        audience=audience,
        last_modified=last_modified,
        priority=priority,
    )
    image = ImageContentBlock(data=data, mime_type=mime_type, uri=uri, annotations=annotations)
    return cls(content=image)

resource classmethod

resource(
    name: str,
    uri: str,
    description: str | None = None,
    mime_type: str | None = None,
    size: int | None = None,
    title: str | None = None,
    audience: Audience | None = None,
    last_modified: datetime | str | None = None,
    priority: float | None = None,
) -> Self

Create a ToolCallContent containing a resource content block.

Parameters:

Name Type Description Default
name str

The name of the resource.

required
uri str

The URI of the resource.

required
description str | None

The description of the resource.

None
mime_type str | None

The MIME type of the resource.

None
size int | None

The size of the resource.

None
title str | None

The title of the resource.

None
audience Audience | None

The audience of the resource.

None
last_modified datetime | str | None

The last modified date of the resource.

None
priority float | None

The priority of the resource.

None
Source code in src/aclientp/schema/tool_call.py
@classmethod
def resource(
    cls,
    name: str,
    uri: str,
    description: str | None = None,
    mime_type: str | None = None,
    size: int | None = None,
    title: str | None = None,
    audience: Audience | None = None,
    last_modified: datetime | str | None = None,
    priority: float | None = None,
) -> Self:
    """Create a ToolCallContent containing a resource content block.

    Args:
        name: The name of the resource.
        uri: The URI of the resource.
        description: The description of the resource.
        mime_type: The MIME type of the resource.
        size: The size of the resource.
        title: The title of the resource.
        audience: The audience of the resource.
        last_modified: The last modified date of the resource.
        priority: The priority of the resource.
    """
    annotations = Annotations.optionally_create(
        audience=audience,
        last_modified=last_modified,
        priority=priority,
    )
    block = ResourceContentBlock(
        name=name,
        uri=uri,
        description=description,
        mime_type=mime_type,
        size=size,
        title=title,
        annotations=annotations,
    )
    return cls(content=block)

text classmethod

text(
    text: str,
    *,
    audience: Audience | None = None,
    last_modified: datetime | str | None = None,
    priority: float | None = None,
) -> Self

Create a ToolCallContent containing text.

Parameters:

Name Type Description Default
text str

The text content.

required
audience Audience | None

The audience for the text.

None
last_modified datetime | str | None

The last modified date of the text.

None
priority float | None

The priority of the text.

None
Source code in src/aclientp/schema/tool_call.py
@classmethod
def text(
    cls,
    text: str,
    *,
    audience: Audience | None = None,
    last_modified: datetime | str | None = None,
    priority: float | None = None,
) -> Self:
    """Create a ToolCallContent containing text.

    Args:
        text: The text content.
        audience: The audience for the text.
        last_modified: The last modified date of the text.
        priority: The priority of the text.
    """
    annotations = Annotations.optionally_create(
        audience=audience,
        last_modified=last_modified,
        priority=priority,
    )
    return cls(content=TextContentBlock(text=text, annotations=annotations))

Cost

Bases: AnnotatedObject

Cost information for a session.

Source code in src/aclientp/schema/session_updates.py
class Cost(AnnotatedObject):
    """Cost information for a session."""

    amount: float
    """Total cumulative cost for session."""

    currency: str
    """Unit of ``amount``: an ISO 4217 currency code (e.g. ``USD``), or e.g. ``credits``."""

amount instance-attribute

amount: float

Total cumulative cost for session.

currency instance-attribute

currency: str

Unit of amount: an ISO 4217 currency code (e.g. USD), or e.g. credits.

CreateTerminalRequest

Bases: BaseAgentRequest

Request to create a new terminal and execute a command.

Source code in src/aclientp/schema/agent_requests.py
class CreateTerminalRequest(BaseAgentRequest):
    """Request to create a new terminal and execute a command."""

    args: Sequence[str] | None = None
    """Array of command arguments."""

    command: str
    """The command to execute."""

    cwd: str | None = None
    """Working directory for the command (absolute path)."""

    env: Sequence[EnvVariable] | None = None
    """Environment variables for the command."""

    output_byte_limit: int | None = Field(default=None, ge=0)
    """Maximum number of output bytes to retain.

    When the limit is exceeded, the Client truncates from the beginning of the output
    to stay within the limit.

    The Client MUST ensure truncation happens at a character boundary to maintain valid
    string output, even if this means the retained output is slightly less than the
    specified limit."""

args class-attribute instance-attribute

args: Sequence[str] | None = None

Array of command arguments.

command instance-attribute

command: str

The command to execute.

cwd class-attribute instance-attribute

cwd: str | None = None

Working directory for the command (absolute path).

env class-attribute instance-attribute

env: Sequence[EnvVariable] | None = None

Environment variables for the command.

output_byte_limit class-attribute instance-attribute

output_byte_limit: int | None = Field(default=None, ge=0)

Maximum number of output bytes to retain.

When the limit is exceeded, the Client truncates from the beginning of the output to stay within the limit.

The Client MUST ensure truncation happens at a character boundary to maintain valid string output, even if this means the retained output is slightly less than the specified limit.

CreateTerminalResponse

Bases: Response

Response containing the ID of the created terminal.

Source code in src/aclientp/schema/client_responses.py
class CreateTerminalResponse(Response):
    """Response containing the ID of the created terminal."""

    terminal_id: str
    """The unique identifier for the created terminal."""

terminal_id instance-attribute

terminal_id: str

The unique identifier for the created terminal.

CurrentModeUpdate

Bases: AnnotatedObject

The current mode of the session has changed.

See protocol docs: Session Modes

Source code in src/aclientp/schema/session_updates.py
class CurrentModeUpdate(AnnotatedObject):
    """The current mode of the session has changed.

    See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
    """

    current_mode_id: str
    """The ID of the current mode"""

    session_update: Literal["current_mode_update"] = Field(
        default="current_mode_update", init=False
    )

current_mode_id instance-attribute

current_mode_id: str

The ID of the current mode

CursorCapabilities

Bases: AnnotatedObject

UNSTABLE: The methods that currently accept a cursor.

Source code in src/aclientp/schema/cursors.py
class CursorCapabilities(AnnotatedObject):
    """**UNSTABLE**: The methods that currently accept a cursor."""

    fork: CursorForkCapabilities | None = None
    """``session/fork`` accepts this cursor. ``None`` means unsupported."""

fork class-attribute instance-attribute

fork: CursorForkCapabilities | None = None

session/fork accepts this cursor. None means unsupported.

CursorForkCapabilities

Bases: AnnotatedObject

UNSTABLE: The cursor can be passed to session/fork as cursorId.

Source code in src/aclientp/schema/cursors.py
class CursorForkCapabilities(AnnotatedObject):
    """**UNSTABLE**: The cursor can be passed to ``session/fork`` as ``cursorId``."""

CursorMessageAnchor

Bases: AnnotatedObject

UNSTABLE: A cursor anchored to a message; type names the kind of message.

Source code in src/aclientp/schema/cursors.py
class CursorMessageAnchor(AnnotatedObject):
    """**UNSTABLE**: A cursor anchored to a message; ``type`` names the kind of message."""

    message_id: str
    """The ID of the anchored message."""

    position: CursorAnchorPosition
    """On which side of the message the cursor is."""

message_id instance-attribute

message_id: str

The ID of the anchored message.

position instance-attribute

On which side of the message the cursor is.

CursorUpdate

Bases: AnnotatedObject

UNSTABLE: A session cursor was announced or its capabilities changed.

Upserts by cursor_id. The first update for a cursor MUST include anchor, which is fixed afterwards; later updates change only capabilities. Only sent if the client advertised session.cursors.

Source code in src/aclientp/schema/session_updates.py
class CursorUpdate(AnnotatedObject):
    """**UNSTABLE**: A session cursor was announced or its capabilities changed.

    Upserts by ``cursor_id``. The first update for a cursor MUST include ``anchor``,
    which is fixed afterwards; later updates change only ``capabilities``.
    Only sent if the client advertised ``session.cursors``.
    """

    session_update: Literal["cursor_update"] = Field(default="cursor_update", init=False)

    cursor_id: CursorId
    """The Agent-owned ID of this cursor, unique within the session."""

    anchor: CursorAnchor | None = None
    """Where the cursor is. Required on the first update for a cursor."""

    capabilities: CursorCapabilities | None = None
    """The methods that currently accept this cursor; a new cursor starts with none."""

anchor class-attribute instance-attribute

anchor: CursorAnchor | None = None

Where the cursor is. Required on the first update for a cursor.

capabilities class-attribute instance-attribute

capabilities: CursorCapabilities | None = None

The methods that currently accept this cursor; a new cursor starts with none.

cursor_id instance-attribute

cursor_id: CursorId

The Agent-owned ID of this cursor, unique within the session.

CustomRequest

Bases: Request

Request for custom/extension methods.

Source code in src/aclientp/schema/client_requests.py
class CustomRequest(Request):
    """Request for custom/extension methods."""

    method: str
    """The custom method name (without underscore prefix)."""

    data: dict[str, Any]
    """The method parameters."""

data instance-attribute

data: dict[str, Any]

The method parameters.

method instance-attribute

method: str

The custom method name (without underscore prefix).

CustomResponse

Bases: Response

Response for custom/extension methods.

Source code in src/aclientp/schema/agent_responses.py
class CustomResponse(Response):
    """Response for custom/extension methods."""

    data: dict[str, Any] | None = None
    """The method result data."""

data class-attribute instance-attribute

data: dict[str, Any] | None = None

The method result data.

DeleteSessionRequest

Bases: Request

Request parameters for deleting a session from session/list.

Only available if the Agent supports the session.delete capability.

Source code in src/aclientp/schema/client_requests.py
class DeleteSessionRequest(Request):
    """Request parameters for deleting a session from ``session/list``.

    Only available if the Agent supports the ``session.delete`` capability.
    """

    session_id: str
    """The ID of the session to delete."""

session_id instance-attribute

session_id: str

The ID of the session to delete.

DeleteSessionResponse

Bases: Response

Response to session/delete.

Source code in src/aclientp/schema/agent_responses.py
class DeleteSessionResponse(Response):
    """Response to ``session/delete``."""

DeniedOutcome

Bases: Schema

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

Source code in src/aclientp/schema/tool_call.py
class DeniedOutcome(Schema):
    """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](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)
    """

    outcome: Literal["cancelled"] = Field(default="cancelled", init=False)

DisableProviderRequest

Bases: Request

Disable a non-required provider.

Source code in src/aclientp/schema/providers.py
class DisableProviderRequest(Request):
    """Disable a non-required provider."""

    provider_id: ProviderId
    """Provider ID to disable."""

provider_id instance-attribute

provider_id: ProviderId

Provider ID to disable.

DisableProviderResponse

Bases: Response

Response to providers/disable.

Source code in src/aclientp/schema/providers.py
class DisableProviderResponse(Response):
    """Response to ``providers/disable``."""

ElicitationCapabilities

Bases: AnnotatedObject

Elicitation capabilities supported by the client.

Source code in src/aclientp/schema/elicitation.py
class ElicitationCapabilities(AnnotatedObject):
    """Elicitation capabilities supported by the client."""

    form: ElicitationFormCapabilities | None = None
    """Whether the client supports form-based elicitation."""

    url: ElicitationUrlCapabilities | None = None
    """Whether the client supports URL-based elicitation."""

form class-attribute instance-attribute

form: ElicitationFormCapabilities | None = None

Whether the client supports form-based elicitation.

url class-attribute instance-attribute

url: ElicitationUrlCapabilities | None = None

Whether the client supports URL-based elicitation.

ElicitationCompleteNotification

Bases: AnnotatedObject

Notification sent by the agent when a URL-based elicitation is complete.

Source code in src/aclientp/schema/elicitation.py
class ElicitationCompleteNotification(AnnotatedObject):
    """Notification sent by the agent when a URL-based elicitation is complete."""

    elicitation_id: str
    """The ID of the elicitation that completed."""

elicitation_id instance-attribute

elicitation_id: str

The ID of the elicitation that completed.

ElicitationFormCapabilities

Bases: AnnotatedObject

Form-based elicitation capabilities.

Source code in src/aclientp/schema/elicitation.py
class ElicitationFormCapabilities(AnnotatedObject):
    """Form-based elicitation capabilities."""

ElicitationRequest

Bases: Request

Request from the agent to elicit structured user input (elicitation/create).

The agent sends this to the client to request information from the user, either via a form or by directing them to a URL.

Mode and scope fields are flattened into the request on the wire:

  • mode: "form" carries requested_schema.
  • mode: "url" carries elicitation_id and url.
  • Session scope sets session_id (and optionally tool_call_id), request scope sets request_id (e.g. during auth before any session exists).
Source code in src/aclientp/schema/elicitation.py
class ElicitationRequest(Request):
    """Request from the agent to elicit structured user input (``elicitation/create``).

    The agent sends this to the client to request information from the user,
    either via a form or by directing them to a URL.

    Mode and scope fields are flattened into the request on the wire:

    - ``mode: "form"`` carries ``requested_schema``.
    - ``mode: "url"`` carries ``elicitation_id`` and ``url``.
    - Session scope sets ``session_id`` (and optionally ``tool_call_id``),
      request scope sets ``request_id`` (e.g. during auth before any session exists).
    """

    message: str
    """A human-readable message describing what input is needed."""

    mode: ElicitationModeType
    """The elicitation mode."""

    requested_schema: ElicitationSchema | None = None
    """Form mode: a JSON Schema describing the form fields to present to the user."""

    elicitation_id: str | None = None
    """URL mode: the unique identifier for this elicitation."""

    url: str | None = None
    """URL mode: the URL to direct the user to."""

    session_id: str | None = None
    """Session scope: the session this elicitation is tied to."""

    tool_call_id: str | None = None
    """Session scope: optional tool call within the session."""

    request_id: int | str | None = None
    """Request scope: the JSON-RPC request this elicitation is tied to."""

    @classmethod
    def form(
        cls,
        message: str,
        schema: ElicitationSchema,
        *,
        session_id: str | None = None,
        tool_call_id: str | None = None,
        request_id: int | str | None = None,
    ) -> Self:
        """Create a form-based elicitation request."""
        return cls(
            message=message,
            mode="form",
            requested_schema=schema,
            session_id=session_id,
            tool_call_id=tool_call_id,
            request_id=request_id,
        )

    @classmethod
    def url_based(
        cls,
        message: str,
        elicitation_id: str,
        url: str,
        *,
        session_id: str | None = None,
        tool_call_id: str | None = None,
        request_id: int | str | None = None,
    ) -> Self:
        """Create a URL-based elicitation request."""
        return cls(
            message=message,
            mode="url",
            elicitation_id=elicitation_id,
            url=url,
            session_id=session_id,
            tool_call_id=tool_call_id,
            request_id=request_id,
        )

elicitation_id class-attribute instance-attribute

elicitation_id: str | None = None

URL mode: the unique identifier for this elicitation.

message instance-attribute

message: str

A human-readable message describing what input is needed.

mode instance-attribute

The elicitation mode.

request_id class-attribute instance-attribute

request_id: int | str | None = None

Request scope: the JSON-RPC request this elicitation is tied to.

requested_schema class-attribute instance-attribute

requested_schema: ElicitationSchema | None = None

Form mode: a JSON Schema describing the form fields to present to the user.

session_id class-attribute instance-attribute

session_id: str | None = None

Session scope: the session this elicitation is tied to.

tool_call_id class-attribute instance-attribute

tool_call_id: str | None = None

Session scope: optional tool call within the session.

url class-attribute instance-attribute

url: str | None = None

URL mode: the URL to direct the user to.

form classmethod

form(
    message: str,
    schema: ElicitationSchema,
    *,
    session_id: str | None = None,
    tool_call_id: str | None = None,
    request_id: int | str | None = None,
) -> Self

Create a form-based elicitation request.

Source code in src/aclientp/schema/elicitation.py
@classmethod
def form(
    cls,
    message: str,
    schema: ElicitationSchema,
    *,
    session_id: str | None = None,
    tool_call_id: str | None = None,
    request_id: int | str | None = None,
) -> Self:
    """Create a form-based elicitation request."""
    return cls(
        message=message,
        mode="form",
        requested_schema=schema,
        session_id=session_id,
        tool_call_id=tool_call_id,
        request_id=request_id,
    )

url_based classmethod

url_based(
    message: str,
    elicitation_id: str,
    url: str,
    *,
    session_id: str | None = None,
    tool_call_id: str | None = None,
    request_id: int | str | None = None,
) -> Self

Create a URL-based elicitation request.

Source code in src/aclientp/schema/elicitation.py
@classmethod
def url_based(
    cls,
    message: str,
    elicitation_id: str,
    url: str,
    *,
    session_id: str | None = None,
    tool_call_id: str | None = None,
    request_id: int | str | None = None,
) -> Self:
    """Create a URL-based elicitation request."""
    return cls(
        message=message,
        mode="url",
        elicitation_id=elicitation_id,
        url=url,
        session_id=session_id,
        tool_call_id=tool_call_id,
        request_id=request_id,
    )

ElicitationResponse

Bases: Response

Response from the client to an elicitation request.

Source code in src/aclientp/schema/elicitation.py
class ElicitationResponse(Response):
    """Response from the client to an elicitation request."""

    action: ElicitationActionType
    """The user's action."""

    content: dict[str, ElicitationContentValue] | None = None
    """For ``accept``: the user-provided content, as an object matching the requested schema."""

    @classmethod
    def accept(cls, content: dict[str, ElicitationContentValue] | None = None) -> Self:
        return cls(action="accept", content=content)

    @classmethod
    def decline(cls) -> Self:
        return cls(action="decline")

    @classmethod
    def cancel(cls) -> Self:
        return cls(action="cancel")

action instance-attribute

The user's action.

content class-attribute instance-attribute

content: dict[str, ElicitationContentValue] | None = None

For accept: the user-provided content, as an object matching the requested schema.

ElicitationSchema

Bases: AnnotatedObject

Type-safe elicitation schema for requesting structured user input.

This represents a JSON Schema object with primitive-typed properties, as required by the elicitation specification.

Source code in src/aclientp/schema/elicitation.py
class ElicitationSchema(AnnotatedObject):
    """Type-safe elicitation schema for requesting structured user input.

    This represents a JSON Schema object with primitive-typed properties,
    as required by the elicitation specification.
    """

    type: Literal["object"] = "object"
    """Type discriminator. Always ``"object"``."""

    title: str | None = None
    """Optional title for the schema."""

    description: str | None = None
    """Optional description of what this schema represents."""

    properties: dict[str, ElicitationPropertySchema] = Field(default_factory=dict)
    """Property definitions (must be primitive types)."""

    required: Sequence[str] | None = None
    """List of required property names."""

description class-attribute instance-attribute

description: str | None = None

Optional description of what this schema represents.

properties class-attribute instance-attribute

properties: dict[str, ElicitationPropertySchema] = Field(default_factory=dict)

Property definitions (must be primitive types).

required class-attribute instance-attribute

required: Sequence[str] | None = None

List of required property names.

title class-attribute instance-attribute

title: str | None = None

Optional title for the schema.

type class-attribute instance-attribute

type: Literal['object'] = 'object'

Type discriminator. Always "object".

ElicitationUrlCapabilities

Bases: AnnotatedObject

URL-based elicitation capabilities.

Source code in src/aclientp/schema/elicitation.py
class ElicitationUrlCapabilities(AnnotatedObject):
    """URL-based elicitation capabilities."""

EmbeddedResourceContentBlock

Bases: BaseContentBlock

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.

Source code in src/aclientp/schema/content_blocks.py
class EmbeddedResourceContentBlock(BaseContentBlock):
    """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.
    """

    type: Literal["resource"] = Field(default="resource", init=False)

    resource: ResourceContents
    """Resource content that can be embedded in a message."""

resource instance-attribute

resource: ResourceContents

Resource content that can be embedded in a message.

EnumOption

Bases: AnnotatedObject

A titled enum option with a const value, human-readable title and optional description.

Source code in src/aclientp/schema/elicitation.py
class EnumOption(AnnotatedObject):
    """A titled enum option with a const value, human-readable title and optional description."""

    const: str
    """The constant value for this option."""

    title: str
    """Human-readable title for this option."""

    description: str | None = None
    """Human-readable description."""

const instance-attribute

const: str

The constant value for this option.

description class-attribute instance-attribute

description: str | None = None

Human-readable description.

title instance-attribute

title: str

Human-readable title for this option.

EnvVariable

Bases: AnnotatedObject

An environment variable to set when launching an MCP server.

Source code in src/aclientp/schema/common.py
class EnvVariable(AnnotatedObject):
    """An environment variable to set when launching an MCP server."""

    name: str
    """The name of the environment variable."""

    value: str
    """The value to set for the environment variable."""

name instance-attribute

name: str

The name of the environment variable.

value instance-attribute

value: str

The value to set for the environment variable.

Error

Bases: Schema

JSON-RPC error object.

Represents an error that occurred during method execution, following the JSON-RPC 2.0 error object specification with optional additional data.

See protocol docs: JSON-RPC Error Object

Source code in src/aclientp/schema/common.py
class Error(Schema):
    """JSON-RPC error object.

    Represents an error that occurred during method execution, following the
    JSON-RPC 2.0 error object specification with optional additional data.

    See protocol docs: [JSON-RPC Error Object](https://www.jsonrpc.org/specification#error_object)
    """

    code: ErrorCode
    """A number indicating the error type that occurred.

    This must be an integer as defined in the JSON-RPC specification.
    """

    data: Any | None = None
    """Optional primitive or structured value that contains additional errorinformation.

    This may include debugging information or context-specific details.
    """

    message: str
    """A string providing a short description of the error.

    The message should be limited to a concise single sentence.
    """

code instance-attribute

code: ErrorCode

A number indicating the error type that occurred.

This must be an integer as defined in the JSON-RPC specification.

data class-attribute instance-attribute

data: Any | None = None

Optional primitive or structured value that contains additional errorinformation.

This may include debugging information or context-specific details.

message instance-attribute

message: str

A string providing a short description of the error.

The message should be limited to a concise single sentence.

ExtNotification

Bases: AnnotatedObject

Extension notification from client or agent.

Allows sending arbitrary notifications that are not part of the ACP spec. Extension notifications provide a way to send one-way messages for custom functionality while maintaining protocol compatibility.

The method name should be prefixed with an underscore (e.g., _myExtension/notify).

See protocol docs: Extensibility

Source code in src/aclientp/schema/notifications.py
class ExtNotification(AnnotatedObject):
    """Extension notification from client or agent.

    Allows sending arbitrary notifications that are not part of the ACP spec.
    Extension notifications provide a way to send one-way messages for custom
    functionality while maintaining protocol compatibility.

    The method name should be prefixed with an underscore (e.g., `_myExtension/notify`).

    See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
    """

    method: str
    """The extension method name (should be prefixed with underscore)."""

    params: dict[str, Any] | None = None
    """Optional parameters for the notification."""

method instance-attribute

method: str

The extension method name (should be prefixed with underscore).

params class-attribute instance-attribute

params: dict[str, Any] | None = None

Optional parameters for the notification.

FileEditToolCallContent

Bases: AnnotatedObject

File modification shown as a diff.

Source code in src/aclientp/schema/tool_call.py
class FileEditToolCallContent(AnnotatedObject):
    """File modification shown as a diff."""

    type: Literal["diff"] = Field(default="diff", init=False)
    """File modification shown as a diff."""

    new_text: str
    """The new content after modification."""

    old_text: str | None = None
    """The original content (None for new files)."""

    path: str
    """The file path being modified."""

new_text instance-attribute

new_text: str

The new content after modification.

old_text class-attribute instance-attribute

old_text: str | None = None

The original content (None for new files).

path instance-attribute

path: str

The file path being modified.

type class-attribute instance-attribute

type: Literal['diff'] = Field(default='diff', init=False)

File modification shown as a diff.

FileSystemCapabilities

Bases: AnnotatedObject

File system capabilities that a client may support.

See protocol docs: FileSystem

Source code in src/aclientp/schema/capabilities.py
class FileSystemCapabilities(AnnotatedObject):
    """File system capabilities that a client may support.

    See protocol docs: [FileSystem](https://agentclientprotocol.com/protocol/initialization#filesystem)
    """

    read_text_file: bool | None = False
    """Whether the Client supports `fs/read_text_file` requests."""

    write_text_file: bool | None = False
    """Whether the Client supports `fs/write_text_file` requests."""

read_text_file class-attribute instance-attribute

read_text_file: bool | None = False

Whether the Client supports fs/read_text_file requests.

write_text_file class-attribute instance-attribute

write_text_file: bool | None = False

Whether the Client supports fs/write_text_file requests.

ForkSessionRequest

Bases: SessionSetupRequest

UNSTABLE: Request parameters for forking an existing session.

Creates a new, active session based on the context of an existing one.

Only available if the Agent supports the session.fork capability.

Source code in src/aclientp/schema/client_requests.py
class ForkSessionRequest(SessionSetupRequest):
    """**UNSTABLE**: Request parameters for forking an existing session.

    Creates a new, active session based on the context of an existing one.

    Only available if the Agent supports the `session.fork` capability.
    """

    session_id: str
    """The ID of the session to fork."""

    cursor_id: str | None = None
    """**UNSTABLE**: Fork at this session cursor instead of the end of the session.

    The new session's history is the source history before the cursor. Only IDs of
    cursors announced on the source session that currently advertise
    ``capabilities.fork`` are valid; Agents reject others with ``-32602``.
    """

cursor_id class-attribute instance-attribute

cursor_id: str | None = None

UNSTABLE: Fork at this session cursor instead of the end of the session.

The new session's history is the source history before the cursor. Only IDs of cursors announced on the source session that currently advertise capabilities.fork are valid; Agents reject others with -32602.

session_id instance-attribute

session_id: str

The ID of the session to fork.

ForkSessionResponse

Bases: Response

UNSTABLE: Response from forking an existing session.

Source code in src/aclientp/schema/agent_responses.py
class ForkSessionResponse(Response):
    """**UNSTABLE**: Response from forking an existing session."""

    modes: SessionModeState | None = None
    """Initial mode state if supported by the Agent

    See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
    """

    session_id: str
    """Unique identifier for the newly created forked session."""

    config_options: Sequence[SessionConfigOption] | None = None
    """The full list of config options with updated values."""

    @classmethod
    def create(
        cls,
        session_id: str,
        config_options: Sequence[SessionConfigOption] | None = None,
        modes: Sequence[SessionMode] | None = None,
        current_mode: str | None = None,
    ) -> Self:
        """Create a response with the given session ID and config options."""
        return cls(
            session_id=session_id,
            config_options=config_options or [],
            modes=_mode_state(modes, current_mode),
        )

config_options class-attribute instance-attribute

config_options: Sequence[SessionConfigOption] | None = None

The full list of config options with updated values.

modes class-attribute instance-attribute

modes: SessionModeState | None = None

Initial mode state if supported by the Agent

See protocol docs: Session Modes

session_id instance-attribute

session_id: str

Unique identifier for the newly created forked session.

create classmethod

create(
    session_id: str,
    config_options: Sequence[SessionConfigOption] | None = None,
    modes: Sequence[SessionMode] | None = None,
    current_mode: str | None = None,
) -> Self

Create a response with the given session ID and config options.

Source code in src/aclientp/schema/agent_responses.py
@classmethod
def create(
    cls,
    session_id: str,
    config_options: Sequence[SessionConfigOption] | None = None,
    modes: Sequence[SessionMode] | None = None,
    current_mode: str | None = None,
) -> Self:
    """Create a response with the given session ID and config options."""
    return cls(
        session_id=session_id,
        config_options=config_options or [],
        modes=_mode_state(modes, current_mode),
    )

HttpHeader

Bases: AnnotatedObject

An HTTP header to set when making requests to the MCP server.

Source code in src/aclientp/schema/mcp.py
class HttpHeader(AnnotatedObject):
    """An HTTP header to set when making requests to the MCP server."""

    name: str
    """The name of the HTTP header."""

    value: str
    """The value to set for the HTTP header."""

name instance-attribute

name: str

The name of the HTTP header.

value instance-attribute

value: str

The value to set for the HTTP header.

HttpMcpServer

Bases: BaseMcpServer

HTTP transport configuration.

Only available when the Agent capabilities indicate mcp_capabilities.http is true.

Source code in src/aclientp/schema/mcp.py
class HttpMcpServer(BaseMcpServer):
    """HTTP transport configuration.

    Only available when the Agent capabilities indicate `mcp_capabilities.http` is `true`.
    """

    headers: Sequence[HttpHeader] = Field(default_factory=list)
    """HTTP headers to set when making requests to the MCP server."""

    type: Literal["http"] = Field(default="http", init=False)
    """HTTP transport type."""

    url: HttpUrl
    """URL to the MCP server."""

    def get_headers_dict(self) -> dict[str, str]:
        return {header.name: header.value for header in self.headers}

headers class-attribute instance-attribute

headers: Sequence[HttpHeader] = Field(default_factory=list)

HTTP headers to set when making requests to the MCP server.

type class-attribute instance-attribute

type: Literal['http'] = Field(default='http', init=False)

HTTP transport type.

url instance-attribute

url: HttpUrl

URL to the MCP server.

IdleStateUpdate

Bases: AnnotatedObject

UNSTABLE: The child is ready to process another prompt.

Source code in src/aclientp/schema/session_updates.py
class IdleStateUpdate(AnnotatedObject):
    """**UNSTABLE**: The child is ready to process another prompt."""

    state: Literal["idle"] = Field(default="idle", init=False)

    stop_reason: (
        Literal["end_turn", "max_tokens", "max_turn_requests", "refusal", "cancelled", "error"]
        | str
        | None
    ) = None
    """Why foreground work stopped. Omitted when there is no stop reason."""

    error: Error | None = None
    """For ``stop_reason: "error"``: the failure, as a JSON-RPC error object."""

    usage: Usage | None = None
    """Token usage for completed foreground work."""

error class-attribute instance-attribute

error: Error | None = None

For stop_reason: "error": the failure, as a JSON-RPC error object.

stop_reason class-attribute instance-attribute

stop_reason: (
    Literal["end_turn", "max_tokens", "max_turn_requests", "refusal", "cancelled", "error"]
    | str
    | None
) = None

Why foreground work stopped. Omitted when there is no stop reason.

usage class-attribute instance-attribute

usage: Usage | None = None

Token usage for completed foreground work.

ImageContentBlock

Bases: BaseContentBlock

Images for visual context or analysis.

Requires the image prompt capability when included in prompts.

Source code in src/aclientp/schema/content_blocks.py
class ImageContentBlock(BaseContentBlock):
    """Images for visual context or analysis.

    Requires the `image` prompt capability when included in prompts.
    """

    type: Literal["image"] = Field(default="image", init=False)

    data: str
    """Base64-encoded image data."""

    mime_type: str
    """MIME type of the image."""

    uri: str | None = None
    """URI of the image."""

data instance-attribute

data: str

Base64-encoded image data.

mime_type instance-attribute

mime_type: str

MIME type of the image.

uri class-attribute instance-attribute

uri: str | None = None

URI of the image.

Implementation

Bases: AnnotatedObject

Describes the name and version of an ACP implementation.

Includes an optional title for UI representation.

Source code in src/aclientp/schema/common.py
class Implementation(AnnotatedObject):
    """Describes the name and version of an ACP implementation.

    Includes an optional title for UI representation.
    """

    name: str
    """Intended for programmatic or logical use.

    Can be used as a display name fallback if title isn't present."""

    title: str | None = None
    """Intended for UI and end-user contexts.

    Optimized to be human-readable and easily understood.
    If not provided, the name should be used for display."""

    version: str
    """Version of the implementation.

    Can be displayed to the user or used for debugging or metrics purposes."""

name instance-attribute

name: str

Intended for programmatic or logical use.

Can be used as a display name fallback if title isn't present.

title class-attribute instance-attribute

title: str | None = None

Intended for UI and end-user contexts.

Optimized to be human-readable and easily understood. If not provided, the name should be used for display.

version instance-attribute

version: str

Version of the implementation.

Can be displayed to the user or used for debugging or metrics purposes.

InitialSessionConfigOption

Bases: AnnotatedObject

UNSTABLE: A config option value to apply when a session is set up.

Sent on session/new, session/load, session/resume and session/fork. When type is "boolean", value is a bool, otherwise a value ID string.

Source code in src/aclientp/schema/config_options.py
class InitialSessionConfigOption(AnnotatedObject):
    """**UNSTABLE**: A config option value to apply when a session is set up.

    Sent on ``session/new``, ``session/load``, ``session/resume`` and ``session/fork``.
    When ``type`` is ``"boolean"``, ``value`` is a bool, otherwise a value ID string.
    """

    config_id: SessionConfigId
    """The ID of the configuration option to set."""

    type: Literal["boolean"] | None = None
    """The value type discriminator. ``"boolean"`` for bool values, absent for value IDs."""

    value: SessionConfigValueId | bool
    """The value to set."""

config_id instance-attribute

config_id: SessionConfigId

The ID of the configuration option to set.

type class-attribute instance-attribute

type: Literal['boolean'] | None = None

The value type discriminator. "boolean" for bool values, absent for value IDs.

value instance-attribute

value: SessionConfigValueId | bool

The value to set.

InitializeProxyRequest

Bases: InitializeRequest

Request parameters for proxy/initialize. Same as initialize.

Source code in src/aclientp/schema/proxy.py
class InitializeProxyRequest(InitializeRequest):
    """Request parameters for ``proxy/initialize``. Same as ``initialize``."""

InitializeProxyResponse

Bases: InitializeResponse

Response to proxy/initialize. Same as the initialize response.

The proxy MUST NOT change protocol_version.

Source code in src/aclientp/schema/proxy.py
class InitializeProxyResponse(InitializeResponse):
    """Response to ``proxy/initialize``. Same as the ``initialize`` response.

    The proxy MUST NOT change ``protocol_version``.
    """

InitializeRequest

Bases: Request

Request parameters for the initialize method.

Sent by the client to establish connection and negotiate capabilities.

See protocol docs: Initialization

Source code in src/aclientp/schema/client_requests.py
class InitializeRequest(Request):
    """Request parameters for the initialize method.

    Sent by the client to establish connection and negotiate capabilities.

    See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)
    """

    client_capabilities: ClientCapabilities | None = Field(default_factory=ClientCapabilities)
    """Capabilities supported by the client."""

    client_info: Implementation | None = None
    """Information about the Client name and version sent to the Agent.

    Note: in future versions of the protocol, this will be required.
    """

    protocol_version: int
    """The latest protocol version supported by the client."""

    @classmethod
    def create(
        cls,
        title: str,
        name: str,
        version: str,
        terminal: bool = True,
        read_text_file: bool = True,
        write_text_file: bool = True,
        protocol_version: int = 1,
        terminal_auth: bool = False,
        prompt_suggestions: bool = False,
        compaction: bool = False,
        notices: bool = False,
        metadata: dict[str, Any] | None = None,
    ) -> Self:
        """Create a new InitializeRequest instance."""
        fs = FileSystemCapabilities(read_text_file=read_text_file, write_text_file=write_text_file)
        auth = AuthCapabilities(terminal=terminal_auth) if terminal_auth else None
        session = ClientSessionCapabilities(
            prompt_suggestions=PromptSuggestionsCapabilities() if prompt_suggestions else None,
            compaction=CompactionCapabilities() if compaction else None,
            notices=NoticeCapabilities() if notices else None,
        )
        caps = ClientCapabilities(terminal=terminal, fs=fs, auth=auth, session=session)
        impl = Implementation(title=title, name=name, version=version)
        return cls(
            client_capabilities=caps,
            client_info=impl,
            protocol_version=protocol_version,
            field_meta=metadata,
        )

    @classmethod
    def create_for_package(
        cls,
        package_name: str,
        allow_terminal: bool = True,
        allow_file_operations: bool = True,
        terminal_auth: bool = False,
        prompt_suggestions: bool = False,
        compaction: bool = False,
        notices: bool = False,
        metadata: dict[str, Any] | None = None,
    ) -> InitializeRequest:
        """Create ACP initialize request for app with given name (based on pkg metadata)."""
        from importlib.metadata import metadata as _metadata

        pkg_meta = _metadata(package_name)
        return cls.create(
            title=pkg_meta["Name"],
            version=pkg_meta["Version"],
            name=package_name,
            protocol_version=1,
            terminal=allow_terminal,
            read_text_file=allow_file_operations,
            write_text_file=allow_file_operations,
            terminal_auth=terminal_auth,
            prompt_suggestions=prompt_suggestions,
            compaction=compaction,
            notices=notices,
            metadata=metadata,
        )

client_capabilities class-attribute instance-attribute

client_capabilities: ClientCapabilities | None = Field(default_factory=ClientCapabilities)

Capabilities supported by the client.

client_info class-attribute instance-attribute

client_info: Implementation | None = None

Information about the Client name and version sent to the Agent.

Note: in future versions of the protocol, this will be required.

protocol_version instance-attribute

protocol_version: int

The latest protocol version supported by the client.

create classmethod

create(
    title: str,
    name: str,
    version: str,
    terminal: bool = True,
    read_text_file: bool = True,
    write_text_file: bool = True,
    protocol_version: int = 1,
    terminal_auth: bool = False,
    prompt_suggestions: bool = False,
    compaction: bool = False,
    notices: bool = False,
    metadata: dict[str, Any] | None = None,
) -> Self

Create a new InitializeRequest instance.

Source code in src/aclientp/schema/client_requests.py
@classmethod
def create(
    cls,
    title: str,
    name: str,
    version: str,
    terminal: bool = True,
    read_text_file: bool = True,
    write_text_file: bool = True,
    protocol_version: int = 1,
    terminal_auth: bool = False,
    prompt_suggestions: bool = False,
    compaction: bool = False,
    notices: bool = False,
    metadata: dict[str, Any] | None = None,
) -> Self:
    """Create a new InitializeRequest instance."""
    fs = FileSystemCapabilities(read_text_file=read_text_file, write_text_file=write_text_file)
    auth = AuthCapabilities(terminal=terminal_auth) if terminal_auth else None
    session = ClientSessionCapabilities(
        prompt_suggestions=PromptSuggestionsCapabilities() if prompt_suggestions else None,
        compaction=CompactionCapabilities() if compaction else None,
        notices=NoticeCapabilities() if notices else None,
    )
    caps = ClientCapabilities(terminal=terminal, fs=fs, auth=auth, session=session)
    impl = Implementation(title=title, name=name, version=version)
    return cls(
        client_capabilities=caps,
        client_info=impl,
        protocol_version=protocol_version,
        field_meta=metadata,
    )

create_for_package classmethod

create_for_package(
    package_name: str,
    allow_terminal: bool = True,
    allow_file_operations: bool = True,
    terminal_auth: bool = False,
    prompt_suggestions: bool = False,
    compaction: bool = False,
    notices: bool = False,
    metadata: dict[str, Any] | None = None,
) -> InitializeRequest

Create ACP initialize request for app with given name (based on pkg metadata).

Source code in src/aclientp/schema/client_requests.py
@classmethod
def create_for_package(
    cls,
    package_name: str,
    allow_terminal: bool = True,
    allow_file_operations: bool = True,
    terminal_auth: bool = False,
    prompt_suggestions: bool = False,
    compaction: bool = False,
    notices: bool = False,
    metadata: dict[str, Any] | None = None,
) -> InitializeRequest:
    """Create ACP initialize request for app with given name (based on pkg metadata)."""
    from importlib.metadata import metadata as _metadata

    pkg_meta = _metadata(package_name)
    return cls.create(
        title=pkg_meta["Name"],
        version=pkg_meta["Version"],
        name=package_name,
        protocol_version=1,
        terminal=allow_terminal,
        read_text_file=allow_file_operations,
        write_text_file=allow_file_operations,
        terminal_auth=terminal_auth,
        prompt_suggestions=prompt_suggestions,
        compaction=compaction,
        notices=notices,
        metadata=metadata,
    )

InitializeResponse

Bases: Response

Response from the initialize method.

Contains the negotiated protocol version and agent capabilities.

See protocol docs: Initialization

Source code in src/aclientp/schema/agent_responses.py
class InitializeResponse(Response):
    """Response from the initialize method.

    Contains the negotiated protocol version and agent capabilities.

    See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)
    """

    agent_capabilities: AgentCapabilities | None = Field(default_factory=AgentCapabilities)
    """Capabilities supported by the agent."""

    agent_info: Implementation | None = None
    """Information about the Agent name and version sent to the Client.


    Note: in future versions of the protocol, this will be required."""

    auth_methods: Sequence[AuthMethod] | None = Field(default_factory=list)
    """Authentication methods supported by the agent."""

    protocol_version: int = Field(ge=0, le=65535)
    """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.
    """

    @classmethod
    def create(
        cls,
        name: str,
        title: str,
        version: str,
        protocol_version: int,
        load_session: bool | None = False,
        http_mcp_servers: bool = False,
        sse_mcp_servers: bool = False,
        audio_prompts: bool = False,
        embedded_context_prompts: bool = False,
        image_prompts: bool = False,
        list_sessions: bool = False,
        resume_session: bool = False,
        close_session: bool = False,
        auth_methods: Sequence[AuthMethod] | None = None,
    ) -> Self:
        """Create an instance of AgentCapabilities.

        Args:
            name: The name of the agent.
            title: The title of the agent.
            version: The version of the agent.
            protocol_version: The protocol version of the agent.
            load_session: Whether the agent supports `session/load`.
            http_mcp_servers: Whether the agent supports HTTP MCP servers.
            sse_mcp_servers: Whether the agent supports SSE MCP servers.
            audio_prompts: Whether the agent supports audio prompts.
            embedded_context_prompts: Whether the agent supports embedded context prompts.
            image_prompts: Whether the agent supports image prompts.
            list_sessions: Whether the agent supports `session/list`.
            resume_session: Whether the agent supports `session/resume`.
            close_session: Whether the agent supports `session/close`.
            auth_methods: The authentication methods supported by the agent.
        """
        caps = AgentCapabilities.create(
            load_session=load_session,
            http_mcp_servers=http_mcp_servers,
            sse_mcp_servers=sse_mcp_servers,
            audio_prompts=audio_prompts,
            embedded_context_prompts=embedded_context_prompts,
            image_prompts=image_prompts,
            list_sessions=list_sessions,
            resume_session=resume_session,
            close_session=close_session,
        )
        return cls(
            agent_info=Implementation(name=name, title=title, version=version),
            protocol_version=protocol_version,
            agent_capabilities=caps,
            auth_methods=auth_methods,
        )

agent_capabilities class-attribute instance-attribute

agent_capabilities: AgentCapabilities | None = Field(default_factory=AgentCapabilities)

Capabilities supported by the agent.

agent_info class-attribute instance-attribute

agent_info: Implementation | None = None

Information about the Agent name and version sent to the Client.

Note: in future versions of the protocol, this will be required.

auth_methods class-attribute instance-attribute

auth_methods: Sequence[AuthMethod] | None = Field(default_factory=list)

Authentication methods supported by the agent.

protocol_version class-attribute instance-attribute

protocol_version: int = Field(ge=0, le=65535)

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.

create classmethod

create(
    name: str,
    title: str,
    version: str,
    protocol_version: int,
    load_session: bool | None = False,
    http_mcp_servers: bool = False,
    sse_mcp_servers: bool = False,
    audio_prompts: bool = False,
    embedded_context_prompts: bool = False,
    image_prompts: bool = False,
    list_sessions: bool = False,
    resume_session: bool = False,
    close_session: bool = False,
    auth_methods: Sequence[AuthMethod] | None = None,
) -> Self

Create an instance of AgentCapabilities.

Parameters:

Name Type Description Default
name str

The name of the agent.

required
title str

The title of the agent.

required
version str

The version of the agent.

required
protocol_version int

The protocol version of the agent.

required
load_session bool | None

Whether the agent supports session/load.

False
http_mcp_servers bool

Whether the agent supports HTTP MCP servers.

False
sse_mcp_servers bool

Whether the agent supports SSE MCP servers.

False
audio_prompts bool

Whether the agent supports audio prompts.

False
embedded_context_prompts bool

Whether the agent supports embedded context prompts.

False
image_prompts bool

Whether the agent supports image prompts.

False
list_sessions bool

Whether the agent supports session/list.

False
resume_session bool

Whether the agent supports session/resume.

False
close_session bool

Whether the agent supports session/close.

False
auth_methods Sequence[AuthMethod] | None

The authentication methods supported by the agent.

None
Source code in src/aclientp/schema/agent_responses.py
@classmethod
def create(
    cls,
    name: str,
    title: str,
    version: str,
    protocol_version: int,
    load_session: bool | None = False,
    http_mcp_servers: bool = False,
    sse_mcp_servers: bool = False,
    audio_prompts: bool = False,
    embedded_context_prompts: bool = False,
    image_prompts: bool = False,
    list_sessions: bool = False,
    resume_session: bool = False,
    close_session: bool = False,
    auth_methods: Sequence[AuthMethod] | None = None,
) -> Self:
    """Create an instance of AgentCapabilities.

    Args:
        name: The name of the agent.
        title: The title of the agent.
        version: The version of the agent.
        protocol_version: The protocol version of the agent.
        load_session: Whether the agent supports `session/load`.
        http_mcp_servers: Whether the agent supports HTTP MCP servers.
        sse_mcp_servers: Whether the agent supports SSE MCP servers.
        audio_prompts: Whether the agent supports audio prompts.
        embedded_context_prompts: Whether the agent supports embedded context prompts.
        image_prompts: Whether the agent supports image prompts.
        list_sessions: Whether the agent supports `session/list`.
        resume_session: Whether the agent supports `session/resume`.
        close_session: Whether the agent supports `session/close`.
        auth_methods: The authentication methods supported by the agent.
    """
    caps = AgentCapabilities.create(
        load_session=load_session,
        http_mcp_servers=http_mcp_servers,
        sse_mcp_servers=sse_mcp_servers,
        audio_prompts=audio_prompts,
        embedded_context_prompts=embedded_context_prompts,
        image_prompts=image_prompts,
        list_sessions=list_sessions,
        resume_session=resume_session,
        close_session=close_session,
    )
    return cls(
        agent_info=Implementation(name=name, title=title, version=version),
        protocol_version=protocol_version,
        agent_capabilities=caps,
        auth_methods=auth_methods,
    )

IntegerPropertySchema

Bases: AnnotatedObject

Schema for integer properties in an elicitation form.

Source code in src/aclientp/schema/elicitation.py
class IntegerPropertySchema(AnnotatedObject):
    """Schema for integer properties in an elicitation form."""

    type: Literal["integer"] = "integer"
    """Type discriminator."""

    title: str | None = None
    """Optional title for the property."""

    description: str | None = None
    """Human-readable description."""

    minimum: int | None = None
    """Minimum value (inclusive)."""

    maximum: int | None = None
    """Maximum value (inclusive)."""

    default: int | None = None
    """Default value."""

default class-attribute instance-attribute

default: int | None = None

Default value.

description class-attribute instance-attribute

description: str | None = None

Human-readable description.

maximum class-attribute instance-attribute

maximum: int | None = None

Maximum value (inclusive).

minimum class-attribute instance-attribute

minimum: int | None = None

Minimum value (inclusive).

title class-attribute instance-attribute

title: str | None = None

Optional title for the property.

type class-attribute instance-attribute

type: Literal['integer'] = 'integer'

Type discriminator.

KillTerminalRequest

Bases: BaseAgentRequest

Request to kill a terminal command without releasing the terminal.

Source code in src/aclientp/schema/agent_requests.py
class KillTerminalRequest(BaseAgentRequest):
    """Request to kill a terminal command without releasing the terminal."""

    terminal_id: str
    """The ID of the terminal to kill."""

terminal_id instance-attribute

terminal_id: str

The ID of the terminal to kill.

KillTerminalResponse

Bases: Response

Response to the terminal/kill method.

Source code in src/aclientp/schema/client_responses.py
class KillTerminalResponse(Response):
    """Response to the ``terminal/kill`` method."""

ListProvidersRequest

Bases: Request

Request the configurable providers.

Source code in src/aclientp/schema/providers.py
class ListProvidersRequest(Request):
    """Request the configurable providers."""

ListProvidersResponse

Bases: Response

Response to providers/list.

Source code in src/aclientp/schema/providers.py
class ListProvidersResponse(Response):
    """Response to ``providers/list``."""

    providers: Sequence[ProviderInfo]
    """Configurable providers with current routing info."""

providers instance-attribute

providers: Sequence[ProviderInfo]

Configurable providers with current routing info.

ListSessionsRequest

Bases: Request

Request parameters for listing existing sessions.

Only available if the Agent supports the session.list capability.

Source code in src/aclientp/schema/client_requests.py
class ListSessionsRequest(Request):
    """Request parameters for listing existing sessions.

    Only available if the Agent supports the `session.list` capability.
    """

    cursor: str | None = None
    """Opaque cursor token from a previous response's nextCursor field for pagination."""

    cwd: str | None = None
    """Filter sessions by working directory. Must be an absolute path."""

    archived: SessionArchiveFilter | None = None
    """**UNSTABLE**: Which sessions to return by archive state. Defaults to ``exclude``."""

archived class-attribute instance-attribute

archived: SessionArchiveFilter | None = None

UNSTABLE: Which sessions to return by archive state. Defaults to exclude.

cursor class-attribute instance-attribute

cursor: str | None = None

Opaque cursor token from a previous response's nextCursor field for pagination.

cwd class-attribute instance-attribute

cwd: str | None = None

Filter sessions by working directory. Must be an absolute path.

ListSessionsResponse

Bases: Response

Response from listing sessions.

Source code in src/aclientp/schema/agent_responses.py
class ListSessionsResponse(Response):
    """Response from listing sessions."""

    next_cursor: str | None = None
    """Opaque cursor token. If present, pass this in the next request's cursor parameter
    to fetch the next page. If absent, there are no more results."""

    sessions: Sequence[SessionInfo] = Field(default_factory=list)
    """Array of session information objects."""

next_cursor class-attribute instance-attribute

next_cursor: str | None = None

Opaque cursor token. If present, pass this in the next request's cursor parameter to fetch the next page. If absent, there are no more results.

sessions class-attribute instance-attribute

sessions: Sequence[SessionInfo] = Field(default_factory=list)

Array of session information objects.

LoadSessionRequest

Bases: SessionSetupRequest

Request parameters for loading an existing session.

Only available if the Agent supports the loadSession capability.

See protocol docs: Loading Sessions

Source code in src/aclientp/schema/client_requests.py
class LoadSessionRequest(SessionSetupRequest):
    """Request parameters for loading an existing session.

    Only available if the Agent supports the `loadSession` capability.

    See protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)
    """

    session_id: str
    """The ID of the session to load."""

session_id instance-attribute

session_id: str

The ID of the session to load.

LoadSessionResponse

Bases: Response

Response from loading an existing session.

Source code in src/aclientp/schema/agent_responses.py
class LoadSessionResponse(Response):
    """Response from loading an existing session."""

    modes: SessionModeState | None = None
    """Initial mode state if supported by the Agent

    See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
    """

    config_options: Sequence[SessionConfigOption] | None = None
    """The full list of config options with updated values."""

config_options class-attribute instance-attribute

config_options: Sequence[SessionConfigOption] | None = None

The full list of config options with updated values.

modes class-attribute instance-attribute

modes: SessionModeState | None = None

Initial mode state if supported by the Agent

See protocol docs: Session Modes

LogoutCapabilities

Bases: AnnotatedObject

Logout capabilities supported by the agent.

By supplying {} it means that the agent supports the logout method.

Source code in src/aclientp/schema/capabilities.py
class LogoutCapabilities(AnnotatedObject):
    """Logout capabilities supported by the agent.

    By supplying ``{}`` it means that the agent supports the logout method.
    """

LogoutRequest

Bases: Request

Request parameters for the logout method.

Terminates the current authenticated session.

After a successful logout, all new sessions will require authentication. There is no guarantee about the behavior of already running sessions.

Source code in src/aclientp/schema/client_requests.py
class LogoutRequest(Request):
    """Request parameters for the logout method.

    Terminates the current authenticated session.

    After a successful logout, all new sessions will require authentication.
    There is no guarantee about the behavior of already running sessions.
    """

LogoutResponse

Bases: Response

Response to the logout method.

Source code in src/aclientp/schema/agent_responses.py
class LogoutResponse(Response):
    """Response to the ``logout`` method."""

McpCapabilities

Bases: AnnotatedObject

MCP capabilities supported by the agent.

Source code in src/aclientp/schema/capabilities.py
class McpCapabilities(AnnotatedObject):
    """MCP capabilities supported by the agent."""

    http: bool | None = False
    """Agent supports [`McpServer::Http`]."""

    sse: bool | None = False
    """Agent supports [`McpServer::Sse`]."""

    acp: bool | None = False
    """**UNSTABLE**: Agent supports ``acp`` MCP servers (MCP over ACP via ``mcp/message``)."""

acp class-attribute instance-attribute

acp: bool | None = False

UNSTABLE: Agent supports acp MCP servers (MCP over ACP via mcp/message).

http class-attribute instance-attribute

http: bool | None = False

Agent supports [McpServer::Http].

sse class-attribute instance-attribute

sse: bool | None = False

Agent supports [McpServer::Sse].

McpError

Bases: Schema

UNSTABLE: A structured inner MCP error. Never an ACP error code.

Source code in src/aclientp/schema/mcp.py
class McpError(Schema):
    """**UNSTABLE**: A structured inner MCP error. Never an ACP error code."""

    code: int
    """Inner MCP error code."""

    message: str
    """Inner MCP error message."""

    data: Any = None
    """Optional error data."""

code instance-attribute

code: int

Inner MCP error code.

data class-attribute instance-attribute

data: Any = None

Optional error data.

message instance-attribute

message: str

Inner MCP error message.

MessageMcpNotification

Bases: AnnotatedObject

UNSTABLE: An inner MCP notification tied to an active inner MCP request.

Source code in src/aclientp/schema/mcp.py
class MessageMcpNotification(AnnotatedObject):
    """**UNSTABLE**: An inner MCP notification tied to an active inner MCP request."""

    server_id: McpServerAcpId
    """The declared ACP MCP server handling the associated request."""

    request_id: McpRequestId
    """The identifier of the active inner MCP request."""

    method: str
    """The inner MCP method name."""

    params: dict[str, Any] | None = None
    """Optional inner MCP params."""

method instance-attribute

method: str

The inner MCP method name.

params class-attribute instance-attribute

params: dict[str, Any] | None = None

Optional inner MCP params.

request_id instance-attribute

request_id: McpRequestId

The identifier of the active inner MCP request.

server_id instance-attribute

server_id: McpServerAcpId

The declared ACP MCP server handling the associated request.

MessageMcpRequest

Bases: Request

UNSTABLE: An inner MCP request sent to an acp MCP server via mcp/message.

Either side may send it, to the side that declared the server.

Source code in src/aclientp/schema/mcp.py
class MessageMcpRequest(Request):
    """**UNSTABLE**: An inner MCP request sent to an ``acp`` MCP server via ``mcp/message``.

    Either side may send it, to the side that declared the server.
    """

    server_id: McpServerAcpId
    """The declared ACP MCP server receiving this request."""

    request_id: McpRequestId
    """The caller-generated identifier for the inner MCP request."""

    method: str
    """The inner MCP method name."""

    params: dict[str, Any] | None = None
    """Optional inner MCP params."""

method instance-attribute

method: str

The inner MCP method name.

params class-attribute instance-attribute

params: dict[str, Any] | None = None

Optional inner MCP params.

request_id instance-attribute

request_id: McpRequestId

The caller-generated identifier for the inner MCP request.

server_id instance-attribute

server_id: McpServerAcpId

The declared ACP MCP server receiving this request.

MessageMcpResponse

Bases: Response

UNSTABLE: Response to mcp/message: exactly one inner MCP outcome.

Either an opaque result (which may be JSON null) or an error. Receivers prefer result if both are present.

Source code in src/aclientp/schema/mcp.py
class MessageMcpResponse(Response):
    """**UNSTABLE**: Response to ``mcp/message``: exactly one inner MCP outcome.

    Either an opaque ``result`` (which may be JSON null) or an ``error``.
    Receivers prefer ``result`` if both are present.
    """

    result: Any = None
    """The opaque inner MCP result."""

    error: McpError | None = None
    """The inner MCP error."""

error class-attribute instance-attribute

error: McpError | None = None

The inner MCP error.

result class-attribute instance-attribute

result: Any = None

The opaque inner MCP result.

MultiSelectPropertySchema

Bases: AnnotatedObject

Schema for multi-select (array) properties in an elicitation form.

Source code in src/aclientp/schema/elicitation.py
class MultiSelectPropertySchema(AnnotatedObject):
    """Schema for multi-select (array) properties in an elicitation form."""

    type: Literal["array"] = "array"
    """Type discriminator."""

    title: str | None = None
    """Optional title for the property."""

    description: str | None = None
    """Human-readable description."""

    min_items: int | None = Field(default=None, ge=0)
    """Minimum number of items to select."""

    max_items: int | None = Field(default=None, ge=0)
    """Maximum number of items to select."""

    items: MultiSelectItems
    """The items definition describing allowed values."""

    default: Sequence[str] | None = None
    """Default selected values."""

default class-attribute instance-attribute

default: Sequence[str] | None = None

Default selected values.

description class-attribute instance-attribute

description: str | None = None

Human-readable description.

items instance-attribute

The items definition describing allowed values.

max_items class-attribute instance-attribute

max_items: int | None = Field(default=None, ge=0)

Maximum number of items to select.

min_items class-attribute instance-attribute

min_items: int | None = Field(default=None, ge=0)

Minimum number of items to select.

title class-attribute instance-attribute

title: str | None = None

Optional title for the property.

type class-attribute instance-attribute

type: Literal['array'] = 'array'

Type discriminator.

NewSessionRequest

Bases: SessionSetupRequest

Request parameters for creating a new session.

See protocol docs: Creating a Session

Source code in src/aclientp/schema/client_requests.py
class NewSessionRequest(SessionSetupRequest):
    """Request parameters for creating a new session.

    See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)
    """

NewSessionResponse

Bases: Response

Response from creating a new session.

See protocol docs: Creating a Session

Source code in src/aclientp/schema/agent_responses.py
class NewSessionResponse(Response):
    """Response from creating a new session.

    See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)
    """

    modes: SessionModeState | None = None
    """Initial mode state if supported by the Agent

    See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
    """

    config_options: Sequence[SessionConfigOption] | None = None
    """**Configuration options for this session."""

    session_id: str
    """Unique identifier for the created session.

    Used in all subsequent requests for this conversation.
    """

config_options class-attribute instance-attribute

config_options: Sequence[SessionConfigOption] | None = None

**Configuration options for this session.

modes class-attribute instance-attribute

modes: SessionModeState | None = None

Initial mode state if supported by the Agent

See protocol docs: Session Modes

session_id instance-attribute

session_id: str

Unique identifier for the created session.

Used in all subsequent requests for this conversation.

Notice

Bases: AnnotatedObject

Fire-and-forget information for the user.

Only sent if the client advertised session.notices.

Source code in src/aclientp/schema/session_updates.py
class Notice(AnnotatedObject):
    """Fire-and-forget information for the user.

    Only sent if the client advertised ``session.notices``.
    """

    session_update: Literal["notice"] = Field(default="notice", init=False)

    severity: NoticeSeverity
    """Presentation severity hint."""

    title: str
    """Required non-empty plain-text title that can stand alone."""

    description: str | None = None
    """Optional plain-text detail or guidance."""

description class-attribute instance-attribute

description: str | None = None

Optional plain-text detail or guidance.

severity instance-attribute

severity: NoticeSeverity

Presentation severity hint.

title instance-attribute

title: str

Required non-empty plain-text title that can stand alone.

NoticeCapabilities

Bases: AnnotatedObject

Client support for presenting live notice session updates to the user.

Source code in src/aclientp/schema/capabilities.py
class NoticeCapabilities(AnnotatedObject):
    """Client support for presenting live ``notice`` session updates to the user."""

NumberPropertySchema

Bases: AnnotatedObject

Schema for number (floating-point) properties in an elicitation form.

Source code in src/aclientp/schema/elicitation.py
class NumberPropertySchema(AnnotatedObject):
    """Schema for number (floating-point) properties in an elicitation form."""

    type: Literal["number"] = "number"
    """Type discriminator."""

    title: str | None = None
    """Optional title for the property."""

    description: str | None = None
    """Human-readable description."""

    minimum: float | None = None
    """Minimum value (inclusive)."""

    maximum: float | None = None
    """Maximum value (inclusive)."""

    default: float | None = None
    """Default value."""

default class-attribute instance-attribute

default: float | None = None

Default value.

description class-attribute instance-attribute

description: str | None = None

Human-readable description.

maximum class-attribute instance-attribute

maximum: float | None = None

Maximum value (inclusive).

minimum class-attribute instance-attribute

minimum: float | None = None

Minimum value (inclusive).

title class-attribute instance-attribute

title: str | None = None

Optional title for the property.

type class-attribute instance-attribute

type: Literal['number'] = 'number'

Type discriminator.

PermissionOption

Bases: AnnotatedObject

An option presented to the user when requesting permission.

Source code in src/aclientp/schema/tool_call.py
class PermissionOption(AnnotatedObject):
    """An option presented to the user when requesting permission."""

    kind: PermissionKind
    """Hint about the nature of this permission option."""

    name: str
    """Human-readable label to display to the user."""

    option_id: str
    """Unique identifier for this permission option."""

kind instance-attribute

kind: PermissionKind

Hint about the nature of this permission option.

name instance-attribute

name: str

Human-readable label to display to the user.

option_id instance-attribute

option_id: str

Unique identifier for this permission option.

PlanCapabilities

Bases: AnnotatedObject

UNSTABLE: Client support for ID-addressed plan_update / plan_removed updates.

Source code in src/aclientp/schema/capabilities.py
class PlanCapabilities(AnnotatedObject):
    """**UNSTABLE**: Client support for ID-addressed ``plan_update`` / ``plan_removed`` updates."""

PlanEntry

Bases: AnnotatedObject

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 Entries

Source code in src/aclientp/schema/agent_plan.py
class PlanEntry(AnnotatedObject):
    """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 Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)
    """

    content: str
    """Human-readable description of what this task aims to accomplish."""

    priority: PlanEntryPriority
    """The relative importance of this task.

    Used to indicate which tasks are most critical to the overall goal.
    """

    status: PlanEntryStatus
    """Current execution status of this task."""

content instance-attribute

content: str

Human-readable description of what this task aims to accomplish.

priority instance-attribute

priority: PlanEntryPriority

The relative importance of this task.

Used to indicate which tasks are most critical to the overall goal.

status instance-attribute

status: PlanEntryStatus

Current execution status of this task.

PlanItems

Bases: AnnotatedObject

UNSTABLE: A plan made of structured entries.

Source code in src/aclientp/schema/agent_plan.py
class PlanItems(AnnotatedObject):
    """**UNSTABLE**: A plan made of structured entries."""

    type: Literal["items"] = Field(default="items", init=False)

    plan_id: PlanId
    """The plan ID to update."""

    entries: Sequence[PlanEntry]
    """The complete list of tasks to be accomplished."""

entries instance-attribute

entries: Sequence[PlanEntry]

The complete list of tasks to be accomplished.

plan_id instance-attribute

plan_id: PlanId

The plan ID to update.

PlanMarkdown

Bases: AnnotatedObject

UNSTABLE: A plan made of raw markdown content.

Source code in src/aclientp/schema/agent_plan.py
class PlanMarkdown(AnnotatedObject):
    """**UNSTABLE**: A plan made of raw markdown content."""

    type: Literal["markdown"] = Field(default="markdown", init=False)

    plan_id: PlanId
    """The plan ID to update."""

    content: str
    """Markdown content for the plan."""

    path: str | None = None
    """The absolute path of the file that holds this plan."""

content instance-attribute

content: str

Markdown content for the plan.

path class-attribute instance-attribute

path: str | None = None

The absolute path of the file that holds this plan.

plan_id instance-attribute

plan_id: PlanId

The plan ID to update.

PlanRemoved

Bases: AnnotatedObject

UNSTABLE: Remove an ID-addressed plan.

Source code in src/aclientp/schema/session_updates.py
class PlanRemoved(AnnotatedObject):
    """**UNSTABLE**: Remove an ID-addressed plan."""

    session_update: Literal["plan_removed"] = Field(default="plan_removed", init=False)

    plan_id: PlanId
    """The plan ID to remove."""

plan_id instance-attribute

plan_id: PlanId

The plan ID to remove.

PlanUpdate

Bases: AnnotatedObject

UNSTABLE: Create or replace an ID-addressed plan.

Only sent if the client advertised the plan capability.

Source code in src/aclientp/schema/session_updates.py
class PlanUpdate(AnnotatedObject):
    """**UNSTABLE**: Create or replace an ID-addressed plan.

    Only sent if the client advertised the ``plan`` capability.
    """

    session_update: Literal["plan_update"] = Field(default="plan_update", init=False)

    plan: PlanUpdateContent
    """The updated plan content."""

plan instance-attribute

The updated plan content.

PromptCapabilities

Bases: AnnotatedObject

Prompt capabilities supported by the agent in session/prompt requests.

Baseline agent functionality requires support for [ContentBlock::Text] and [ContentBlock::ResourceContentBlock] 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 Capabilities

Source code in src/aclientp/schema/capabilities.py
class PromptCapabilities(AnnotatedObject):
    """Prompt capabilities supported by the agent in `session/prompt` requests.

    Baseline agent functionality requires support for [`ContentBlock::Text`]
    and [`ContentBlock::ResourceContentBlock`] 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 Capabilities](https://agentclientprotocol.com/protocol/initialization#prompt-capabilities)
    """

    audio: bool | None = False
    """Agent supports [`ContentBlock::Audio`]."""

    embedded_context: bool | None = False
    """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.
    """

    image: bool | None = False
    """Agent supports [`ContentBlock::Image`]."""

audio class-attribute instance-attribute

audio: bool | None = False

Agent supports [ContentBlock::Audio].

embedded_context class-attribute instance-attribute

embedded_context: bool | None = False

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.

image class-attribute instance-attribute

image: bool | None = False

Agent supports [ContentBlock::Image].

PromptRequest

Bases: Request

Request parameters for sending a user prompt to the agent.

Contains the user's message and any additional context.

See protocol docs: User Message

Source code in src/aclientp/schema/client_requests.py
class PromptRequest(Request):
    """Request parameters for sending a user prompt to the agent.

    Contains the user's message and any additional context.

    See protocol docs: [User Message](https://agentclientprotocol.com/protocol/prompt-turn#1-user-message)
    """

    prompt: Sequence[ContentBlock]
    """The blocks of content that compose the user's message.

    As a baseline, the Agent MUST support [`ContentBlock::Text`] and
    [`ContentBlock::ResourceContentBlock`],
    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::ResourceContentBlock`].

    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.
    """

    session_id: str
    """The ID of the session to send this user message to."""

prompt instance-attribute

prompt: Sequence[ContentBlock]

The blocks of content that compose the user's message.

As a baseline, the Agent MUST support [ContentBlock::Text] and [ContentBlock::ResourceContentBlock], 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::ResourceContentBlock].

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.

session_id instance-attribute

session_id: str

The ID of the session to send this user message to.

PromptResponse

Bases: Response

Response from processing a user prompt.

See protocol docs: Check for Completion

Source code in src/aclientp/schema/agent_responses.py
class PromptResponse(Response):
    """Response from processing a user prompt.

    See protocol docs: [Check for Completion](https://agentclientprotocol.com/protocol/prompt-turn#4-check-for-completion)
    """

    stop_reason: StopReason
    """Indicates why the agent stopped processing the turn."""

    usage: Usage | None = None
    """**UNSTABLE**: Token usage for this turn (optional)."""

stop_reason instance-attribute

stop_reason: StopReason

Indicates why the agent stopped processing the turn.

usage class-attribute instance-attribute

usage: Usage | None = None

UNSTABLE: Token usage for this turn (optional).

PromptSuggestion

Bases: AnnotatedObject

UNSTABLE: A prompt the client can offer to the user.

Source code in src/aclientp/schema/session_updates.py
class PromptSuggestion(AnnotatedObject):
    """**UNSTABLE**: A prompt the client can offer to the user."""

    prompt: Sequence[ContentBlock]
    """The content of the suggested prompt."""

prompt instance-attribute

prompt: Sequence[ContentBlock]

The content of the suggested prompt.

PromptSuggestionsAudioCapabilities

Bases: AnnotatedObject

UNSTABLE: Prompt suggestions may include audio content blocks.

Source code in src/aclientp/schema/capabilities.py
class PromptSuggestionsAudioCapabilities(AnnotatedObject):
    """**UNSTABLE**: Prompt suggestions may include ``audio`` content blocks."""

PromptSuggestionsCapabilities

Bases: AnnotatedObject

UNSTABLE: Client support for prompt_suggestions_update session updates.

Text and resource link content are always allowed.

Source code in src/aclientp/schema/capabilities.py
class PromptSuggestionsCapabilities(AnnotatedObject):
    """**UNSTABLE**: Client support for ``prompt_suggestions_update`` session updates.

    Text and resource link content are always allowed.
    """

    image: PromptSuggestionsImageCapabilities | None = None
    """Whether prompt suggestions may include ``image`` content blocks."""

    audio: PromptSuggestionsAudioCapabilities | None = None
    """Whether prompt suggestions may include ``audio`` content blocks."""

    embedded_context: PromptSuggestionsEmbeddedContextCapabilities | None = None
    """Whether prompt suggestions may include ``resource`` content blocks."""

audio class-attribute instance-attribute

Whether prompt suggestions may include audio content blocks.

embedded_context class-attribute instance-attribute

embedded_context: PromptSuggestionsEmbeddedContextCapabilities | None = None

Whether prompt suggestions may include resource content blocks.

image class-attribute instance-attribute

Whether prompt suggestions may include image content blocks.

PromptSuggestionsEmbeddedContextCapabilities

Bases: AnnotatedObject

UNSTABLE: Prompt suggestions may include resource content blocks.

Source code in src/aclientp/schema/capabilities.py
class PromptSuggestionsEmbeddedContextCapabilities(AnnotatedObject):
    """**UNSTABLE**: Prompt suggestions may include ``resource`` content blocks."""

PromptSuggestionsImageCapabilities

Bases: AnnotatedObject

UNSTABLE: Prompt suggestions may include image content blocks.

Source code in src/aclientp/schema/capabilities.py
class PromptSuggestionsImageCapabilities(AnnotatedObject):
    """**UNSTABLE**: Prompt suggestions may include ``image`` content blocks."""

PromptSuggestionsUpdate

Bases: AnnotatedObject

UNSTABLE: Suggested next prompts, replacing any previous suggestions.

Only sent if the client advertised session.prompt_suggestions.

Source code in src/aclientp/schema/session_updates.py
class PromptSuggestionsUpdate(AnnotatedObject):
    """**UNSTABLE**: Suggested next prompts, replacing any previous suggestions.

    Only sent if the client advertised ``session.prompt_suggestions``.
    """

    session_update: Literal["prompt_suggestions_update"] = Field(
        default="prompt_suggestions_update", init=False
    )

    suggestions: Sequence[PromptSuggestion]
    """The suggestions the Client can offer, ordered most likely first."""

suggestions instance-attribute

suggestions: Sequence[PromptSuggestion]

The suggestions the Client can offer, ordered most likely first.

ProviderCurrentConfig

Bases: AnnotatedObject

Current effective non-secret routing config of a provider.

Source code in src/aclientp/schema/providers.py
class ProviderCurrentConfig(AnnotatedObject):
    """Current effective non-secret routing config of a provider."""

    api_type: LlmProtocol
    """Protocol currently used by this provider."""

    base_url: str
    """Base URL currently used by this provider."""

api_type instance-attribute

api_type: LlmProtocol

Protocol currently used by this provider.

base_url instance-attribute

base_url: str

Base URL currently used by this provider.

ProviderInfo

Bases: AnnotatedObject

A configurable provider with its current routing info, suitable for UI display.

Source code in src/aclientp/schema/providers.py
class ProviderInfo(AnnotatedObject):
    """A configurable provider with its current routing info, suitable for UI display."""

    provider_id: ProviderId
    """Provider identifier."""

    supported: Sequence[LlmProtocol]
    """Supported protocol types for this provider."""

    required: bool
    """Whether this provider is mandatory. Clients must not call ``providers/disable`` for it."""

    current: ProviderCurrentConfig | None = None
    """Current effective config. ``None`` means the provider is disabled."""

current class-attribute instance-attribute

current: ProviderCurrentConfig | None = None

Current effective config. None means the provider is disabled.

provider_id instance-attribute

provider_id: ProviderId

Provider identifier.

required instance-attribute

required: bool

Whether this provider is mandatory. Clients must not call providers/disable for it.

supported instance-attribute

supported: Sequence[LlmProtocol]

Supported protocol types for this provider.

ProvidersCapabilities

Bases: AnnotatedObject

UNSTABLE: Support for providers/list, providers/set and providers/disable.

Source code in src/aclientp/schema/capabilities.py
class ProvidersCapabilities(AnnotatedObject):
    """**UNSTABLE**: Support for ``providers/list``, ``providers/set`` and ``providers/disable``."""

ProxySuccessorNotification

Bases: AnnotatedObject

A notification wrapped for delivery to the proxy's successor.

Source code in src/aclientp/schema/proxy.py
class ProxySuccessorNotification(AnnotatedObject):
    """A notification wrapped for delivery to the proxy's successor."""

    method: str
    """Method name of the wrapped notification."""

    params: Any = None
    """Params of the wrapped notification, forwarded unchanged."""

method instance-attribute

method: str

Method name of the wrapped notification.

params class-attribute instance-attribute

params: Any = None

Params of the wrapped notification, forwarded unchanged.

ProxySuccessorRequest

Bases: AnnotatedObject

A request wrapped for delivery to the proxy's successor.

The result is the wrapped request's result, forwarded unchanged. field_meta belongs to the envelope and is hop-local.

Source code in src/aclientp/schema/proxy.py
class ProxySuccessorRequest(AnnotatedObject):
    """A request wrapped for delivery to the proxy's successor.

    The result is the wrapped request's result, forwarded unchanged.
    ``field_meta`` belongs to the envelope and is hop-local.
    """

    method: str
    """Method name of the wrapped request."""

    params: Any = None
    """Params of the wrapped request, forwarded unchanged."""

method instance-attribute

method: str

Method name of the wrapped request.

params class-attribute instance-attribute

params: Any = None

Params of the wrapped request, forwarded unchanged.

ReadTextFileRequest

Bases: BaseAgentRequest

Request to read content from a text file.

Only available if the client supports the fs.readTextFile capability.

Source code in src/aclientp/schema/agent_requests.py
class ReadTextFileRequest(BaseAgentRequest):
    """Request to read content from a text file.

    Only available if the client supports the `fs.readTextFile` capability.
    """

    limit: int | None = Field(default=None, ge=0)
    """Maximum number of lines to read."""

    line: int | None = Field(default=None, ge=0)
    """Line number to start reading from (1-based)."""

    path: str
    """Absolute path to the file to read."""

limit class-attribute instance-attribute

limit: int | None = Field(default=None, ge=0)

Maximum number of lines to read.

line class-attribute instance-attribute

line: int | None = Field(default=None, ge=0)

Line number to start reading from (1-based).

path instance-attribute

path: str

Absolute path to the file to read.

ReadTextFileResponse

Bases: Response

Response containing the contents of a text file.

Source code in src/aclientp/schema/client_responses.py
class ReadTextFileResponse(Response):
    """Response containing the contents of a text file."""

    content: str
    """The contents of the text file."""

content instance-attribute

content: str

The contents of the text file.

ReleaseTerminalRequest

Bases: BaseAgentRequest

Request to release a terminal and free its resources.

Source code in src/aclientp/schema/agent_requests.py
class ReleaseTerminalRequest(BaseAgentRequest):
    """Request to release a terminal and free its resources."""

    terminal_id: str
    """The ID of the terminal to release."""

terminal_id instance-attribute

terminal_id: str

The ID of the terminal to release.

ReleaseTerminalResponse

Bases: Response

Response to terminal/release method.

Source code in src/aclientp/schema/client_responses.py
class ReleaseTerminalResponse(Response):
    """Response to terminal/release method."""

RequestPermissionRequest

Bases: BaseAgentRequest

Request for user permission to execute a tool call.

Sent when the agent needs authorization before performing a sensitive operation.

See protocol docs: Requesting Permission

Source code in src/aclientp/schema/agent_requests.py
class RequestPermissionRequest(BaseAgentRequest):
    """Request for user permission to execute a tool call.

    Sent when the agent needs authorization before performing a sensitive operation.

    See protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/tool-calls#requesting-permission)
    """

    options: Sequence[PermissionOption]
    """Available permission options for the user to choose from."""

    tool_call: ToolCallUpdate
    """Details about the tool call requiring permission."""

options instance-attribute

options: Sequence[PermissionOption]

Available permission options for the user to choose from.

tool_call instance-attribute

tool_call: ToolCallUpdate

Details about the tool call requiring permission.

RequestPermissionResponse

Bases: Response

Response to a permission request.

Source code in src/aclientp/schema/client_responses.py
class RequestPermissionResponse(Response):
    """Response to a permission request."""

    outcome: RequestPermissionOutcome
    """The user's decision on the permission request."""

    @classmethod
    def denied(cls, metadata: dict[str, Any] | None = None) -> Self:
        """Create a response indicating that the permission request was denied."""
        return cls(outcome=DeniedOutcome(), field_meta=metadata)

    @classmethod
    def allowed(cls, option_id: str, metadata: dict[str, Any] | None = None) -> Self:
        """Create a response indicating that the permission request was allowed."""
        return cls(outcome=AllowedOutcome(option_id=option_id), field_meta=metadata)

outcome instance-attribute

The user's decision on the permission request.

allowed classmethod

allowed(option_id: str, metadata: dict[str, Any] | None = None) -> Self

Create a response indicating that the permission request was allowed.

Source code in src/aclientp/schema/client_responses.py
@classmethod
def allowed(cls, option_id: str, metadata: dict[str, Any] | None = None) -> Self:
    """Create a response indicating that the permission request was allowed."""
    return cls(outcome=AllowedOutcome(option_id=option_id), field_meta=metadata)

denied classmethod

denied(metadata: dict[str, Any] | None = None) -> Self

Create a response indicating that the permission request was denied.

Source code in src/aclientp/schema/client_responses.py
@classmethod
def denied(cls, metadata: dict[str, Any] | None = None) -> Self:
    """Create a response indicating that the permission request was denied."""
    return cls(outcome=DeniedOutcome(), field_meta=metadata)

RequiresActionStateUpdate

Bases: AnnotatedObject

UNSTABLE: Foreground work is blocked on user action.

Source code in src/aclientp/schema/session_updates.py
class RequiresActionStateUpdate(AnnotatedObject):
    """**UNSTABLE**: Foreground work is blocked on user action."""

    state: Literal["requires_action"] = Field(default="requires_action", init=False)

ResourceContentBlock

Bases: BaseContentBlock

References to resources that the agent can access.

All agents MUST support resource links in prompts.

Source code in src/aclientp/schema/content_blocks.py
class ResourceContentBlock(BaseContentBlock):
    """References to resources that the agent can access.

    All agents MUST support resource links in prompts.
    """

    type: Literal["resource_link"] = Field(default="resource_link", init=False)

    description: str | None = None
    """Description of the resource."""

    mime_type: str | None = None
    """MIME type of the resource."""

    name: str
    """Name of the resource."""

    size: int | None = Field(default=None, ge=0)
    """Size of the resource in bytes."""

    title: str | None = None
    """Title of the resource."""

    uri: str
    """URI of the resource."""

description class-attribute instance-attribute

description: str | None = None

Description of the resource.

mime_type class-attribute instance-attribute

mime_type: str | None = None

MIME type of the resource.

name instance-attribute

name: str

Name of the resource.

size class-attribute instance-attribute

size: int | None = Field(default=None, ge=0)

Size of the resource in bytes.

title class-attribute instance-attribute

title: str | None = None

Title of the resource.

uri instance-attribute

uri: str

URI of the resource.

ResumeSessionRequest

Bases: SessionSetupRequest

Request parameters for resuming an existing session.

Resumes an existing session without returning previous messages (unlike session/load). mcp_servers is the complete client-provided set.

Only available if the Agent supports the session.resume capability.

Source code in src/aclientp/schema/client_requests.py
class ResumeSessionRequest(SessionSetupRequest):
    """Request parameters for resuming an existing session.

    Resumes an existing session without returning previous messages (unlike `session/load`).
    ``mcp_servers`` is the complete client-provided set.

    Only available if the Agent supports the `session.resume` capability.
    """

    session_id: str
    """The ID of the session to resume."""

session_id instance-attribute

session_id: str

The ID of the session to resume.

ResumeSessionResponse

Bases: Response

Response from resuming an existing session.

Source code in src/aclientp/schema/agent_responses.py
class ResumeSessionResponse(Response):
    """Response from resuming an existing session."""

    modes: SessionModeState | None = None
    """Initial mode state if supported by the Agent

    See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
    """

    config_options: Sequence[SessionConfigOption] | None = None
    """The full list of config options with updated values."""

    @classmethod
    def create(
        cls,
        config_options: Sequence[SessionConfigOption] | None = None,
        modes: Sequence[SessionMode] | None = None,
        current_mode: str | None = None,
    ) -> Self:
        """Create a response with the given config options and modes."""
        return cls(config_options=config_options or [], modes=_mode_state(modes, current_mode))

config_options class-attribute instance-attribute

config_options: Sequence[SessionConfigOption] | None = None

The full list of config options with updated values.

modes class-attribute instance-attribute

modes: SessionModeState | None = None

Initial mode state if supported by the Agent

See protocol docs: Session Modes

create classmethod

create(
    config_options: Sequence[SessionConfigOption] | None = None,
    modes: Sequence[SessionMode] | None = None,
    current_mode: str | None = None,
) -> Self

Create a response with the given config options and modes.

Source code in src/aclientp/schema/agent_responses.py
@classmethod
def create(
    cls,
    config_options: Sequence[SessionConfigOption] | None = None,
    modes: Sequence[SessionMode] | None = None,
    current_mode: str | None = None,
) -> Self:
    """Create a response with the given config options and modes."""
    return cls(config_options=config_options or [], modes=_mode_state(modes, current_mode))

RunningStateUpdate

Bases: AnnotatedObject

UNSTABLE: Foreground work is in progress.

Source code in src/aclientp/schema/session_updates.py
class RunningStateUpdate(AnnotatedObject):
    """**UNSTABLE**: Foreground work is in progress."""

    state: Literal["running"] = Field(default="running", init=False)

SelectSessionConfigOption

Bases: BaseSessionConfigOption

A select-type session configuration option.

Single-value selector (dropdown) with a list of options.

Advertised by the agent to describe an available select config option and its current state. See SessionConfigOptionValueId for the value sent by the client when changing it.

Source code in src/aclientp/schema/config_options.py
class SelectSessionConfigOption(BaseSessionConfigOption):
    """A select-type session configuration option.

    Single-value selector (dropdown) with a list of options.

    Advertised by the agent to describe an available select config option and its current state.
    See ``SessionConfigOptionValueId`` for the value sent by the client when changing it.
    """

    type: Literal["select"] = Field(default="select", init=False)
    """Discriminator for the config option type."""

    current_value: SessionConfigValueId
    """The currently selected value."""

    options: SessionConfigSelectOptions
    """The set of selectable options."""

current_value instance-attribute

current_value: SessionConfigValueId

The currently selected value.

options instance-attribute

The set of selectable options.

type class-attribute instance-attribute

type: Literal['select'] = Field(default='select', init=False)

Discriminator for the config option type.

SessionAdditionalDirectoriesCapabilities

Bases: AnnotatedObject

Support for additionalDirectories on session lifecycle requests.

Source code in src/aclientp/schema/capabilities.py
class SessionAdditionalDirectoriesCapabilities(AnnotatedObject):
    """Support for ``additionalDirectories`` on session lifecycle requests."""

SessionArchiveCapabilities

Bases: AnnotatedObject

UNSTABLE: Support for session/archive and session/unarchive.

Source code in src/aclientp/schema/capabilities.py
class SessionArchiveCapabilities(AnnotatedObject):
    """**UNSTABLE**: Support for ``session/archive`` and ``session/unarchive``."""

SessionCancelCapabilities

Bases: AnnotatedObject

UNSTABLE: Permits the client to cancel a subagent's current work.

Source code in src/aclientp/schema/capabilities.py
class SessionCancelCapabilities(AnnotatedObject):
    """**UNSTABLE**: Permits the client to cancel a subagent's current work."""

SessionCapabilities

Bases: AnnotatedObject

Session capabilities supported by the agent.

As a baseline, all Agents MUST support session/new, session/prompt, session/cancel, and session/update.

Optionally, they MAY support other session methods and notifications by specifying additional capabilities.

Note: session/load is still handled by the top-level load_session capability. This will be unified in future versions of the protocol.

See protocol docs: Session Capabilities

Source code in src/aclientp/schema/capabilities.py
class SessionCapabilities(AnnotatedObject):
    """Session capabilities supported by the agent.

    As a baseline, all Agents **MUST** support `session/new`, `session/prompt`,
    `session/cancel`, and `session/update`.

    Optionally, they **MAY** support other session methods and notifications
    by specifying additional capabilities.

    Note: `session/load` is still handled by the top-level `load_session` capability.
    This will be unified in future versions of the protocol.

    See protocol docs: [Session Capabilities](https://agentclientprotocol.com/protocol/initialization#session-capabilities)
    """

    list: SessionListCapabilities | None = None
    """Whether the agent supports `session/list`."""

    delete: SessionDeleteCapabilities | None = None
    """Whether the agent supports ``session/delete``."""

    additional_directories: SessionAdditionalDirectoriesCapabilities | None = None
    """Whether the agent supports ``additionalDirectories`` on session lifecycle requests."""

    system_prompt: SessionSystemPromptCapabilities | None = None
    """Whether the agent supports ``systemPrompt`` on session lifecycle requests."""

    resume: SessionResumeCapabilities | None = None
    """Whether the agent supports `session/resume`."""

    close: SessionCloseCapabilities | None = None
    """Whether the agent supports `session/close`."""

    fork: SessionForkCapabilities | None = None
    """**UNSTABLE**: Whether the agent supports `session/fork`."""

    archive: SessionArchiveCapabilities | None = None
    """**UNSTABLE**: Whether the agent supports ``session/archive`` and ``session/unarchive``."""

    status: SessionStatusCapabilities | None = None
    """**UNSTABLE**: Whether the agent supports ``session/status``."""

    options: SessionOptionsCapabilities | None = None
    """**UNSTABLE**: Whether the agent supports ``session/options``."""

    title: SessionTitleCapabilities | None = None
    """**UNSTABLE**: Whether the agent supports ``session/set_title``."""

additional_directories class-attribute instance-attribute

additional_directories: SessionAdditionalDirectoriesCapabilities | None = None

Whether the agent supports additionalDirectories on session lifecycle requests.

archive class-attribute instance-attribute

archive: SessionArchiveCapabilities | None = None

UNSTABLE: Whether the agent supports session/archive and session/unarchive.

close class-attribute instance-attribute

close: SessionCloseCapabilities | None = None

Whether the agent supports session/close.

delete class-attribute instance-attribute

delete: SessionDeleteCapabilities | None = None

Whether the agent supports session/delete.

fork class-attribute instance-attribute

fork: SessionForkCapabilities | None = None

UNSTABLE: Whether the agent supports session/fork.

list class-attribute instance-attribute

list: SessionListCapabilities | None = None

Whether the agent supports session/list.

options class-attribute instance-attribute

options: SessionOptionsCapabilities | None = None

UNSTABLE: Whether the agent supports session/options.

resume class-attribute instance-attribute

resume: SessionResumeCapabilities | None = None

Whether the agent supports session/resume.

status class-attribute instance-attribute

status: SessionStatusCapabilities | None = None

UNSTABLE: Whether the agent supports session/status.

system_prompt class-attribute instance-attribute

system_prompt: SessionSystemPromptCapabilities | None = None

Whether the agent supports systemPrompt on session lifecycle requests.

title class-attribute instance-attribute

title: SessionTitleCapabilities | None = None

UNSTABLE: Whether the agent supports session/set_title.

SessionCloseCapabilities

Bases: AnnotatedObject

Capabilities for the session/close method.

By supplying {} it means that the agent supports closing of sessions.

Source code in src/aclientp/schema/capabilities.py
class SessionCloseCapabilities(AnnotatedObject):
    """Capabilities for the `session/close` method.

    By supplying ``{}`` it means that the agent supports closing of sessions.
    """

SessionConfigOptionValueBoolean

Bases: AnnotatedObject

A boolean value for setting a config option (type: "boolean").

Sent by the client to change a boolean config option. See BooleanSessionConfigOption for the option definition advertised by the agent.

Source code in src/aclientp/schema/config_options.py
class SessionConfigOptionValueBoolean(AnnotatedObject):
    """A boolean value for setting a config option (type: "boolean").

    Sent by the client to change a boolean config option.
    See ``BooleanSessionConfigOption`` for the option definition advertised by the agent.
    """

    type: Literal["boolean"] = Field(default="boolean", init=False)
    """Discriminator value."""

    value: bool
    """The boolean value."""

type class-attribute instance-attribute

type: Literal['boolean'] = Field(default='boolean', init=False)

Discriminator value.

value instance-attribute

value: bool

The boolean value.

SessionConfigOptionValueId

Bases: AnnotatedObject

A SessionConfigValueId string value for setting a config option.

This is the default when type is absent on the wire. Unknown type values with string payloads also gracefully deserialize into this variant.

Sent by the client to change a select config option. See SelectSessionConfigOption for the option definition advertised by the agent.

Source code in src/aclientp/schema/config_options.py
class SessionConfigOptionValueId(AnnotatedObject):
    """A SessionConfigValueId string value for setting a config option.

    This is the default when ``type`` is absent on the wire. Unknown ``type``
    values with string payloads also gracefully deserialize into this variant.

    Sent by the client to change a select config option.
    See ``SelectSessionConfigOption`` for the option definition advertised by the agent.
    """

    value: SessionConfigValueId
    """The value ID."""

value instance-attribute

The value ID.

SessionConfigOptionsCapabilities

Bases: AnnotatedObject

Session configuration option capabilities supported by the client.

Source code in src/aclientp/schema/capabilities.py
class SessionConfigOptionsCapabilities(AnnotatedObject):
    """Session configuration option capabilities supported by the client."""

    boolean: BooleanConfigOptionCapabilities | None = None
    """Whether the client supports boolean session configuration options."""

boolean class-attribute instance-attribute

boolean: BooleanConfigOptionCapabilities | None = None

Whether the client supports boolean session configuration options.

SessionConfigSelectGroup

Bases: AnnotatedObject

A group of possible values for a configuration selector.

Source code in src/aclientp/schema/config_options.py
class SessionConfigSelectGroup(AnnotatedObject):
    """A group of possible values for a configuration selector."""

    group: SessionConfigGroupId
    """Unique identifier for this group."""

    name: str
    """Human-readable label for this group."""

    options: Sequence[SessionConfigSelectOption]
    """The set of option values in this group."""

group instance-attribute

Unique identifier for this group.

name instance-attribute

name: str

Human-readable label for this group.

options instance-attribute

options: Sequence[SessionConfigSelectOption]

The set of option values in this group.

SessionConfigSelectOption

Bases: AnnotatedObject

A possible value for a configuration selector.

Source code in src/aclientp/schema/config_options.py
class SessionConfigSelectOption(AnnotatedObject):
    """A possible value for a configuration selector."""

    value: SessionConfigValueId
    """Unique identifier for this option value."""

    name: str
    """Human-readable label for this option value."""

    description: str | None = None
    """Optional description for this option value."""

description class-attribute instance-attribute

description: str | None = None

Optional description for this option value.

name instance-attribute

name: str

Human-readable label for this option value.

value instance-attribute

Unique identifier for this option value.

SessionCursorsCapabilities

Bases: AnnotatedObject

UNSTABLE: Client support for cursor_update session updates.

{} advertises support. See the Session Cursors RFD.

Source code in src/aclientp/schema/capabilities.py
class SessionCursorsCapabilities(AnnotatedObject):
    """**UNSTABLE**: Client support for ``cursor_update`` session updates.

    ``{}`` advertises support. See the
    [Session Cursors RFD](https://agentclientprotocol.com/rfds/session-cursors).
    """

SessionDeleteCapabilities

Bases: AnnotatedObject

Capabilities for the session/delete method.

Source code in src/aclientp/schema/capabilities.py
class SessionDeleteCapabilities(AnnotatedObject):
    """Capabilities for the ``session/delete`` method."""

SessionForkCapabilities

Bases: AnnotatedObject

Capabilities for the session/fork method.

UNSTABLE: This capability is not part of the spec yet, and may be removed or changed at any point.

By supplying {} it means that the agent supports forking of sessions.

Source code in src/aclientp/schema/capabilities.py
class SessionForkCapabilities(AnnotatedObject):
    """Capabilities for the `session/fork` method.

    **UNSTABLE**: This capability is not part of the spec yet,
    and may be removed or changed at any point.

    By supplying `{}` it means that the agent supports forking of sessions.
    """

SessionInfo

Bases: AnnotatedObject

Information about a session returned by session/list.

Source code in src/aclientp/schema/session_state.py
class SessionInfo(AnnotatedObject):
    """Information about a session returned by session/list."""

    cwd: str
    """The working directory for this session. Must be an absolute path."""

    additional_directories: Sequence[str] = Field(default_factory=list)
    """Additional workspace roots reported for this session. Each path must be absolute."""

    session_id: str
    """Unique identifier for the session."""

    title: str | None = None
    """Human-readable title for the session."""

    updated_at: str | None = None
    """ISO 8601 timestamp of last activity."""

    archived: bool | None = None
    """**UNSTABLE**: Whether the session is archived."""

additional_directories class-attribute instance-attribute

additional_directories: Sequence[str] = Field(default_factory=list)

Additional workspace roots reported for this session. Each path must be absolute.

archived class-attribute instance-attribute

archived: bool | None = None

UNSTABLE: Whether the session is archived.

cwd instance-attribute

cwd: str

The working directory for this session. Must be an absolute path.

session_id instance-attribute

session_id: str

Unique identifier for the session.

title class-attribute instance-attribute

title: str | None = None

Human-readable title for the session.

updated_at class-attribute instance-attribute

updated_at: str | None = None

ISO 8601 timestamp of last activity.

SessionInfoUpdate

Bases: AnnotatedObject

Incremental update to session metadata.

Used to notify clients of changes to session info (title, timestamps) without requiring a full session list refresh.

Fields that are None are not changed. To update a field, set it to a value.

Source code in src/aclientp/schema/session_updates.py
class SessionInfoUpdate(AnnotatedObject):
    """Incremental update to session metadata.

    Used to notify clients of changes to session info (title, timestamps)
    without requiring a full session list refresh.

    Fields that are None are not changed. To update a field, set it to a value.
    """

    session_update: Literal["session_info_update"] = Field(
        default="session_info_update", init=False
    )

    title: str | None = None
    """New title for the session, or None to leave unchanged."""

    updated_at: str | None = None
    """New ISO 8601 timestamp, or None to leave unchanged."""

title class-attribute instance-attribute

title: str | None = None

New title for the session, or None to leave unchanged.

updated_at class-attribute instance-attribute

updated_at: str | None = None

New ISO 8601 timestamp, or None to leave unchanged.

SessionListCapabilities

Bases: AnnotatedObject

Capabilities for the session/list method.

By supplying {} it means that the agent supports listing of sessions.

Source code in src/aclientp/schema/capabilities.py
class SessionListCapabilities(AnnotatedObject):
    """Capabilities for the `session/list` method.

    By supplying `{}` it means that the agent supports listing of sessions.
    """

SessionMessage

Bases: AnnotatedObject

UNSTABLE: A message exchanged between sessions (e.g. parent and subagent).

Upserts by message_id: omitted fields are left unchanged, None clears them.

Source code in src/aclientp/schema/session_updates.py
class SessionMessage(AnnotatedObject):
    """**UNSTABLE**: A message exchanged between sessions (e.g. parent and subagent).

    Upserts by ``message_id``: omitted fields are left unchanged, ``None`` clears them.
    """

    session_update: Literal["session_message"] = Field(default="session_message", init=False)

    message_id: str
    """Identifier of this message within the enclosing session's transcript."""

    sender_session_id: str | None = None
    """The sending session."""

    recipient_session_id: str | None = None
    """The receiving session."""

    sender_message_id: str | None = None
    """On an incoming view, the ``message_id`` of the outgoing view in the sender's transcript."""

    recipient_message_id: str | None = None
    """On an outgoing view, the ``message_id`` of the incoming view in the recipient."""

    content: Sequence[ContentBlock] | None = None
    """Replaces all content when non-empty. ``None`` or ``[]`` clears it."""

content class-attribute instance-attribute

content: Sequence[ContentBlock] | None = None

Replaces all content when non-empty. None or [] clears it.

message_id instance-attribute

message_id: str

Identifier of this message within the enclosing session's transcript.

recipient_message_id class-attribute instance-attribute

recipient_message_id: str | None = None

On an outgoing view, the message_id of the incoming view in the recipient.

recipient_session_id class-attribute instance-attribute

recipient_session_id: str | None = None

The receiving session.

sender_message_id class-attribute instance-attribute

sender_message_id: str | None = None

On an incoming view, the message_id of the outgoing view in the sender's transcript.

sender_session_id class-attribute instance-attribute

sender_session_id: str | None = None

The sending session.

SessionMessageChunk

Bases: AnnotatedObject

UNSTABLE: A content block appended to a session_message.

Source code in src/aclientp/schema/session_updates.py
class SessionMessageChunk(AnnotatedObject):
    """**UNSTABLE**: A content block appended to a ``session_message``."""

    session_update: Literal["session_message_chunk"] = Field(
        default="session_message_chunk", init=False
    )

    message_id: str
    """Identifier of this message within the enclosing session's transcript."""

    content: ContentBlock
    """A single content block appended to the message."""

content instance-attribute

content: ContentBlock

A single content block appended to the message.

message_id instance-attribute

message_id: str

Identifier of this message within the enclosing session's transcript.

SessionMessageCursorAnchor

Bases: CursorMessageAnchor

UNSTABLE: The cursor is next to a session-directed message.

Source code in src/aclientp/schema/cursors.py
class SessionMessageCursorAnchor(CursorMessageAnchor):
    """**UNSTABLE**: The cursor is next to a session-directed message."""

    type: Literal["session_message"] = Field(default="session_message", init=False)

SessionMode

Bases: AnnotatedObject

A mode the agent can operate in.

See protocol docs: Session Modes

Source code in src/aclientp/schema/session_state.py
class SessionMode(AnnotatedObject):
    """A mode the agent can operate in.

    See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
    """

    description: str | None = None
    """Optional description of the mode."""

    id: str
    """Unique identifier for the mode."""

    name: str
    """Human-readable name of the mode."""

description class-attribute instance-attribute

description: str | None = None

Optional description of the mode.

id instance-attribute

id: str

Unique identifier for the mode.

name instance-attribute

name: str

Human-readable name of the mode.

SessionModeState

Bases: AnnotatedObject

The set of modes and the one currently active.

Source code in src/aclientp/schema/session_state.py
class SessionModeState(AnnotatedObject):
    """The set of modes and the one currently active."""

    available_modes: Sequence[SessionMode]
    """The set of modes that the Agent can operate in."""

    current_mode_id: str
    """The current mode the Agent is in."""

available_modes instance-attribute

available_modes: Sequence[SessionMode]

The set of modes that the Agent can operate in.

current_mode_id instance-attribute

current_mode_id: str

The current mode the Agent is in.

SessionNotification

Bases: AnnotatedObject

Notification containing a session update from the agent.

Used to stream real-time progress and results during prompt processing.

See protocol docs: Agent Reports Output

Source code in src/aclientp/schema/notifications.py
class SessionNotification(AnnotatedObject):
    """Notification containing a session update from the agent.

    Used to stream real-time progress and results during prompt processing.

    See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)
    """

    session_id: str
    """The ID of the session this update pertains to."""

    update: SessionUpdate
    """The session update data."""

session_id instance-attribute

session_id: str

The ID of the session this update pertains to.

update instance-attribute

update: SessionUpdate

The session update data.

SessionOptionsCapabilities

Bases: AnnotatedObject

UNSTABLE: Support for session/options.

Source code in src/aclientp/schema/capabilities.py
class SessionOptionsCapabilities(AnnotatedObject):
    """**UNSTABLE**: Support for ``session/options``."""

SessionOptionsRequest

Bases: Request

UNSTABLE: Request the modes and config options a session would start with.

Only available if the Agent supports the session.options capability.

Source code in src/aclientp/schema/client_requests.py
class SessionOptionsRequest(Request):
    """**UNSTABLE**: Request the modes and config options a session would start with.

    Only available if the Agent supports the ``session.options`` capability.
    """

    cwd: str
    """The working directory to resolve options for. Must be an absolute path."""

    additional_directories: Sequence[str] = Field(default_factory=list)
    """Additional workspace roots to resolve options for. Each path must be absolute."""

    session_id: str | None = None
    """The session to resolve options for."""

additional_directories class-attribute instance-attribute

additional_directories: Sequence[str] = Field(default_factory=list)

Additional workspace roots to resolve options for. Each path must be absolute.

cwd instance-attribute

cwd: str

The working directory to resolve options for. Must be an absolute path.

session_id class-attribute instance-attribute

session_id: str | None = None

The session to resolve options for.

SessionOptionsResponse

Bases: Response

UNSTABLE: The modes and config options a session would start with.

Source code in src/aclientp/schema/agent_responses.py
class SessionOptionsResponse(Response):
    """**UNSTABLE**: The modes and config options a session would start with."""

    modes: SessionModeState | None = None
    """The mode state the session would start with, if the Agent supports modes."""

    config_options: Sequence[SessionConfigOption] | None = None
    """The config options the session would start with."""

config_options class-attribute instance-attribute

config_options: Sequence[SessionConfigOption] | None = None

The config options the session would start with.

modes class-attribute instance-attribute

modes: SessionModeState | None = None

The mode state the session would start with, if the Agent supports modes.

SessionReferenceToolCallContent

Bases: AnnotatedObject

UNSTABLE: Reference to another session, e.g. a subagent spawned by this tool call.

Source code in src/aclientp/schema/tool_call.py
class SessionReferenceToolCallContent(AnnotatedObject):
    """**UNSTABLE**: Reference to another session, e.g. a subagent spawned by this tool call."""

    type: Literal["session"] = Field(default="session", init=False)
    """Session reference tool call content."""

    session_id: str
    """The referenced session."""

session_id instance-attribute

session_id: str

The referenced session.

type class-attribute instance-attribute

type: Literal['session'] = Field(default='session', init=False)

Session reference tool call content.

SessionResumeCapabilities

Bases: AnnotatedObject

Capabilities for the session/resume method.

By supplying {} it means that the agent supports resuming of sessions.

Source code in src/aclientp/schema/capabilities.py
class SessionResumeCapabilities(AnnotatedObject):
    """Capabilities for the `session/resume` method.

    By supplying `{}` it means that the agent supports resuming of sessions.
    """

SessionSetupRequest

Bases: Request

Fields shared by the session lifecycle requests (new, load, resume, fork).

Source code in src/aclientp/schema/client_requests.py
class SessionSetupRequest(Request):
    """Fields shared by the session lifecycle requests (new, load, resume, fork)."""

    cwd: str
    """The working directory for this session. Must be an absolute path."""

    additional_directories: Sequence[str] = Field(default_factory=list)
    """Additional workspace roots for this session. Each path must be absolute.

    Requires the ``session_capabilities.additional_directories`` capability.
    """

    mcp_servers: Sequence[McpServer] = Field(default_factory=list)
    """List of MCP (Model Context Protocol) servers the agent should connect to."""

    system_prompt: SystemPrompt | None = None
    """System-level instructions for the session.

    Requires the ``session_capabilities.system_prompt`` capability.
    """

    config_options: Sequence[InitialSessionConfigOption] = Field(default_factory=list)
    """**UNSTABLE**: Config option values to apply when the session is set up."""

additional_directories class-attribute instance-attribute

additional_directories: Sequence[str] = Field(default_factory=list)

Additional workspace roots for this session. Each path must be absolute.

Requires the session_capabilities.additional_directories capability.

config_options class-attribute instance-attribute

config_options: Sequence[InitialSessionConfigOption] = Field(default_factory=list)

UNSTABLE: Config option values to apply when the session is set up.

cwd instance-attribute

cwd: str

The working directory for this session. Must be an absolute path.

mcp_servers class-attribute instance-attribute

mcp_servers: Sequence[McpServer] = Field(default_factory=list)

List of MCP (Model Context Protocol) servers the agent should connect to.

system_prompt class-attribute instance-attribute

system_prompt: SystemPrompt | None = None

System-level instructions for the session.

Requires the session_capabilities.system_prompt capability.

SessionStatusCapabilities

Bases: AnnotatedObject

UNSTABLE: Support for session/status.

Source code in src/aclientp/schema/capabilities.py
class SessionStatusCapabilities(AnnotatedObject):
    """**UNSTABLE**: Support for ``session/status``."""

SessionStatusRequest

Bases: Request

UNSTABLE: Request parameters for checking whether the Agent has a session in memory.

Only available if the Agent supports the session.status capability.

Source code in src/aclientp/schema/client_requests.py
class SessionStatusRequest(Request):
    """**UNSTABLE**: Request parameters for checking whether the Agent has a session in memory.

    Only available if the Agent supports the ``session.status`` capability.
    """

    session_id: str
    """The ID of the session to check."""

session_id instance-attribute

session_id: str

The ID of the session to check.

SessionStatusResponse

Bases: Response

UNSTABLE: Response to session/status.

Source code in src/aclientp/schema/agent_responses.py
class SessionStatusResponse(Response):
    """**UNSTABLE**: Response to ``session/status``."""

    status: SessionStatus
    """Whether the Agent has the session in memory."""

status instance-attribute

status: SessionStatus

Whether the Agent has the session in memory.

SessionSystemPromptCapabilities

Bases: AnnotatedObject

Capabilities for client-provided system prompts.

Source code in src/aclientp/schema/capabilities.py
class SessionSystemPromptCapabilities(AnnotatedObject):
    """Capabilities for client-provided system prompts."""

    mode: SessionSystemPromptModeCapabilities | None = None
    """Delivery modes the agent supports in addition to ``append``."""

mode class-attribute instance-attribute

Delivery modes the agent supports in addition to append.

SessionSystemPromptModeCapabilities

Bases: AnnotatedObject

System prompt delivery modes the agent supports in addition to append.

Source code in src/aclientp/schema/capabilities.py
class SessionSystemPromptModeCapabilities(AnnotatedObject):
    """System prompt delivery modes the agent supports in addition to ``append``."""

    override: SessionSystemPromptOverrideCapabilities | None = None
    """Whether the agent supports ``override`` mode."""

override class-attribute instance-attribute

Whether the agent supports override mode.

SessionSystemPromptOverrideCapabilities

Bases: AnnotatedObject

Support for the override system prompt mode.

Source code in src/aclientp/schema/capabilities.py
class SessionSystemPromptOverrideCapabilities(AnnotatedObject):
    """Support for the ``override`` system prompt mode."""

SessionTitleCapabilities

Bases: AnnotatedObject

UNSTABLE: Support for session/set_title.

Source code in src/aclientp/schema/capabilities.py
class SessionTitleCapabilities(AnnotatedObject):
    """**UNSTABLE**: Support for ``session/set_title``."""

SetProviderRequest

Bases: Request

Configure a provider's routing.

Source code in src/aclientp/schema/providers.py
class SetProviderRequest(Request):
    """Configure a provider's routing."""

    provider_id: ProviderId
    """Provider ID to configure."""

    api_type: LlmProtocol
    """Protocol type for this provider."""

    base_url: str
    """Base URL for requests sent through this provider."""

    headers: dict[str, str] = Field(default_factory=dict)
    """Full headers map for this provider (may include authorization headers)."""

api_type instance-attribute

api_type: LlmProtocol

Protocol type for this provider.

base_url instance-attribute

base_url: str

Base URL for requests sent through this provider.

headers class-attribute instance-attribute

headers: dict[str, str] = Field(default_factory=dict)

Full headers map for this provider (may include authorization headers).

provider_id instance-attribute

provider_id: ProviderId

Provider ID to configure.

SetProviderResponse

Bases: Response

Response to providers/set.

Source code in src/aclientp/schema/providers.py
class SetProviderResponse(Response):
    """Response to ``providers/set``."""

SetSessionConfigOptionRequest

Bases: Request

Request parameters for setting a session configuration option.

Supports both select (string value ID) and boolean config options. When type is "boolean", value is a bool. When type is absent or "value_id", value is a string.

See protocol docs: Session Config Options

Source code in src/aclientp/schema/client_requests.py
class SetSessionConfigOptionRequest(Request):
    """Request parameters for setting a session configuration option.

    Supports both select (string value ID) and boolean config options.
    When ``type`` is ``"boolean"``, ``value`` is a bool.
    When ``type`` is absent or ``"value_id"``, ``value`` is a string.

    See protocol docs: [Session Config Options](https://agentclientprotocol.com/protocol/session-config-options)
    """

    config_id: str
    """The ID of the configuration option to set."""

    session_id: str
    """The ID of the session to set the config option for."""

    type: str | None = None
    """The value type discriminator. ``"boolean"`` for bool values, absent for string value IDs."""

    value: str | bool
    """The value to set. String for select options, bool for boolean options."""

config_id instance-attribute

config_id: str

The ID of the configuration option to set.

session_id instance-attribute

session_id: str

The ID of the session to set the config option for.

type class-attribute instance-attribute

type: str | None = None

The value type discriminator. "boolean" for bool values, absent for string value IDs.

value instance-attribute

value: str | bool

The value to set. String for select options, bool for boolean options.

SetSessionConfigOptionResponse

Bases: Response

Response to session/set_config_option method.

Source code in src/aclientp/schema/agent_responses.py
class SetSessionConfigOptionResponse(Response):
    """Response to `session/set_config_option` method."""

    config_options: Sequence[SessionConfigOption] = []
    """The full list of config options with updated values."""

config_options class-attribute instance-attribute

config_options: Sequence[SessionConfigOption] = []

The full list of config options with updated values.

SetSessionModeRequest

Bases: Request

Request parameters for setting a session mode.

Source code in src/aclientp/schema/client_requests.py
class SetSessionModeRequest(Request):
    """Request parameters for setting a session mode."""

    mode_id: str
    """The ID of the mode to set."""

    session_id: str
    """The ID of the session to set the mode for."""

mode_id instance-attribute

mode_id: str

The ID of the mode to set.

session_id instance-attribute

session_id: str

The ID of the session to set the mode for.

SetSessionModeResponse

Bases: Response

Response to session/set_mode method.

Source code in src/aclientp/schema/agent_responses.py
class SetSessionModeResponse(Response):
    """Response to `session/set_mode` method."""

SetSessionTitleRequest

Bases: Request

UNSTABLE: Request parameters for renaming a session.

Only available if the Agent supports the session.title capability.

Source code in src/aclientp/schema/client_requests.py
class SetSessionTitleRequest(Request):
    """**UNSTABLE**: Request parameters for renaming a session.

    Only available if the Agent supports the ``session.title`` capability.
    """

    session_id: str
    """The ID of the session to retitle."""

    title: str
    """The new title for the session."""

session_id instance-attribute

session_id: str

The ID of the session to retitle.

title instance-attribute

title: str

The new title for the session.

SetSessionTitleResponse

Bases: Response

UNSTABLE: Response to session/set_title.

Source code in src/aclientp/schema/agent_responses.py
class SetSessionTitleResponse(Response):
    """**UNSTABLE**: Response to ``session/set_title``."""

    title: str
    """The title the Agent stored."""

title instance-attribute

title: str

The title the Agent stored.

SseMcpServer

Bases: BaseMcpServer

SSE transport configuration.

Only available when the Agent capabilities indicate mcp_capabilities.sse is true.

Source code in src/aclientp/schema/mcp.py
class SseMcpServer(BaseMcpServer):
    """SSE transport configuration.

    Only available when the Agent capabilities indicate `mcp_capabilities.sse` is `true`.
    """

    headers: Sequence[HttpHeader]
    """HTTP headers to set when making requests to the MCP server."""

    type: Literal["sse"] = Field(default="sse", init=False)
    """SSE transport type."""

    url: HttpUrl
    """URL to the MCP server."""

    def get_headers_dict(self) -> dict[str, str]:
        return {header.name: header.value for header in self.headers}

headers instance-attribute

headers: Sequence[HttpHeader]

HTTP headers to set when making requests to the MCP server.

type class-attribute instance-attribute

type: Literal['sse'] = Field(default='sse', init=False)

SSE transport type.

url instance-attribute

url: HttpUrl

URL to the MCP server.

StdioMcpServer

Bases: BaseMcpServer

Stdio transport configuration.

All Agents MUST support this transport.

Source code in src/aclientp/schema/mcp.py
class StdioMcpServer(BaseMcpServer):
    """Stdio transport configuration.

    All Agents MUST support this transport.
    """

    args: Sequence[str]
    """Command-line arguments to pass to the MCP server."""

    # typ: Literal["stdio"] = Field(default="stdio", init=False)
    # """Stdio transport type."""

    command: str
    """Path to the MCP server executable."""

    env: Sequence[EnvVariable]
    """Environment variables to set when launching the MCP server."""

    def get_env_dict(self) -> dict[str, str]:
        return {env.name: env.value for env in self.env}

args instance-attribute

args: Sequence[str]

Command-line arguments to pass to the MCP server.

command instance-attribute

command: str

Path to the MCP server executable.

env instance-attribute

env: Sequence[EnvVariable]

Environment variables to set when launching the MCP server.

StringPropertySchema

Bases: AnnotatedObject

Schema for string properties in an elicitation form.

When enum_values or one_of is set, this represents a single-select enum.

Source code in src/aclientp/schema/elicitation.py
class StringPropertySchema(AnnotatedObject):
    """Schema for string properties in an elicitation form.

    When ``enum_values`` or ``one_of`` is set, this represents a single-select enum.
    """

    type: Literal["string"] = "string"
    """Type discriminator."""

    title: str | None = None
    """Optional title for the property."""

    description: str | None = None
    """Human-readable description."""

    min_length: int | None = Field(default=None, ge=0)
    """Minimum string length."""

    max_length: int | None = Field(default=None, ge=0)
    """Maximum string length."""

    pattern: str | None = None
    """Pattern the string must match."""

    format: StringFormatLiteral | None = None
    """String format."""

    default: str | None = None
    """Default value."""

    enum: Sequence[str] | None = None
    """Enum values for untitled single-select enums."""

    one_of: Sequence[EnumOption] | None = None
    """Titled enum options for titled single-select enums."""

default class-attribute instance-attribute

default: str | None = None

Default value.

description class-attribute instance-attribute

description: str | None = None

Human-readable description.

enum class-attribute instance-attribute

enum: Sequence[str] | None = None

Enum values for untitled single-select enums.

format class-attribute instance-attribute

format: StringFormatLiteral | None = None

String format.

max_length class-attribute instance-attribute

max_length: int | None = Field(default=None, ge=0)

Maximum string length.

min_length class-attribute instance-attribute

min_length: int | None = Field(default=None, ge=0)

Minimum string length.

one_of class-attribute instance-attribute

one_of: Sequence[EnumOption] | None = None

Titled enum options for titled single-select enums.

pattern class-attribute instance-attribute

pattern: str | None = None

Pattern the string must match.

title class-attribute instance-attribute

title: str | None = None

Optional title for the property.

type class-attribute instance-attribute

type: Literal['string'] = 'string'

Type discriminator.

SubagentCapabilities

Bases: AnnotatedObject

UNSTABLE: Client support for subagent_update session updates.

Source code in src/aclientp/schema/capabilities.py
class SubagentCapabilities(AnnotatedObject):
    """**UNSTABLE**: Client support for ``subagent_update`` session updates."""

SubagentSessionCapabilities

Bases: AnnotatedObject

UNSTABLE: Capabilities of a subagent session.

Source code in src/aclientp/schema/capabilities.py
class SubagentSessionCapabilities(AnnotatedObject):
    """**UNSTABLE**: Capabilities of a subagent session."""

    cancel: SessionCancelCapabilities | None = None
    """Permits the client to cancel this child's current work without ending the session."""

cancel class-attribute instance-attribute

cancel: SessionCancelCapabilities | None = None

Permits the client to cancel this child's current work without ending the session.

SubagentUpdate

Bases: AnnotatedObject

UNSTABLE: A subagent session started by the parent, or a change to it.

Only sent if the client advertised the subagents capability.

Source code in src/aclientp/schema/session_updates.py
class SubagentUpdate(AnnotatedObject):
    """**UNSTABLE**: A subagent session started by the parent, or a change to it.

    Only sent if the client advertised the ``subagents`` capability.
    """

    session_update: Literal["subagent_update"] = Field(default="subagent_update", init=False)

    session_id: str
    """The opaque session ID identifying the child in all ACP messages."""

    title: str | None = None
    """The parent's human-readable display title for this child."""

    description: str | None = None
    """The parent's description of the child's role or purpose."""

    capabilities: SubagentSessionCapabilities | None = None
    """Client-initiated session mutations permitted for this subagent session."""

    state: StateUpdate | None = None
    """Current state snapshot for the child session."""

    cwd: str | None = None
    """The child's working directory. Must be an absolute path."""

    additional_directories: Sequence[str] | None = None
    """Additional workspace roots for the child. Each path must be absolute."""

additional_directories class-attribute instance-attribute

additional_directories: Sequence[str] | None = None

Additional workspace roots for the child. Each path must be absolute.

capabilities class-attribute instance-attribute

capabilities: SubagentSessionCapabilities | None = None

Client-initiated session mutations permitted for this subagent session.

cwd class-attribute instance-attribute

cwd: str | None = None

The child's working directory. Must be an absolute path.

description class-attribute instance-attribute

description: str | None = None

The parent's description of the child's role or purpose.

session_id instance-attribute

session_id: str

The opaque session ID identifying the child in all ACP messages.

state class-attribute instance-attribute

state: StateUpdate | None = None

Current state snapshot for the child session.

title class-attribute instance-attribute

title: str | None = None

The parent's human-readable display title for this child.

SystemPrompt

Bases: AnnotatedObject

Client-provided system-level instructions for a session.

Only allowed if the Agent advertises session_capabilities.system_prompt.

Source code in src/aclientp/schema/client_requests.py
class SystemPrompt(AnnotatedObject):
    """Client-provided system-level instructions for a session.

    Only allowed if the Agent advertises ``session_capabilities.system_prompt``.
    """

    mode: SystemPromptMode
    """How the Agent combines ``content`` with its own instructions."""

    content: Sequence[ContentBlock]
    """The system prompt content."""

content instance-attribute

content: Sequence[ContentBlock]

The system prompt content.

mode instance-attribute

How the Agent combines content with its own instructions.

TerminalExitStatus

Bases: AnnotatedObject

Exit status of a terminal command.

Source code in src/aclientp/schema/terminal.py
class TerminalExitStatus(AnnotatedObject):
    """Exit status of a terminal command."""

    exit_code: int | None = None
    """The process exit code (may be null if terminated by signal)."""

    signal: str | None = None
    """The signal that terminated the process (may be null if exited normally)."""

exit_code class-attribute instance-attribute

exit_code: int | None = None

The process exit code (may be null if terminated by signal).

signal class-attribute instance-attribute

signal: str | None = None

The signal that terminated the process (may be null if exited normally).

TerminalOutputRequest

Bases: BaseAgentRequest

Request to get the current output and status of a terminal.

Source code in src/aclientp/schema/agent_requests.py
class TerminalOutputRequest(BaseAgentRequest):
    """Request to get the current output and status of a terminal."""

    terminal_id: str
    """The ID of the terminal to get output from."""

terminal_id instance-attribute

terminal_id: str

The ID of the terminal to get output from.

TerminalOutputResponse

Bases: Response

Response containing the terminal output and exit status.

Source code in src/aclientp/schema/client_responses.py
class TerminalOutputResponse(Response):
    """Response containing the terminal output and exit status."""

    exit_status: TerminalExitStatus | None = None
    """Exit status if the command has completed."""

    output: str
    """The terminal output captured so far."""

    truncated: bool
    """Whether the output was truncated due to byte limits."""

exit_status class-attribute instance-attribute

exit_status: TerminalExitStatus | None = None

Exit status if the command has completed.

output instance-attribute

output: str

The terminal output captured so far.

truncated instance-attribute

truncated: bool

Whether the output was truncated due to byte limits.

TerminalToolCallContent

Bases: AnnotatedObject

Embed a terminal created with terminal/create by its id.

The terminal must be added before calling terminal/release. See protocol docs: Terminal

Source code in src/aclientp/schema/tool_call.py
class TerminalToolCallContent(AnnotatedObject):
    """Embed a terminal created with `terminal/create` by its id.

    The terminal must be added before calling `terminal/release`.
    See protocol docs: [Terminal](https://agentclientprotocol.com/protocol/terminal)
    """

    type: Literal["terminal"] = Field(default="terminal", init=False)
    """Terminal tool call content."""

    terminal_id: str
    """The ID of the terminal being embedded."""

terminal_id instance-attribute

terminal_id: str

The ID of the terminal being embedded.

type class-attribute instance-attribute

type: Literal['terminal'] = Field(default='terminal', init=False)

Terminal tool call content.

TextContentBlock

Bases: BaseContentBlock

Text content.

May be plain text or formatted with Markdown.

All agents MUST support text content blocks in prompts. Clients SHOULD render this text as Markdown.

Source code in src/aclientp/schema/content_blocks.py
class TextContentBlock(BaseContentBlock):
    """Text content.

    May be plain text or formatted with Markdown.

    All agents MUST support text content blocks in prompts.
    Clients SHOULD render this text as Markdown.
    """

    type: Literal["text"] = Field(default="text", init=False)

    text: str
    """Text content of the block."""

text instance-attribute

text: str

Text content of the block.

TextResourceContents

Bases: BaseResourceContents

Text-based resource contents.

Source code in src/aclientp/schema/content_blocks.py
class TextResourceContents(BaseResourceContents):
    """Text-based resource contents."""

    text: str
    """Text content of the resource."""

text instance-attribute

text: str

Text content of the resource.

TitledMultiSelectItems

Bases: AnnotatedObject

Items definition for titled multi-select enum properties.

Source code in src/aclientp/schema/elicitation.py
class TitledMultiSelectItems(AnnotatedObject):
    """Items definition for titled multi-select enum properties."""

    any_of: Sequence[EnumOption]
    """Titled enum options."""

any_of instance-attribute

any_of: Sequence[EnumOption]

Titled enum options.

ToolCallCursorAnchor

Bases: AnnotatedObject

UNSTABLE: The cursor is next to a tool call.

Source code in src/aclientp/schema/cursors.py
class ToolCallCursorAnchor(AnnotatedObject):
    """**UNSTABLE**: The cursor is next to a tool call."""

    type: Literal["tool_call"] = Field(default="tool_call", init=False)

    tool_call_id: str
    """The ID of the anchored tool call."""

    position: CursorAnchorPosition
    """On which side of the tool call the cursor is."""

position instance-attribute

On which side of the tool call the cursor is.

tool_call_id instance-attribute

tool_call_id: str

The ID of the anchored tool call.

ToolCallLocation

Bases: AnnotatedObject

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 Agent

Source code in src/aclientp/schema/tool_call.py
class ToolCallLocation(AnnotatedObject):
    """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 Agent](https://agentclientprotocol.com/protocol/tool-calls#following-the-agent)
    """

    line: int | None = Field(default=0, ge=0)
    """Optional 1-based line number within the file.

    Defaults to 0 (unspecified) rather than None: some clients only render
    clickable paths when the field is present.
    """

    path: str
    """The absolute file path being accessed or modified."""

line class-attribute instance-attribute

line: int | None = Field(default=0, ge=0)

Optional 1-based line number within the file.

Defaults to 0 (unspecified) rather than None: some clients only render clickable paths when the field is present.

path instance-attribute

path: str

The absolute file path being accessed or modified.

ToolCallProgress

Bases: AnnotatedObject

Update on the status or results of a tool call.

Source code in src/aclientp/schema/session_updates.py
class ToolCallProgress(AnnotatedObject):
    """Update on the status or results of a tool call."""

    session_update: Literal["tool_call_update"] = Field(default="tool_call_update", init=False)
    """Tool call update."""

    content: Sequence[ToolCallContent] | None = None
    """Replace the content collection."""

    kind: ToolCallKind | None = None
    """Update the tool kind."""

    locations: Sequence[ToolCallLocation] | None = None
    """Replace the locations collection."""

    raw_input: Any | None = None
    """Update the raw input."""

    raw_output: Any | None = None
    """Update the raw output."""

    status: ToolCallStatus | None = None
    """Update the execution status."""

    title: str | None = None
    """Update the human-readable title."""

    name: str | None = None
    """Update the programmatic name of the tool being invoked."""

    tool_call_id: str
    """The ID of the tool call being updated."""

content class-attribute instance-attribute

content: Sequence[ToolCallContent] | None = None

Replace the content collection.

kind class-attribute instance-attribute

kind: ToolCallKind | None = None

Update the tool kind.

locations class-attribute instance-attribute

locations: Sequence[ToolCallLocation] | None = None

Replace the locations collection.

name class-attribute instance-attribute

name: str | None = None

Update the programmatic name of the tool being invoked.

raw_input class-attribute instance-attribute

raw_input: Any | None = None

Update the raw input.

raw_output class-attribute instance-attribute

raw_output: Any | None = None

Update the raw output.

session_update class-attribute instance-attribute

session_update: Literal['tool_call_update'] = Field(default='tool_call_update', init=False)

Tool call update.

status class-attribute instance-attribute

status: ToolCallStatus | None = None

Update the execution status.

title class-attribute instance-attribute

title: str | None = None

Update the human-readable title.

tool_call_id instance-attribute

tool_call_id: str

The ID of the tool call being updated.

ToolCallStart

Bases: AnnotatedObject

Notification that a new tool call has been initiated.

Source code in src/aclientp/schema/session_updates.py
class ToolCallStart(AnnotatedObject):
    """Notification that a new tool call has been initiated."""

    session_update: Literal["tool_call"] = Field(default="tool_call", init=False)
    """Notification that a new tool call has been initiated."""

    content: Sequence[ToolCallContent] | None = None
    """Content produced by the tool call."""

    kind: ToolCallKind | None = None
    """The category of tool being invoked.

    Helps clients choose appropriate icons and UI treatment.
    """

    locations: Sequence[ToolCallLocation] | None = None
    """File locations affected by this tool call.

    Enables "follow-along" features in clients.
    """

    raw_input: Any | None = None
    """Raw input parameters sent to the tool."""

    raw_output: Any | None = None
    """Raw output returned by the tool."""

    status: ToolCallStatus | None = None
    """Current execution status of the tool call."""

    title: str
    """Human-readable title describing what the tool is doing."""

    name: str | None = None
    """Programmatic name of the tool being invoked."""

    tool_call_id: str
    """Unique identifier for this tool call within the session."""

content class-attribute instance-attribute

content: Sequence[ToolCallContent] | None = None

Content produced by the tool call.

kind class-attribute instance-attribute

kind: ToolCallKind | None = None

The category of tool being invoked.

Helps clients choose appropriate icons and UI treatment.

locations class-attribute instance-attribute

locations: Sequence[ToolCallLocation] | None = None

File locations affected by this tool call.

Enables "follow-along" features in clients.

name class-attribute instance-attribute

name: str | None = None

Programmatic name of the tool being invoked.

raw_input class-attribute instance-attribute

raw_input: Any | None = None

Raw input parameters sent to the tool.

raw_output class-attribute instance-attribute

raw_output: Any | None = None

Raw output returned by the tool.

session_update class-attribute instance-attribute

session_update: Literal['tool_call'] = Field(default='tool_call', init=False)

Notification that a new tool call has been initiated.

status class-attribute instance-attribute

status: ToolCallStatus | None = None

Current execution status of the tool call.

title instance-attribute

title: str

Human-readable title describing what the tool is doing.

tool_call_id instance-attribute

tool_call_id: str

Unique identifier for this tool call within the session.

ToolCallUpdate

Bases: AnnotatedObject

Details about the tool call requiring permission.

Source code in src/aclientp/schema/tool_call.py
class ToolCallUpdate(AnnotatedObject):
    """Details about the tool call requiring permission."""

    content: Sequence[ToolCallContent] | None = None
    """Replace the content collection."""

    kind: ToolCallKind | None = None
    """Update the tool kind."""

    locations: Sequence[ToolCallLocation] | None = None
    """Replace the locations collection."""

    raw_input: Any | None = None
    """Update the raw input."""

    raw_output: Any | None = None
    """Update the raw output."""

    status: ToolCallStatus | None = None
    """Update the execution status."""

    title: str | None = None
    """Update the human-readable title."""

    name: str | None = None
    """Programmatic name of the tool being invoked."""

    tool_call_id: str
    """The ID of the tool call being updated."""

content class-attribute instance-attribute

content: Sequence[ToolCallContent] | None = None

Replace the content collection.

kind class-attribute instance-attribute

kind: ToolCallKind | None = None

Update the tool kind.

locations class-attribute instance-attribute

locations: Sequence[ToolCallLocation] | None = None

Replace the locations collection.

name class-attribute instance-attribute

name: str | None = None

Programmatic name of the tool being invoked.

raw_input class-attribute instance-attribute

raw_input: Any | None = None

Update the raw input.

raw_output class-attribute instance-attribute

raw_output: Any | None = None

Update the raw output.

status class-attribute instance-attribute

status: ToolCallStatus | None = None

Update the execution status.

title class-attribute instance-attribute

title: str | None = None

Update the human-readable title.

tool_call_id instance-attribute

tool_call_id: str

The ID of the tool call being updated.

UnarchiveSessionRequest

Bases: Request

UNSTABLE: Request parameters for unarchiving a session.

Only available if the Agent supports the session.archive capability.

Source code in src/aclientp/schema/client_requests.py
class UnarchiveSessionRequest(Request):
    """**UNSTABLE**: Request parameters for unarchiving a session.

    Only available if the Agent supports the ``session.archive`` capability.
    """

    session_id: str
    """The ID of the session to unarchive."""

session_id instance-attribute

session_id: str

The ID of the session to unarchive.

UnarchiveSessionResponse

Bases: Response

UNSTABLE: Response to session/unarchive.

Source code in src/aclientp/schema/agent_responses.py
class UnarchiveSessionResponse(Response):
    """**UNSTABLE**: Response to ``session/unarchive``."""

UnknownCursorAnchor

Bases: AnnotatedObject

UNSTABLE: A cursor anchored to a custom or future kind of entity.

The raw kind is kept in type; values starting with _ are extensions. A Client that does not recognize it cannot place the cursor.

Source code in src/aclientp/schema/cursors.py
class UnknownCursorAnchor(AnnotatedObject):
    """**UNSTABLE**: A cursor anchored to a custom or future kind of entity.

    The raw kind is kept in ``type``; values starting with ``_`` are extensions.
    A Client that does not recognize it cannot place the cursor.
    """

    type: str
    """The anchor kind."""

type instance-attribute

type: str

The anchor kind.

UnknownStateUpdate

Bases: AnnotatedObject

UNSTABLE: The Agent cannot currently determine foreground activity.

Also used for custom or future states, whose raw value is kept in state.

Source code in src/aclientp/schema/session_updates.py
class UnknownStateUpdate(AnnotatedObject):
    """**UNSTABLE**: The Agent cannot currently determine foreground activity.

    Also used for custom or future states, whose raw value is kept in ``state``.
    """

    state: str = "unknown"

UntitledMultiSelectItems

Bases: AnnotatedObject

Items definition for untitled multi-select enum properties.

Source code in src/aclientp/schema/elicitation.py
class UntitledMultiSelectItems(AnnotatedObject):
    """Items definition for untitled multi-select enum properties."""

    type: Literal["string"] = "string"
    """Item type discriminator. Must be ``"string"``."""

    enum: Sequence[str]
    """Allowed enum values."""

enum instance-attribute

enum: Sequence[str]

Allowed enum values.

type class-attribute instance-attribute

type: Literal['string'] = 'string'

Item type discriminator. Must be "string".

Usage

Bases: AnnotatedObject

UNSTABLE: Token usage information for a prompt turn.

Source code in src/aclientp/schema/session_updates.py
class Usage(AnnotatedObject):
    """**UNSTABLE**: Token usage information for a prompt turn."""

    total_tokens: int = Field(ge=0)
    """Sum of all token types across session."""

    input_tokens: int = Field(ge=0)
    """Total input tokens across all turns."""

    output_tokens: int = Field(ge=0)
    """Total output tokens across all turns."""

    thought_tokens: int | None = Field(default=None, ge=0)
    """Total thought/reasoning tokens."""

    cached_read_tokens: int | None = Field(default=None, ge=0)
    """Total cache read tokens."""

    cached_write_tokens: int | None = Field(default=None, ge=0)
    """Total cache write tokens."""

cached_read_tokens class-attribute instance-attribute

cached_read_tokens: int | None = Field(default=None, ge=0)

Total cache read tokens.

cached_write_tokens class-attribute instance-attribute

cached_write_tokens: int | None = Field(default=None, ge=0)

Total cache write tokens.

input_tokens class-attribute instance-attribute

input_tokens: int = Field(ge=0)

Total input tokens across all turns.

output_tokens class-attribute instance-attribute

output_tokens: int = Field(ge=0)

Total output tokens across all turns.

thought_tokens class-attribute instance-attribute

thought_tokens: int | None = Field(default=None, ge=0)

Total thought/reasoning tokens.

total_tokens class-attribute instance-attribute

total_tokens: int = Field(ge=0)

Sum of all token types across session.

UsageUpdate

Bases: AnnotatedObject

Context window and cost update for a session.

Source code in src/aclientp/schema/session_updates.py
class UsageUpdate(AnnotatedObject):
    """Context window and cost update for a session."""

    session_update: Literal["usage_update"] = Field(default="usage_update", init=False)

    used: int = Field(ge=0)
    """Tokens currently in context."""

    size: int = Field(ge=0)
    """Total context window size in tokens."""

    cost: Cost | None = None
    """Cumulative session cost (optional)."""

cost class-attribute instance-attribute

cost: Cost | None = None

Cumulative session cost (optional).

size class-attribute instance-attribute

size: int = Field(ge=0)

Total context window size in tokens.

used class-attribute instance-attribute

used: int = Field(ge=0)

Tokens currently in context.

UserMessageChunk

Bases: BaseChunk

A chunk of the user's message being streamed.

Source code in src/aclientp/schema/session_updates.py
class UserMessageChunk(BaseChunk):
    """A chunk of the user's message being streamed."""

    session_update: Literal["user_message_chunk"] = Field(default="user_message_chunk", init=False)
    """User message chunk."""

session_update class-attribute instance-attribute

session_update: Literal['user_message_chunk'] = Field(default='user_message_chunk', init=False)

User message chunk.

UserMessageCursorAnchor

Bases: CursorMessageAnchor

UNSTABLE: The cursor is next to a user message.

Source code in src/aclientp/schema/cursors.py
class UserMessageCursorAnchor(CursorMessageAnchor):
    """**UNSTABLE**: The cursor is next to a user message."""

    type: Literal["user_message"] = Field(default="user_message", init=False)

WaitForTerminalExitRequest

Bases: BaseAgentRequest

Request to wait for a terminal command to exit.

Source code in src/aclientp/schema/agent_requests.py
class WaitForTerminalExitRequest(BaseAgentRequest):
    """Request to wait for a terminal command to exit."""

    terminal_id: str
    """The ID of the terminal to wait for."""

terminal_id instance-attribute

terminal_id: str

The ID of the terminal to wait for.

WaitForTerminalExitResponse

Bases: Response

Response containing the exit status of a terminal command.

Source code in src/aclientp/schema/client_responses.py
class WaitForTerminalExitResponse(Response):
    """Response containing the exit status of a terminal command."""

    exit_code: int | None = None
    """The process exit code (may be null if terminated by signal)."""

    signal: str | None = None
    """The signal that terminated the process (may be null if exited normally)."""

exit_code class-attribute instance-attribute

exit_code: int | None = None

The process exit code (may be null if terminated by signal).

signal class-attribute instance-attribute

signal: str | None = None

The signal that terminated the process (may be null if exited normally).

WriteTextFileRequest

Bases: BaseAgentRequest

Request to write content to a text file.

Only available if the client supports the fs.writeTextFile capability.

Source code in src/aclientp/schema/agent_requests.py
class WriteTextFileRequest(BaseAgentRequest):
    """Request to write content to a text file.

    Only available if the client supports the `fs.writeTextFile` capability.
    """

    content: str
    """The text content to write to the file."""

    path: str
    """Absolute path to the file to write."""

content instance-attribute

content: str

The text content to write to the file.

path instance-attribute

path: str

Absolute path to the file to write.

WriteTextFileResponse

Bases: Response

Response to fs/write_text_file.

Source code in src/aclientp/schema/client_responses.py
class WriteTextFileResponse(Response):
    """Response to `fs/write_text_file`."""