@@ -25,7 +25,7 @@ pub trait Agent {
2525 ///
2626 /// The agent should respond with its supported protocol version and capabilities.
2727 ///
28- /// See: < https://agentclientprotocol.com/protocol/initialization>
28+ /// See: [ https://agentclientprotocol.com/protocol/initialization](https://agentclientprotocol.com/protocol/initialization)
2929 fn initialize (
3030 & self ,
3131 arguments : InitializeRequest ,
@@ -39,7 +39,7 @@ pub trait Agent {
3939 /// After successful authentication, the client can proceed to create sessions with
4040 /// `new_session` without receiving an `auth_required` error.
4141 ///
42- /// See: < https://agentclientprotocol.com/protocol/initialization>
42+ /// See: [ https://agentclientprotocol.com/protocol/initialization](https://agentclientprotocol.com/protocol/initialization)
4343 fn authenticate (
4444 & self ,
4545 arguments : AuthenticateRequest ,
@@ -57,7 +57,7 @@ pub trait Agent {
5757 ///
5858 /// May return an `auth_required` error if the agent requires authentication.
5959 ///
60- /// See: < https://agentclientprotocol.com/protocol/session-setup>
60+ /// See: [ https://agentclientprotocol.com/protocol/session-setup](https://agentclientprotocol.com/protocol/session-setup)
6161 fn new_session (
6262 & self ,
6363 arguments : NewSessionRequest ,
@@ -71,7 +71,7 @@ pub trait Agent {
7171 /// - Connect to the specified MCP servers
7272 /// - Stream the entire conversation history back to the client via notifications
7373 ///
74- /// See: < https://agentclientprotocol.com/protocol/session-setup#loading-sessions>
74+ /// See: [ https://agentclientprotocol.com/protocol/session-setup#loading-sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)
7575 fn load_session (
7676 & self ,
7777 arguments : LoadSessionRequest ,
@@ -85,7 +85,7 @@ pub trait Agent {
8585 /// - Executes any requested tool calls
8686 /// - Returns when the turn is complete with a stop reason
8787 ///
88- /// See: < https://agentclientprotocol.com/protocol/prompt-turn>
88+ /// See: [ https://agentclientprotocol.com/protocol/prompt-turn](https://agentclientprotocol.com/protocol/prompt-turn)
8989 fn prompt (
9090 & self ,
9191 arguments : PromptRequest ,
@@ -101,7 +101,7 @@ pub trait Agent {
101101 /// - Send any pending `session/update` notifications
102102 /// - Respond to the original `session/prompt` request with `StopReason::Cancelled`
103103 ///
104- /// See: < https://agentclientprotocol.com/protocol/prompt-turn#cancellation>
104+ /// See: [ https://agentclientprotocol.com/protocol/prompt-turn#cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)
105105 fn cancel ( & self , args : CancelNotification ) -> impl Future < Output = Result < ( ) , Error > > ;
106106}
107107
@@ -111,8 +111,9 @@ pub trait Agent {
111111///
112112/// Sent by the client to establish connection and negotiate capabilities.
113113///
114- /// See: < https://agentclientprotocol.com/protocol/initialization>
114+ /// See: [ https://agentclientprotocol.com/protocol/initialization](https://agentclientprotocol.com/protocol/initialization)
115115#[ derive( Debug , Clone , Serialize , Deserialize , JsonSchema ) ]
116+ #[ schemars( transform = crate :: schema_metadata:: add_group_initialization) ]
116117#[ serde( rename_all = "camelCase" ) ]
117118pub struct InitializeRequest {
118119 /// The latest protocol version supported by the client.
@@ -126,8 +127,9 @@ pub struct InitializeRequest {
126127///
127128/// Contains the negotiated protocol version and agent capabilities.
128129///
129- /// See: < https://agentclientprotocol.com/protocol/initialization>
130+ /// See: [ https://agentclientprotocol.com/protocol/initialization](https://agentclientprotocol.com/protocol/initialization)
130131#[ derive( Debug , Clone , Serialize , Deserialize , JsonSchema ) ]
132+ #[ schemars( transform = crate :: schema_metadata:: add_group_initialization) ]
131133#[ serde( rename_all = "camelCase" ) ]
132134pub struct InitializeResponse {
133135 /// The protocol version the client specified if supported by the agent,
@@ -149,6 +151,7 @@ pub struct InitializeResponse {
149151///
150152/// Specifies which authentication method to use.
151153#[ derive( Debug , Clone , Serialize , Deserialize , JsonSchema ) ]
154+ #[ schemars( transform = crate :: schema_metadata:: add_group_initialization) ]
152155#[ serde( rename_all = "camelCase" ) ]
153156pub struct AuthenticateRequest {
154157 /// The ID of the authentication method to use.
@@ -158,11 +161,13 @@ pub struct AuthenticateRequest {
158161
159162/// Unique identifier for an authentication method.
160163#[ derive( Debug , Clone , Serialize , Deserialize , JsonSchema , PartialEq , Eq , Hash ) ]
164+ #[ schemars( transform = crate :: schema_metadata:: add_group_initialization) ]
161165#[ serde( transparent) ]
162166pub struct AuthMethodId ( pub Arc < str > ) ;
163167
164168/// Describes an available authentication method.
165169#[ derive( Debug , Clone , Serialize , Deserialize , JsonSchema ) ]
170+ #[ schemars( transform = crate :: schema_metadata:: add_group_initialization) ]
166171#[ serde( rename_all = "camelCase" ) ]
167172pub struct AuthMethod {
168173 /// Unique identifier for this authentication method.
@@ -177,8 +182,9 @@ pub struct AuthMethod {
177182
178183/// Request parameters for creating a new session.
179184///
180- /// See: < https://agentclientprotocol.com/protocol/session-setup#creating-a-session>
185+ /// See: [ https://agentclientprotocol.com/protocol/session-setup#creating-a-session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)
181186#[ derive( Debug , Clone , Serialize , Deserialize , JsonSchema ) ]
187+ #[ schemars( transform = crate :: schema_metadata:: add_group_session) ]
182188#[ serde( rename_all = "camelCase" ) ]
183189pub struct NewSessionRequest {
184190 /// List of MCP (Model Context Protocol) servers the agent should connect to.
@@ -191,8 +197,9 @@ pub struct NewSessionRequest {
191197
192198/// Response from creating a new session.
193199///
194- /// See: < https://agentclientprotocol.com/protocol/session-setup#creating-a-session>
200+ /// See: [ https://agentclientprotocol.com/protocol/session-setup#creating-a-session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)
195201#[ derive( Debug , Clone , Serialize , Deserialize , JsonSchema ) ]
202+ #[ schemars( transform = crate :: schema_metadata:: add_group_session) ]
196203#[ serde( rename_all = "camelCase" ) ]
197204pub struct NewSessionResponse {
198205 /// Unique identifier for the created session.
@@ -206,8 +213,9 @@ pub struct NewSessionResponse {
206213///
207214/// Only available if the agent supports the `loadSession` capability.
208215///
209- /// See: < https://agentclientprotocol.com/protocol/session-setup#loading-sessions>
216+ /// See: [ https://agentclientprotocol.com/protocol/session-setup#loading-sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)
210217#[ derive( Debug , Clone , Serialize , Deserialize , JsonSchema ) ]
218+ #[ schemars( transform = crate :: schema_metadata:: add_group_session) ]
211219#[ serde( rename_all = "camelCase" ) ]
212220pub struct LoadSessionRequest {
213221 /// List of MCP servers to connect to for this session.
@@ -225,8 +233,9 @@ pub struct LoadSessionRequest {
225233/// MCP servers provide tools and context that the agent can use when
226234/// processing prompts.
227235///
228- /// See: < https://agentclientprotocol.com/protocol/session-setup#mcp-servers>
236+ /// See: [ https://agentclientprotocol.com/protocol/session-setup#mcp-servers](https://agentclientprotocol.com/protocol/session-setup#mcp-servers)
229237#[ derive( Debug , Clone , Serialize , Deserialize , JsonSchema ) ]
238+ #[ schemars( transform = crate :: schema_metadata:: add_group_mcp) ]
230239#[ serde( rename_all = "camelCase" ) ]
231240pub struct McpServer {
232241 /// Human-readable name identifying this MCP server.
@@ -241,6 +250,7 @@ pub struct McpServer {
241250
242251/// An environment variable to set when launching an MCP server.
243252#[ derive( Debug , Clone , Serialize , Deserialize , JsonSchema ) ]
253+ #[ schemars( transform = crate :: schema_metadata:: add_group_mcp) ]
244254#[ serde( rename_all = "camelCase" ) ]
245255pub struct EnvVariable {
246256 /// The name of the environment variable.
@@ -255,8 +265,9 @@ pub struct EnvVariable {
255265///
256266/// Contains the user's message and any additional context.
257267///
258- /// See: < https://agentclientprotocol.com/protocol/prompt-turn#1-user-message>
268+ /// See: [ https://agentclientprotocol.com/protocol/prompt-turn#1-user-message](https://agentclientprotocol.com/protocol/prompt-turn#1-user-message)
259269#[ derive( Debug , Clone , Serialize , Deserialize , JsonSchema ) ]
270+ #[ schemars( transform = crate :: schema_metadata:: add_group_session) ]
260271#[ serde( rename_all = "camelCase" ) ]
261272pub struct PromptRequest {
262273 /// The ID of the session to send this user message to
@@ -281,8 +292,9 @@ pub struct PromptRequest {
281292
282293/// Response from processing a user prompt.
283294///
284- /// See: < https://agentclientprotocol.com/protocol/prompt-turn#4-check-for-completion>
295+ /// See: [ https://agentclientprotocol.com/protocol/prompt-turn#4-check-for-completion](https://agentclientprotocol.com/protocol/prompt-turn#4-check-for-completion)
285296#[ derive( Debug , Clone , Serialize , Deserialize , JsonSchema ) ]
297+ #[ schemars( transform = crate :: schema_metadata:: add_group_session) ]
286298#[ serde( rename_all = "camelCase" ) ]
287299pub struct PromptResponse {
288300 /// Indicates why the agent stopped processing the turn.
@@ -291,8 +303,9 @@ pub struct PromptResponse {
291303
292304/// Reasons why an agent stops processing a prompt turn.
293305///
294- /// See: < https://agentclientprotocol.com/protocol/prompt-turn#stop-reasons>
306+ /// See: [ https://agentclientprotocol.com/protocol/prompt-turn#stop-reasons](https://agentclientprotocol.com/protocol/prompt-turn#stop-reasons)
295307#[ derive( Debug , Copy , Clone , Eq , PartialEq , Serialize , Deserialize , JsonSchema ) ]
308+ #[ schemars( transform = crate :: schema_metadata:: add_group_session) ]
296309#[ serde( rename_all = "snake_case" ) ]
297310pub enum StopReason {
298311 /// The turn ended successfully.
@@ -322,8 +335,9 @@ pub enum StopReason {
322335/// Advertised during initialization to inform the client about
323336/// available features and content types.
324337///
325- /// See: < https://agentclientprotocol.com/protocol/initialization#agent-capabilities>
338+ /// See: [ https://agentclientprotocol.com/protocol/initialization#agent-capabilities](https://agentclientprotocol.com/protocol/initialization#agent-capabilities)
326339#[ derive( Default , Debug , Clone , Serialize , Deserialize , JsonSchema ) ]
340+ #[ schemars( transform = crate :: schema_metadata:: add_group_initialization) ]
327341#[ serde( rename_all = "camelCase" ) ]
328342pub struct AgentCapabilities {
329343 /// Whether the agent supports `session/load`.
@@ -345,8 +359,9 @@ pub struct AgentCapabilities {
345359/// Indicates which content types beyond the baseline (text and resource links)
346360/// the agent can process.
347361///
348- /// See: < https://agentclientprotocol.com/protocol/initialization#prompt-capabilities>
362+ /// See: [ https://agentclientprotocol.com/protocol/initialization#prompt-capabilities](https://agentclientprotocol.com/protocol/initialization#prompt-capabilities)
349363#[ derive( Default , Debug , Clone , Copy , Serialize , Deserialize , JsonSchema ) ]
364+ #[ schemars( transform = crate :: schema_metadata:: add_group_initialization) ]
350365#[ serde( rename_all = "camelCase" ) ]
351366pub struct PromptCapabilities {
352367 /// Agent supports [`ContentBlock::Image`].
@@ -414,6 +429,7 @@ pub(crate) const SESSION_CANCEL_METHOD_NAME: &str = "session/cancel";
414429///
415430/// This enum encompasses all method calls from client to agent.
416431#[ derive( Clone , Debug , Serialize , Deserialize , JsonSchema ) ]
432+ #[ schemars( transform = crate :: schema_metadata:: add_group_message_types) ]
417433#[ serde( untagged) ]
418434pub enum ClientRequest {
419435 InitializeRequest ( InitializeRequest ) ,
@@ -430,6 +446,7 @@ pub enum ClientRequest {
430446///
431447/// These are responses to the corresponding ClientRequest variants.
432448#[ derive( Clone , Debug , Serialize , Deserialize , JsonSchema ) ]
449+ #[ schemars( transform = crate :: schema_metadata:: add_group_message_types) ]
433450#[ serde( untagged) ]
434451pub enum AgentResponse {
435452 InitializeResponse ( InitializeResponse ) ,
@@ -446,15 +463,17 @@ pub enum AgentResponse {
446463///
447464/// Notifications do not expect a response.
448465#[ derive( Clone , Debug , Serialize , Deserialize , JsonSchema ) ]
466+ #[ schemars( transform = crate :: schema_metadata:: add_group_message_types) ]
449467#[ serde( untagged) ]
450468pub enum ClientNotification {
451469 CancelNotification ( CancelNotification ) ,
452470}
453471
454472/// Notification to cancel ongoing operations for a session.
455473///
456- /// See: < https://agentclientprotocol.com/protocol/prompt-turn#cancellation>
474+ /// See: [ https://agentclientprotocol.com/protocol/prompt-turn#cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)
457475#[ derive( Debug , Clone , Serialize , Deserialize , JsonSchema ) ]
476+ #[ schemars( transform = crate :: schema_metadata:: add_group_session) ]
458477#[ serde( rename_all = "camelCase" ) ]
459478pub struct CancelNotification {
460479 /// The ID of the session to cancel operations for.
0 commit comments