From 30f449c558a19ec09dd7adf6ecefa0bb440bfa0c Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Thu, 20 Nov 2025 14:31:52 +0100 Subject: [PATCH 1/8] Clean up JSON Schema We made some changes in the past to inline a bunch of $refs to make things easier for sdk generation. However, this came with downsides of less distinct types. This should have a more compatible version, that still preserves the non-inlined types. At least on the TypeScript side this has vastly improved the generated types. --- Cargo.lock | 48 +- Cargo.toml | 2 +- docs/protocol/schema.mdx | 925 ++++++++------- rust/bin/generate.rs | 6 +- rust/client.rs | 3 - rust/content.rs | 16 +- rust/plan.rs | 1 - rust/rpc.rs | 5 - rust/tool_call.rs | 2 - schema/schema.json | 1701 ++++++++++++++++------------ unstable/docs/protocol/schema.mdx | 935 +++++++++------- unstable/schema/schema.json | 1727 +++++++++++++++++------------ 12 files changed, 3071 insertions(+), 2300 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 09b3cda2..1b3ba381 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -54,42 +54,42 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "memchr" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" [[package]] name = "proc-macro2" -version = "1.0.101" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.40" +version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" dependencies = [ "proc-macro2", ] [[package]] name = "ref-cast" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", @@ -104,9 +104,9 @@ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "schemars" -version = "1.0.4" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +checksum = "9558e172d4e8533736ba97870c4b2cd63f84b382a3d6eb063da41b91cce17289" dependencies = [ "dyn-clone", "ref-cast", @@ -117,9 +117,9 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "1.0.4" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80" +checksum = "301858a4023d78debd2353c7426dc486001bddc91ae31a76fb1f55132f7e2633" dependencies = [ "proc-macro2", "quote", @@ -129,9 +129,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.226" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dca6411025b24b60bfa7ec1fe1f8e710ac09782dca409ee8237ba74b51295fd" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ "serde_core", "serde_derive", @@ -139,18 +139,18 @@ dependencies = [ [[package]] name = "serde_core" -version = "1.0.226" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba2ba63999edb9dac981fb34b3e5c0d111a69b0924e253ed29d83f7c99e966a4" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.226" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8db53ae22f34573731bafa1db20f04027b2d25e02d8205921b569171699cdb33" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -183,9 +183,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.106" +version = "2.0.110" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +checksum = "a99801b5bd34ede4cf3fc688c5919368fea4e4814a4664359503e6015b280aea" dependencies = [ "proc-macro2", "quote", @@ -194,9 +194,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.19" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" [[package]] name = "unicode-xid" diff --git a/Cargo.toml b/Cargo.toml index 8a95d9f3..84f94ed5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ path = "rust/bin/generate.rs" [dependencies] anyhow = "1" -derive_more = { version = "2.0.1", features = ["from", "display"] } +derive_more = { version = "2", features = ["from", "display"] } schemars = { version = "1" } serde = { version = "1", features = ["derive", "rc"] } serde_json = { version = "1", features = ["raw_value"] } diff --git a/docs/protocol/schema.mdx b/docs/protocol/schema.mdx index d21e0d6c..677f6292 100644 --- a/docs/protocol/schema.mdx +++ b/docs/protocol/schema.mdx @@ -35,11 +35,7 @@ Specifies which authentication method to use. Extension point for implementations -AuthMethodId} - required -> + The ID of the authentication method to use. Must be one of the methods advertised in the initialize response. @@ -85,7 +81,7 @@ See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/ini Extension point for implementations -ClientCapabilities} > + Capabilities supported by the client. - Default: `{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false}` @@ -97,7 +93,7 @@ See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/ini Note: in future versions of the protocol, this will be required. -ProtocolVersion} required> + The latest protocol version supported by the client. @@ -116,7 +112,7 @@ See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/ini Extension point for implementations -AgentCapabilities} > + Capabilities supported by the agent. - Default: `{"loadSession":false,"mcpCapabilities":{"http":false,"sse":false},"promptCapabilities":{"audio":false,"embeddedContext":false,"image":false}}` @@ -134,7 +130,7 @@ Note: in future versions of the protocol, this will be required. - Default: `[]` -ProtocolVersion} required> + The protocol version the client specified if supported by the agent, or the latest protocol version supported by the agent. @@ -171,11 +167,7 @@ See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/promp Extension point for implementations -SessionId} - required -> + The ID of the session to cancel operations for. @@ -226,11 +218,7 @@ See protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/s > List of MCP servers to connect to for this session. -SessionId} - required -> + The ID of the session to load. @@ -319,7 +307,7 @@ See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes) -SessionId} required> + Unique identifier for the created session. Used in all subsequent requests for this conversation. @@ -373,7 +361,7 @@ as it avoids extra round-trips and allows the message to include pieces of context from sources the agent may not have access to. -SessionId} required> + The ID of the session to send this user message to @@ -390,11 +378,7 @@ See protocol docs: [Check for Completion](https://agentclientprotocol.com/protoc Extension point for implementations -StopReason} - required -> + Indicates why the agent stopped processing the turn. @@ -426,18 +410,10 @@ Request parameters for setting a session mode. Extension point for implementations -SessionModeId} - required -> + The ID of the mode to set. -SessionId} - required -> + The ID of the session to set the mode for. @@ -497,7 +473,7 @@ Only available if the client supports the `fs.readTextFile` capability. Absolute path to the file to read. -SessionId} required> + The session ID for this request. @@ -543,11 +519,7 @@ Only available if the client supports the `fs.writeTextFile` capability. Absolute path to the file to write. -SessionId} - required -> + The session ID for this request. @@ -606,11 +578,7 @@ See protocol docs: [Requesting Permission](https://agentclientprotocol.com/proto > Available permission options for the user to choose from. -SessionId} - required -> + The session ID for this request. @@ -628,11 +596,7 @@ Response to a permission request. Extension point for implementations -RequestPermissionOutcome} - required -> + The user's decision on the permission request. @@ -666,18 +630,10 @@ See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protoc Extension point for implementations -SessionId} - required -> + The ID of the session this update pertains to. -SessionUpdate} - required -> + The actual update content. @@ -735,7 +691,7 @@ specified limit. - Minimum: `0` -SessionId} required> + The session ID for this request. @@ -781,11 +737,7 @@ Request to kill a terminal command without releasing the terminal. Extension point for implementations -SessionId} - required -> + The session ID for this request. @@ -825,11 +777,7 @@ Request to get the current output and status of a terminal. Extension point for implementations -SessionId} - required -> + The session ID for this request. @@ -894,11 +842,7 @@ Request to release a terminal and free its resources. Extension point for implementations -SessionId} - required -> + The session ID for this request. @@ -935,11 +879,7 @@ Request to wait for a terminal command to exit. Extension point for implementations -SessionId} - required -> + The session ID for this request. @@ -989,13 +929,13 @@ See protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol - Default: `false` -McpCapabilities} > + MCP capabilities supported by the agent. - Default: `{"http":false,"sse":false}` -PromptCapabilities} > + Prompt capabilities supported by the agent. - Default: `{"audio":false,"embeddedContext":false,"image":false}` @@ -1017,6 +957,31 @@ Optional annotations for the client. The client can use annotations to inform ho +## AudioContent + +Audio provided to or from an LLM. + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + + Annotations + + | null + + } +> + + + ## AuthMethod Describes an available authentication method. @@ -1031,11 +996,7 @@ Describes an available authentication method. Optional description providing more details about this authentication method. -AuthMethodId} - required -> + Unique identifier for this authentication method. @@ -1097,6 +1058,32 @@ All text that was typed after the command name is provided as input. +## AvailableCommandsUpdate + +Available commands are ready or have changed + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + + AvailableCommand + + [] + + } + required +> + Commands the agent can execute + + ## BlobResourceContents Binary resource contents. @@ -1128,7 +1115,7 @@ See protocol docs: [Client Capabilities](https://agentclientprotocol.com/protoco Extension point for implementations -FileSystemCapability} > + File system capabilities supported by the client. Determines which file operations the agent can request. @@ -1170,21 +1157,6 @@ Clients SHOULD render this text as Markdown. - - Extension point for implementations - - - - Annotations - - | null - - } -> - @@ -1197,24 +1169,7 @@ Requires the `image` prompt capability when included in prompts. - - Extension point for implementations - - - - Annotations - - | null - - } -> - - - @@ -1226,22 +1181,6 @@ Requires the `audio` prompt capability when included in prompts. - - Extension point for implementations - - - - Annotations - - | null - - } -> - - @@ -1254,27 +1193,7 @@ All agents MUST support resource links in prompts. - - Extension point for implementations - - - - Annotations - - | null - - } -> - - - - - - @@ -1288,6 +1207,51 @@ Requires the `embeddedContext` prompt capability when included in prompts. + + + + + +## ContentChunk + +A streamed item of content + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + A single item of content + + +## CurrentModeUpdate + +The current mode of the session has changed + +See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes) + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + The ID of the current mode + + +## EmbeddedResource + +The contents of a resource, embedded into a prompt or tool call result. + +**Type:** Object + +**Properties:** + Extension point for implementations @@ -1307,10 +1271,6 @@ Requires the `embeddedContext` prompt capability when included in prompts. type={EmbeddedResourceResource} required > - - - - ## EmbeddedResourceResource @@ -1437,6 +1397,32 @@ An HTTP header to set when making requests to the MCP server. The value to set for the HTTP header. +## ImageContent + +An image provided to or from an LLM. + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + + Annotations + + | null + + } +> + + + + ## Implementation Describes the name and version of an MCP implementation, with an optional @@ -1462,36 +1448,188 @@ If not provided, the name should be used for display. for debugging or metrics purposes. -## McpCapabilities - -MCP capabilities supported by the agent +## JsonRpcMessage -**Type:** Object +A message (request, response, or notification) with `"jsonrpc": "2.0"` specified as +[required by JSON-RPC 2.0 Specification][1]. -**Properties:** +[1]: https://www.jsonrpc.org/specification#compatibility - - Extension point for implementations - - - Agent supports `McpServer::Http`. +**Type:** Union - - Default: `false` + +{""} - - - Agent supports `McpServer::Sse`. + - - Default: `false` + + JSON RPC Request Id - +An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2] -## McpServer +The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects. -Configuration for connecting to an MCP (Model Context Protocol) server. +[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling. -MCP servers provide tools and context that the agent can use when -processing prompts. +[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. + + + + +AgentRequest | null} > + + + + + + +{""} + + + + + JSON RPC Request Id + +An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2] + +The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects. + +[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling. + +[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. + + + + + + + +{""} + + + + + + + AgentNotification + + | null + + } +> + + + + +## JsonRpcMessage2 + +A message (request, response, or notification) with `"jsonrpc": "2.0"` specified as +[required by JSON-RPC 2.0 Specification][1]. + +[1]: https://www.jsonrpc.org/specification#compatibility + +**Type:** Union + + +{""} + + + + + JSON RPC Request Id + +An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2] + +The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects. + +[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling. + +[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. + + + + +ClientRequest | null} > + + + + + + +{""} + + + + + JSON RPC Request Id + +An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2] + +The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects. + +[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling. + +[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. + + + + + + + +{""} + + + + + + + ClientNotification + + | null + + } +> + + + + +## McpCapabilities + +MCP capabilities supported by the agent + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + Agent supports `McpServer::Http`. + + - Default: `false` + + + + Agent supports `McpServer::Sse`. + + - Default: `false` + + + +## McpServer + +Configuration for connecting to an MCP (Model Context Protocol) server. + +MCP servers provide tools and context that the agent can use when +processing prompts. See protocol docs: [MCP Servers](https://agentclientprotocol.com/protocol/session-setup#mcp-servers) @@ -1615,21 +1753,13 @@ An option presented to the user when requesting permission. Extension point for implementations -PermissionOptionKind} - required -> + Hint about the nature of this permission option. Human-readable label to display to the user. -PermissionOptionId} - required -> + Unique identifier for this permission option. @@ -1663,6 +1793,31 @@ Helps clients choose appropriate icons and UI treatment. Reject this operation and remember the choice. +## Plan + +An execution plan for accomplishing complex tasks. + +Plans consist of multiple entries representing individual tasks or goals. +Agents report plans to clients to provide visibility into their execution strategy. +Plans can evolve during execution as the agent discovers new requirements or completes tasks. + +See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan) + +**Type:** Object + +**Properties:** + + + Extension point for implementations + +PlanEntry[]} required> + 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. + + + ## PlanEntry A single entry in the execution plan. @@ -1681,19 +1836,11 @@ See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent Human-readable description of what this task aims to accomplish. -PlanEntryPriority} - required -> + The relative importance of this task. Used to indicate which tasks are most critical to the overall goal. -PlanEntryStatus} - required -> + Current execution status of this task. @@ -1823,11 +1970,7 @@ The user selected one of the provided options. -PermissionOptionId} - required -> + The ID of the option the user selected. @@ -1835,6 +1978,35 @@ The user selected one of the provided options. +## ResourceLink + +A resource that the server is capable of reading, included in a prompt or tool call result. + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + + Annotations + + | null + + } +> + + + + + + + ## Role The sender or recipient of messages and data in a conversation. @@ -1918,11 +2090,7 @@ The set of modes and the one currently active. > The set of modes that the Agent can operate in -SessionModeId} - required -> + The current mode the Agent is in. @@ -1941,16 +2109,6 @@ A chunk of the user's message being streamed. - - Extension point for implementations - -ContentBlock} - required -> - A single item of content - @@ -1961,16 +2119,6 @@ A chunk of the agent's response being streamed. - - Extension point for implementations - -ContentBlock} - required -> - A single item of content - @@ -1981,16 +2129,6 @@ A chunk of the agent's internal reasoning being streamed. - - Extension point for implementations - -ContentBlock} - required -> - A single item of content - @@ -2001,63 +2139,7 @@ Notification that a new tool call has been initiated. - - Extension point for implementations - - - - ToolCallContent - - [] - - } -> - Content produced by the tool call. - -ToolKind}> - The category of tool being invoked. Helps clients choose appropriate icons and - UI treatment. - - - - ToolCallLocation - - [] - - } -> - File locations affected by this tool call. Enables "follow-along" features in - clients. - - - Raw input parameters sent to the tool. - - - Raw output returned by the tool. - -ToolCallStatus} -> - Current execution status of the tool call. - - - Human-readable title describing what the tool is doing. - -ToolCallId} - required -> - Unique identifier for this tool call within the session. - @@ -2067,58 +2149,7 @@ Update on the status or results of a tool call. - - Extension point for implementations - - - Replace the content collection. - - - - ToolKind - - | null - - } -> - Update the tool kind. - - - Replace the locations collection. - - - Update the raw input. - - - Update the raw output. - - - - ToolCallStatus - - | null - - } -> - Update the execution status. - - - Update the human-readable title. - -ToolCallId} - required -> - The ID of the tool call being updated. - @@ -2129,18 +2160,7 @@ See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-p - - Extension point for implementations - -PlanEntry[]} required> - 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. - - - - + @@ -2150,23 +2170,6 @@ Available commands are ready or have changed - - Extension point for implementations - - - - AvailableCommand - - [] - - } - required -> - Commands the agent can execute - @@ -2179,16 +2182,6 @@ See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/sess - - Extension point for implementations - -SessionModeId} - required -> - The ID of the current mode - @@ -2250,6 +2243,30 @@ Exit status of a terminal command. The signal that terminated the process (may be null if exited normally). +## TextContent + +Text provided to or from an LLM. + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + + Annotations + + | null + + } +> + + ## TextResourceContents Text-based resource contents. @@ -2265,6 +2282,69 @@ Text-based resource contents. +## ToolCall + +Represents a tool call that the language model has requested. + +Tool calls are actions that the agent executes on behalf of the language model, +such as reading files, executing code, or fetching data from external sources. + +See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-calls) + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + + ToolCallContent + + [] + + } +> + Content produced by the tool call. + + + The category of tool being invoked. Helps clients choose appropriate icons and + UI treatment. + + + + ToolCallLocation + + [] + + } +> + File locations affected by this tool call. Enables "follow-along" features in + clients. + + + Raw input parameters sent to the tool. + + + Raw output returned by the tool. + + + Current execution status of the tool call. + + + Human-readable title describing what the tool is doing. + + + Unique identifier for this tool call within the session. + + ## ToolCallContent Content produced by a tool call. @@ -2281,11 +2361,7 @@ Standard content block (text, images, resources). -ContentBlock} - required -> + The actual content block. @@ -2387,6 +2463,67 @@ See protocol docs: [Status](https://agentclientprotocol.com/protocol/tool-calls# The tool call failed with an error. +## ToolCallUpdate + +An update to an existing tool call. + +Used to report progress and results as tools execute. All fields except +the tool call ID are optional - only changed fields need to be included. + +See protocol docs: [Updating](https://agentclientprotocol.com/protocol/tool-calls#updating) + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + Replace the content collection. + + + + ToolKind + + | null + + } +> + Update the tool kind. + + + Replace the locations collection. + + + Update the raw input. + + + Update the raw output. + + + + ToolCallStatus + + | null + + } +> + Update the execution status. + + + Update the human-readable title. + + + The ID of the tool call being updated. + + ## ToolKind Categories of tools that can be invoked. diff --git a/rust/bin/generate.rs b/rust/bin/generate.rs index 1811a894..8adfadf9 100644 --- a/rust/bin/generate.rs +++ b/rust/bin/generate.rs @@ -2,7 +2,7 @@ use agent_client_protocol_schema::{ AGENT_METHOD_NAMES, AgentSide, CLIENT_METHOD_NAMES, ClientSide, JsonRpcMessage, OutgoingMessage, VERSION, }; -use schemars::{JsonSchema, generate::SchemaSettings}; +use schemars::{JsonSchema, generate::SchemaSettings, transform::RemoveRefSiblings}; use std::{env, fs, path::Path}; use markdown_generator::MarkdownGenerator; @@ -26,8 +26,8 @@ enum AcpTypes { } fn main() { - let mut settings = SchemaSettings::default(); - settings.untagged_enum_variant_titles = true; + let mut settings = SchemaSettings::draft2020_12(); + settings = settings.with_transform(RemoveRefSiblings::default()); let generator = settings.into_generator(); let mut schema = generator.into_root_schema_for::(); diff --git a/rust/client.rs b/rust/client.rs index 61ec29bb..4dd5c191 100644 --- a/rust/client.rs +++ b/rust/client.rs @@ -70,7 +70,6 @@ pub enum SessionUpdate { /// See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes) #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -#[schemars(inline)] pub struct CurrentModeUpdate { /// The ID of the current mode pub current_mode_id: SessionModeId, @@ -82,7 +81,6 @@ pub struct CurrentModeUpdate { /// A streamed item of content #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq)] #[serde(rename_all = "camelCase")] -#[schemars(inline)] pub struct ContentChunk { /// A single item of content pub content: ContentBlock, @@ -94,7 +92,6 @@ pub struct ContentChunk { /// Available commands are ready or have changed #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -#[schemars(inline)] pub struct AvailableCommandsUpdate { /// Commands the agent can execute pub available_commands: Vec, diff --git a/rust/content.rs b/rust/content.rs index 0e5a53c7..7f067729 100644 --- a/rust/content.rs +++ b/rust/content.rs @@ -57,7 +57,6 @@ pub enum ContentBlock { /// Text provided to or from an LLM. #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] -#[schemars(inline)] pub struct TextContent { #[serde(default, skip_serializing_if = "Option::is_none")] pub annotations: Option, @@ -79,7 +78,6 @@ impl> From for ContentBlock { /// An image provided to or from an LLM. #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] -#[schemars(inline)] pub struct ImageContent { #[serde(default, skip_serializing_if = "Option::is_none")] pub annotations: Option, @@ -95,7 +93,6 @@ pub struct ImageContent { /// Audio provided to or from an LLM. #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] -#[schemars(inline)] pub struct AudioContent { #[serde(default, skip_serializing_if = "Option::is_none")] pub annotations: Option, @@ -109,7 +106,6 @@ pub struct AudioContent { /// The contents of a resource, embedded into a prompt or tool call result. #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] -#[schemars(inline)] pub struct EmbeddedResource { #[serde(default, skip_serializing_if = "Option::is_none")] pub annotations: Option, @@ -153,7 +149,6 @@ pub struct BlobResourceContents { /// A resource that the server is capable of reading, included in a prompt or tool call result. #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] -#[schemars(inline)] pub struct ResourceLink { #[serde(default, skip_serializing_if = "Option::is_none")] pub annotations: Option, @@ -174,16 +169,13 @@ pub struct ResourceLink { /// Optional annotations for the client. The client can use annotations to inform how objects are used or displayed #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] pub struct Annotations { - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub audience: Option>, - #[serde( - rename = "lastModified", - default, - skip_serializing_if = "Option::is_none" - )] + #[serde(skip_serializing_if = "Option::is_none")] pub last_modified: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub priority: Option, /// Extension point for implementations #[serde(skip_serializing_if = "Option::is_none", rename = "_meta")] diff --git a/rust/plan.rs b/rust/plan.rs index f850e560..b8d2ee28 100644 --- a/rust/plan.rs +++ b/rust/plan.rs @@ -17,7 +17,6 @@ use serde::{Deserialize, Serialize}; /// See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan) #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -#[schemars(inline)] pub struct Plan { /// The list of tasks to be accomplished. /// diff --git a/rust/rpc.rs b/rust/rpc.rs index eab17875..f1688032 100644 --- a/rust/rpc.rs +++ b/rust/rpc.rs @@ -27,17 +27,13 @@ use crate::{ #[schemars(inline)] pub enum RequestId { #[display("null")] - #[schemars(title = "null")] Null, - #[schemars(title = "number")] Number(i64), - #[schemars(title = "string")] Str(String), } #[derive(Serialize, Deserialize, Clone, JsonSchema)] #[serde(untagged)] -#[schemars(inline)] pub enum OutgoingMessage { Request { id: RequestId, @@ -69,7 +65,6 @@ enum JsonRpcVersion { /// /// [1]: https://www.jsonrpc.org/specification#compatibility #[derive(Debug, Serialize, Deserialize, JsonSchema)] -#[schemars(inline)] pub struct JsonRpcMessage { jsonrpc: JsonRpcVersion, #[serde(flatten)] diff --git a/rust/tool_call.rs b/rust/tool_call.rs index 5b480cac..9fa85f7a 100644 --- a/rust/tool_call.rs +++ b/rust/tool_call.rs @@ -20,7 +20,6 @@ use crate::{ContentBlock, Error}; /// See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-calls) #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "camelCase")] -#[schemars(inline)] pub struct ToolCall { /// Unique identifier for this tool call within the session. #[serde(rename = "toolCallId")] @@ -88,7 +87,6 @@ impl ToolCall { /// See protocol docs: [Updating](https://agentclientprotocol.com/protocol/tool-calls#updating) #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "camelCase")] -#[schemars(inline)] pub struct ToolCallUpdate { /// The ID of the tool call being updated. #[serde(rename = "toolCallId")] diff --git a/schema/schema.json b/schema/schema.json index 98d0cf9d..e11cd7c0 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -12,7 +12,11 @@ "type": "boolean" }, "mcpCapabilities": { - "$ref": "#/$defs/McpCapabilities", + "allOf": [ + { + "$ref": "#/$defs/McpCapabilities" + } + ], "default": { "http": false, "sse": false @@ -20,7 +24,11 @@ "description": "MCP capabilities supported by the agent." }, "promptCapabilities": { - "$ref": "#/$defs/PromptCapabilities", + "allOf": [ + { + "$ref": "#/$defs/PromptCapabilities" + } + ], "default": { "audio": false, "embeddedContext": false, @@ -34,180 +42,96 @@ "AgentNotification": { "anyOf": [ { - "$ref": "#/$defs/SessionNotification", - "description": "Handles session update notifications from the agent.\n\nThis is a notification endpoint (no response expected) that receives\nreal-time updates about session progress, including message chunks,\ntool calls, and execution plans.\n\nNote: Clients SHOULD continue accepting tool call updates even after\nsending a `session/cancel` notification, as the agent may send final\nupdates before responding with the cancelled stop reason.\n\nSee protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)", - "title": "SessionNotification" + "allOf": [ + { + "$ref": "#/$defs/SessionNotification" + } + ], + "description": "Handles session update notifications from the agent.\n\nThis is a notification endpoint (no response expected) that receives\nreal-time updates about session progress, including message chunks,\ntool calls, and execution plans.\n\nNote: Clients SHOULD continue accepting tool call updates even after\nsending a `session/cancel` notification, as the agent may send final\nupdates before responding with the cancelled stop reason.\n\nSee protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)" }, { - "description": "Handles extension notifications from the agent.\n\nAllows the Agent to send an arbitrary notification that is not part of the ACP spec.\nExtension notifications provide a way to send one-way messages for custom functionality\nwhile maintaining protocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", - "title": "ExtNotification" + "description": "Handles extension notifications from the agent.\n\nAllows the Agent to send an arbitrary notification that is not part of the ACP spec.\nExtension notifications provide a way to send one-way messages for custom functionality\nwhile maintaining protocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)" } ], "description": "All possible notifications that an agent can send to a client.\n\nThis enum is used internally for routing RPC notifications. You typically won't need\nto use this directly - use the notification methods on the [`Client`] trait instead.\n\nNotifications do not expect a response.", "x-docs-ignore": true }, "AgentOutgoingMessage": { - "anyOf": [ - { - "properties": { - "id": { - "anyOf": [ - { - "title": "null", - "type": "null" - }, - { - "format": "int64", - "title": "number", - "type": "integer" - }, - { - "title": "string", - "type": "string" - } - ], - "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." - }, - "method": { - "type": "string" - }, - "params": { - "anyOf": [ - { - "$ref": "#/$defs/AgentRequest" - }, - { - "type": "null" - } - ] - } - }, - "required": ["id", "method"], - "title": "Request", - "type": "object" - }, - { - "oneOf": [ - { - "properties": { - "result": { - "$ref": "#/$defs/AgentResponse" - } - }, - "required": ["result"], - "type": "object" - }, - { - "properties": { - "error": { - "$ref": "#/$defs/Error" - } - }, - "required": ["error"], - "type": "object" - } - ], - "properties": { - "id": { - "anyOf": [ - { - "title": "null", - "type": "null" - }, - { - "format": "int64", - "title": "number", - "type": "integer" - }, - { - "title": "string", - "type": "string" - } - ], - "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." - } - }, - "required": ["id"], - "title": "Response", - "type": "object" - }, + "allOf": [ { - "properties": { - "method": { - "type": "string" - }, - "params": { - "anyOf": [ - { - "$ref": "#/$defs/AgentNotification" - }, - { - "type": "null" - } - ] - } - }, - "required": ["method"], - "title": "Notification", - "type": "object" + "$ref": "#/$defs/JsonRpcMessage" } ], - "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", - "properties": { - "jsonrpc": { - "enum": ["2.0"], - "type": "string" - } - }, - "required": ["jsonrpc"], - "type": "object", "x-docs-ignore": true }, "AgentRequest": { "anyOf": [ { - "$ref": "#/$defs/WriteTextFileRequest", - "description": "Writes content to a text file in the client's file system.\n\nOnly available if the client advertises the `fs.writeTextFile` capability.\nAllows the agent to create or modify files within the client's environment.\n\nSee protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)", - "title": "WriteTextFileRequest" + "allOf": [ + { + "$ref": "#/$defs/WriteTextFileRequest" + } + ], + "description": "Writes content to a text file in the client's file system.\n\nOnly available if the client advertises the `fs.writeTextFile` capability.\nAllows the agent to create or modify files within the client's environment.\n\nSee protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)" }, { - "$ref": "#/$defs/ReadTextFileRequest", - "description": "Reads content from a text file in the client's file system.\n\nOnly available if the client advertises the `fs.readTextFile` capability.\nAllows the agent to access file contents within the client's environment.\n\nSee protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)", - "title": "ReadTextFileRequest" + "allOf": [ + { + "$ref": "#/$defs/ReadTextFileRequest" + } + ], + "description": "Reads content from a text file in the client's file system.\n\nOnly available if the client advertises the `fs.readTextFile` capability.\nAllows the agent to access file contents within the client's environment.\n\nSee protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)" }, { - "$ref": "#/$defs/RequestPermissionRequest", - "description": "Requests permission from the user for a tool call operation.\n\nCalled by the agent when it needs user authorization before executing\na potentially sensitive operation. The client should present the options\nto the user and return their decision.\n\nIf the client cancels the prompt turn via `session/cancel`, it MUST\nrespond to this request with `RequestPermissionOutcome::Cancelled`.\n\nSee protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/tool-calls#requesting-permission)", - "title": "RequestPermissionRequest" + "allOf": [ + { + "$ref": "#/$defs/RequestPermissionRequest" + } + ], + "description": "Requests permission from the user for a tool call operation.\n\nCalled by the agent when it needs user authorization before executing\na potentially sensitive operation. The client should present the options\nto the user and return their decision.\n\nIf the client cancels the prompt turn via `session/cancel`, it MUST\nrespond to this request with `RequestPermissionOutcome::Cancelled`.\n\nSee protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/tool-calls#requesting-permission)" }, { - "$ref": "#/$defs/CreateTerminalRequest", - "description": "Executes a command in a new terminal\n\nOnly available if the `terminal` Client capability is set to `true`.\n\nReturns a `TerminalId` that can be used with other terminal methods\nto get the current output, wait for exit, and kill the command.\n\nThe `TerminalId` can also be used to embed the terminal in a tool call\nby using the `ToolCallContent::Terminal` variant.\n\nThe Agent is responsible for releasing the terminal by using the `terminal/release`\nmethod.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", - "title": "CreateTerminalRequest" + "allOf": [ + { + "$ref": "#/$defs/CreateTerminalRequest" + } + ], + "description": "Executes a command in a new terminal\n\nOnly available if the `terminal` Client capability is set to `true`.\n\nReturns a `TerminalId` that can be used with other terminal methods\nto get the current output, wait for exit, and kill the command.\n\nThe `TerminalId` can also be used to embed the terminal in a tool call\nby using the `ToolCallContent::Terminal` variant.\n\nThe Agent is responsible for releasing the terminal by using the `terminal/release`\nmethod.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)" }, { - "$ref": "#/$defs/TerminalOutputRequest", - "description": "Gets the terminal output and exit status\n\nReturns the current content in the terminal without waiting for the command to exit.\nIf the command has already exited, the exit status is included.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", - "title": "TerminalOutputRequest" + "allOf": [ + { + "$ref": "#/$defs/TerminalOutputRequest" + } + ], + "description": "Gets the terminal output and exit status\n\nReturns the current content in the terminal without waiting for the command to exit.\nIf the command has already exited, the exit status is included.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)" }, { - "$ref": "#/$defs/ReleaseTerminalRequest", - "description": "Releases a terminal\n\nThe command is killed if it hasn't exited yet. Use `terminal/wait_for_exit`\nto wait for the command to exit before releasing the terminal.\n\nAfter release, the `TerminalId` can no longer be used with other `terminal/*` methods,\nbut tool calls that already contain it, continue to display its output.\n\nThe `terminal/kill` method can be used to terminate the command without releasing\nthe terminal, allowing the Agent to call `terminal/output` and other methods.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", - "title": "ReleaseTerminalRequest" + "allOf": [ + { + "$ref": "#/$defs/ReleaseTerminalRequest" + } + ], + "description": "Releases a terminal\n\nThe command is killed if it hasn't exited yet. Use `terminal/wait_for_exit`\nto wait for the command to exit before releasing the terminal.\n\nAfter release, the `TerminalId` can no longer be used with other `terminal/*` methods,\nbut tool calls that already contain it, continue to display its output.\n\nThe `terminal/kill` method can be used to terminate the command without releasing\nthe terminal, allowing the Agent to call `terminal/output` and other methods.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)" }, { - "$ref": "#/$defs/WaitForTerminalExitRequest", - "description": "Waits for the terminal command to exit and return its exit status\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", - "title": "WaitForTerminalExitRequest" + "allOf": [ + { + "$ref": "#/$defs/WaitForTerminalExitRequest" + } + ], + "description": "Waits for the terminal command to exit and return its exit status\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)" }, { - "$ref": "#/$defs/KillTerminalCommandRequest", - "description": "Kills the terminal command without releasing the terminal\n\nWhile `terminal/release` will also kill the command, this method will keep\nthe `TerminalId` valid so it can be used with other methods.\n\nThis method can be helpful when implementing command timeouts which terminate\nthe command as soon as elapsed, and then get the final output so it can be sent\nto the model.\n\nNote: `terminal/release` when `TerminalId` is no longer needed.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", - "title": "KillTerminalCommandRequest" + "allOf": [ + { + "$ref": "#/$defs/KillTerminalCommandRequest" + } + ], + "description": "Kills the terminal command without releasing the terminal\n\nWhile `terminal/release` will also kill the command, this method will keep\nthe `TerminalId` valid so it can be used with other methods.\n\nThis method can be helpful when implementing command timeouts which terminate\nthe command as soon as elapsed, and then get the final output so it can be sent\nto the model.\n\nNote: `terminal/release` when `TerminalId` is no longer needed.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)" }, { - "description": "Handles extension method requests from the agent.\n\nAllows the Agent to send an arbitrary request that is not part of the ACP spec.\nExtension methods provide a way to add custom functionality while maintaining\nprotocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", - "title": "ExtMethodRequest" + "description": "Handles extension method requests from the agent.\n\nAllows the Agent to send an arbitrary request that is not part of the ACP spec.\nExtension methods provide a way to add custom functionality while maintaining\nprotocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)" } ], "description": "All possible requests that an agent can send to a client.\n\nThis enum is used internally for routing RPC requests. You typically won't need\nto use this directly - instead, use the methods on the [`Client`] trait.\n\nThis enum encompasses all method calls from agent to client.", @@ -216,32 +140,24 @@ "AgentResponse": { "anyOf": [ { - "$ref": "#/$defs/InitializeResponse", - "title": "InitializeResponse" + "$ref": "#/$defs/InitializeResponse" }, { - "$ref": "#/$defs/AuthenticateResponse", - "title": "AuthenticateResponse" + "$ref": "#/$defs/AuthenticateResponse" }, { - "$ref": "#/$defs/NewSessionResponse", - "title": "NewSessionResponse" + "$ref": "#/$defs/NewSessionResponse" }, { - "$ref": "#/$defs/LoadSessionResponse", - "title": "LoadSessionResponse" + "$ref": "#/$defs/LoadSessionResponse" }, { - "$ref": "#/$defs/SetSessionModeResponse", - "title": "SetSessionModeResponse" + "$ref": "#/$defs/SetSessionModeResponse" }, { - "$ref": "#/$defs/PromptResponse", - "title": "PromptResponse" + "$ref": "#/$defs/PromptResponse" }, - { - "title": "ExtMethodResponse" - } + true ], "description": "All possible responses that an agent can send to a client.\n\nThis enum is used internally for routing RPC responses. You typically won't need\nto use this directly - the responses are handled automatically by the connection.\n\nThese are responses to the corresponding `ClientRequest` variants.", "x-docs-ignore": true @@ -268,6 +184,32 @@ }, "type": "object" }, + "AudioContent": { + "description": "Audio provided to or from an LLM.", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "annotations": { + "anyOf": [ + { + "$ref": "#/$defs/Annotations" + }, + { + "type": "null" + } + ] + }, + "data": { + "type": "string" + }, + "mimeType": { + "type": "string" + } + }, + "required": ["data", "mimeType"], + "type": "object" + }, "AuthMethod": { "description": "Describes an available authentication method.", "properties": { @@ -279,7 +221,11 @@ "type": ["string", "null"] }, "id": { - "$ref": "#/$defs/AuthMethodId", + "allOf": [ + { + "$ref": "#/$defs/AuthMethodId" + } + ], "description": "Unique identifier for this authentication method." }, "name": { @@ -301,7 +247,11 @@ "description": "Extension point for implementations" }, "methodId": { - "$ref": "#/$defs/AuthMethodId", + "allOf": [ + { + "$ref": "#/$defs/AuthMethodId" + } + ], "description": "The ID of the authentication method to use.\nMust be one of the methods advertised in the initialize response." } }, @@ -361,12 +311,28 @@ } }, "required": ["hint"], - "title": "UnstructuredCommandInput", "type": "object" } ], "description": "The input specification for a command." }, + "AvailableCommandsUpdate": { + "description": "Available commands are ready or have changed", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "availableCommands": { + "description": "Commands the agent can execute", + "items": { + "$ref": "#/$defs/AvailableCommand" + }, + "type": "array" + } + }, + "required": ["availableCommands"], + "type": "object" + }, "BlobResourceContents": { "description": "Binary resource contents.", "properties": { @@ -393,7 +359,11 @@ "description": "Extension point for implementations" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The ID of the session to cancel operations for." } }, @@ -409,7 +379,11 @@ "description": "Extension point for implementations" }, "fs": { - "$ref": "#/$defs/FileSystemCapability", + "allOf": [ + { + "$ref": "#/$defs/FileSystemCapability" + } + ], "default": { "readTextFile": false, "writeTextFile": false @@ -427,170 +401,80 @@ "ClientNotification": { "anyOf": [ { - "$ref": "#/$defs/CancelNotification", - "description": "Cancels ongoing operations for a session.\n\nThis is a notification sent by the client to cancel an ongoing prompt turn.\n\nUpon receiving this notification, the Agent SHOULD:\n- Stop all language model requests as soon as possible\n- Abort all tool call invocations in progress\n- Send any pending `session/update` notifications\n- Respond to the original `session/prompt` request with `StopReason::Cancelled`\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)", - "title": "CancelNotification" + "allOf": [ + { + "$ref": "#/$defs/CancelNotification" + } + ], + "description": "Cancels ongoing operations for a session.\n\nThis is a notification sent by the client to cancel an ongoing prompt turn.\n\nUpon receiving this notification, the Agent SHOULD:\n- Stop all language model requests as soon as possible\n- Abort all tool call invocations in progress\n- Send any pending `session/update` notifications\n- Respond to the original `session/prompt` request with `StopReason::Cancelled`\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)" }, { - "description": "Handles extension notifications from the client.\n\nExtension notifications provide a way to send one-way messages for custom functionality\nwhile maintaining protocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", - "title": "ExtNotification" + "description": "Handles extension notifications from the client.\n\nExtension notifications provide a way to send one-way messages for custom functionality\nwhile maintaining protocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)" } ], "description": "All possible notifications that a client can send to an agent.\n\nThis enum is used internally for routing RPC notifications. You typically won't need\nto use this directly - use the notification methods on the [`Agent`] trait instead.\n\nNotifications do not expect a response.", "x-docs-ignore": true }, "ClientOutgoingMessage": { + "allOf": [ + { + "$ref": "#/$defs/JsonRpcMessage2" + } + ], + "x-docs-ignore": true + }, + "ClientRequest": { "anyOf": [ { - "properties": { - "id": { - "anyOf": [ - { - "title": "null", - "type": "null" - }, - { - "format": "int64", - "title": "number", - "type": "integer" - }, - { - "title": "string", - "type": "string" - } - ], - "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." - }, - "method": { - "type": "string" - }, - "params": { - "anyOf": [ - { - "$ref": "#/$defs/ClientRequest" - }, - { - "type": "null" - } - ] + "allOf": [ + { + "$ref": "#/$defs/InitializeRequest" } - }, - "required": ["id", "method"], - "title": "Request", - "type": "object" + ], + "description": "Establishes the connection with a client and negotiates protocol capabilities.\n\nThis method is called once at the beginning of the connection to:\n- Negotiate the protocol version to use\n- Exchange capability information between client and agent\n- Determine available authentication methods\n\nThe agent should respond with its supported protocol version and capabilities.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)" }, { - "oneOf": [ + "allOf": [ { - "properties": { - "result": { - "$ref": "#/$defs/ClientResponse" - } - }, - "required": ["result"], - "type": "object" - }, + "$ref": "#/$defs/AuthenticateRequest" + } + ], + "description": "Authenticates the client using the specified authentication method.\n\nCalled when the agent requires authentication before allowing session creation.\nThe client provides the authentication method ID that was advertised during initialization.\n\nAfter successful authentication, the client can proceed to create sessions with\n`new_session` without receiving an `auth_required` error.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)" + }, + { + "allOf": [ { - "properties": { - "error": { - "$ref": "#/$defs/Error" - } - }, - "required": ["error"], - "type": "object" + "$ref": "#/$defs/NewSessionRequest" } ], - "properties": { - "id": { - "anyOf": [ - { - "title": "null", - "type": "null" - }, - { - "format": "int64", - "title": "number", - "type": "integer" - }, - { - "title": "string", - "type": "string" - } - ], - "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." - } - }, - "required": ["id"], - "title": "Response", - "type": "object" + "description": "Creates a new conversation session with the agent.\n\nSessions represent independent conversation contexts with their own history and state.\n\nThe agent should:\n- Create a new session context\n- Connect to any specified MCP servers\n- Return a unique session ID for future requests\n\nMay return an `auth_required` error if the agent requires authentication.\n\nSee protocol docs: [Session Setup](https://agentclientprotocol.com/protocol/session-setup)" }, { - "properties": { - "method": { - "type": "string" - }, - "params": { - "anyOf": [ - { - "$ref": "#/$defs/ClientNotification" - }, - { - "type": "null" - } - ] + "allOf": [ + { + "$ref": "#/$defs/LoadSessionRequest" } - }, - "required": ["method"], - "title": "Notification", - "type": "object" - } - ], - "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", - "properties": { - "jsonrpc": { - "enum": ["2.0"], - "type": "string" - } - }, - "required": ["jsonrpc"], - "type": "object", - "x-docs-ignore": true - }, - "ClientRequest": { - "anyOf": [ - { - "$ref": "#/$defs/InitializeRequest", - "description": "Establishes the connection with a client and negotiates protocol capabilities.\n\nThis method is called once at the beginning of the connection to:\n- Negotiate the protocol version to use\n- Exchange capability information between client and agent\n- Determine available authentication methods\n\nThe agent should respond with its supported protocol version and capabilities.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)", - "title": "InitializeRequest" - }, - { - "$ref": "#/$defs/AuthenticateRequest", - "description": "Authenticates the client using the specified authentication method.\n\nCalled when the agent requires authentication before allowing session creation.\nThe client provides the authentication method ID that was advertised during initialization.\n\nAfter successful authentication, the client can proceed to create sessions with\n`new_session` without receiving an `auth_required` error.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)", - "title": "AuthenticateRequest" - }, - { - "$ref": "#/$defs/NewSessionRequest", - "description": "Creates a new conversation session with the agent.\n\nSessions represent independent conversation contexts with their own history and state.\n\nThe agent should:\n- Create a new session context\n- Connect to any specified MCP servers\n- Return a unique session ID for future requests\n\nMay return an `auth_required` error if the agent requires authentication.\n\nSee protocol docs: [Session Setup](https://agentclientprotocol.com/protocol/session-setup)", - "title": "NewSessionRequest" - }, - { - "$ref": "#/$defs/LoadSessionRequest", - "description": "Loads an existing session to resume a previous conversation.\n\nThis method is only available if the agent advertises the `loadSession` capability.\n\nThe agent should:\n- Restore the session context and conversation history\n- Connect to the specified MCP servers\n- Stream the entire conversation history back to the client via notifications\n\nSee protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)", - "title": "LoadSessionRequest" + ], + "description": "Loads an existing session to resume a previous conversation.\n\nThis method is only available if the agent advertises the `loadSession` capability.\n\nThe agent should:\n- Restore the session context and conversation history\n- Connect to the specified MCP servers\n- Stream the entire conversation history back to the client via notifications\n\nSee protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)" }, { - "$ref": "#/$defs/SetSessionModeRequest", - "description": "Sets the current mode for a session.\n\nAllows switching between different agent modes (e.g., \"ask\", \"architect\", \"code\")\nthat affect system prompts, tool availability, and permission behaviors.\n\nThe mode must be one of the modes advertised in `availableModes` during session\ncreation or loading. Agents may also change modes autonomously and notify the\nclient via `current_mode_update` notifications.\n\nThis method can be called at any time during a session, whether the Agent is\nidle or actively generating a response.\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", - "title": "SetSessionModeRequest" + "allOf": [ + { + "$ref": "#/$defs/SetSessionModeRequest" + } + ], + "description": "Sets the current mode for a session.\n\nAllows switching between different agent modes (e.g., \"ask\", \"architect\", \"code\")\nthat affect system prompts, tool availability, and permission behaviors.\n\nThe mode must be one of the modes advertised in `availableModes` during session\ncreation or loading. Agents may also change modes autonomously and notify the\nclient via `current_mode_update` notifications.\n\nThis method can be called at any time during a session, whether the Agent is\nidle or actively generating a response.\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" }, { - "$ref": "#/$defs/PromptRequest", - "description": "Processes a user prompt within a session.\n\nThis method handles the whole lifecycle of a prompt:\n- Receives user messages with optional context (files, images, etc.)\n- Processes the prompt using language models\n- Reports language model content and tool calls to the Clients\n- Requests permission to run tools\n- Executes any requested tool calls\n- Returns when the turn is complete with a stop reason\n\nSee protocol docs: [Prompt Turn](https://agentclientprotocol.com/protocol/prompt-turn)", - "title": "PromptRequest" + "allOf": [ + { + "$ref": "#/$defs/PromptRequest" + } + ], + "description": "Processes a user prompt within a session.\n\nThis method handles the whole lifecycle of a prompt:\n- Receives user messages with optional context (files, images, etc.)\n- Processes the prompt using language models\n- Reports language model content and tool calls to the Clients\n- Requests permission to run tools\n- Executes any requested tool calls\n- Returns when the turn is complete with a stop reason\n\nSee protocol docs: [Prompt Turn](https://agentclientprotocol.com/protocol/prompt-turn)" }, { - "description": "Handles extension method requests from the client.\n\nExtension methods provide a way to add custom functionality while maintaining\nprotocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", - "title": "ExtMethodRequest" + "description": "Handles extension method requests from the client.\n\nExtension methods provide a way to add custom functionality while maintaining\nprotocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)" } ], "description": "All possible requests that a client can send to an agent.\n\nThis enum is used internally for routing RPC requests. You typically won't need\nto use this directly - instead, use the methods on the [`Agent`] trait.\n\nThis enum encompasses all method calls from client to agent.", @@ -599,40 +483,30 @@ "ClientResponse": { "anyOf": [ { - "$ref": "#/$defs/WriteTextFileResponse", - "title": "WriteTextFileResponse" + "$ref": "#/$defs/WriteTextFileResponse" }, { - "$ref": "#/$defs/ReadTextFileResponse", - "title": "ReadTextFileResponse" + "$ref": "#/$defs/ReadTextFileResponse" }, { - "$ref": "#/$defs/RequestPermissionResponse", - "title": "RequestPermissionResponse" + "$ref": "#/$defs/RequestPermissionResponse" }, { - "$ref": "#/$defs/CreateTerminalResponse", - "title": "CreateTerminalResponse" + "$ref": "#/$defs/CreateTerminalResponse" }, { - "$ref": "#/$defs/TerminalOutputResponse", - "title": "TerminalOutputResponse" + "$ref": "#/$defs/TerminalOutputResponse" }, { - "$ref": "#/$defs/ReleaseTerminalResponse", - "title": "ReleaseTerminalResponse" + "$ref": "#/$defs/ReleaseTerminalResponse" }, { - "$ref": "#/$defs/WaitForTerminalExitResponse", - "title": "WaitForTerminalExitResponse" + "$ref": "#/$defs/WaitForTerminalExitResponse" }, { - "$ref": "#/$defs/KillTerminalCommandResponse", - "title": "KillTerminalResponse" + "$ref": "#/$defs/KillTerminalCommandResponse" }, - { - "title": "ExtMethodResponse" - } + true ], "description": "All possible responses that a client can send to an agent.\n\nThis enum is used internally for routing RPC responses. You typically won't need\nto use this directly - the responses are handled automatically by the connection.\n\nThese are responses to the corresponding `AgentRequest` variants.", "x-docs-ignore": true @@ -644,167 +518,105 @@ }, "oneOf": [ { + "allOf": [ + { + "$ref": "#/$defs/TextContent" + } + ], "description": "Text content. May be plain text or formatted with Markdown.\n\nAll agents MUST support text content blocks in prompts.\nClients SHOULD render this text as Markdown.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "annotations": { - "anyOf": [ - { - "$ref": "#/$defs/Annotations" - }, - { - "type": "null" - } - ] - }, - "text": { - "type": "string" - }, "type": { "const": "text", "type": "string" } }, - "required": ["type", "text"], + "required": ["type"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/ImageContent" + } + ], "description": "Images for visual context or analysis.\n\nRequires the `image` prompt capability when included in prompts.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "annotations": { - "anyOf": [ - { - "$ref": "#/$defs/Annotations" - }, - { - "type": "null" - } - ] - }, - "data": { - "type": "string" - }, - "mimeType": { - "type": "string" - }, "type": { "const": "image", "type": "string" - }, - "uri": { - "type": ["string", "null"] } }, - "required": ["type", "data", "mimeType"], + "required": ["type"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/AudioContent" + } + ], "description": "Audio data for transcription or analysis.\n\nRequires the `audio` prompt capability when included in prompts.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "annotations": { - "anyOf": [ - { - "$ref": "#/$defs/Annotations" - }, - { - "type": "null" - } - ] - }, - "data": { - "type": "string" - }, - "mimeType": { - "type": "string" - }, "type": { "const": "audio", "type": "string" } }, - "required": ["type", "data", "mimeType"], + "required": ["type"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/ResourceLink" + } + ], "description": "References to resources that the agent can access.\n\nAll agents MUST support resource links in prompts.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "annotations": { - "anyOf": [ - { - "$ref": "#/$defs/Annotations" - }, - { - "type": "null" - } - ] - }, - "description": { - "type": ["string", "null"] - }, - "mimeType": { - "type": ["string", "null"] - }, - "name": { - "type": "string" - }, - "size": { - "format": "int64", - "type": ["integer", "null"] - }, - "title": { - "type": ["string", "null"] - }, "type": { "const": "resource_link", "type": "string" - }, - "uri": { - "type": "string" } }, - "required": ["type", "name", "uri"], + "required": ["type"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/EmbeddedResource" + } + ], "description": "Complete resource contents embedded directly in the message.\n\nPreferred for including context as it avoids extra round-trips.\n\nRequires the `embeddedContext` prompt capability when included in prompts.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "annotations": { - "anyOf": [ - { - "$ref": "#/$defs/Annotations" - }, - { - "type": "null" - } - ] - }, - "resource": { - "$ref": "#/$defs/EmbeddedResourceResource" - }, "type": { "const": "resource", "type": "string" } }, - "required": ["type", "resource"], + "required": ["type"], "type": "object" } ] }, + "ContentChunk": { + "description": "A streamed item of content", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "content": { + "allOf": [ + { + "$ref": "#/$defs/ContentBlock" + } + ], + "description": "A single item of content" + } + }, + "required": ["content"], + "type": "object" + }, "CreateTerminalRequest": { "description": "Request to create a new terminal and execute a command.", "properties": { @@ -840,7 +652,11 @@ "type": ["integer", "null"] }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The session ID for this request." } }, @@ -865,15 +681,54 @@ "x-method": "terminal/create", "x-side": "client" }, + "CurrentModeUpdate": { + "description": "The current mode of the session has changed\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "currentModeId": { + "allOf": [ + { + "$ref": "#/$defs/SessionModeId" + } + ], + "description": "The ID of the current mode" + } + }, + "required": ["currentModeId"], + "type": "object" + }, + "EmbeddedResource": { + "description": "The contents of a resource, embedded into a prompt or tool call result.", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "annotations": { + "anyOf": [ + { + "$ref": "#/$defs/Annotations" + }, + { + "type": "null" + } + ] + }, + "resource": { + "$ref": "#/$defs/EmbeddedResourceResource" + } + }, + "required": ["resource"], + "type": "object" + }, "EmbeddedResourceResource": { "anyOf": [ { - "$ref": "#/$defs/TextResourceContents", - "title": "TextResourceContents" + "$ref": "#/$defs/TextResourceContents" }, { - "$ref": "#/$defs/BlobResourceContents", - "title": "BlobResourceContents" + "$ref": "#/$defs/BlobResourceContents" } ], "description": "Resource content that can be embedded in a message." @@ -952,6 +807,35 @@ "required": ["name", "value"], "type": "object" }, + "ImageContent": { + "description": "An image provided to or from an LLM.", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "annotations": { + "anyOf": [ + { + "$ref": "#/$defs/Annotations" + }, + { + "type": "null" + } + ] + }, + "data": { + "type": "string" + }, + "mimeType": { + "type": "string" + }, + "uri": { + "type": ["string", "null"] + } + }, + "required": ["data", "mimeType"], + "type": "object" + }, "Implementation": { "description": "Describes the name and version of an MCP implementation, with an optional\ntitle for UI representation.", "properties": { @@ -978,7 +862,11 @@ "description": "Extension point for implementations" }, "clientCapabilities": { - "$ref": "#/$defs/ClientCapabilities", + "allOf": [ + { + "$ref": "#/$defs/ClientCapabilities" + } + ], "default": { "fs": { "readTextFile": false, @@ -996,69 +884,295 @@ { "type": "null" } - ], - "description": "Information about the Client name and version sent to the Agent.\n\nNote: in future versions of the protocol, this will be required." - }, - "protocolVersion": { - "$ref": "#/$defs/ProtocolVersion", - "description": "The latest protocol version supported by the client." + ], + "description": "Information about the Client name and version sent to the Agent.\n\nNote: in future versions of the protocol, this will be required." + }, + "protocolVersion": { + "allOf": [ + { + "$ref": "#/$defs/ProtocolVersion" + } + ], + "description": "The latest protocol version supported by the client." + } + }, + "required": ["protocolVersion"], + "type": "object", + "x-method": "initialize", + "x-side": "agent" + }, + "InitializeResponse": { + "description": "Response from the initialize method.\n\nContains the negotiated protocol version and agent capabilities.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "agentCapabilities": { + "allOf": [ + { + "$ref": "#/$defs/AgentCapabilities" + } + ], + "default": { + "loadSession": false, + "mcpCapabilities": { + "http": false, + "sse": false + }, + "promptCapabilities": { + "audio": false, + "embeddedContext": false, + "image": false + } + }, + "description": "Capabilities supported by the agent." + }, + "agentInfo": { + "anyOf": [ + { + "$ref": "#/$defs/Implementation" + }, + { + "type": "null" + } + ], + "description": "Information about the Agent name and version sent to the Client.\n\nNote: in future versions of the protocol, this will be required." + }, + "authMethods": { + "default": [], + "description": "Authentication methods supported by the agent.", + "items": { + "$ref": "#/$defs/AuthMethod" + }, + "type": "array" + }, + "protocolVersion": { + "allOf": [ + { + "$ref": "#/$defs/ProtocolVersion" + } + ], + "description": "The protocol version the client specified if supported by the agent,\nor the latest protocol version supported by the agent.\n\nThe client should disconnect, if it doesn't support this version." + } + }, + "required": ["protocolVersion"], + "type": "object", + "x-method": "initialize", + "x-side": "agent" + }, + "JsonRpcMessage": { + "anyOf": [ + { + "properties": { + "id": { + "anyOf": [ + { + "type": "null" + }, + { + "format": "int64", + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." + }, + "method": { + "type": "string" + }, + "params": { + "anyOf": [ + { + "$ref": "#/$defs/AgentRequest" + }, + { + "type": "null" + } + ] + } + }, + "required": ["id", "method"], + "type": "object" + }, + { + "oneOf": [ + { + "properties": { + "result": { + "$ref": "#/$defs/AgentResponse" + } + }, + "required": ["result"], + "type": "object" + }, + { + "properties": { + "error": { + "$ref": "#/$defs/Error" + } + }, + "required": ["error"], + "type": "object" + } + ], + "properties": { + "id": { + "anyOf": [ + { + "type": "null" + }, + { + "format": "int64", + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." + } + }, + "required": ["id"], + "type": "object" + }, + { + "properties": { + "method": { + "type": "string" + }, + "params": { + "anyOf": [ + { + "$ref": "#/$defs/AgentNotification" + }, + { + "type": "null" + } + ] + } + }, + "required": ["method"], + "type": "object" + } + ], + "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", + "properties": { + "jsonrpc": { + "enum": ["2.0"], + "type": "string" } }, - "required": ["protocolVersion"], - "type": "object", - "x-method": "initialize", - "x-side": "agent" + "required": ["jsonrpc"], + "type": "object" }, - "InitializeResponse": { - "description": "Response from the initialize method.\n\nContains the negotiated protocol version and agent capabilities.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)", - "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "agentCapabilities": { - "$ref": "#/$defs/AgentCapabilities", - "default": { - "loadSession": false, - "mcpCapabilities": { - "http": false, - "sse": false + "JsonRpcMessage2": { + "anyOf": [ + { + "properties": { + "id": { + "anyOf": [ + { + "type": "null" + }, + { + "format": "int64", + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." }, - "promptCapabilities": { - "audio": false, - "embeddedContext": false, - "image": false + "method": { + "type": "string" + }, + "params": { + "anyOf": [ + { + "$ref": "#/$defs/ClientRequest" + }, + { + "type": "null" + } + ] } }, - "description": "Capabilities supported by the agent." + "required": ["id", "method"], + "type": "object" }, - "agentInfo": { - "anyOf": [ + { + "oneOf": [ { - "$ref": "#/$defs/Implementation" + "properties": { + "result": { + "$ref": "#/$defs/ClientResponse" + } + }, + "required": ["result"], + "type": "object" }, { - "type": "null" + "properties": { + "error": { + "$ref": "#/$defs/Error" + } + }, + "required": ["error"], + "type": "object" } ], - "description": "Information about the Agent name and version sent to the Client.\n\nNote: in future versions of the protocol, this will be required." - }, - "authMethods": { - "default": [], - "description": "Authentication methods supported by the agent.", - "items": { - "$ref": "#/$defs/AuthMethod" + "properties": { + "id": { + "anyOf": [ + { + "type": "null" + }, + { + "format": "int64", + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." + } }, - "type": "array" + "required": ["id"], + "type": "object" }, - "protocolVersion": { - "$ref": "#/$defs/ProtocolVersion", - "description": "The protocol version the client specified if supported by the agent,\nor the latest protocol version supported by the agent.\n\nThe client should disconnect, if it doesn't support this version." + { + "properties": { + "method": { + "type": "string" + }, + "params": { + "anyOf": [ + { + "$ref": "#/$defs/ClientNotification" + }, + { + "type": "null" + } + ] + } + }, + "required": ["method"], + "type": "object" + } + ], + "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", + "properties": { + "jsonrpc": { + "enum": ["2.0"], + "type": "string" } }, - "required": ["protocolVersion"], - "type": "object", - "x-method": "initialize", - "x-side": "agent" + "required": ["jsonrpc"], + "type": "object" }, "KillTerminalCommandRequest": { "description": "Request to kill a terminal command without releasing the terminal.", @@ -1067,7 +1181,11 @@ "description": "Extension point for implementations" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The session ID for this request." }, "terminalId": { @@ -1109,7 +1227,11 @@ "type": "array" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The ID of the session to load." } }, @@ -1240,7 +1362,6 @@ } }, "required": ["name", "command", "args", "env"], - "title": "stdio", "type": "object" } ], @@ -1290,7 +1411,11 @@ "description": "Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "Unique identifier for the created session.\n\nUsed in all subsequent requests for this conversation." } }, @@ -1306,7 +1431,11 @@ "description": "Extension point for implementations" }, "kind": { - "$ref": "#/$defs/PermissionOptionKind", + "allOf": [ + { + "$ref": "#/$defs/PermissionOptionKind" + } + ], "description": "Hint about the nature of this permission option." }, "name": { @@ -1314,7 +1443,11 @@ "type": "string" }, "optionId": { - "$ref": "#/$defs/PermissionOptionId", + "allOf": [ + { + "$ref": "#/$defs/PermissionOptionId" + } + ], "description": "Unique identifier for this permission option." } }, @@ -1350,6 +1483,23 @@ } ] }, + "Plan": { + "description": "An execution plan for accomplishing complex tasks.\n\nPlans consist of multiple entries representing individual tasks or goals.\nAgents report plans to clients to provide visibility into their execution strategy.\nPlans can evolve during execution as the agent discovers new requirements or completes tasks.\n\nSee protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan)", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "entries": { + "description": "The list of tasks to be accomplished.\n\nWhen updating a plan, the agent must send a complete list of all entries\nwith their current status. The client replaces the entire plan with each update.", + "items": { + "$ref": "#/$defs/PlanEntry" + }, + "type": "array" + } + }, + "required": ["entries"], + "type": "object" + }, "PlanEntry": { "description": "A single entry in the execution plan.\n\nRepresents a task or goal that the assistant intends to accomplish\nas part of fulfilling the user's request.\nSee protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)", "properties": { @@ -1361,11 +1511,19 @@ "type": "string" }, "priority": { - "$ref": "#/$defs/PlanEntryPriority", + "allOf": [ + { + "$ref": "#/$defs/PlanEntryPriority" + } + ], "description": "The relative importance of this task.\nUsed to indicate which tasks are most critical to the overall goal." }, "status": { - "$ref": "#/$defs/PlanEntryStatus", + "allOf": [ + { + "$ref": "#/$defs/PlanEntryStatus" + } + ], "description": "Current execution status of this task." } }, @@ -1450,7 +1608,11 @@ "type": "array" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The ID of the session to send this user message to" } }, @@ -1466,7 +1628,11 @@ "description": "Extension point for implementations" }, "stopReason": { - "$ref": "#/$defs/StopReason", + "allOf": [ + { + "$ref": "#/$defs/StopReason" + } + ], "description": "Indicates why the agent stopped processing the turn." } }, @@ -1505,7 +1671,11 @@ "type": "string" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The session ID for this request." } }, @@ -1536,7 +1706,11 @@ "description": "Extension point for implementations" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The session ID for this request." }, "terminalId": { @@ -1581,7 +1755,11 @@ "description": "The user selected one of the provided options.", "properties": { "optionId": { - "$ref": "#/$defs/PermissionOptionId", + "allOf": [ + { + "$ref": "#/$defs/PermissionOptionId" + } + ], "description": "The ID of the option the user selected." }, "outcome": { @@ -1608,68 +1786,20 @@ "type": "array" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The session ID for this request." }, "toolCall": { - "description": "Details about the tool call requiring permission.", - "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "content": { - "description": "Replace the content collection.", - "items": { - "$ref": "#/$defs/ToolCallContent" - }, - "type": ["array", "null"] - }, - "kind": { - "anyOf": [ - { - "$ref": "#/$defs/ToolKind" - }, - { - "type": "null" - } - ], - "description": "Update the tool kind." - }, - "locations": { - "description": "Replace the locations collection.", - "items": { - "$ref": "#/$defs/ToolCallLocation" - }, - "type": ["array", "null"] - }, - "rawInput": { - "description": "Update the raw input." - }, - "rawOutput": { - "description": "Update the raw output." - }, - "status": { - "anyOf": [ - { - "$ref": "#/$defs/ToolCallStatus" - }, - { - "type": "null" - } - ], - "description": "Update the execution status." - }, - "title": { - "description": "Update the human-readable title.", - "type": ["string", "null"] - }, - "toolCallId": { - "$ref": "#/$defs/ToolCallId", - "description": "The ID of the tool call being updated." + "allOf": [ + { + "$ref": "#/$defs/ToolCallUpdate" } - }, - "required": ["toolCallId"], - "type": "object" + ], + "description": "Details about the tool call requiring permission." } }, "required": ["sessionId", "toolCall", "options"], @@ -1683,15 +1813,58 @@ "_meta": { "description": "Extension point for implementations" }, - "outcome": { - "$ref": "#/$defs/RequestPermissionOutcome", - "description": "The user's decision on the permission request." + "outcome": { + "allOf": [ + { + "$ref": "#/$defs/RequestPermissionOutcome" + } + ], + "description": "The user's decision on the permission request." + } + }, + "required": ["outcome"], + "type": "object", + "x-method": "session/request_permission", + "x-side": "client" + }, + "ResourceLink": { + "description": "A resource that the server is capable of reading, included in a prompt or tool call result.", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "annotations": { + "anyOf": [ + { + "$ref": "#/$defs/Annotations" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": ["string", "null"] + }, + "mimeType": { + "type": ["string", "null"] + }, + "name": { + "type": "string" + }, + "size": { + "format": "int64", + "type": ["integer", "null"] + }, + "title": { + "type": ["string", "null"] + }, + "uri": { + "type": "string" } }, - "required": ["outcome"], - "type": "object", - "x-method": "session/request_permission", - "x-side": "client" + "required": ["name", "uri"], + "type": "object" }, "Role": { "description": "The sender or recipient of messages and data in a conversation.", @@ -1739,7 +1912,11 @@ "type": "array" }, "currentModeId": { - "$ref": "#/$defs/SessionModeId", + "allOf": [ + { + "$ref": "#/$defs/SessionModeId" + } + ], "description": "The current mode the Agent is in." } }, @@ -1753,11 +1930,19 @@ "description": "Extension point for implementations" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The ID of the session this update pertains to." }, "update": { - "$ref": "#/$defs/SessionUpdate", + "allOf": [ + { + "$ref": "#/$defs/SessionUpdate" + } + ], "description": "The actual update content." } }, @@ -1773,231 +1958,131 @@ }, "oneOf": [ { + "allOf": [ + { + "$ref": "#/$defs/ContentChunk" + } + ], "description": "A chunk of the user's message being streamed.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "content": { - "$ref": "#/$defs/ContentBlock", - "description": "A single item of content" - }, "sessionUpdate": { "const": "user_message_chunk", "type": "string" } }, - "required": ["sessionUpdate", "content"], + "required": ["sessionUpdate"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/ContentChunk" + } + ], "description": "A chunk of the agent's response being streamed.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "content": { - "$ref": "#/$defs/ContentBlock", - "description": "A single item of content" - }, "sessionUpdate": { "const": "agent_message_chunk", "type": "string" } }, - "required": ["sessionUpdate", "content"], + "required": ["sessionUpdate"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/ContentChunk" + } + ], "description": "A chunk of the agent's internal reasoning being streamed.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "content": { - "$ref": "#/$defs/ContentBlock", - "description": "A single item of content" - }, "sessionUpdate": { "const": "agent_thought_chunk", "type": "string" } }, - "required": ["sessionUpdate", "content"], + "required": ["sessionUpdate"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/ToolCall" + } + ], "description": "Notification that a new tool call has been initiated.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "content": { - "description": "Content produced by the tool call.", - "items": { - "$ref": "#/$defs/ToolCallContent" - }, - "type": "array" - }, - "kind": { - "$ref": "#/$defs/ToolKind", - "description": "The category of tool being invoked.\nHelps clients choose appropriate icons and UI treatment." - }, - "locations": { - "description": "File locations affected by this tool call.\nEnables \"follow-along\" features in clients.", - "items": { - "$ref": "#/$defs/ToolCallLocation" - }, - "type": "array" - }, - "rawInput": { - "description": "Raw input parameters sent to the tool." - }, - "rawOutput": { - "description": "Raw output returned by the tool." - }, "sessionUpdate": { "const": "tool_call", "type": "string" - }, - "status": { - "$ref": "#/$defs/ToolCallStatus", - "description": "Current execution status of the tool call." - }, - "title": { - "description": "Human-readable title describing what the tool is doing.", - "type": "string" - }, - "toolCallId": { - "$ref": "#/$defs/ToolCallId", - "description": "Unique identifier for this tool call within the session." } }, - "required": ["sessionUpdate", "toolCallId", "title"], + "required": ["sessionUpdate"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/ToolCallUpdate" + } + ], "description": "Update on the status or results of a tool call.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "content": { - "description": "Replace the content collection.", - "items": { - "$ref": "#/$defs/ToolCallContent" - }, - "type": ["array", "null"] - }, - "kind": { - "anyOf": [ - { - "$ref": "#/$defs/ToolKind" - }, - { - "type": "null" - } - ], - "description": "Update the tool kind." - }, - "locations": { - "description": "Replace the locations collection.", - "items": { - "$ref": "#/$defs/ToolCallLocation" - }, - "type": ["array", "null"] - }, - "rawInput": { - "description": "Update the raw input." - }, - "rawOutput": { - "description": "Update the raw output." - }, "sessionUpdate": { "const": "tool_call_update", "type": "string" - }, - "status": { - "anyOf": [ - { - "$ref": "#/$defs/ToolCallStatus" - }, - { - "type": "null" - } - ], - "description": "Update the execution status." - }, - "title": { - "description": "Update the human-readable title.", - "type": ["string", "null"] - }, - "toolCallId": { - "$ref": "#/$defs/ToolCallId", - "description": "The ID of the tool call being updated." } }, - "required": ["sessionUpdate", "toolCallId"], + "required": ["sessionUpdate"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/Plan" + } + ], "description": "The agent's execution plan for complex tasks.\nSee protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan)", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "entries": { - "description": "The list of tasks to be accomplished.\n\nWhen updating a plan, the agent must send a complete list of all entries\nwith their current status. The client replaces the entire plan with each update.", - "items": { - "$ref": "#/$defs/PlanEntry" - }, - "type": "array" - }, "sessionUpdate": { "const": "plan", "type": "string" } }, - "required": ["sessionUpdate", "entries"], + "required": ["sessionUpdate"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/AvailableCommandsUpdate" + } + ], "description": "Available commands are ready or have changed", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "availableCommands": { - "description": "Commands the agent can execute", - "items": { - "$ref": "#/$defs/AvailableCommand" - }, - "type": "array" - }, "sessionUpdate": { "const": "available_commands_update", "type": "string" } }, - "required": ["sessionUpdate", "availableCommands"], + "required": ["sessionUpdate"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/CurrentModeUpdate" + } + ], "description": "The current mode of the session has changed\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "currentModeId": { - "$ref": "#/$defs/SessionModeId", - "description": "The ID of the current mode" - }, "sessionUpdate": { "const": "current_mode_update", "type": "string" } }, - "required": ["sessionUpdate", "currentModeId"], + "required": ["sessionUpdate"], "type": "object" } ] @@ -2009,11 +2094,19 @@ "description": "Extension point for implementations" }, "modeId": { - "$ref": "#/$defs/SessionModeId", + "allOf": [ + { + "$ref": "#/$defs/SessionModeId" + } + ], "description": "The ID of the mode to set." }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The ID of the session to set the mode for." } }, @@ -2087,7 +2180,11 @@ "description": "Extension point for implementations" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The session ID for this request." }, "terminalId": { @@ -2131,6 +2228,29 @@ "x-method": "terminal/output", "x-side": "client" }, + "TextContent": { + "description": "Text provided to or from an LLM.", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "annotations": { + "anyOf": [ + { + "$ref": "#/$defs/Annotations" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + } + }, + "required": ["text"], + "type": "object" + }, "TextResourceContents": { "description": "Text-based resource contents.", "properties": { @@ -2150,6 +2270,64 @@ "required": ["text", "uri"], "type": "object" }, + "ToolCall": { + "description": "Represents a tool call that the language model has requested.\n\nTool calls are actions that the agent executes on behalf of the language model,\nsuch as reading files, executing code, or fetching data from external sources.\n\nSee protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-calls)", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "content": { + "description": "Content produced by the tool call.", + "items": { + "$ref": "#/$defs/ToolCallContent" + }, + "type": "array" + }, + "kind": { + "allOf": [ + { + "$ref": "#/$defs/ToolKind" + } + ], + "description": "The category of tool being invoked.\nHelps clients choose appropriate icons and UI treatment." + }, + "locations": { + "description": "File locations affected by this tool call.\nEnables \"follow-along\" features in clients.", + "items": { + "$ref": "#/$defs/ToolCallLocation" + }, + "type": "array" + }, + "rawInput": { + "description": "Raw input parameters sent to the tool." + }, + "rawOutput": { + "description": "Raw output returned by the tool." + }, + "status": { + "allOf": [ + { + "$ref": "#/$defs/ToolCallStatus" + } + ], + "description": "Current execution status of the tool call." + }, + "title": { + "description": "Human-readable title describing what the tool is doing.", + "type": "string" + }, + "toolCallId": { + "allOf": [ + { + "$ref": "#/$defs/ToolCallId" + } + ], + "description": "Unique identifier for this tool call within the session." + } + }, + "required": ["toolCallId", "title"], + "type": "object" + }, "ToolCallContent": { "description": "Content produced by a tool call.\n\nTool calls can produce different types of content including\nstandard content blocks (text, images) or file diffs.\n\nSee protocol docs: [Content](https://agentclientprotocol.com/protocol/tool-calls#content)", "discriminator": { @@ -2160,7 +2338,11 @@ "description": "Standard content block (text, images, resources).", "properties": { "content": { - "$ref": "#/$defs/ContentBlock", + "allOf": [ + { + "$ref": "#/$defs/ContentBlock" + } + ], "description": "The actual content block." }, "type": { @@ -2262,6 +2444,70 @@ } ] }, + "ToolCallUpdate": { + "description": "An update to an existing tool call.\n\nUsed to report progress and results as tools execute. All fields except\nthe tool call ID are optional - only changed fields need to be included.\n\nSee protocol docs: [Updating](https://agentclientprotocol.com/protocol/tool-calls#updating)", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "content": { + "description": "Replace the content collection.", + "items": { + "$ref": "#/$defs/ToolCallContent" + }, + "type": ["array", "null"] + }, + "kind": { + "anyOf": [ + { + "$ref": "#/$defs/ToolKind" + }, + { + "type": "null" + } + ], + "description": "Update the tool kind." + }, + "locations": { + "description": "Replace the locations collection.", + "items": { + "$ref": "#/$defs/ToolCallLocation" + }, + "type": ["array", "null"] + }, + "rawInput": { + "description": "Update the raw input." + }, + "rawOutput": { + "description": "Update the raw output." + }, + "status": { + "anyOf": [ + { + "$ref": "#/$defs/ToolCallStatus" + }, + { + "type": "null" + } + ], + "description": "Update the execution status." + }, + "title": { + "description": "Update the human-readable title.", + "type": ["string", "null"] + }, + "toolCallId": { + "allOf": [ + { + "$ref": "#/$defs/ToolCallId" + } + ], + "description": "The ID of the tool call being updated." + } + }, + "required": ["toolCallId"], + "type": "object" + }, "ToolKind": { "description": "Categories of tools that can be invoked.\n\nTool kinds help clients choose appropriate icons and optimize how they\ndisplay tool execution progress.\n\nSee protocol docs: [Creating](https://agentclientprotocol.com/protocol/tool-calls#creating)", "oneOf": [ @@ -2324,7 +2570,11 @@ "description": "Extension point for implementations" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The session ID for this request." }, "terminalId": { @@ -2373,7 +2623,11 @@ "type": "string" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The session ID for this request." } }, @@ -2397,12 +2651,11 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { - "$ref": "#/$defs/AgentOutgoingMessage", - "title": "AgentOutgoingMessage" + "$ref": "#/$defs/AgentOutgoingMessage" }, { - "$ref": "#/$defs/ClientOutgoingMessage", - "title": "ClientOutgoingMessage" + "$ref": "#/$defs/ClientOutgoingMessage" } - ] + ], + "title": "AcpTypes" } diff --git a/unstable/docs/protocol/schema.mdx b/unstable/docs/protocol/schema.mdx index 89eb8269..a6124c80 100644 --- a/unstable/docs/protocol/schema.mdx +++ b/unstable/docs/protocol/schema.mdx @@ -35,11 +35,7 @@ Specifies which authentication method to use. Extension point for implementations -AuthMethodId} - required -> + The ID of the authentication method to use. Must be one of the methods advertised in the initialize response. @@ -85,7 +81,7 @@ See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/ini Extension point for implementations -ClientCapabilities} > + Capabilities supported by the client. - Default: `{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false}` @@ -97,7 +93,7 @@ See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/ini Note: in future versions of the protocol, this will be required. -ProtocolVersion} required> + The latest protocol version supported by the client. @@ -116,7 +112,7 @@ See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/ini Extension point for implementations -AgentCapabilities} > + Capabilities supported by the agent. - Default: `{"loadSession":false,"mcpCapabilities":{"http":false,"sse":false},"promptCapabilities":{"audio":false,"embeddedContext":false,"image":false}}` @@ -134,7 +130,7 @@ Note: in future versions of the protocol, this will be required. - Default: `[]` -ProtocolVersion} required> + The protocol version the client specified if supported by the agent, or the latest protocol version supported by the agent. @@ -171,11 +167,7 @@ See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/promp Extension point for implementations -SessionId} - required -> + The ID of the session to cancel operations for. @@ -226,11 +218,7 @@ See protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/s > List of MCP servers to connect to for this session. -SessionId} - required -> + The ID of the session to load. @@ -335,7 +323,7 @@ Initial model state if supported by the Agent See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes) -SessionId} required> + Unique identifier for the created session. Used in all subsequent requests for this conversation. @@ -389,7 +377,7 @@ as it avoids extra round-trips and allows the message to include pieces of context from sources the agent may not have access to. -SessionId} required> + The ID of the session to send this user message to @@ -406,11 +394,7 @@ See protocol docs: [Check for Completion](https://agentclientprotocol.com/protoc Extension point for implementations -StopReason} - required -> + Indicates why the agent stopped processing the turn. @@ -442,18 +426,10 @@ Request parameters for setting a session mode. Extension point for implementations -SessionModeId} - required -> + The ID of the mode to set. -SessionId} - required -> + The ID of the session to set the mode for. @@ -491,14 +467,10 @@ Request parameters for setting a session model. Extension point for implementations -ModelId} required> + The ID of the model to set. -SessionId} - required -> + The ID of the session to set the model for. @@ -564,7 +536,7 @@ Only available if the client supports the `fs.readTextFile` capability. Absolute path to the file to read. -SessionId} required> + The session ID for this request. @@ -610,11 +582,7 @@ Only available if the client supports the `fs.writeTextFile` capability. Absolute path to the file to write. -SessionId} - required -> + The session ID for this request. @@ -673,11 +641,7 @@ See protocol docs: [Requesting Permission](https://agentclientprotocol.com/proto > Available permission options for the user to choose from. -SessionId} - required -> + The session ID for this request. @@ -695,11 +659,7 @@ Response to a permission request. Extension point for implementations -RequestPermissionOutcome} - required -> + The user's decision on the permission request. @@ -733,18 +693,10 @@ See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protoc Extension point for implementations -SessionId} - required -> + The ID of the session this update pertains to. -SessionUpdate} - required -> + The actual update content. @@ -802,7 +754,7 @@ specified limit. - Minimum: `0` -SessionId} required> + The session ID for this request. @@ -848,11 +800,7 @@ Request to kill a terminal command without releasing the terminal. Extension point for implementations -SessionId} - required -> + The session ID for this request. @@ -892,11 +840,7 @@ Request to get the current output and status of a terminal. Extension point for implementations -SessionId} - required -> + The session ID for this request. @@ -961,11 +905,7 @@ Request to release a terminal and free its resources. Extension point for implementations -SessionId} - required -> + The session ID for this request. @@ -1002,11 +942,7 @@ Request to wait for a terminal command to exit. Extension point for implementations -SessionId} - required -> + The session ID for this request. @@ -1056,13 +992,13 @@ See protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol - Default: `false` -McpCapabilities} > + MCP capabilities supported by the agent. - Default: `{"http":false,"sse":false}` -PromptCapabilities} > + Prompt capabilities supported by the agent. - Default: `{"audio":false,"embeddedContext":false,"image":false}` @@ -1084,6 +1020,31 @@ Optional annotations for the client. The client can use annotations to inform ho +## AudioContent + +Audio provided to or from an LLM. + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + + Annotations + + | null + + } +> + + + ## AuthMethod Describes an available authentication method. @@ -1098,11 +1059,7 @@ Describes an available authentication method. Optional description providing more details about this authentication method. -AuthMethodId} - required -> + Unique identifier for this authentication method. @@ -1164,6 +1121,32 @@ All text that was typed after the command name is provided as input. +## AvailableCommandsUpdate + +Available commands are ready or have changed + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + + AvailableCommand + + [] + + } + required +> + Commands the agent can execute + + ## BlobResourceContents Binary resource contents. @@ -1195,7 +1178,7 @@ See protocol docs: [Client Capabilities](https://agentclientprotocol.com/protoco Extension point for implementations -FileSystemCapability} > + File system capabilities supported by the client. Determines which file operations the agent can request. @@ -1237,21 +1220,6 @@ Clients SHOULD render this text as Markdown. - - Extension point for implementations - - - - Annotations - - | null - - } -> - @@ -1264,24 +1232,7 @@ Requires the `image` prompt capability when included in prompts. - - Extension point for implementations - - - - Annotations - - | null - - } -> - - - @@ -1293,22 +1244,6 @@ Requires the `audio` prompt capability when included in prompts. - - Extension point for implementations - - - - Annotations - - | null - - } -> - - @@ -1321,27 +1256,7 @@ All agents MUST support resource links in prompts. - - Extension point for implementations - - - - Annotations - - | null - - } -> - - - - - - @@ -1355,6 +1270,51 @@ Requires the `embeddedContext` prompt capability when included in prompts. + + + + + +## ContentChunk + +A streamed item of content + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + A single item of content + + +## CurrentModeUpdate + +The current mode of the session has changed + +See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes) + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + The ID of the current mode + + +## EmbeddedResource + +The contents of a resource, embedded into a prompt or tool call result. + +**Type:** Object + +**Properties:** + Extension point for implementations @@ -1374,10 +1334,6 @@ Requires the `embeddedContext` prompt capability when included in prompts. type={EmbeddedResourceResource} required > - - - - ## EmbeddedResourceResource @@ -1504,6 +1460,32 @@ An HTTP header to set when making requests to the MCP server. The value to set for the HTTP header. +## ImageContent + +An image provided to or from an LLM. + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + + Annotations + + | null + + } +> + + + + ## Implementation Describes the name and version of an MCP implementation, with an optional @@ -1529,33 +1511,185 @@ If not provided, the name should be used for display. for debugging or metrics purposes. -## McpCapabilities +## JsonRpcMessage -MCP capabilities supported by the agent +A message (request, response, or notification) with `"jsonrpc": "2.0"` specified as +[required by JSON-RPC 2.0 Specification][1]. -**Type:** Object +[1]: https://www.jsonrpc.org/specification#compatibility -**Properties:** +**Type:** Union - - Extension point for implementations - - - Agent supports `McpServer::Http`. + +{""} - - Default: `false` + - - - Agent supports `McpServer::Sse`. + + JSON RPC Request Id - - Default: `false` +An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2] - +The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects. -## McpServer +[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling. -Configuration for connecting to an MCP (Model Context Protocol) server. +[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. + + + + +AgentRequest | null} > + + + + + + +{""} + + + + + JSON RPC Request Id + +An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2] + +The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects. + +[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling. + +[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. + + + + + + + +{""} + + + + + + + AgentNotification + + | null + + } +> + + + + +## JsonRpcMessage2 + +A message (request, response, or notification) with `"jsonrpc": "2.0"` specified as +[required by JSON-RPC 2.0 Specification][1]. + +[1]: https://www.jsonrpc.org/specification#compatibility + +**Type:** Union + + +{""} + + + + + JSON RPC Request Id + +An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2] + +The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects. + +[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling. + +[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. + + + + +ClientRequest | null} > + + + + + + +{""} + + + + + JSON RPC Request Id + +An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2] + +The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects. + +[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling. + +[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. + + + + + + + +{""} + + + + + + + ClientNotification + + | null + + } +> + + + + +## McpCapabilities + +MCP capabilities supported by the agent + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + Agent supports `McpServer::Http`. + + - Default: `false` + + + + Agent supports `McpServer::Sse`. + + - Default: `false` + + + +## McpServer + +Configuration for connecting to an MCP (Model Context Protocol) server. MCP servers provide tools and context that the agent can use when processing prompts. @@ -1699,7 +1833,7 @@ Information about a selectable model. Optional description of the model. -ModelId} required> + Unique identifier for the model. @@ -1717,21 +1851,13 @@ An option presented to the user when requesting permission. Extension point for implementations -PermissionOptionKind} - required -> + Hint about the nature of this permission option. Human-readable label to display to the user. -PermissionOptionId} - required -> + Unique identifier for this permission option. @@ -1765,6 +1891,31 @@ Helps clients choose appropriate icons and UI treatment. Reject this operation and remember the choice. +## Plan + +An execution plan for accomplishing complex tasks. + +Plans consist of multiple entries representing individual tasks or goals. +Agents report plans to clients to provide visibility into their execution strategy. +Plans can evolve during execution as the agent discovers new requirements or completes tasks. + +See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan) + +**Type:** Object + +**Properties:** + + + Extension point for implementations + +PlanEntry[]} required> + 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. + + + ## PlanEntry A single entry in the execution plan. @@ -1783,19 +1934,11 @@ See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent Human-readable description of what this task aims to accomplish. -PlanEntryPriority} - required -> + The relative importance of this task. Used to indicate which tasks are most critical to the overall goal. -PlanEntryStatus} - required -> + Current execution status of this task. @@ -1925,11 +2068,7 @@ The user selected one of the provided options. -PermissionOptionId} - required -> + The ID of the option the user selected. @@ -1937,6 +2076,35 @@ The user selected one of the provided options. +## ResourceLink + +A resource that the server is capable of reading, included in a prompt or tool call result. + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + + Annotations + + | null + + } +> + + + + + + + ## Role The sender or recipient of messages and data in a conversation. @@ -2020,11 +2188,7 @@ The set of modes and the one currently active. > The set of modes that the Agent can operate in -SessionModeId} - required -> + The current mode the Agent is in. @@ -2057,11 +2221,7 @@ The set of models and the one currently active. > The set of models that the Agent can use -ModelId} - required -> + The current model the Agent is in. @@ -2080,16 +2240,6 @@ A chunk of the user's message being streamed. - - Extension point for implementations - -ContentBlock} - required -> - A single item of content - @@ -2100,16 +2250,6 @@ A chunk of the agent's response being streamed. - - Extension point for implementations - -ContentBlock} - required -> - A single item of content - @@ -2120,16 +2260,6 @@ A chunk of the agent's internal reasoning being streamed. - - Extension point for implementations - -ContentBlock} - required -> - A single item of content - @@ -2140,63 +2270,7 @@ Notification that a new tool call has been initiated. - - Extension point for implementations - - - - ToolCallContent - - [] - - } -> - Content produced by the tool call. - -ToolKind}> - The category of tool being invoked. Helps clients choose appropriate icons and - UI treatment. - - - - ToolCallLocation - - [] - - } -> - File locations affected by this tool call. Enables "follow-along" features in - clients. - - - Raw input parameters sent to the tool. - - - Raw output returned by the tool. - -ToolCallStatus} -> - Current execution status of the tool call. - - - Human-readable title describing what the tool is doing. - -ToolCallId} - required -> - Unique identifier for this tool call within the session. - @@ -2206,58 +2280,7 @@ Update on the status or results of a tool call. - - Extension point for implementations - - - Replace the content collection. - - - - ToolKind - - | null - - } -> - Update the tool kind. - - - Replace the locations collection. - - - Update the raw input. - - - Update the raw output. - - - - ToolCallStatus - - | null - - } -> - Update the execution status. - - - Update the human-readable title. - -ToolCallId} - required -> - The ID of the tool call being updated. - @@ -2268,18 +2291,7 @@ See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-p - - Extension point for implementations - -PlanEntry[]} required> - 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. - - - - + @@ -2289,23 +2301,6 @@ Available commands are ready or have changed - - Extension point for implementations - - - - AvailableCommand - - [] - - } - required -> - Commands the agent can execute - @@ -2318,16 +2313,6 @@ See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/sess - - Extension point for implementations - -SessionModeId} - required -> - The ID of the current mode - @@ -2389,6 +2374,30 @@ Exit status of a terminal command. The signal that terminated the process (may be null if exited normally). +## TextContent + +Text provided to or from an LLM. + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + + Annotations + + | null + + } +> + + ## TextResourceContents Text-based resource contents. @@ -2404,6 +2413,69 @@ Text-based resource contents. +## ToolCall + +Represents a tool call that the language model has requested. + +Tool calls are actions that the agent executes on behalf of the language model, +such as reading files, executing code, or fetching data from external sources. + +See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-calls) + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + + ToolCallContent + + [] + + } +> + Content produced by the tool call. + + + The category of tool being invoked. Helps clients choose appropriate icons and + UI treatment. + + + + ToolCallLocation + + [] + + } +> + File locations affected by this tool call. Enables "follow-along" features in + clients. + + + Raw input parameters sent to the tool. + + + Raw output returned by the tool. + + + Current execution status of the tool call. + + + Human-readable title describing what the tool is doing. + + + Unique identifier for this tool call within the session. + + ## ToolCallContent Content produced by a tool call. @@ -2420,11 +2492,7 @@ Standard content block (text, images, resources). -ContentBlock} - required -> + The actual content block. @@ -2526,6 +2594,67 @@ See protocol docs: [Status](https://agentclientprotocol.com/protocol/tool-calls# The tool call failed with an error. +## ToolCallUpdate + +An update to an existing tool call. + +Used to report progress and results as tools execute. All fields except +the tool call ID are optional - only changed fields need to be included. + +See protocol docs: [Updating](https://agentclientprotocol.com/protocol/tool-calls#updating) + +**Type:** Object + +**Properties:** + + + Extension point for implementations + + + Replace the content collection. + + + + ToolKind + + | null + + } +> + Update the tool kind. + + + Replace the locations collection. + + + Update the raw input. + + + Update the raw output. + + + + ToolCallStatus + + | null + + } +> + Update the execution status. + + + Update the human-readable title. + + + The ID of the tool call being updated. + + ## ToolKind Categories of tools that can be invoked. diff --git a/unstable/schema/schema.json b/unstable/schema/schema.json index b2654308..b1a11d6e 100644 --- a/unstable/schema/schema.json +++ b/unstable/schema/schema.json @@ -12,7 +12,11 @@ "type": "boolean" }, "mcpCapabilities": { - "$ref": "#/$defs/McpCapabilities", + "allOf": [ + { + "$ref": "#/$defs/McpCapabilities" + } + ], "default": { "http": false, "sse": false @@ -20,7 +24,11 @@ "description": "MCP capabilities supported by the agent." }, "promptCapabilities": { - "$ref": "#/$defs/PromptCapabilities", + "allOf": [ + { + "$ref": "#/$defs/PromptCapabilities" + } + ], "default": { "audio": false, "embeddedContext": false, @@ -34,180 +42,96 @@ "AgentNotification": { "anyOf": [ { - "$ref": "#/$defs/SessionNotification", - "description": "Handles session update notifications from the agent.\n\nThis is a notification endpoint (no response expected) that receives\nreal-time updates about session progress, including message chunks,\ntool calls, and execution plans.\n\nNote: Clients SHOULD continue accepting tool call updates even after\nsending a `session/cancel` notification, as the agent may send final\nupdates before responding with the cancelled stop reason.\n\nSee protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)", - "title": "SessionNotification" + "allOf": [ + { + "$ref": "#/$defs/SessionNotification" + } + ], + "description": "Handles session update notifications from the agent.\n\nThis is a notification endpoint (no response expected) that receives\nreal-time updates about session progress, including message chunks,\ntool calls, and execution plans.\n\nNote: Clients SHOULD continue accepting tool call updates even after\nsending a `session/cancel` notification, as the agent may send final\nupdates before responding with the cancelled stop reason.\n\nSee protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)" }, { - "description": "Handles extension notifications from the agent.\n\nAllows the Agent to send an arbitrary notification that is not part of the ACP spec.\nExtension notifications provide a way to send one-way messages for custom functionality\nwhile maintaining protocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", - "title": "ExtNotification" + "description": "Handles extension notifications from the agent.\n\nAllows the Agent to send an arbitrary notification that is not part of the ACP spec.\nExtension notifications provide a way to send one-way messages for custom functionality\nwhile maintaining protocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)" } ], "description": "All possible notifications that an agent can send to a client.\n\nThis enum is used internally for routing RPC notifications. You typically won't need\nto use this directly - use the notification methods on the [`Client`] trait instead.\n\nNotifications do not expect a response.", "x-docs-ignore": true }, "AgentOutgoingMessage": { - "anyOf": [ - { - "properties": { - "id": { - "anyOf": [ - { - "title": "null", - "type": "null" - }, - { - "format": "int64", - "title": "number", - "type": "integer" - }, - { - "title": "string", - "type": "string" - } - ], - "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." - }, - "method": { - "type": "string" - }, - "params": { - "anyOf": [ - { - "$ref": "#/$defs/AgentRequest" - }, - { - "type": "null" - } - ] - } - }, - "required": ["id", "method"], - "title": "Request", - "type": "object" - }, - { - "oneOf": [ - { - "properties": { - "result": { - "$ref": "#/$defs/AgentResponse" - } - }, - "required": ["result"], - "type": "object" - }, - { - "properties": { - "error": { - "$ref": "#/$defs/Error" - } - }, - "required": ["error"], - "type": "object" - } - ], - "properties": { - "id": { - "anyOf": [ - { - "title": "null", - "type": "null" - }, - { - "format": "int64", - "title": "number", - "type": "integer" - }, - { - "title": "string", - "type": "string" - } - ], - "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." - } - }, - "required": ["id"], - "title": "Response", - "type": "object" - }, + "allOf": [ { - "properties": { - "method": { - "type": "string" - }, - "params": { - "anyOf": [ - { - "$ref": "#/$defs/AgentNotification" - }, - { - "type": "null" - } - ] - } - }, - "required": ["method"], - "title": "Notification", - "type": "object" + "$ref": "#/$defs/JsonRpcMessage" } ], - "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", - "properties": { - "jsonrpc": { - "enum": ["2.0"], - "type": "string" - } - }, - "required": ["jsonrpc"], - "type": "object", "x-docs-ignore": true }, "AgentRequest": { "anyOf": [ { - "$ref": "#/$defs/WriteTextFileRequest", - "description": "Writes content to a text file in the client's file system.\n\nOnly available if the client advertises the `fs.writeTextFile` capability.\nAllows the agent to create or modify files within the client's environment.\n\nSee protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)", - "title": "WriteTextFileRequest" + "allOf": [ + { + "$ref": "#/$defs/WriteTextFileRequest" + } + ], + "description": "Writes content to a text file in the client's file system.\n\nOnly available if the client advertises the `fs.writeTextFile` capability.\nAllows the agent to create or modify files within the client's environment.\n\nSee protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)" }, { - "$ref": "#/$defs/ReadTextFileRequest", - "description": "Reads content from a text file in the client's file system.\n\nOnly available if the client advertises the `fs.readTextFile` capability.\nAllows the agent to access file contents within the client's environment.\n\nSee protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)", - "title": "ReadTextFileRequest" + "allOf": [ + { + "$ref": "#/$defs/ReadTextFileRequest" + } + ], + "description": "Reads content from a text file in the client's file system.\n\nOnly available if the client advertises the `fs.readTextFile` capability.\nAllows the agent to access file contents within the client's environment.\n\nSee protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)" }, { - "$ref": "#/$defs/RequestPermissionRequest", - "description": "Requests permission from the user for a tool call operation.\n\nCalled by the agent when it needs user authorization before executing\na potentially sensitive operation. The client should present the options\nto the user and return their decision.\n\nIf the client cancels the prompt turn via `session/cancel`, it MUST\nrespond to this request with `RequestPermissionOutcome::Cancelled`.\n\nSee protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/tool-calls#requesting-permission)", - "title": "RequestPermissionRequest" + "allOf": [ + { + "$ref": "#/$defs/RequestPermissionRequest" + } + ], + "description": "Requests permission from the user for a tool call operation.\n\nCalled by the agent when it needs user authorization before executing\na potentially sensitive operation. The client should present the options\nto the user and return their decision.\n\nIf the client cancels the prompt turn via `session/cancel`, it MUST\nrespond to this request with `RequestPermissionOutcome::Cancelled`.\n\nSee protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/tool-calls#requesting-permission)" }, { - "$ref": "#/$defs/CreateTerminalRequest", - "description": "Executes a command in a new terminal\n\nOnly available if the `terminal` Client capability is set to `true`.\n\nReturns a `TerminalId` that can be used with other terminal methods\nto get the current output, wait for exit, and kill the command.\n\nThe `TerminalId` can also be used to embed the terminal in a tool call\nby using the `ToolCallContent::Terminal` variant.\n\nThe Agent is responsible for releasing the terminal by using the `terminal/release`\nmethod.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", - "title": "CreateTerminalRequest" + "allOf": [ + { + "$ref": "#/$defs/CreateTerminalRequest" + } + ], + "description": "Executes a command in a new terminal\n\nOnly available if the `terminal` Client capability is set to `true`.\n\nReturns a `TerminalId` that can be used with other terminal methods\nto get the current output, wait for exit, and kill the command.\n\nThe `TerminalId` can also be used to embed the terminal in a tool call\nby using the `ToolCallContent::Terminal` variant.\n\nThe Agent is responsible for releasing the terminal by using the `terminal/release`\nmethod.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)" }, { - "$ref": "#/$defs/TerminalOutputRequest", - "description": "Gets the terminal output and exit status\n\nReturns the current content in the terminal without waiting for the command to exit.\nIf the command has already exited, the exit status is included.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", - "title": "TerminalOutputRequest" + "allOf": [ + { + "$ref": "#/$defs/TerminalOutputRequest" + } + ], + "description": "Gets the terminal output and exit status\n\nReturns the current content in the terminal without waiting for the command to exit.\nIf the command has already exited, the exit status is included.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)" }, { - "$ref": "#/$defs/ReleaseTerminalRequest", - "description": "Releases a terminal\n\nThe command is killed if it hasn't exited yet. Use `terminal/wait_for_exit`\nto wait for the command to exit before releasing the terminal.\n\nAfter release, the `TerminalId` can no longer be used with other `terminal/*` methods,\nbut tool calls that already contain it, continue to display its output.\n\nThe `terminal/kill` method can be used to terminate the command without releasing\nthe terminal, allowing the Agent to call `terminal/output` and other methods.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", - "title": "ReleaseTerminalRequest" + "allOf": [ + { + "$ref": "#/$defs/ReleaseTerminalRequest" + } + ], + "description": "Releases a terminal\n\nThe command is killed if it hasn't exited yet. Use `terminal/wait_for_exit`\nto wait for the command to exit before releasing the terminal.\n\nAfter release, the `TerminalId` can no longer be used with other `terminal/*` methods,\nbut tool calls that already contain it, continue to display its output.\n\nThe `terminal/kill` method can be used to terminate the command without releasing\nthe terminal, allowing the Agent to call `terminal/output` and other methods.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)" }, { - "$ref": "#/$defs/WaitForTerminalExitRequest", - "description": "Waits for the terminal command to exit and return its exit status\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", - "title": "WaitForTerminalExitRequest" + "allOf": [ + { + "$ref": "#/$defs/WaitForTerminalExitRequest" + } + ], + "description": "Waits for the terminal command to exit and return its exit status\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)" }, { - "$ref": "#/$defs/KillTerminalCommandRequest", - "description": "Kills the terminal command without releasing the terminal\n\nWhile `terminal/release` will also kill the command, this method will keep\nthe `TerminalId` valid so it can be used with other methods.\n\nThis method can be helpful when implementing command timeouts which terminate\nthe command as soon as elapsed, and then get the final output so it can be sent\nto the model.\n\nNote: `terminal/release` when `TerminalId` is no longer needed.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", - "title": "KillTerminalCommandRequest" + "allOf": [ + { + "$ref": "#/$defs/KillTerminalCommandRequest" + } + ], + "description": "Kills the terminal command without releasing the terminal\n\nWhile `terminal/release` will also kill the command, this method will keep\nthe `TerminalId` valid so it can be used with other methods.\n\nThis method can be helpful when implementing command timeouts which terminate\nthe command as soon as elapsed, and then get the final output so it can be sent\nto the model.\n\nNote: `terminal/release` when `TerminalId` is no longer needed.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)" }, { - "description": "Handles extension method requests from the agent.\n\nAllows the Agent to send an arbitrary request that is not part of the ACP spec.\nExtension methods provide a way to add custom functionality while maintaining\nprotocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", - "title": "ExtMethodRequest" + "description": "Handles extension method requests from the agent.\n\nAllows the Agent to send an arbitrary request that is not part of the ACP spec.\nExtension methods provide a way to add custom functionality while maintaining\nprotocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)" } ], "description": "All possible requests that an agent can send to a client.\n\nThis enum is used internally for routing RPC requests. You typically won't need\nto use this directly - instead, use the methods on the [`Client`] trait.\n\nThis enum encompasses all method calls from agent to client.", @@ -216,36 +140,27 @@ "AgentResponse": { "anyOf": [ { - "$ref": "#/$defs/InitializeResponse", - "title": "InitializeResponse" + "$ref": "#/$defs/InitializeResponse" }, { - "$ref": "#/$defs/AuthenticateResponse", - "title": "AuthenticateResponse" + "$ref": "#/$defs/AuthenticateResponse" }, { - "$ref": "#/$defs/NewSessionResponse", - "title": "NewSessionResponse" + "$ref": "#/$defs/NewSessionResponse" }, { - "$ref": "#/$defs/LoadSessionResponse", - "title": "LoadSessionResponse" + "$ref": "#/$defs/LoadSessionResponse" }, { - "$ref": "#/$defs/SetSessionModeResponse", - "title": "SetSessionModeResponse" + "$ref": "#/$defs/SetSessionModeResponse" }, { - "$ref": "#/$defs/PromptResponse", - "title": "PromptResponse" + "$ref": "#/$defs/PromptResponse" }, { - "$ref": "#/$defs/SetSessionModelResponse", - "title": "SetSessionModelResponse" + "$ref": "#/$defs/SetSessionModelResponse" }, - { - "title": "ExtMethodResponse" - } + true ], "description": "All possible responses that an agent can send to a client.\n\nThis enum is used internally for routing RPC responses. You typically won't need\nto use this directly - the responses are handled automatically by the connection.\n\nThese are responses to the corresponding `ClientRequest` variants.", "x-docs-ignore": true @@ -272,6 +187,32 @@ }, "type": "object" }, + "AudioContent": { + "description": "Audio provided to or from an LLM.", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "annotations": { + "anyOf": [ + { + "$ref": "#/$defs/Annotations" + }, + { + "type": "null" + } + ] + }, + "data": { + "type": "string" + }, + "mimeType": { + "type": "string" + } + }, + "required": ["data", "mimeType"], + "type": "object" + }, "AuthMethod": { "description": "Describes an available authentication method.", "properties": { @@ -283,7 +224,11 @@ "type": ["string", "null"] }, "id": { - "$ref": "#/$defs/AuthMethodId", + "allOf": [ + { + "$ref": "#/$defs/AuthMethodId" + } + ], "description": "Unique identifier for this authentication method." }, "name": { @@ -305,7 +250,11 @@ "description": "Extension point for implementations" }, "methodId": { - "$ref": "#/$defs/AuthMethodId", + "allOf": [ + { + "$ref": "#/$defs/AuthMethodId" + } + ], "description": "The ID of the authentication method to use.\nMust be one of the methods advertised in the initialize response." } }, @@ -365,12 +314,28 @@ } }, "required": ["hint"], - "title": "UnstructuredCommandInput", "type": "object" } ], "description": "The input specification for a command." }, + "AvailableCommandsUpdate": { + "description": "Available commands are ready or have changed", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "availableCommands": { + "description": "Commands the agent can execute", + "items": { + "$ref": "#/$defs/AvailableCommand" + }, + "type": "array" + } + }, + "required": ["availableCommands"], + "type": "object" + }, "BlobResourceContents": { "description": "Binary resource contents.", "properties": { @@ -397,7 +362,11 @@ "description": "Extension point for implementations" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The ID of the session to cancel operations for." } }, @@ -413,7 +382,11 @@ "description": "Extension point for implementations" }, "fs": { - "$ref": "#/$defs/FileSystemCapability", + "allOf": [ + { + "$ref": "#/$defs/FileSystemCapability" + } + ], "default": { "readTextFile": false, "writeTextFile": false @@ -431,175 +404,88 @@ "ClientNotification": { "anyOf": [ { - "$ref": "#/$defs/CancelNotification", - "description": "Cancels ongoing operations for a session.\n\nThis is a notification sent by the client to cancel an ongoing prompt turn.\n\nUpon receiving this notification, the Agent SHOULD:\n- Stop all language model requests as soon as possible\n- Abort all tool call invocations in progress\n- Send any pending `session/update` notifications\n- Respond to the original `session/prompt` request with `StopReason::Cancelled`\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)", - "title": "CancelNotification" + "allOf": [ + { + "$ref": "#/$defs/CancelNotification" + } + ], + "description": "Cancels ongoing operations for a session.\n\nThis is a notification sent by the client to cancel an ongoing prompt turn.\n\nUpon receiving this notification, the Agent SHOULD:\n- Stop all language model requests as soon as possible\n- Abort all tool call invocations in progress\n- Send any pending `session/update` notifications\n- Respond to the original `session/prompt` request with `StopReason::Cancelled`\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)" }, { - "description": "Handles extension notifications from the client.\n\nExtension notifications provide a way to send one-way messages for custom functionality\nwhile maintaining protocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", - "title": "ExtNotification" + "description": "Handles extension notifications from the client.\n\nExtension notifications provide a way to send one-way messages for custom functionality\nwhile maintaining protocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)" } ], "description": "All possible notifications that a client can send to an agent.\n\nThis enum is used internally for routing RPC notifications. You typically won't need\nto use this directly - use the notification methods on the [`Agent`] trait instead.\n\nNotifications do not expect a response.", "x-docs-ignore": true }, "ClientOutgoingMessage": { + "allOf": [ + { + "$ref": "#/$defs/JsonRpcMessage2" + } + ], + "x-docs-ignore": true + }, + "ClientRequest": { "anyOf": [ { - "properties": { - "id": { - "anyOf": [ - { - "title": "null", - "type": "null" - }, - { - "format": "int64", - "title": "number", - "type": "integer" - }, - { - "title": "string", - "type": "string" - } - ], - "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." - }, - "method": { - "type": "string" - }, - "params": { - "anyOf": [ - { - "$ref": "#/$defs/ClientRequest" - }, - { - "type": "null" - } - ] + "allOf": [ + { + "$ref": "#/$defs/InitializeRequest" } - }, - "required": ["id", "method"], - "title": "Request", - "type": "object" + ], + "description": "Establishes the connection with a client and negotiates protocol capabilities.\n\nThis method is called once at the beginning of the connection to:\n- Negotiate the protocol version to use\n- Exchange capability information between client and agent\n- Determine available authentication methods\n\nThe agent should respond with its supported protocol version and capabilities.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)" }, { - "oneOf": [ + "allOf": [ { - "properties": { - "result": { - "$ref": "#/$defs/ClientResponse" - } - }, - "required": ["result"], - "type": "object" - }, + "$ref": "#/$defs/AuthenticateRequest" + } + ], + "description": "Authenticates the client using the specified authentication method.\n\nCalled when the agent requires authentication before allowing session creation.\nThe client provides the authentication method ID that was advertised during initialization.\n\nAfter successful authentication, the client can proceed to create sessions with\n`new_session` without receiving an `auth_required` error.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)" + }, + { + "allOf": [ { - "properties": { - "error": { - "$ref": "#/$defs/Error" - } - }, - "required": ["error"], - "type": "object" + "$ref": "#/$defs/NewSessionRequest" } ], - "properties": { - "id": { - "anyOf": [ - { - "title": "null", - "type": "null" - }, - { - "format": "int64", - "title": "number", - "type": "integer" - }, - { - "title": "string", - "type": "string" - } - ], - "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." - } - }, - "required": ["id"], - "title": "Response", - "type": "object" + "description": "Creates a new conversation session with the agent.\n\nSessions represent independent conversation contexts with their own history and state.\n\nThe agent should:\n- Create a new session context\n- Connect to any specified MCP servers\n- Return a unique session ID for future requests\n\nMay return an `auth_required` error if the agent requires authentication.\n\nSee protocol docs: [Session Setup](https://agentclientprotocol.com/protocol/session-setup)" }, { - "properties": { - "method": { - "type": "string" - }, - "params": { - "anyOf": [ - { - "$ref": "#/$defs/ClientNotification" - }, - { - "type": "null" - } - ] + "allOf": [ + { + "$ref": "#/$defs/LoadSessionRequest" } - }, - "required": ["method"], - "title": "Notification", - "type": "object" - } - ], - "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", - "properties": { - "jsonrpc": { - "enum": ["2.0"], - "type": "string" - } - }, - "required": ["jsonrpc"], - "type": "object", - "x-docs-ignore": true - }, - "ClientRequest": { - "anyOf": [ - { - "$ref": "#/$defs/InitializeRequest", - "description": "Establishes the connection with a client and negotiates protocol capabilities.\n\nThis method is called once at the beginning of the connection to:\n- Negotiate the protocol version to use\n- Exchange capability information between client and agent\n- Determine available authentication methods\n\nThe agent should respond with its supported protocol version and capabilities.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)", - "title": "InitializeRequest" - }, - { - "$ref": "#/$defs/AuthenticateRequest", - "description": "Authenticates the client using the specified authentication method.\n\nCalled when the agent requires authentication before allowing session creation.\nThe client provides the authentication method ID that was advertised during initialization.\n\nAfter successful authentication, the client can proceed to create sessions with\n`new_session` without receiving an `auth_required` error.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)", - "title": "AuthenticateRequest" - }, - { - "$ref": "#/$defs/NewSessionRequest", - "description": "Creates a new conversation session with the agent.\n\nSessions represent independent conversation contexts with their own history and state.\n\nThe agent should:\n- Create a new session context\n- Connect to any specified MCP servers\n- Return a unique session ID for future requests\n\nMay return an `auth_required` error if the agent requires authentication.\n\nSee protocol docs: [Session Setup](https://agentclientprotocol.com/protocol/session-setup)", - "title": "NewSessionRequest" - }, - { - "$ref": "#/$defs/LoadSessionRequest", - "description": "Loads an existing session to resume a previous conversation.\n\nThis method is only available if the agent advertises the `loadSession` capability.\n\nThe agent should:\n- Restore the session context and conversation history\n- Connect to the specified MCP servers\n- Stream the entire conversation history back to the client via notifications\n\nSee protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)", - "title": "LoadSessionRequest" + ], + "description": "Loads an existing session to resume a previous conversation.\n\nThis method is only available if the agent advertises the `loadSession` capability.\n\nThe agent should:\n- Restore the session context and conversation history\n- Connect to the specified MCP servers\n- Stream the entire conversation history back to the client via notifications\n\nSee protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)" }, { - "$ref": "#/$defs/SetSessionModeRequest", - "description": "Sets the current mode for a session.\n\nAllows switching between different agent modes (e.g., \"ask\", \"architect\", \"code\")\nthat affect system prompts, tool availability, and permission behaviors.\n\nThe mode must be one of the modes advertised in `availableModes` during session\ncreation or loading. Agents may also change modes autonomously and notify the\nclient via `current_mode_update` notifications.\n\nThis method can be called at any time during a session, whether the Agent is\nidle or actively generating a response.\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", - "title": "SetSessionModeRequest" + "allOf": [ + { + "$ref": "#/$defs/SetSessionModeRequest" + } + ], + "description": "Sets the current mode for a session.\n\nAllows switching between different agent modes (e.g., \"ask\", \"architect\", \"code\")\nthat affect system prompts, tool availability, and permission behaviors.\n\nThe mode must be one of the modes advertised in `availableModes` during session\ncreation or loading. Agents may also change modes autonomously and notify the\nclient via `current_mode_update` notifications.\n\nThis method can be called at any time during a session, whether the Agent is\nidle or actively generating a response.\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" }, { - "$ref": "#/$defs/PromptRequest", - "description": "Processes a user prompt within a session.\n\nThis method handles the whole lifecycle of a prompt:\n- Receives user messages with optional context (files, images, etc.)\n- Processes the prompt using language models\n- Reports language model content and tool calls to the Clients\n- Requests permission to run tools\n- Executes any requested tool calls\n- Returns when the turn is complete with a stop reason\n\nSee protocol docs: [Prompt Turn](https://agentclientprotocol.com/protocol/prompt-turn)", - "title": "PromptRequest" + "allOf": [ + { + "$ref": "#/$defs/PromptRequest" + } + ], + "description": "Processes a user prompt within a session.\n\nThis method handles the whole lifecycle of a prompt:\n- Receives user messages with optional context (files, images, etc.)\n- Processes the prompt using language models\n- Reports language model content and tool calls to the Clients\n- Requests permission to run tools\n- Executes any requested tool calls\n- Returns when the turn is complete with a stop reason\n\nSee protocol docs: [Prompt Turn](https://agentclientprotocol.com/protocol/prompt-turn)" }, { - "$ref": "#/$defs/SetSessionModelRequest", - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nSelect a model for a given session.", - "title": "SetSessionModelRequest" + "allOf": [ + { + "$ref": "#/$defs/SetSessionModelRequest" + } + ], + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nSelect a model for a given session." }, { - "description": "Handles extension method requests from the client.\n\nExtension methods provide a way to add custom functionality while maintaining\nprotocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", - "title": "ExtMethodRequest" + "description": "Handles extension method requests from the client.\n\nExtension methods provide a way to add custom functionality while maintaining\nprotocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)" } ], "description": "All possible requests that a client can send to an agent.\n\nThis enum is used internally for routing RPC requests. You typically won't need\nto use this directly - instead, use the methods on the [`Agent`] trait.\n\nThis enum encompasses all method calls from client to agent.", @@ -608,40 +494,30 @@ "ClientResponse": { "anyOf": [ { - "$ref": "#/$defs/WriteTextFileResponse", - "title": "WriteTextFileResponse" + "$ref": "#/$defs/WriteTextFileResponse" }, { - "$ref": "#/$defs/ReadTextFileResponse", - "title": "ReadTextFileResponse" + "$ref": "#/$defs/ReadTextFileResponse" }, { - "$ref": "#/$defs/RequestPermissionResponse", - "title": "RequestPermissionResponse" + "$ref": "#/$defs/RequestPermissionResponse" }, { - "$ref": "#/$defs/CreateTerminalResponse", - "title": "CreateTerminalResponse" + "$ref": "#/$defs/CreateTerminalResponse" }, { - "$ref": "#/$defs/TerminalOutputResponse", - "title": "TerminalOutputResponse" + "$ref": "#/$defs/TerminalOutputResponse" }, { - "$ref": "#/$defs/ReleaseTerminalResponse", - "title": "ReleaseTerminalResponse" + "$ref": "#/$defs/ReleaseTerminalResponse" }, { - "$ref": "#/$defs/WaitForTerminalExitResponse", - "title": "WaitForTerminalExitResponse" + "$ref": "#/$defs/WaitForTerminalExitResponse" }, { - "$ref": "#/$defs/KillTerminalCommandResponse", - "title": "KillTerminalResponse" + "$ref": "#/$defs/KillTerminalCommandResponse" }, - { - "title": "ExtMethodResponse" - } + true ], "description": "All possible responses that a client can send to an agent.\n\nThis enum is used internally for routing RPC responses. You typically won't need\nto use this directly - the responses are handled automatically by the connection.\n\nThese are responses to the corresponding `AgentRequest` variants.", "x-docs-ignore": true @@ -653,167 +529,105 @@ }, "oneOf": [ { + "allOf": [ + { + "$ref": "#/$defs/TextContent" + } + ], "description": "Text content. May be plain text or formatted with Markdown.\n\nAll agents MUST support text content blocks in prompts.\nClients SHOULD render this text as Markdown.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "annotations": { - "anyOf": [ - { - "$ref": "#/$defs/Annotations" - }, - { - "type": "null" - } - ] - }, - "text": { - "type": "string" - }, "type": { "const": "text", "type": "string" } }, - "required": ["type", "text"], + "required": ["type"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/ImageContent" + } + ], "description": "Images for visual context or analysis.\n\nRequires the `image` prompt capability when included in prompts.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "annotations": { - "anyOf": [ - { - "$ref": "#/$defs/Annotations" - }, - { - "type": "null" - } - ] - }, - "data": { - "type": "string" - }, - "mimeType": { - "type": "string" - }, "type": { "const": "image", "type": "string" - }, - "uri": { - "type": ["string", "null"] } }, - "required": ["type", "data", "mimeType"], + "required": ["type"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/AudioContent" + } + ], "description": "Audio data for transcription or analysis.\n\nRequires the `audio` prompt capability when included in prompts.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "annotations": { - "anyOf": [ - { - "$ref": "#/$defs/Annotations" - }, - { - "type": "null" - } - ] - }, - "data": { - "type": "string" - }, - "mimeType": { - "type": "string" - }, "type": { "const": "audio", "type": "string" } }, - "required": ["type", "data", "mimeType"], + "required": ["type"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/ResourceLink" + } + ], "description": "References to resources that the agent can access.\n\nAll agents MUST support resource links in prompts.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "annotations": { - "anyOf": [ - { - "$ref": "#/$defs/Annotations" - }, - { - "type": "null" - } - ] - }, - "description": { - "type": ["string", "null"] - }, - "mimeType": { - "type": ["string", "null"] - }, - "name": { - "type": "string" - }, - "size": { - "format": "int64", - "type": ["integer", "null"] - }, - "title": { - "type": ["string", "null"] - }, "type": { "const": "resource_link", "type": "string" - }, - "uri": { - "type": "string" } }, - "required": ["type", "name", "uri"], + "required": ["type"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/EmbeddedResource" + } + ], "description": "Complete resource contents embedded directly in the message.\n\nPreferred for including context as it avoids extra round-trips.\n\nRequires the `embeddedContext` prompt capability when included in prompts.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "annotations": { - "anyOf": [ - { - "$ref": "#/$defs/Annotations" - }, - { - "type": "null" - } - ] - }, - "resource": { - "$ref": "#/$defs/EmbeddedResourceResource" - }, "type": { "const": "resource", "type": "string" } }, - "required": ["type", "resource"], + "required": ["type"], "type": "object" } ] }, + "ContentChunk": { + "description": "A streamed item of content", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "content": { + "allOf": [ + { + "$ref": "#/$defs/ContentBlock" + } + ], + "description": "A single item of content" + } + }, + "required": ["content"], + "type": "object" + }, "CreateTerminalRequest": { "description": "Request to create a new terminal and execute a command.", "properties": { @@ -849,7 +663,11 @@ "type": ["integer", "null"] }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The session ID for this request." } }, @@ -874,15 +692,54 @@ "x-method": "terminal/create", "x-side": "client" }, + "CurrentModeUpdate": { + "description": "The current mode of the session has changed\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "currentModeId": { + "allOf": [ + { + "$ref": "#/$defs/SessionModeId" + } + ], + "description": "The ID of the current mode" + } + }, + "required": ["currentModeId"], + "type": "object" + }, + "EmbeddedResource": { + "description": "The contents of a resource, embedded into a prompt or tool call result.", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "annotations": { + "anyOf": [ + { + "$ref": "#/$defs/Annotations" + }, + { + "type": "null" + } + ] + }, + "resource": { + "$ref": "#/$defs/EmbeddedResourceResource" + } + }, + "required": ["resource"], + "type": "object" + }, "EmbeddedResourceResource": { "anyOf": [ { - "$ref": "#/$defs/TextResourceContents", - "title": "TextResourceContents" + "$ref": "#/$defs/TextResourceContents" }, { - "$ref": "#/$defs/BlobResourceContents", - "title": "BlobResourceContents" + "$ref": "#/$defs/BlobResourceContents" } ], "description": "Resource content that can be embedded in a message." @@ -961,6 +818,35 @@ "required": ["name", "value"], "type": "object" }, + "ImageContent": { + "description": "An image provided to or from an LLM.", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "annotations": { + "anyOf": [ + { + "$ref": "#/$defs/Annotations" + }, + { + "type": "null" + } + ] + }, + "data": { + "type": "string" + }, + "mimeType": { + "type": "string" + }, + "uri": { + "type": ["string", "null"] + } + }, + "required": ["data", "mimeType"], + "type": "object" + }, "Implementation": { "description": "Describes the name and version of an MCP implementation, with an optional\ntitle for UI representation.", "properties": { @@ -987,7 +873,11 @@ "description": "Extension point for implementations" }, "clientCapabilities": { - "$ref": "#/$defs/ClientCapabilities", + "allOf": [ + { + "$ref": "#/$defs/ClientCapabilities" + } + ], "default": { "fs": { "readTextFile": false, @@ -1009,65 +899,291 @@ "description": "Information about the Client name and version sent to the Agent.\n\nNote: in future versions of the protocol, this will be required." }, "protocolVersion": { - "$ref": "#/$defs/ProtocolVersion", + "allOf": [ + { + "$ref": "#/$defs/ProtocolVersion" + } + ], "description": "The latest protocol version supported by the client." } }, - "required": ["protocolVersion"], - "type": "object", - "x-method": "initialize", - "x-side": "agent" + "required": ["protocolVersion"], + "type": "object", + "x-method": "initialize", + "x-side": "agent" + }, + "InitializeResponse": { + "description": "Response from the initialize method.\n\nContains the negotiated protocol version and agent capabilities.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "agentCapabilities": { + "allOf": [ + { + "$ref": "#/$defs/AgentCapabilities" + } + ], + "default": { + "loadSession": false, + "mcpCapabilities": { + "http": false, + "sse": false + }, + "promptCapabilities": { + "audio": false, + "embeddedContext": false, + "image": false + } + }, + "description": "Capabilities supported by the agent." + }, + "agentInfo": { + "anyOf": [ + { + "$ref": "#/$defs/Implementation" + }, + { + "type": "null" + } + ], + "description": "Information about the Agent name and version sent to the Client.\n\nNote: in future versions of the protocol, this will be required." + }, + "authMethods": { + "default": [], + "description": "Authentication methods supported by the agent.", + "items": { + "$ref": "#/$defs/AuthMethod" + }, + "type": "array" + }, + "protocolVersion": { + "allOf": [ + { + "$ref": "#/$defs/ProtocolVersion" + } + ], + "description": "The protocol version the client specified if supported by the agent,\nor the latest protocol version supported by the agent.\n\nThe client should disconnect, if it doesn't support this version." + } + }, + "required": ["protocolVersion"], + "type": "object", + "x-method": "initialize", + "x-side": "agent" + }, + "JsonRpcMessage": { + "anyOf": [ + { + "properties": { + "id": { + "anyOf": [ + { + "type": "null" + }, + { + "format": "int64", + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." + }, + "method": { + "type": "string" + }, + "params": { + "anyOf": [ + { + "$ref": "#/$defs/AgentRequest" + }, + { + "type": "null" + } + ] + } + }, + "required": ["id", "method"], + "type": "object" + }, + { + "oneOf": [ + { + "properties": { + "result": { + "$ref": "#/$defs/AgentResponse" + } + }, + "required": ["result"], + "type": "object" + }, + { + "properties": { + "error": { + "$ref": "#/$defs/Error" + } + }, + "required": ["error"], + "type": "object" + } + ], + "properties": { + "id": { + "anyOf": [ + { + "type": "null" + }, + { + "format": "int64", + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." + } + }, + "required": ["id"], + "type": "object" + }, + { + "properties": { + "method": { + "type": "string" + }, + "params": { + "anyOf": [ + { + "$ref": "#/$defs/AgentNotification" + }, + { + "type": "null" + } + ] + } + }, + "required": ["method"], + "type": "object" + } + ], + "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", + "properties": { + "jsonrpc": { + "enum": ["2.0"], + "type": "string" + } + }, + "required": ["jsonrpc"], + "type": "object" }, - "InitializeResponse": { - "description": "Response from the initialize method.\n\nContains the negotiated protocol version and agent capabilities.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)", - "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "agentCapabilities": { - "$ref": "#/$defs/AgentCapabilities", - "default": { - "loadSession": false, - "mcpCapabilities": { - "http": false, - "sse": false + "JsonRpcMessage2": { + "anyOf": [ + { + "properties": { + "id": { + "anyOf": [ + { + "type": "null" + }, + { + "format": "int64", + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." }, - "promptCapabilities": { - "audio": false, - "embeddedContext": false, - "image": false + "method": { + "type": "string" + }, + "params": { + "anyOf": [ + { + "$ref": "#/$defs/ClientRequest" + }, + { + "type": "null" + } + ] } }, - "description": "Capabilities supported by the agent." + "required": ["id", "method"], + "type": "object" }, - "agentInfo": { - "anyOf": [ + { + "oneOf": [ { - "$ref": "#/$defs/Implementation" + "properties": { + "result": { + "$ref": "#/$defs/ClientResponse" + } + }, + "required": ["result"], + "type": "object" }, { - "type": "null" + "properties": { + "error": { + "$ref": "#/$defs/Error" + } + }, + "required": ["error"], + "type": "object" } ], - "description": "Information about the Agent name and version sent to the Client.\n\nNote: in future versions of the protocol, this will be required." - }, - "authMethods": { - "default": [], - "description": "Authentication methods supported by the agent.", - "items": { - "$ref": "#/$defs/AuthMethod" + "properties": { + "id": { + "anyOf": [ + { + "type": "null" + }, + { + "format": "int64", + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." + } }, - "type": "array" + "required": ["id"], + "type": "object" }, - "protocolVersion": { - "$ref": "#/$defs/ProtocolVersion", - "description": "The protocol version the client specified if supported by the agent,\nor the latest protocol version supported by the agent.\n\nThe client should disconnect, if it doesn't support this version." + { + "properties": { + "method": { + "type": "string" + }, + "params": { + "anyOf": [ + { + "$ref": "#/$defs/ClientNotification" + }, + { + "type": "null" + } + ] + } + }, + "required": ["method"], + "type": "object" + } + ], + "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", + "properties": { + "jsonrpc": { + "enum": ["2.0"], + "type": "string" } }, - "required": ["protocolVersion"], - "type": "object", - "x-method": "initialize", - "x-side": "agent" + "required": ["jsonrpc"], + "type": "object" }, "KillTerminalCommandRequest": { "description": "Request to kill a terminal command without releasing the terminal.", @@ -1076,7 +1192,11 @@ "description": "Extension point for implementations" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The session ID for this request." }, "terminalId": { @@ -1118,7 +1238,11 @@ "type": "array" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The ID of the session to load." } }, @@ -1260,7 +1384,6 @@ } }, "required": ["name", "command", "args", "env"], - "title": "stdio", "type": "object" } ], @@ -1284,7 +1407,11 @@ "type": ["string", "null"] }, "modelId": { - "$ref": "#/$defs/ModelId", + "allOf": [ + { + "$ref": "#/$defs/ModelId" + } + ], "description": "Unique identifier for the model." }, "name": { @@ -1347,7 +1474,11 @@ "description": "Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "Unique identifier for the created session.\n\nUsed in all subsequent requests for this conversation." } }, @@ -1363,7 +1494,11 @@ "description": "Extension point for implementations" }, "kind": { - "$ref": "#/$defs/PermissionOptionKind", + "allOf": [ + { + "$ref": "#/$defs/PermissionOptionKind" + } + ], "description": "Hint about the nature of this permission option." }, "name": { @@ -1371,7 +1506,11 @@ "type": "string" }, "optionId": { - "$ref": "#/$defs/PermissionOptionId", + "allOf": [ + { + "$ref": "#/$defs/PermissionOptionId" + } + ], "description": "Unique identifier for this permission option." } }, @@ -1407,6 +1546,23 @@ } ] }, + "Plan": { + "description": "An execution plan for accomplishing complex tasks.\n\nPlans consist of multiple entries representing individual tasks or goals.\nAgents report plans to clients to provide visibility into their execution strategy.\nPlans can evolve during execution as the agent discovers new requirements or completes tasks.\n\nSee protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan)", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "entries": { + "description": "The list of tasks to be accomplished.\n\nWhen updating a plan, the agent must send a complete list of all entries\nwith their current status. The client replaces the entire plan with each update.", + "items": { + "$ref": "#/$defs/PlanEntry" + }, + "type": "array" + } + }, + "required": ["entries"], + "type": "object" + }, "PlanEntry": { "description": "A single entry in the execution plan.\n\nRepresents a task or goal that the assistant intends to accomplish\nas part of fulfilling the user's request.\nSee protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)", "properties": { @@ -1418,11 +1574,19 @@ "type": "string" }, "priority": { - "$ref": "#/$defs/PlanEntryPriority", + "allOf": [ + { + "$ref": "#/$defs/PlanEntryPriority" + } + ], "description": "The relative importance of this task.\nUsed to indicate which tasks are most critical to the overall goal." }, "status": { - "$ref": "#/$defs/PlanEntryStatus", + "allOf": [ + { + "$ref": "#/$defs/PlanEntryStatus" + } + ], "description": "Current execution status of this task." } }, @@ -1507,7 +1671,11 @@ "type": "array" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The ID of the session to send this user message to" } }, @@ -1523,7 +1691,11 @@ "description": "Extension point for implementations" }, "stopReason": { - "$ref": "#/$defs/StopReason", + "allOf": [ + { + "$ref": "#/$defs/StopReason" + } + ], "description": "Indicates why the agent stopped processing the turn." } }, @@ -1562,7 +1734,11 @@ "type": "string" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The session ID for this request." } }, @@ -1593,7 +1769,11 @@ "description": "Extension point for implementations" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The session ID for this request." }, "terminalId": { @@ -1638,7 +1818,11 @@ "description": "The user selected one of the provided options.", "properties": { "optionId": { - "$ref": "#/$defs/PermissionOptionId", + "allOf": [ + { + "$ref": "#/$defs/PermissionOptionId" + } + ], "description": "The ID of the option the user selected." }, "outcome": { @@ -1665,68 +1849,20 @@ "type": "array" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The session ID for this request." }, "toolCall": { - "description": "Details about the tool call requiring permission.", - "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "content": { - "description": "Replace the content collection.", - "items": { - "$ref": "#/$defs/ToolCallContent" - }, - "type": ["array", "null"] - }, - "kind": { - "anyOf": [ - { - "$ref": "#/$defs/ToolKind" - }, - { - "type": "null" - } - ], - "description": "Update the tool kind." - }, - "locations": { - "description": "Replace the locations collection.", - "items": { - "$ref": "#/$defs/ToolCallLocation" - }, - "type": ["array", "null"] - }, - "rawInput": { - "description": "Update the raw input." - }, - "rawOutput": { - "description": "Update the raw output." - }, - "status": { - "anyOf": [ - { - "$ref": "#/$defs/ToolCallStatus" - }, - { - "type": "null" - } - ], - "description": "Update the execution status." - }, - "title": { - "description": "Update the human-readable title.", - "type": ["string", "null"] - }, - "toolCallId": { - "$ref": "#/$defs/ToolCallId", - "description": "The ID of the tool call being updated." + "allOf": [ + { + "$ref": "#/$defs/ToolCallUpdate" } - }, - "required": ["toolCallId"], - "type": "object" + ], + "description": "Details about the tool call requiring permission." } }, "required": ["sessionId", "toolCall", "options"], @@ -1740,15 +1876,58 @@ "_meta": { "description": "Extension point for implementations" }, - "outcome": { - "$ref": "#/$defs/RequestPermissionOutcome", - "description": "The user's decision on the permission request." + "outcome": { + "allOf": [ + { + "$ref": "#/$defs/RequestPermissionOutcome" + } + ], + "description": "The user's decision on the permission request." + } + }, + "required": ["outcome"], + "type": "object", + "x-method": "session/request_permission", + "x-side": "client" + }, + "ResourceLink": { + "description": "A resource that the server is capable of reading, included in a prompt or tool call result.", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "annotations": { + "anyOf": [ + { + "$ref": "#/$defs/Annotations" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": ["string", "null"] + }, + "mimeType": { + "type": ["string", "null"] + }, + "name": { + "type": "string" + }, + "size": { + "format": "int64", + "type": ["integer", "null"] + }, + "title": { + "type": ["string", "null"] + }, + "uri": { + "type": "string" } }, - "required": ["outcome"], - "type": "object", - "x-method": "session/request_permission", - "x-side": "client" + "required": ["name", "uri"], + "type": "object" }, "Role": { "description": "The sender or recipient of messages and data in a conversation.", @@ -1796,7 +1975,11 @@ "type": "array" }, "currentModeId": { - "$ref": "#/$defs/SessionModeId", + "allOf": [ + { + "$ref": "#/$defs/SessionModeId" + } + ], "description": "The current mode the Agent is in." } }, @@ -1817,7 +2000,11 @@ "type": "array" }, "currentModelId": { - "$ref": "#/$defs/ModelId", + "allOf": [ + { + "$ref": "#/$defs/ModelId" + } + ], "description": "The current model the Agent is in." } }, @@ -1831,11 +2018,19 @@ "description": "Extension point for implementations" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The ID of the session this update pertains to." }, "update": { - "$ref": "#/$defs/SessionUpdate", + "allOf": [ + { + "$ref": "#/$defs/SessionUpdate" + } + ], "description": "The actual update content." } }, @@ -1851,231 +2046,131 @@ }, "oneOf": [ { + "allOf": [ + { + "$ref": "#/$defs/ContentChunk" + } + ], "description": "A chunk of the user's message being streamed.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "content": { - "$ref": "#/$defs/ContentBlock", - "description": "A single item of content" - }, "sessionUpdate": { "const": "user_message_chunk", "type": "string" } }, - "required": ["sessionUpdate", "content"], + "required": ["sessionUpdate"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/ContentChunk" + } + ], "description": "A chunk of the agent's response being streamed.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "content": { - "$ref": "#/$defs/ContentBlock", - "description": "A single item of content" - }, "sessionUpdate": { "const": "agent_message_chunk", "type": "string" } }, - "required": ["sessionUpdate", "content"], + "required": ["sessionUpdate"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/ContentChunk" + } + ], "description": "A chunk of the agent's internal reasoning being streamed.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "content": { - "$ref": "#/$defs/ContentBlock", - "description": "A single item of content" - }, "sessionUpdate": { "const": "agent_thought_chunk", "type": "string" } }, - "required": ["sessionUpdate", "content"], + "required": ["sessionUpdate"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/ToolCall" + } + ], "description": "Notification that a new tool call has been initiated.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "content": { - "description": "Content produced by the tool call.", - "items": { - "$ref": "#/$defs/ToolCallContent" - }, - "type": "array" - }, - "kind": { - "$ref": "#/$defs/ToolKind", - "description": "The category of tool being invoked.\nHelps clients choose appropriate icons and UI treatment." - }, - "locations": { - "description": "File locations affected by this tool call.\nEnables \"follow-along\" features in clients.", - "items": { - "$ref": "#/$defs/ToolCallLocation" - }, - "type": "array" - }, - "rawInput": { - "description": "Raw input parameters sent to the tool." - }, - "rawOutput": { - "description": "Raw output returned by the tool." - }, "sessionUpdate": { "const": "tool_call", "type": "string" - }, - "status": { - "$ref": "#/$defs/ToolCallStatus", - "description": "Current execution status of the tool call." - }, - "title": { - "description": "Human-readable title describing what the tool is doing.", - "type": "string" - }, - "toolCallId": { - "$ref": "#/$defs/ToolCallId", - "description": "Unique identifier for this tool call within the session." } }, - "required": ["sessionUpdate", "toolCallId", "title"], + "required": ["sessionUpdate"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/ToolCallUpdate" + } + ], "description": "Update on the status or results of a tool call.", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "content": { - "description": "Replace the content collection.", - "items": { - "$ref": "#/$defs/ToolCallContent" - }, - "type": ["array", "null"] - }, - "kind": { - "anyOf": [ - { - "$ref": "#/$defs/ToolKind" - }, - { - "type": "null" - } - ], - "description": "Update the tool kind." - }, - "locations": { - "description": "Replace the locations collection.", - "items": { - "$ref": "#/$defs/ToolCallLocation" - }, - "type": ["array", "null"] - }, - "rawInput": { - "description": "Update the raw input." - }, - "rawOutput": { - "description": "Update the raw output." - }, "sessionUpdate": { "const": "tool_call_update", "type": "string" - }, - "status": { - "anyOf": [ - { - "$ref": "#/$defs/ToolCallStatus" - }, - { - "type": "null" - } - ], - "description": "Update the execution status." - }, - "title": { - "description": "Update the human-readable title.", - "type": ["string", "null"] - }, - "toolCallId": { - "$ref": "#/$defs/ToolCallId", - "description": "The ID of the tool call being updated." } }, - "required": ["sessionUpdate", "toolCallId"], + "required": ["sessionUpdate"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/Plan" + } + ], "description": "The agent's execution plan for complex tasks.\nSee protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan)", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "entries": { - "description": "The list of tasks to be accomplished.\n\nWhen updating a plan, the agent must send a complete list of all entries\nwith their current status. The client replaces the entire plan with each update.", - "items": { - "$ref": "#/$defs/PlanEntry" - }, - "type": "array" - }, "sessionUpdate": { "const": "plan", "type": "string" } }, - "required": ["sessionUpdate", "entries"], + "required": ["sessionUpdate"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/AvailableCommandsUpdate" + } + ], "description": "Available commands are ready or have changed", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "availableCommands": { - "description": "Commands the agent can execute", - "items": { - "$ref": "#/$defs/AvailableCommand" - }, - "type": "array" - }, "sessionUpdate": { "const": "available_commands_update", "type": "string" } }, - "required": ["sessionUpdate", "availableCommands"], + "required": ["sessionUpdate"], "type": "object" }, { + "allOf": [ + { + "$ref": "#/$defs/CurrentModeUpdate" + } + ], "description": "The current mode of the session has changed\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", "properties": { - "_meta": { - "description": "Extension point for implementations" - }, - "currentModeId": { - "$ref": "#/$defs/SessionModeId", - "description": "The ID of the current mode" - }, "sessionUpdate": { "const": "current_mode_update", "type": "string" } }, - "required": ["sessionUpdate", "currentModeId"], + "required": ["sessionUpdate"], "type": "object" } ] @@ -2087,11 +2182,19 @@ "description": "Extension point for implementations" }, "modeId": { - "$ref": "#/$defs/SessionModeId", + "allOf": [ + { + "$ref": "#/$defs/SessionModeId" + } + ], "description": "The ID of the mode to set." }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The ID of the session to set the mode for." } }, @@ -2116,11 +2219,19 @@ "description": "Extension point for implementations" }, "modelId": { - "$ref": "#/$defs/ModelId", + "allOf": [ + { + "$ref": "#/$defs/ModelId" + } + ], "description": "The ID of the model to set." }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The ID of the session to set the model for." } }, @@ -2196,7 +2307,11 @@ "description": "Extension point for implementations" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The session ID for this request." }, "terminalId": { @@ -2240,6 +2355,29 @@ "x-method": "terminal/output", "x-side": "client" }, + "TextContent": { + "description": "Text provided to or from an LLM.", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "annotations": { + "anyOf": [ + { + "$ref": "#/$defs/Annotations" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + } + }, + "required": ["text"], + "type": "object" + }, "TextResourceContents": { "description": "Text-based resource contents.", "properties": { @@ -2259,6 +2397,64 @@ "required": ["text", "uri"], "type": "object" }, + "ToolCall": { + "description": "Represents a tool call that the language model has requested.\n\nTool calls are actions that the agent executes on behalf of the language model,\nsuch as reading files, executing code, or fetching data from external sources.\n\nSee protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-calls)", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "content": { + "description": "Content produced by the tool call.", + "items": { + "$ref": "#/$defs/ToolCallContent" + }, + "type": "array" + }, + "kind": { + "allOf": [ + { + "$ref": "#/$defs/ToolKind" + } + ], + "description": "The category of tool being invoked.\nHelps clients choose appropriate icons and UI treatment." + }, + "locations": { + "description": "File locations affected by this tool call.\nEnables \"follow-along\" features in clients.", + "items": { + "$ref": "#/$defs/ToolCallLocation" + }, + "type": "array" + }, + "rawInput": { + "description": "Raw input parameters sent to the tool." + }, + "rawOutput": { + "description": "Raw output returned by the tool." + }, + "status": { + "allOf": [ + { + "$ref": "#/$defs/ToolCallStatus" + } + ], + "description": "Current execution status of the tool call." + }, + "title": { + "description": "Human-readable title describing what the tool is doing.", + "type": "string" + }, + "toolCallId": { + "allOf": [ + { + "$ref": "#/$defs/ToolCallId" + } + ], + "description": "Unique identifier for this tool call within the session." + } + }, + "required": ["toolCallId", "title"], + "type": "object" + }, "ToolCallContent": { "description": "Content produced by a tool call.\n\nTool calls can produce different types of content including\nstandard content blocks (text, images) or file diffs.\n\nSee protocol docs: [Content](https://agentclientprotocol.com/protocol/tool-calls#content)", "discriminator": { @@ -2269,7 +2465,11 @@ "description": "Standard content block (text, images, resources).", "properties": { "content": { - "$ref": "#/$defs/ContentBlock", + "allOf": [ + { + "$ref": "#/$defs/ContentBlock" + } + ], "description": "The actual content block." }, "type": { @@ -2371,6 +2571,70 @@ } ] }, + "ToolCallUpdate": { + "description": "An update to an existing tool call.\n\nUsed to report progress and results as tools execute. All fields except\nthe tool call ID are optional - only changed fields need to be included.\n\nSee protocol docs: [Updating](https://agentclientprotocol.com/protocol/tool-calls#updating)", + "properties": { + "_meta": { + "description": "Extension point for implementations" + }, + "content": { + "description": "Replace the content collection.", + "items": { + "$ref": "#/$defs/ToolCallContent" + }, + "type": ["array", "null"] + }, + "kind": { + "anyOf": [ + { + "$ref": "#/$defs/ToolKind" + }, + { + "type": "null" + } + ], + "description": "Update the tool kind." + }, + "locations": { + "description": "Replace the locations collection.", + "items": { + "$ref": "#/$defs/ToolCallLocation" + }, + "type": ["array", "null"] + }, + "rawInput": { + "description": "Update the raw input." + }, + "rawOutput": { + "description": "Update the raw output." + }, + "status": { + "anyOf": [ + { + "$ref": "#/$defs/ToolCallStatus" + }, + { + "type": "null" + } + ], + "description": "Update the execution status." + }, + "title": { + "description": "Update the human-readable title.", + "type": ["string", "null"] + }, + "toolCallId": { + "allOf": [ + { + "$ref": "#/$defs/ToolCallId" + } + ], + "description": "The ID of the tool call being updated." + } + }, + "required": ["toolCallId"], + "type": "object" + }, "ToolKind": { "description": "Categories of tools that can be invoked.\n\nTool kinds help clients choose appropriate icons and optimize how they\ndisplay tool execution progress.\n\nSee protocol docs: [Creating](https://agentclientprotocol.com/protocol/tool-calls#creating)", "oneOf": [ @@ -2433,7 +2697,11 @@ "description": "Extension point for implementations" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The session ID for this request." }, "terminalId": { @@ -2482,7 +2750,11 @@ "type": "string" }, "sessionId": { - "$ref": "#/$defs/SessionId", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], "description": "The session ID for this request." } }, @@ -2506,12 +2778,11 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { - "$ref": "#/$defs/AgentOutgoingMessage", - "title": "AgentOutgoingMessage" + "$ref": "#/$defs/AgentOutgoingMessage" }, { - "$ref": "#/$defs/ClientOutgoingMessage", - "title": "ClientOutgoingMessage" + "$ref": "#/$defs/ClientOutgoingMessage" } - ] + ], + "title": "AcpTypes" } From a2065a441d6c9b9bd4da488620276ae83569b73c Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Thu, 20 Nov 2025 14:33:46 +0100 Subject: [PATCH 2/8] Inline json rpc stuff again --- docs/protocol/schema.mdx | 152 ----------- rust/rpc.rs | 2 + schema/schema.json | 425 ++++++++++++++---------------- unstable/docs/protocol/schema.mdx | 152 ----------- unstable/schema/schema.json | 425 ++++++++++++++---------------- 5 files changed, 412 insertions(+), 744 deletions(-) diff --git a/docs/protocol/schema.mdx b/docs/protocol/schema.mdx index 677f6292..a42cc5b4 100644 --- a/docs/protocol/schema.mdx +++ b/docs/protocol/schema.mdx @@ -1448,158 +1448,6 @@ If not provided, the name should be used for display. for debugging or metrics purposes. -## JsonRpcMessage - -A message (request, response, or notification) with `"jsonrpc": "2.0"` specified as -[required by JSON-RPC 2.0 Specification][1]. - -[1]: https://www.jsonrpc.org/specification#compatibility - -**Type:** Union - - -{""} - - - - - JSON RPC Request Id - -An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2] - -The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects. - -[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling. - -[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. - - - - -AgentRequest | null} > - - - - - - -{""} - - - - - JSON RPC Request Id - -An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2] - -The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects. - -[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling. - -[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. - - - - - - - -{""} - - - - - - - AgentNotification - - | null - - } -> - - - - -## JsonRpcMessage2 - -A message (request, response, or notification) with `"jsonrpc": "2.0"` specified as -[required by JSON-RPC 2.0 Specification][1]. - -[1]: https://www.jsonrpc.org/specification#compatibility - -**Type:** Union - - -{""} - - - - - JSON RPC Request Id - -An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2] - -The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects. - -[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling. - -[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. - - - - -ClientRequest | null} > - - - - - - -{""} - - - - - JSON RPC Request Id - -An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2] - -The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects. - -[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling. - -[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. - - - - - - - -{""} - - - - - - - ClientNotification - - | null - - } -> - - - - ## McpCapabilities MCP capabilities supported by the agent diff --git a/rust/rpc.rs b/rust/rpc.rs index f1688032..8d865898 100644 --- a/rust/rpc.rs +++ b/rust/rpc.rs @@ -34,6 +34,7 @@ pub enum RequestId { #[derive(Serialize, Deserialize, Clone, JsonSchema)] #[serde(untagged)] +#[schemars(inline)] pub enum OutgoingMessage { Request { id: RequestId, @@ -65,6 +66,7 @@ enum JsonRpcVersion { /// /// [1]: https://www.jsonrpc.org/specification#compatibility #[derive(Debug, Serialize, Deserialize, JsonSchema)] +#[schemars(inline)] pub struct JsonRpcMessage { jsonrpc: JsonRpcVersion, #[serde(flatten)] diff --git a/schema/schema.json b/schema/schema.json index e11cd7c0..960e4716 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -57,11 +57,111 @@ "x-docs-ignore": true }, "AgentOutgoingMessage": { - "allOf": [ + "anyOf": [ + { + "properties": { + "id": { + "anyOf": [ + { + "type": "null" + }, + { + "format": "int64", + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." + }, + "method": { + "type": "string" + }, + "params": { + "anyOf": [ + { + "$ref": "#/$defs/AgentRequest" + }, + { + "type": "null" + } + ] + } + }, + "required": ["id", "method"], + "type": "object" + }, + { + "oneOf": [ + { + "properties": { + "result": { + "$ref": "#/$defs/AgentResponse" + } + }, + "required": ["result"], + "type": "object" + }, + { + "properties": { + "error": { + "$ref": "#/$defs/Error" + } + }, + "required": ["error"], + "type": "object" + } + ], + "properties": { + "id": { + "anyOf": [ + { + "type": "null" + }, + { + "format": "int64", + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." + } + }, + "required": ["id"], + "type": "object" + }, { - "$ref": "#/$defs/JsonRpcMessage" + "properties": { + "method": { + "type": "string" + }, + "params": { + "anyOf": [ + { + "$ref": "#/$defs/AgentNotification" + }, + { + "type": "null" + } + ] + } + }, + "required": ["method"], + "type": "object" } ], + "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", + "properties": { + "jsonrpc": { + "enum": ["2.0"], + "type": "string" + } + }, + "required": ["jsonrpc"], + "type": "object", "x-docs-ignore": true }, "AgentRequest": { @@ -416,11 +516,111 @@ "x-docs-ignore": true }, "ClientOutgoingMessage": { - "allOf": [ + "anyOf": [ + { + "properties": { + "id": { + "anyOf": [ + { + "type": "null" + }, + { + "format": "int64", + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." + }, + "method": { + "type": "string" + }, + "params": { + "anyOf": [ + { + "$ref": "#/$defs/ClientRequest" + }, + { + "type": "null" + } + ] + } + }, + "required": ["id", "method"], + "type": "object" + }, + { + "oneOf": [ + { + "properties": { + "result": { + "$ref": "#/$defs/ClientResponse" + } + }, + "required": ["result"], + "type": "object" + }, + { + "properties": { + "error": { + "$ref": "#/$defs/Error" + } + }, + "required": ["error"], + "type": "object" + } + ], + "properties": { + "id": { + "anyOf": [ + { + "type": "null" + }, + { + "format": "int64", + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." + } + }, + "required": ["id"], + "type": "object" + }, { - "$ref": "#/$defs/JsonRpcMessage2" + "properties": { + "method": { + "type": "string" + }, + "params": { + "anyOf": [ + { + "$ref": "#/$defs/ClientNotification" + }, + { + "type": "null" + } + ] + } + }, + "required": ["method"], + "type": "object" } ], + "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", + "properties": { + "jsonrpc": { + "enum": ["2.0"], + "type": "string" + } + }, + "required": ["jsonrpc"], + "type": "object", "x-docs-ignore": true }, "ClientRequest": { @@ -960,220 +1160,6 @@ "x-method": "initialize", "x-side": "agent" }, - "JsonRpcMessage": { - "anyOf": [ - { - "properties": { - "id": { - "anyOf": [ - { - "type": "null" - }, - { - "format": "int64", - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." - }, - "method": { - "type": "string" - }, - "params": { - "anyOf": [ - { - "$ref": "#/$defs/AgentRequest" - }, - { - "type": "null" - } - ] - } - }, - "required": ["id", "method"], - "type": "object" - }, - { - "oneOf": [ - { - "properties": { - "result": { - "$ref": "#/$defs/AgentResponse" - } - }, - "required": ["result"], - "type": "object" - }, - { - "properties": { - "error": { - "$ref": "#/$defs/Error" - } - }, - "required": ["error"], - "type": "object" - } - ], - "properties": { - "id": { - "anyOf": [ - { - "type": "null" - }, - { - "format": "int64", - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." - } - }, - "required": ["id"], - "type": "object" - }, - { - "properties": { - "method": { - "type": "string" - }, - "params": { - "anyOf": [ - { - "$ref": "#/$defs/AgentNotification" - }, - { - "type": "null" - } - ] - } - }, - "required": ["method"], - "type": "object" - } - ], - "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", - "properties": { - "jsonrpc": { - "enum": ["2.0"], - "type": "string" - } - }, - "required": ["jsonrpc"], - "type": "object" - }, - "JsonRpcMessage2": { - "anyOf": [ - { - "properties": { - "id": { - "anyOf": [ - { - "type": "null" - }, - { - "format": "int64", - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." - }, - "method": { - "type": "string" - }, - "params": { - "anyOf": [ - { - "$ref": "#/$defs/ClientRequest" - }, - { - "type": "null" - } - ] - } - }, - "required": ["id", "method"], - "type": "object" - }, - { - "oneOf": [ - { - "properties": { - "result": { - "$ref": "#/$defs/ClientResponse" - } - }, - "required": ["result"], - "type": "object" - }, - { - "properties": { - "error": { - "$ref": "#/$defs/Error" - } - }, - "required": ["error"], - "type": "object" - } - ], - "properties": { - "id": { - "anyOf": [ - { - "type": "null" - }, - { - "format": "int64", - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." - } - }, - "required": ["id"], - "type": "object" - }, - { - "properties": { - "method": { - "type": "string" - }, - "params": { - "anyOf": [ - { - "$ref": "#/$defs/ClientNotification" - }, - { - "type": "null" - } - ] - } - }, - "required": ["method"], - "type": "object" - } - ], - "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", - "properties": { - "jsonrpc": { - "enum": ["2.0"], - "type": "string" - } - }, - "required": ["jsonrpc"], - "type": "object" - }, "KillTerminalCommandRequest": { "description": "Request to kill a terminal command without releasing the terminal.", "properties": { @@ -2656,6 +2642,5 @@ { "$ref": "#/$defs/ClientOutgoingMessage" } - ], - "title": "AcpTypes" + ] } diff --git a/unstable/docs/protocol/schema.mdx b/unstable/docs/protocol/schema.mdx index a6124c80..bf987bd6 100644 --- a/unstable/docs/protocol/schema.mdx +++ b/unstable/docs/protocol/schema.mdx @@ -1511,158 +1511,6 @@ If not provided, the name should be used for display. for debugging or metrics purposes. -## JsonRpcMessage - -A message (request, response, or notification) with `"jsonrpc": "2.0"` specified as -[required by JSON-RPC 2.0 Specification][1]. - -[1]: https://www.jsonrpc.org/specification#compatibility - -**Type:** Union - - -{""} - - - - - JSON RPC Request Id - -An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2] - -The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects. - -[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling. - -[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. - - - - -AgentRequest | null} > - - - - - - -{""} - - - - - JSON RPC Request Id - -An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2] - -The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects. - -[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling. - -[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. - - - - - - - -{""} - - - - - - - AgentNotification - - | null - - } -> - - - - -## JsonRpcMessage2 - -A message (request, response, or notification) with `"jsonrpc": "2.0"` specified as -[required by JSON-RPC 2.0 Specification][1]. - -[1]: https://www.jsonrpc.org/specification#compatibility - -**Type:** Union - - -{""} - - - - - JSON RPC Request Id - -An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2] - -The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects. - -[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling. - -[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. - - - - -ClientRequest | null} > - - - - - - -{""} - - - - - JSON RPC Request Id - -An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2] - -The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects. - -[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling. - -[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. - - - - - - - -{""} - - - - - - - ClientNotification - - | null - - } -> - - - - ## McpCapabilities MCP capabilities supported by the agent diff --git a/unstable/schema/schema.json b/unstable/schema/schema.json index b1a11d6e..87579d38 100644 --- a/unstable/schema/schema.json +++ b/unstable/schema/schema.json @@ -57,11 +57,111 @@ "x-docs-ignore": true }, "AgentOutgoingMessage": { - "allOf": [ + "anyOf": [ + { + "properties": { + "id": { + "anyOf": [ + { + "type": "null" + }, + { + "format": "int64", + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." + }, + "method": { + "type": "string" + }, + "params": { + "anyOf": [ + { + "$ref": "#/$defs/AgentRequest" + }, + { + "type": "null" + } + ] + } + }, + "required": ["id", "method"], + "type": "object" + }, + { + "oneOf": [ + { + "properties": { + "result": { + "$ref": "#/$defs/AgentResponse" + } + }, + "required": ["result"], + "type": "object" + }, + { + "properties": { + "error": { + "$ref": "#/$defs/Error" + } + }, + "required": ["error"], + "type": "object" + } + ], + "properties": { + "id": { + "anyOf": [ + { + "type": "null" + }, + { + "format": "int64", + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." + } + }, + "required": ["id"], + "type": "object" + }, { - "$ref": "#/$defs/JsonRpcMessage" + "properties": { + "method": { + "type": "string" + }, + "params": { + "anyOf": [ + { + "$ref": "#/$defs/AgentNotification" + }, + { + "type": "null" + } + ] + } + }, + "required": ["method"], + "type": "object" } ], + "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", + "properties": { + "jsonrpc": { + "enum": ["2.0"], + "type": "string" + } + }, + "required": ["jsonrpc"], + "type": "object", "x-docs-ignore": true }, "AgentRequest": { @@ -419,11 +519,111 @@ "x-docs-ignore": true }, "ClientOutgoingMessage": { - "allOf": [ + "anyOf": [ + { + "properties": { + "id": { + "anyOf": [ + { + "type": "null" + }, + { + "format": "int64", + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." + }, + "method": { + "type": "string" + }, + "params": { + "anyOf": [ + { + "$ref": "#/$defs/ClientRequest" + }, + { + "type": "null" + } + ] + } + }, + "required": ["id", "method"], + "type": "object" + }, + { + "oneOf": [ + { + "properties": { + "result": { + "$ref": "#/$defs/ClientResponse" + } + }, + "required": ["result"], + "type": "object" + }, + { + "properties": { + "error": { + "$ref": "#/$defs/Error" + } + }, + "required": ["error"], + "type": "object" + } + ], + "properties": { + "id": { + "anyOf": [ + { + "type": "null" + }, + { + "format": "int64", + "type": "integer" + }, + { + "type": "string" + } + ], + "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." + } + }, + "required": ["id"], + "type": "object" + }, { - "$ref": "#/$defs/JsonRpcMessage2" + "properties": { + "method": { + "type": "string" + }, + "params": { + "anyOf": [ + { + "$ref": "#/$defs/ClientNotification" + }, + { + "type": "null" + } + ] + } + }, + "required": ["method"], + "type": "object" } ], + "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", + "properties": { + "jsonrpc": { + "enum": ["2.0"], + "type": "string" + } + }, + "required": ["jsonrpc"], + "type": "object", "x-docs-ignore": true }, "ClientRequest": { @@ -971,220 +1171,6 @@ "x-method": "initialize", "x-side": "agent" }, - "JsonRpcMessage": { - "anyOf": [ - { - "properties": { - "id": { - "anyOf": [ - { - "type": "null" - }, - { - "format": "int64", - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." - }, - "method": { - "type": "string" - }, - "params": { - "anyOf": [ - { - "$ref": "#/$defs/AgentRequest" - }, - { - "type": "null" - } - ] - } - }, - "required": ["id", "method"], - "type": "object" - }, - { - "oneOf": [ - { - "properties": { - "result": { - "$ref": "#/$defs/AgentResponse" - } - }, - "required": ["result"], - "type": "object" - }, - { - "properties": { - "error": { - "$ref": "#/$defs/Error" - } - }, - "required": ["error"], - "type": "object" - } - ], - "properties": { - "id": { - "anyOf": [ - { - "type": "null" - }, - { - "format": "int64", - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." - } - }, - "required": ["id"], - "type": "object" - }, - { - "properties": { - "method": { - "type": "string" - }, - "params": { - "anyOf": [ - { - "$ref": "#/$defs/AgentNotification" - }, - { - "type": "null" - } - ] - } - }, - "required": ["method"], - "type": "object" - } - ], - "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", - "properties": { - "jsonrpc": { - "enum": ["2.0"], - "type": "string" - } - }, - "required": ["jsonrpc"], - "type": "object" - }, - "JsonRpcMessage2": { - "anyOf": [ - { - "properties": { - "id": { - "anyOf": [ - { - "type": "null" - }, - { - "format": "int64", - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." - }, - "method": { - "type": "string" - }, - "params": { - "anyOf": [ - { - "$ref": "#/$defs/ClientRequest" - }, - { - "type": "null" - } - ] - } - }, - "required": ["id", "method"], - "type": "object" - }, - { - "oneOf": [ - { - "properties": { - "result": { - "$ref": "#/$defs/ClientResponse" - } - }, - "required": ["result"], - "type": "object" - }, - { - "properties": { - "error": { - "$ref": "#/$defs/Error" - } - }, - "required": ["error"], - "type": "object" - } - ], - "properties": { - "id": { - "anyOf": [ - { - "type": "null" - }, - { - "format": "int64", - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." - } - }, - "required": ["id"], - "type": "object" - }, - { - "properties": { - "method": { - "type": "string" - }, - "params": { - "anyOf": [ - { - "$ref": "#/$defs/ClientNotification" - }, - { - "type": "null" - } - ] - } - }, - "required": ["method"], - "type": "object" - } - ], - "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", - "properties": { - "jsonrpc": { - "enum": ["2.0"], - "type": "string" - } - }, - "required": ["jsonrpc"], - "type": "object" - }, "KillTerminalCommandRequest": { "description": "Request to kill a terminal command without releasing the terminal.", "properties": { @@ -2783,6 +2769,5 @@ { "$ref": "#/$defs/ClientOutgoingMessage" } - ], - "title": "AcpTypes" + ] } From 51b6982f60c8038e546c5921b6a95b6d88abb386 Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Thu, 20 Nov 2025 14:43:12 +0100 Subject: [PATCH 3/8] Clean up defaults --- docs/protocol/schema.mdx | 48 +++++++++++-------------------- rust/agent.rs | 4 +-- rust/client.rs | 8 +++--- rust/content.rs | 24 ++++++++-------- rust/tool_call.rs | 34 +++++++--------------- schema/schema.json | 2 ++ unstable/docs/protocol/schema.mdx | 48 +++++++++++-------------------- unstable/schema/schema.json | 2 ++ 8 files changed, 67 insertions(+), 103 deletions(-) diff --git a/docs/protocol/schema.mdx b/docs/protocol/schema.mdx index a42cc5b4..bf970dc1 100644 --- a/docs/protocol/schema.mdx +++ b/docs/protocol/schema.mdx @@ -2143,48 +2143,34 @@ See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-ca **Properties:** - + Extension point for implementations - - - ToolCallContent - - [] - - } -> +ToolCallContent[]} > Content produced by the tool call. - - The category of tool being invoked. Helps clients choose appropriate icons and - UI treatment. + + The category of tool being invoked. +Helps clients choose appropriate icons and UI treatment. + + - Default: `"other"` + - - - ToolCallLocation - - [] - - } -> - File locations affected by this tool call. Enables "follow-along" features in - clients. +ToolCallLocation[]} > + File locations affected by this tool call. +Enables "follow-along" features in clients. - + Raw input parameters sent to the tool. - + Raw output returned by the tool. - + Current execution status of the tool call. + + - Default: `"pending"` + Human-readable title describing what the tool is doing. diff --git a/rust/agent.rs b/rust/agent.rs index 7d9bf1a2..2ecf4939 100644 --- a/rust/agent.rs +++ b/rust/agent.rs @@ -167,7 +167,7 @@ pub struct NewSessionResponse { /// Initial mode state if supported by the Agent /// /// See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes) - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub modes: Option, /// **UNSTABLE** /// @@ -175,7 +175,7 @@ pub struct NewSessionResponse { /// /// Initial model state if supported by the Agent #[cfg(feature = "unstable_session_model")] - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub models: Option, /// Extension point for implementations #[serde(skip_serializing_if = "Option::is_none", rename = "_meta")] diff --git a/rust/client.rs b/rust/client.rs index 4dd5c191..bf91673b 100644 --- a/rust/client.rs +++ b/rust/client.rs @@ -265,10 +265,10 @@ pub struct ReadTextFileRequest { /// Absolute path to the file to read. pub path: PathBuf, /// Line number to start reading from (1-based). - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub line: Option, /// Maximum number of lines to read. - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, /// Extension point for implementations #[serde(skip_serializing_if = "Option::is_none", rename = "_meta")] @@ -309,7 +309,7 @@ pub struct CreateTerminalRequest { #[serde(default, skip_serializing_if = "Vec::is_empty")] pub env: Vec, /// Working directory for the command (absolute path). - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub cwd: Option, /// Maximum number of output bytes to retain. /// @@ -319,7 +319,7 @@ pub struct CreateTerminalRequest { /// 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. - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub output_byte_limit: Option, /// Extension point for implementations #[serde(skip_serializing_if = "Option::is_none", rename = "_meta")] diff --git a/rust/content.rs b/rust/content.rs index 7f067729..4cf2ebfd 100644 --- a/rust/content.rs +++ b/rust/content.rs @@ -58,7 +58,7 @@ pub enum ContentBlock { /// Text provided to or from an LLM. #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] pub struct TextContent { - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub annotations: Option, pub text: String, /// Extension point for implementations @@ -79,12 +79,12 @@ impl> From for ContentBlock { /// An image provided to or from an LLM. #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] pub struct ImageContent { - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub annotations: Option, pub data: String, #[serde(rename = "mimeType")] pub mime_type: String, - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub uri: Option, /// Extension point for implementations #[serde(skip_serializing_if = "Option::is_none", rename = "_meta")] @@ -94,7 +94,7 @@ pub struct ImageContent { /// Audio provided to or from an LLM. #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] pub struct AudioContent { - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub annotations: Option, pub data: String, #[serde(rename = "mimeType")] @@ -107,7 +107,7 @@ pub struct AudioContent { /// The contents of a resource, embedded into a prompt or tool call result. #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] pub struct EmbeddedResource { - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub annotations: Option, pub resource: EmbeddedResourceResource, /// Extension point for implementations @@ -126,7 +126,7 @@ pub enum EmbeddedResourceResource { /// Text-based resource contents. #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] pub struct TextResourceContents { - #[serde(rename = "mimeType", default, skip_serializing_if = "Option::is_none")] + #[serde(rename = "mimeType", skip_serializing_if = "Option::is_none")] pub mime_type: Option, pub text: String, pub uri: String, @@ -139,7 +139,7 @@ pub struct TextResourceContents { #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] pub struct BlobResourceContents { pub blob: String, - #[serde(rename = "mimeType", default, skip_serializing_if = "Option::is_none")] + #[serde(rename = "mimeType", skip_serializing_if = "Option::is_none")] pub mime_type: Option, pub uri: String, /// Extension point for implementations @@ -150,16 +150,16 @@ pub struct BlobResourceContents { /// A resource that the server is capable of reading, included in a prompt or tool call result. #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] pub struct ResourceLink { - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub annotations: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, - #[serde(rename = "mimeType", default, skip_serializing_if = "Option::is_none")] + #[serde(rename = "mimeType", skip_serializing_if = "Option::is_none")] pub mime_type: Option, pub name: String, - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub size: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub title: Option, pub uri: String, /// Extension point for implementations diff --git a/rust/tool_call.rs b/rust/tool_call.rs index 9fa85f7a..bd550f9d 100644 --- a/rust/tool_call.rs +++ b/rust/tool_call.rs @@ -28,10 +28,10 @@ pub struct ToolCall { pub title: String, /// The category of tool being invoked. /// Helps clients choose appropriate icons and UI treatment. - #[serde(default, skip_serializing_if = "ToolKind::is_default")] + #[serde(default)] pub kind: ToolKind, /// Current execution status of the tool call. - #[serde(default, skip_serializing_if = "ToolCallStatus::is_default")] + #[serde(default)] pub status: ToolCallStatus, /// Content produced by the tool call. #[serde(default, skip_serializing_if = "Vec::is_empty")] @@ -41,10 +41,10 @@ pub struct ToolCall { #[serde(default, skip_serializing_if = "Vec::is_empty")] pub locations: Vec, /// Raw input parameters sent to the tool. - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub raw_input: Option, /// Raw output returned by the tool. - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub raw_output: Option, /// Extension point for implementations #[serde(skip_serializing_if = "Option::is_none", rename = "_meta")] @@ -109,25 +109,25 @@ pub struct ToolCallUpdate { #[serde(rename_all = "camelCase")] pub struct ToolCallUpdateFields { /// Update the tool kind. - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub kind: Option, /// Update the execution status. - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub status: Option, /// Update the human-readable title. - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub title: Option, /// Replace the content collection. - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub content: Option>, /// Replace the locations collection. - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub locations: Option>, /// Update the raw input. - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub raw_input: Option, /// Update the raw output. - #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub raw_output: Option, } @@ -237,12 +237,6 @@ pub enum ToolKind { Other, } -impl ToolKind { - fn is_default(&self) -> bool { - matches!(self, ToolKind::Other) - } -} - /// Execution status of a tool call. /// /// Tool calls progress through different statuses during their lifecycle. @@ -263,12 +257,6 @@ pub enum ToolCallStatus { Failed, } -impl ToolCallStatus { - fn is_default(&self) -> bool { - matches!(self, ToolCallStatus::Pending) - } -} - /// Content produced by a tool call. /// /// Tool calls can produce different types of content including diff --git a/schema/schema.json b/schema/schema.json index 960e4716..834e50f4 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -2275,6 +2275,7 @@ "$ref": "#/$defs/ToolKind" } ], + "default": "other", "description": "The category of tool being invoked.\nHelps clients choose appropriate icons and UI treatment." }, "locations": { @@ -2296,6 +2297,7 @@ "$ref": "#/$defs/ToolCallStatus" } ], + "default": "pending", "description": "Current execution status of the tool call." }, "title": { diff --git a/unstable/docs/protocol/schema.mdx b/unstable/docs/protocol/schema.mdx index bf987bd6..36a53937 100644 --- a/unstable/docs/protocol/schema.mdx +++ b/unstable/docs/protocol/schema.mdx @@ -2274,48 +2274,34 @@ See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-ca **Properties:** - + Extension point for implementations - - - ToolCallContent - - [] - - } -> +ToolCallContent[]} > Content produced by the tool call. - - The category of tool being invoked. Helps clients choose appropriate icons and - UI treatment. + + The category of tool being invoked. +Helps clients choose appropriate icons and UI treatment. + + - Default: `"other"` + - - - ToolCallLocation - - [] - - } -> - File locations affected by this tool call. Enables "follow-along" features in - clients. +ToolCallLocation[]} > + File locations affected by this tool call. +Enables "follow-along" features in clients. - + Raw input parameters sent to the tool. - + Raw output returned by the tool. - + Current execution status of the tool call. + + - Default: `"pending"` + Human-readable title describing what the tool is doing. diff --git a/unstable/schema/schema.json b/unstable/schema/schema.json index 87579d38..8d925174 100644 --- a/unstable/schema/schema.json +++ b/unstable/schema/schema.json @@ -2402,6 +2402,7 @@ "$ref": "#/$defs/ToolKind" } ], + "default": "other", "description": "The category of tool being invoked.\nHelps clients choose appropriate icons and UI treatment." }, "locations": { @@ -2423,6 +2424,7 @@ "$ref": "#/$defs/ToolCallStatus" } ], + "default": "pending", "description": "Current execution status of the tool call." }, "title": { From 3eff437879755c4830f88d06892fbed0fe138aaf Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Thu, 20 Nov 2025 14:57:39 +0100 Subject: [PATCH 4/8] Remove unneded serde renames --- rust/client.rs | 5 ++--- rust/content.rs | 16 +++++++++------- rust/tool_call.rs | 22 ++++++++++------------ 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/rust/client.rs b/rust/client.rs index bf91673b..c2f25b06 100644 --- a/rust/client.rs +++ b/rust/client.rs @@ -120,7 +120,6 @@ pub struct AvailableCommand { #[serde(untagged, rename_all = "camelCase")] pub enum AvailableCommandInput { /// All text that was typed after the command name is provided as input. - #[schemars(rename = "UnstructuredCommandInput")] Unstructured { /// A hint to display when the input hasn't been provided yet hint: String, @@ -151,10 +150,10 @@ pub struct RequestPermissionRequest { /// An option presented to the user when requesting permission. #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] +#[serde(rename_all = "camelCase")] pub struct PermissionOption { /// Unique identifier for this permission option. - #[serde(rename = "optionId")] - pub id: PermissionOptionId, + pub option_id: PermissionOptionId, /// Human-readable label to display to the user. pub name: String, /// Hint about the nature of this permission option. diff --git a/rust/content.rs b/rust/content.rs index 4cf2ebfd..3632905a 100644 --- a/rust/content.rs +++ b/rust/content.rs @@ -78,11 +78,11 @@ impl> From for ContentBlock { /// An image provided to or from an LLM. #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] pub struct ImageContent { #[serde(skip_serializing_if = "Option::is_none")] pub annotations: Option, pub data: String, - #[serde(rename = "mimeType")] pub mime_type: String, #[serde(skip_serializing_if = "Option::is_none")] pub uri: Option, @@ -93,11 +93,11 @@ pub struct ImageContent { /// Audio provided to or from an LLM. #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] pub struct AudioContent { #[serde(skip_serializing_if = "Option::is_none")] pub annotations: Option, pub data: String, - #[serde(rename = "mimeType")] pub mime_type: String, /// Extension point for implementations #[serde(skip_serializing_if = "Option::is_none", rename = "_meta")] @@ -125,8 +125,9 @@ pub enum EmbeddedResourceResource { /// Text-based resource contents. #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] pub struct TextResourceContents { - #[serde(rename = "mimeType", skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub mime_type: Option, pub text: String, pub uri: String, @@ -137,9 +138,10 @@ pub struct TextResourceContents { /// Binary resource contents. #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] pub struct BlobResourceContents { pub blob: String, - #[serde(rename = "mimeType", skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub mime_type: Option, pub uri: String, /// Extension point for implementations @@ -149,12 +151,13 @@ pub struct BlobResourceContents { /// A resource that the server is capable of reading, included in a prompt or tool call result. #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] pub struct ResourceLink { #[serde(skip_serializing_if = "Option::is_none")] pub annotations: Option, #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, - #[serde(rename = "mimeType", skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none")] pub mime_type: Option, pub name: String, #[serde(skip_serializing_if = "Option::is_none")] @@ -184,9 +187,8 @@ pub struct Annotations { /// The sender or recipient of messages and data in a conversation. #[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] pub enum Role { - #[serde(rename = "assistant")] Assistant, - #[serde(rename = "user")] User, } diff --git a/rust/tool_call.rs b/rust/tool_call.rs index bd550f9d..1bd74780 100644 --- a/rust/tool_call.rs +++ b/rust/tool_call.rs @@ -22,8 +22,7 @@ use crate::{ContentBlock, Error}; #[serde(rename_all = "camelCase")] pub struct ToolCall { /// Unique identifier for this tool call within the session. - #[serde(rename = "toolCallId")] - pub id: ToolCallId, + pub tool_call_id: ToolCallId, /// Human-readable title describing what the tool is doing. pub title: String, /// The category of tool being invoked. @@ -89,8 +88,7 @@ impl ToolCall { #[serde(rename_all = "camelCase")] pub struct ToolCallUpdate { /// The ID of the tool call being updated. - #[serde(rename = "toolCallId")] - pub id: ToolCallId, + pub tool_call_id: ToolCallId, /// Fields being updated. #[serde(flatten)] pub fields: ToolCallUpdateFields, @@ -138,7 +136,7 @@ impl TryFrom for ToolCall { fn try_from(update: ToolCallUpdate) -> Result { let ToolCallUpdate { - id, + tool_call_id, fields: ToolCallUpdateFields { kind, @@ -149,11 +147,11 @@ impl TryFrom for ToolCall { raw_input, raw_output, }, - meta: _, + meta, } = update; Ok(Self { - id, + tool_call_id, title: title.ok_or_else(|| { Error::invalid_params() .with_data(serde_json::json!("title is required for a tool call")) @@ -164,7 +162,7 @@ impl TryFrom for ToolCall { locations: locations.unwrap_or_default(), raw_input, raw_output, - meta: None, + meta, }) } } @@ -172,7 +170,7 @@ impl TryFrom for ToolCall { impl From for ToolCallUpdate { fn from(value: ToolCall) -> Self { let ToolCall { - id, + tool_call_id, title, kind, status, @@ -180,10 +178,10 @@ impl From for ToolCallUpdate { locations, raw_input, raw_output, - meta: _, + meta, } = value; Self { - id, + tool_call_id, fields: ToolCallUpdateFields { kind: Some(kind), status: Some(status), @@ -193,7 +191,7 @@ impl From for ToolCallUpdate { raw_input, raw_output, }, - meta: None, + meta, } } } From 33a2bc6210cd2a245f6a368133e15a560b70fb31 Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Fri, 21 Nov 2025 10:50:22 +0100 Subject: [PATCH 5/8] Replace bool schemas Helps with compatibility of more JSON Schema variants --- rust/bin/generate.rs | 10 ++++++++-- schema/schema.json | 6 +++--- unstable/schema/schema.json | 6 +++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/rust/bin/generate.rs b/rust/bin/generate.rs index 8adfadf9..14cd8939 100644 --- a/rust/bin/generate.rs +++ b/rust/bin/generate.rs @@ -2,7 +2,11 @@ use agent_client_protocol_schema::{ AGENT_METHOD_NAMES, AgentSide, CLIENT_METHOD_NAMES, ClientSide, JsonRpcMessage, OutgoingMessage, VERSION, }; -use schemars::{JsonSchema, generate::SchemaSettings, transform::RemoveRefSiblings}; +use schemars::{ + JsonSchema, + generate::SchemaSettings, + transform::{RemoveRefSiblings, ReplaceBoolSchemas}, +}; use std::{env, fs, path::Path}; use markdown_generator::MarkdownGenerator; @@ -27,7 +31,9 @@ enum AcpTypes { fn main() { let mut settings = SchemaSettings::draft2020_12(); - settings = settings.with_transform(RemoveRefSiblings::default()); + settings = settings + .with_transform(RemoveRefSiblings::default()) + .with_transform(ReplaceBoolSchemas::default()); let generator = settings.into_generator(); let mut schema = generator.into_root_schema_for::(); diff --git a/schema/schema.json b/schema/schema.json index 834e50f4..c930167e 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -257,7 +257,7 @@ { "$ref": "#/$defs/PromptResponse" }, - true + {} ], "description": "All possible responses that an agent can send to a client.\n\nThis enum is used internally for routing RPC responses. You typically won't need\nto use this directly - the responses are handled automatically by the connection.\n\nThese are responses to the corresponding `ClientRequest` variants.", "x-docs-ignore": true @@ -706,7 +706,7 @@ { "$ref": "#/$defs/KillTerminalCommandResponse" }, - true + {} ], "description": "All possible responses that a client can send to an agent.\n\nThis enum is used internally for routing RPC responses. You typically won't need\nto use this directly - the responses are handled automatically by the connection.\n\nThese are responses to the corresponding `AgentRequest` variants.", "x-docs-ignore": true @@ -2104,7 +2104,7 @@ "SetSessionModeResponse": { "description": "Response to `session/set_mode` method.", "properties": { - "_meta": true + "_meta": {} }, "type": "object", "x-method": "session/set_mode", diff --git a/unstable/schema/schema.json b/unstable/schema/schema.json index 8d925174..22dd6b01 100644 --- a/unstable/schema/schema.json +++ b/unstable/schema/schema.json @@ -260,7 +260,7 @@ { "$ref": "#/$defs/SetSessionModelResponse" }, - true + {} ], "description": "All possible responses that an agent can send to a client.\n\nThis enum is used internally for routing RPC responses. You typically won't need\nto use this directly - the responses are handled automatically by the connection.\n\nThese are responses to the corresponding `ClientRequest` variants.", "x-docs-ignore": true @@ -717,7 +717,7 @@ { "$ref": "#/$defs/KillTerminalCommandResponse" }, - true + {} ], "description": "All possible responses that a client can send to an agent.\n\nThis enum is used internally for routing RPC responses. You typically won't need\nto use this directly - the responses are handled automatically by the connection.\n\nThese are responses to the corresponding `AgentRequest` variants.", "x-docs-ignore": true @@ -2192,7 +2192,7 @@ "SetSessionModeResponse": { "description": "Response to `session/set_mode` method.", "properties": { - "_meta": true + "_meta": {} }, "type": "object", "x-method": "session/set_mode", From 9e832d6c4d05de2616b1ad3031870d7a8d162730 Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Fri, 21 Nov 2025 11:11:23 +0100 Subject: [PATCH 6/8] Bring back default change as it has weird effects with anyof --- docs/protocol/schema.mdx | 48 ++++++++++++++++++++----------- rust/tool_call.rs | 16 +++++++++-- schema/schema.json | 2 -- unstable/docs/protocol/schema.mdx | 48 ++++++++++++++++++++----------- unstable/schema/schema.json | 2 -- 5 files changed, 76 insertions(+), 40 deletions(-) diff --git a/docs/protocol/schema.mdx b/docs/protocol/schema.mdx index bf970dc1..a42cc5b4 100644 --- a/docs/protocol/schema.mdx +++ b/docs/protocol/schema.mdx @@ -2143,34 +2143,48 @@ See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-ca **Properties:** - + Extension point for implementations -ToolCallContent[]} > + + + ToolCallContent + + [] + + } +> Content produced by the tool call. - - The category of tool being invoked. -Helps clients choose appropriate icons and UI treatment. - - - Default: `"other"` - + + The category of tool being invoked. Helps clients choose appropriate icons and + UI treatment. -ToolCallLocation[]} > - File locations affected by this tool call. -Enables "follow-along" features in clients. + + + ToolCallLocation + + [] + + } +> + File locations affected by this tool call. Enables "follow-along" features in + clients. - + Raw input parameters sent to the tool. - + Raw output returned by the tool. - + Current execution status of the tool call. - - - Default: `"pending"` - Human-readable title describing what the tool is doing. diff --git a/rust/tool_call.rs b/rust/tool_call.rs index 1bd74780..7b8cc974 100644 --- a/rust/tool_call.rs +++ b/rust/tool_call.rs @@ -27,10 +27,10 @@ pub struct ToolCall { pub title: String, /// The category of tool being invoked. /// Helps clients choose appropriate icons and UI treatment. - #[serde(default)] + #[serde(default, skip_serializing_if = "ToolKind::is_default")] pub kind: ToolKind, /// Current execution status of the tool call. - #[serde(default)] + #[serde(default, skip_serializing_if = "ToolCallStatus::is_default")] pub status: ToolCallStatus, /// Content produced by the tool call. #[serde(default, skip_serializing_if = "Vec::is_empty")] @@ -235,6 +235,12 @@ pub enum ToolKind { Other, } +impl ToolKind { + fn is_default(&self) -> bool { + matches!(self, ToolKind::Other) + } +} + /// Execution status of a tool call. /// /// Tool calls progress through different statuses during their lifecycle. @@ -255,6 +261,12 @@ pub enum ToolCallStatus { Failed, } +impl ToolCallStatus { + fn is_default(&self) -> bool { + matches!(self, ToolCallStatus::Pending) + } +} + /// Content produced by a tool call. /// /// Tool calls can produce different types of content including diff --git a/schema/schema.json b/schema/schema.json index c930167e..ab22d444 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -2275,7 +2275,6 @@ "$ref": "#/$defs/ToolKind" } ], - "default": "other", "description": "The category of tool being invoked.\nHelps clients choose appropriate icons and UI treatment." }, "locations": { @@ -2297,7 +2296,6 @@ "$ref": "#/$defs/ToolCallStatus" } ], - "default": "pending", "description": "Current execution status of the tool call." }, "title": { diff --git a/unstable/docs/protocol/schema.mdx b/unstable/docs/protocol/schema.mdx index 36a53937..bf987bd6 100644 --- a/unstable/docs/protocol/schema.mdx +++ b/unstable/docs/protocol/schema.mdx @@ -2274,34 +2274,48 @@ See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-ca **Properties:** - + Extension point for implementations -ToolCallContent[]} > + + + ToolCallContent + + [] + + } +> Content produced by the tool call. - - The category of tool being invoked. -Helps clients choose appropriate icons and UI treatment. - - - Default: `"other"` - + + The category of tool being invoked. Helps clients choose appropriate icons and + UI treatment. -ToolCallLocation[]} > - File locations affected by this tool call. -Enables "follow-along" features in clients. + + + ToolCallLocation + + [] + + } +> + File locations affected by this tool call. Enables "follow-along" features in + clients. - + Raw input parameters sent to the tool. - + Raw output returned by the tool. - + Current execution status of the tool call. - - - Default: `"pending"` - Human-readable title describing what the tool is doing. diff --git a/unstable/schema/schema.json b/unstable/schema/schema.json index 22dd6b01..4042a00e 100644 --- a/unstable/schema/schema.json +++ b/unstable/schema/schema.json @@ -2402,7 +2402,6 @@ "$ref": "#/$defs/ToolKind" } ], - "default": "other", "description": "The category of tool being invoked.\nHelps clients choose appropriate icons and UI treatment." }, "locations": { @@ -2424,7 +2423,6 @@ "$ref": "#/$defs/ToolCallStatus" } ], - "default": "pending", "description": "Current execution status of the tool call." }, "title": { From a5193bf707606471f8e749cbf15b84b327c4dad1 Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Fri, 21 Nov 2025 11:21:39 +0100 Subject: [PATCH 7/8] Fix references in generated docs with the allOf change --- docs/protocol/schema.mdx | 197 +++++++++++++++++++++------ rust/bin/generate.rs | 9 ++ unstable/docs/protocol/schema.mdx | 213 +++++++++++++++++++++++------- 3 files changed, 333 insertions(+), 86 deletions(-) diff --git a/docs/protocol/schema.mdx b/docs/protocol/schema.mdx index a42cc5b4..1df9b1f1 100644 --- a/docs/protocol/schema.mdx +++ b/docs/protocol/schema.mdx @@ -35,7 +35,11 @@ Specifies which authentication method to use. Extension point for implementations - +AuthMethodId} + required +> The ID of the authentication method to use. Must be one of the methods advertised in the initialize response. @@ -81,7 +85,7 @@ See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/ini Extension point for implementations - +ClientCapabilities} > Capabilities supported by the client. - Default: `{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false}` @@ -93,7 +97,7 @@ See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/ini Note: in future versions of the protocol, this will be required. - +ProtocolVersion} required> The latest protocol version supported by the client. @@ -112,7 +116,7 @@ See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/ini Extension point for implementations - +AgentCapabilities} > Capabilities supported by the agent. - Default: `{"loadSession":false,"mcpCapabilities":{"http":false,"sse":false},"promptCapabilities":{"audio":false,"embeddedContext":false,"image":false}}` @@ -130,7 +134,7 @@ Note: in future versions of the protocol, this will be required. - Default: `[]` - +ProtocolVersion} required> The protocol version the client specified if supported by the agent, or the latest protocol version supported by the agent. @@ -167,7 +171,11 @@ See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/promp Extension point for implementations - +SessionId} + required +> The ID of the session to cancel operations for. @@ -218,7 +226,11 @@ See protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/s > List of MCP servers to connect to for this session. - +SessionId} + required +> The ID of the session to load. @@ -307,7 +319,7 @@ See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes) - +SessionId} required> Unique identifier for the created session. Used in all subsequent requests for this conversation. @@ -361,7 +373,7 @@ as it avoids extra round-trips and allows the message to include pieces of context from sources the agent may not have access to. - +SessionId} required> The ID of the session to send this user message to @@ -378,7 +390,11 @@ See protocol docs: [Check for Completion](https://agentclientprotocol.com/protoc Extension point for implementations - +StopReason} + required +> Indicates why the agent stopped processing the turn. @@ -410,10 +426,18 @@ Request parameters for setting a session mode. Extension point for implementations - +SessionModeId} + required +> The ID of the mode to set. - +SessionId} + required +> The ID of the session to set the mode for. @@ -473,7 +497,7 @@ Only available if the client supports the `fs.readTextFile` capability. Absolute path to the file to read. - +SessionId} required> The session ID for this request. @@ -519,7 +543,11 @@ Only available if the client supports the `fs.writeTextFile` capability. Absolute path to the file to write. - +SessionId} + required +> The session ID for this request. @@ -578,10 +606,18 @@ See protocol docs: [Requesting Permission](https://agentclientprotocol.com/proto > Available permission options for the user to choose from. - +SessionId} + required +> The session ID for this request. - +ToolCallUpdate} + required +> Details about the tool call requiring permission. @@ -596,7 +632,11 @@ Response to a permission request. Extension point for implementations - +RequestPermissionOutcome} + required +> The user's decision on the permission request. @@ -630,10 +670,18 @@ See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protoc Extension point for implementations - +SessionId} + required +> The ID of the session this update pertains to. - +SessionUpdate} + required +> The actual update content. @@ -691,7 +739,7 @@ specified limit. - Minimum: `0` - +SessionId} required> The session ID for this request. @@ -737,7 +785,11 @@ Request to kill a terminal command without releasing the terminal. Extension point for implementations - +SessionId} + required +> The session ID for this request. @@ -777,7 +829,11 @@ Request to get the current output and status of a terminal. Extension point for implementations - +SessionId} + required +> The session ID for this request. @@ -842,7 +898,11 @@ Request to release a terminal and free its resources. Extension point for implementations - +SessionId} + required +> The session ID for this request. @@ -879,7 +939,11 @@ Request to wait for a terminal command to exit. Extension point for implementations - +SessionId} + required +> The session ID for this request. @@ -929,13 +993,13 @@ See protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol - Default: `false` - +McpCapabilities} > MCP capabilities supported by the agent. - Default: `{"http":false,"sse":false}` - +PromptCapabilities} > Prompt capabilities supported by the agent. - Default: `{"audio":false,"embeddedContext":false,"image":false}` @@ -996,7 +1060,11 @@ Describes an available authentication method. Optional description providing more details about this authentication method. - +AuthMethodId} + required +> Unique identifier for this authentication method. @@ -1115,7 +1183,7 @@ See protocol docs: [Client Capabilities](https://agentclientprotocol.com/protoco Extension point for implementations - +FileSystemCapability} > File system capabilities supported by the client. Determines which file operations the agent can request. @@ -1223,7 +1291,11 @@ A streamed item of content Extension point for implementations - +ContentBlock} + required +> A single item of content @@ -1240,7 +1312,11 @@ See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/sess Extension point for implementations - +SessionModeId} + required +> The ID of the current mode @@ -1601,13 +1677,21 @@ An option presented to the user when requesting permission. Extension point for implementations - +PermissionOptionKind} + required +> Hint about the nature of this permission option. Human-readable label to display to the user. - +PermissionOptionId} + required +> Unique identifier for this permission option. @@ -1684,11 +1768,19 @@ See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent Human-readable description of what this task aims to accomplish. - +PlanEntryPriority} + required +> The relative importance of this task. Used to indicate which tasks are most critical to the overall goal. - +PlanEntryStatus} + required +> Current execution status of this task. @@ -1818,7 +1910,11 @@ The user selected one of the provided options. - +PermissionOptionId} + required +> The ID of the option the user selected. @@ -1938,7 +2034,11 @@ The set of modes and the one currently active. > The set of modes that the Agent can operate in - +SessionModeId} + required +> The current mode the Agent is in. @@ -2159,7 +2259,7 @@ See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-ca > Content produced by the tool call. - +ToolKind}> The category of tool being invoked. Helps clients choose appropriate icons and UI treatment. @@ -2183,13 +2283,20 @@ See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-ca Raw output returned by the tool. - +ToolCallStatus} +> Current execution status of the tool call. Human-readable title describing what the tool is doing. - +ToolCallId} + required +> Unique identifier for this tool call within the session. @@ -2209,7 +2316,11 @@ Standard content block (text, images, resources). - +ContentBlock} + required +> The actual content block. @@ -2368,7 +2479,11 @@ See protocol docs: [Updating](https://agentclientprotocol.com/protocol/tool-call Update the human-readable title. - +ToolCallId} + required +> The ID of the tool call being updated. diff --git a/rust/bin/generate.rs b/rust/bin/generate.rs index 14cd8939..25a28c6c 100644 --- a/rust/bin/generate.rs +++ b/rust/bin/generate.rs @@ -590,6 +590,15 @@ and control access to resources." ); } + // Check for single-item allOf/anyOf/oneOf wrappers (often used for $ref with sibling properties) + for key in ["allOf", "anyOf", "oneOf"] { + if let Some(arr) = schema.get(key).and_then(|v| v.as_array()) + && arr.len() == 1 + { + return Self::get_type_string(&arr[0]); + } + } + // Check for type if let Some(type_val) = schema.get("type") { if let Some(type_str) = type_val.as_str() { diff --git a/unstable/docs/protocol/schema.mdx b/unstable/docs/protocol/schema.mdx index bf987bd6..ba672946 100644 --- a/unstable/docs/protocol/schema.mdx +++ b/unstable/docs/protocol/schema.mdx @@ -35,7 +35,11 @@ Specifies which authentication method to use. Extension point for implementations - +AuthMethodId} + required +> The ID of the authentication method to use. Must be one of the methods advertised in the initialize response. @@ -81,7 +85,7 @@ See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/ini Extension point for implementations - +ClientCapabilities} > Capabilities supported by the client. - Default: `{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false}` @@ -93,7 +97,7 @@ See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/ini Note: in future versions of the protocol, this will be required. - +ProtocolVersion} required> The latest protocol version supported by the client. @@ -112,7 +116,7 @@ See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/ini Extension point for implementations - +AgentCapabilities} > Capabilities supported by the agent. - Default: `{"loadSession":false,"mcpCapabilities":{"http":false,"sse":false},"promptCapabilities":{"audio":false,"embeddedContext":false,"image":false}}` @@ -130,7 +134,7 @@ Note: in future versions of the protocol, this will be required. - Default: `[]` - +ProtocolVersion} required> The protocol version the client specified if supported by the agent, or the latest protocol version supported by the agent. @@ -167,7 +171,11 @@ See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/promp Extension point for implementations - +SessionId} + required +> The ID of the session to cancel operations for. @@ -218,7 +226,11 @@ See protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/s > List of MCP servers to connect to for this session. - +SessionId} + required +> The ID of the session to load. @@ -323,7 +335,7 @@ Initial model state if supported by the Agent See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes) - +SessionId} required> Unique identifier for the created session. Used in all subsequent requests for this conversation. @@ -377,7 +389,7 @@ as it avoids extra round-trips and allows the message to include pieces of context from sources the agent may not have access to. - +SessionId} required> The ID of the session to send this user message to @@ -394,7 +406,11 @@ See protocol docs: [Check for Completion](https://agentclientprotocol.com/protoc Extension point for implementations - +StopReason} + required +> Indicates why the agent stopped processing the turn. @@ -426,10 +442,18 @@ Request parameters for setting a session mode. Extension point for implementations - +SessionModeId} + required +> The ID of the mode to set. - +SessionId} + required +> The ID of the session to set the mode for. @@ -467,10 +491,14 @@ Request parameters for setting a session model. Extension point for implementations - +ModelId} required> The ID of the model to set. - +SessionId} + required +> The ID of the session to set the model for. @@ -536,7 +564,7 @@ Only available if the client supports the `fs.readTextFile` capability. Absolute path to the file to read. - +SessionId} required> The session ID for this request. @@ -582,7 +610,11 @@ Only available if the client supports the `fs.writeTextFile` capability. Absolute path to the file to write. - +SessionId} + required +> The session ID for this request. @@ -641,10 +673,18 @@ See protocol docs: [Requesting Permission](https://agentclientprotocol.com/proto > Available permission options for the user to choose from. - +SessionId} + required +> The session ID for this request. - +ToolCallUpdate} + required +> Details about the tool call requiring permission. @@ -659,7 +699,11 @@ Response to a permission request. Extension point for implementations - +RequestPermissionOutcome} + required +> The user's decision on the permission request. @@ -693,10 +737,18 @@ See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protoc Extension point for implementations - +SessionId} + required +> The ID of the session this update pertains to. - +SessionUpdate} + required +> The actual update content. @@ -754,7 +806,7 @@ specified limit. - Minimum: `0` - +SessionId} required> The session ID for this request. @@ -800,7 +852,11 @@ Request to kill a terminal command without releasing the terminal. Extension point for implementations - +SessionId} + required +> The session ID for this request. @@ -840,7 +896,11 @@ Request to get the current output and status of a terminal. Extension point for implementations - +SessionId} + required +> The session ID for this request. @@ -905,7 +965,11 @@ Request to release a terminal and free its resources. Extension point for implementations - +SessionId} + required +> The session ID for this request. @@ -942,7 +1006,11 @@ Request to wait for a terminal command to exit. Extension point for implementations - +SessionId} + required +> The session ID for this request. @@ -992,13 +1060,13 @@ See protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol - Default: `false` - +McpCapabilities} > MCP capabilities supported by the agent. - Default: `{"http":false,"sse":false}` - +PromptCapabilities} > Prompt capabilities supported by the agent. - Default: `{"audio":false,"embeddedContext":false,"image":false}` @@ -1059,7 +1127,11 @@ Describes an available authentication method. Optional description providing more details about this authentication method. - +AuthMethodId} + required +> Unique identifier for this authentication method. @@ -1178,7 +1250,7 @@ See protocol docs: [Client Capabilities](https://agentclientprotocol.com/protoco Extension point for implementations - +FileSystemCapability} > File system capabilities supported by the client. Determines which file operations the agent can request. @@ -1286,7 +1358,11 @@ A streamed item of content Extension point for implementations - +ContentBlock} + required +> A single item of content @@ -1303,7 +1379,11 @@ See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/sess Extension point for implementations - +SessionModeId} + required +> The ID of the current mode @@ -1681,7 +1761,7 @@ Information about a selectable model. Optional description of the model. - +ModelId} required> Unique identifier for the model. @@ -1699,13 +1779,21 @@ An option presented to the user when requesting permission. Extension point for implementations - +PermissionOptionKind} + required +> Hint about the nature of this permission option. Human-readable label to display to the user. - +PermissionOptionId} + required +> Unique identifier for this permission option. @@ -1782,11 +1870,19 @@ See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent Human-readable description of what this task aims to accomplish. - +PlanEntryPriority} + required +> The relative importance of this task. Used to indicate which tasks are most critical to the overall goal. - +PlanEntryStatus} + required +> Current execution status of this task. @@ -1916,7 +2012,11 @@ The user selected one of the provided options. - +PermissionOptionId} + required +> The ID of the option the user selected. @@ -2036,7 +2136,11 @@ The set of modes and the one currently active. > The set of modes that the Agent can operate in - +SessionModeId} + required +> The current mode the Agent is in. @@ -2069,7 +2173,11 @@ The set of models and the one currently active. > The set of models that the Agent can use - +ModelId} + required +> The current model the Agent is in. @@ -2290,7 +2398,7 @@ See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-ca > Content produced by the tool call. - +ToolKind}> The category of tool being invoked. Helps clients choose appropriate icons and UI treatment. @@ -2314,13 +2422,20 @@ See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-ca Raw output returned by the tool. - +ToolCallStatus} +> Current execution status of the tool call. Human-readable title describing what the tool is doing. - +ToolCallId} + required +> Unique identifier for this tool call within the session. @@ -2340,7 +2455,11 @@ Standard content block (text, images, resources). - +ContentBlock} + required +> The actual content block. @@ -2499,7 +2618,11 @@ See protocol docs: [Updating](https://agentclientprotocol.com/protocol/tool-call Update the human-readable title. - +ToolCallId} + required +> The ID of the tool call being updated. From 47a3b4f8e8dbc5c3aecfd408901d77f08c86d975 Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Fri, 21 Nov 2025 11:32:32 +0100 Subject: [PATCH 8/8] Better merge properties in the docs for types that extend refs --- docs/protocol/schema.mdx | 264 +++++++++++++++++++++++++++++- rust/bin/generate.rs | 77 ++++++--- unstable/docs/protocol/schema.mdx | 264 +++++++++++++++++++++++++++++- 3 files changed, 580 insertions(+), 25 deletions(-) diff --git a/docs/protocol/schema.mdx b/docs/protocol/schema.mdx index 1df9b1f1..a19fd379 100644 --- a/docs/protocol/schema.mdx +++ b/docs/protocol/schema.mdx @@ -1225,6 +1225,21 @@ Clients SHOULD render this text as Markdown. + + Extension point for implementations + + + + Annotations + + | null + + } +> + @@ -1237,7 +1252,24 @@ Requires the `image` prompt capability when included in prompts. + + Extension point for implementations + + + + Annotations + + | null + + } +> + + + @@ -1249,6 +1281,22 @@ Requires the `audio` prompt capability when included in prompts. + + Extension point for implementations + + + + Annotations + + | null + + } +> + + @@ -1261,7 +1309,27 @@ All agents MUST support resource links in prompts. + + Extension point for implementations + + + + Annotations + + | null + + } +> + + + + + + @@ -1275,6 +1343,25 @@ Requires the `embeddedContext` prompt capability when included in prompts. + + Extension point for implementations + + + + Annotations + + | null + + } +> +EmbeddedResourceResource} + required +> @@ -2057,6 +2144,16 @@ A chunk of the user's message being streamed. + + Extension point for implementations + +ContentBlock} + required +> + A single item of content + @@ -2067,6 +2164,16 @@ A chunk of the agent's response being streamed. + + Extension point for implementations + +ContentBlock} + required +> + A single item of content + @@ -2077,6 +2184,16 @@ A chunk of the agent's internal reasoning being streamed. + + Extension point for implementations + +ContentBlock} + required +> + A single item of content + @@ -2087,7 +2204,63 @@ Notification that a new tool call has been initiated. + + Extension point for implementations + + + + ToolCallContent + + [] + + } +> + Content produced by the tool call. + +ToolKind}> + The category of tool being invoked. Helps clients choose appropriate icons and + UI treatment. + + + + ToolCallLocation + + [] + + } +> + File locations affected by this tool call. Enables "follow-along" features in + clients. + + + Raw input parameters sent to the tool. + + + Raw output returned by the tool. + +ToolCallStatus} +> + Current execution status of the tool call. + + + Human-readable title describing what the tool is doing. + +ToolCallId} + required +> + Unique identifier for this tool call within the session. + @@ -2097,7 +2270,58 @@ Update on the status or results of a tool call. + + Extension point for implementations + + + Replace the content collection. + + + + ToolKind + + | null + + } +> + Update the tool kind. + + + Replace the locations collection. + + + Update the raw input. + + + Update the raw output. + + + + ToolCallStatus + + | null + + } +> + Update the execution status. + + + Update the human-readable title. + +ToolCallId} + required +> + The ID of the tool call being updated. + @@ -2108,7 +2332,18 @@ See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-p - + + Extension point for implementations + +PlanEntry[]} required> + 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. + + + + @@ -2118,6 +2353,23 @@ Available commands are ready or have changed + + Extension point for implementations + + + + AvailableCommand + + [] + + } + required +> + Commands the agent can execute + @@ -2130,6 +2382,16 @@ See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/sess + + Extension point for implementations + +SessionModeId} + required +> + The ID of the current mode + diff --git a/rust/bin/generate.rs b/rust/bin/generate.rs index 25a28c6c..df27a1b0 100644 --- a/rust/bin/generate.rs +++ b/rust/bin/generate.rs @@ -277,10 +277,8 @@ and control access to resources." write!(&mut self.output, "").unwrap(); - writeln!(&mut self.output).unwrap(); - self.document_properties_as_fields(props, variant, 0); - writeln!(&mut self.output).unwrap(); - writeln!(&mut self.output, "").unwrap(); + // Collect all properties and required fields + let mut merged_props = serde_json::Map::new(); + let mut merged_required = Vec::new(); + + // Helper to merge from a definition + let mut merge_from = |def: &Value| { + if let Some(props) = def.get("properties").and_then(|v| v.as_object()) { + for (k, v) in props { + merged_props.insert(k.clone(), v.clone()); + } } - } else if !variant_name.is_empty() { - // If this is a $ref, look up and document the referenced type's properties - if let Some(ref_def) = self.definitions.get(&variant_name).cloned() - && let Some(props) = ref_def.get("properties").and_then(|v| v.as_object()) - && !props.is_empty() - { - writeln!(&mut self.output).unwrap(); - writeln!(&mut self.output, "").unwrap(); - writeln!(&mut self.output).unwrap(); - self.document_properties_as_fields(props, &ref_def, 0); - writeln!(&mut self.output).unwrap(); - writeln!(&mut self.output, "").unwrap(); + if let Some(req) = def.get("required").and_then(|v| v.as_array()) { + for r in req { + if !merged_required.contains(r) { + merged_required.push(r.clone()); + } + } + } + }; + + // 1. Check for $ref (direct) + if let Some(ref_val) = variant.get("$ref").and_then(|v| v.as_str()) { + let type_name = ref_val.strip_prefix("#/$defs/").unwrap_or(ref_val); + if let Some(ref_def) = self.definitions.get(type_name) { + merge_from(ref_def); + } + } + + // 2. Check for allOf (often used for inheritance/composition) + if let Some(all_of) = variant.get("allOf").and_then(|v| v.as_array()) { + for item in all_of { + if let Some(ref_val) = item.get("$ref").and_then(|v| v.as_str()) { + let type_name = ref_val.strip_prefix("#/$defs/").unwrap_or(ref_val); + if let Some(ref_def) = self.definitions.get(type_name) { + merge_from(ref_def); + } + } else { + merge_from(item); + } } } + // 3. Local properties + merge_from(variant); + + if !merged_props.is_empty() { + writeln!(&mut self.output).unwrap(); + writeln!(&mut self.output, "").unwrap(); + writeln!(&mut self.output).unwrap(); + + let mut synthetic_def = serde_json::Map::new(); + synthetic_def.insert("required".to_string(), Value::Array(merged_required)); + + self.document_properties_as_fields(&merged_props, &Value::Object(synthetic_def), 0); + writeln!(&mut self.output).unwrap(); + writeln!(&mut self.output, "").unwrap(); + } + writeln!(&mut self.output, "").unwrap(); writeln!(&mut self.output).unwrap(); } diff --git a/unstable/docs/protocol/schema.mdx b/unstable/docs/protocol/schema.mdx index ba672946..f8a0b7d2 100644 --- a/unstable/docs/protocol/schema.mdx +++ b/unstable/docs/protocol/schema.mdx @@ -1292,6 +1292,21 @@ Clients SHOULD render this text as Markdown. + + Extension point for implementations + + + + Annotations + + | null + + } +> + @@ -1304,7 +1319,24 @@ Requires the `image` prompt capability when included in prompts. + + Extension point for implementations + + + + Annotations + + | null + + } +> + + + @@ -1316,6 +1348,22 @@ Requires the `audio` prompt capability when included in prompts. + + Extension point for implementations + + + + Annotations + + | null + + } +> + + @@ -1328,7 +1376,27 @@ All agents MUST support resource links in prompts. + + Extension point for implementations + + + + Annotations + + | null + + } +> + + + + + + @@ -1342,6 +1410,25 @@ Requires the `embeddedContext` prompt capability when included in prompts. + + Extension point for implementations + + + + Annotations + + | null + + } +> +EmbeddedResourceResource} + required +> @@ -2196,6 +2283,16 @@ A chunk of the user's message being streamed. + + Extension point for implementations + +ContentBlock} + required +> + A single item of content + @@ -2206,6 +2303,16 @@ A chunk of the agent's response being streamed. + + Extension point for implementations + +ContentBlock} + required +> + A single item of content + @@ -2216,6 +2323,16 @@ A chunk of the agent's internal reasoning being streamed. + + Extension point for implementations + +ContentBlock} + required +> + A single item of content + @@ -2226,7 +2343,63 @@ Notification that a new tool call has been initiated. + + Extension point for implementations + + + + ToolCallContent + + [] + + } +> + Content produced by the tool call. + +ToolKind}> + The category of tool being invoked. Helps clients choose appropriate icons and + UI treatment. + + + + ToolCallLocation + + [] + + } +> + File locations affected by this tool call. Enables "follow-along" features in + clients. + + + Raw input parameters sent to the tool. + + + Raw output returned by the tool. + +ToolCallStatus} +> + Current execution status of the tool call. + + + Human-readable title describing what the tool is doing. + +ToolCallId} + required +> + Unique identifier for this tool call within the session. + @@ -2236,7 +2409,58 @@ Update on the status or results of a tool call. + + Extension point for implementations + + + Replace the content collection. + + + + ToolKind + + | null + + } +> + Update the tool kind. + + + Replace the locations collection. + + + Update the raw input. + + + Update the raw output. + + + + ToolCallStatus + + | null + + } +> + Update the execution status. + + + Update the human-readable title. + +ToolCallId} + required +> + The ID of the tool call being updated. + @@ -2247,7 +2471,18 @@ See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-p - + + Extension point for implementations + +PlanEntry[]} required> + 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. + + + + @@ -2257,6 +2492,23 @@ Available commands are ready or have changed + + Extension point for implementations + + + + AvailableCommand + + [] + + } + required +> + Commands the agent can execute + @@ -2269,6 +2521,16 @@ See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/sess + + Extension point for implementations + +SessionModeId} + required +> + The ID of the current mode +