rust_mcp_schema/generated_schema/2025_06_18/
mcp_schema.rs

1/// ----------------------------------------------------------------------------
2/// This file is auto-generated by mcp-schema-gen v0.4.4.
3/// WARNING:
4/// It is not recommended to modify this file directly. You are free to
5/// modify or extend the implementations as needed, but please do so at your own risk.
6///
7/// Generated from : <https://github.com/modelcontextprotocol/specification.git>
8/// Hash : 71204c22f8e062795dca00a87d31070033572ba2
9/// Generated at : 2025-10-03 15:17:04
10/// ----------------------------------------------------------------------------
11///
12use super::validators as validate;
13/// MCP Protocol Version
14pub const LATEST_PROTOCOL_VERSION: &str = "2025-06-18";
15/// JSON-RPC Version
16pub const JSONRPC_VERSION: &str = "2.0";
17/// Parse error. Invalid JSON was received. An error occurred while parsing the JSON text.
18pub const PARSE_ERROR: i64 = -32700i64;
19/// Invalid Request. The JSON sent is not a valid Request object.
20pub const INVALID_REQUEST: i64 = -32600i64;
21/// Method not found. The method does not exist / is not available.
22pub const METHOD_NOT_FOUND: i64 = -32601i64;
23/// Invalid param. Invalid method parameter(s).
24pub const INVALID_PARAMS: i64 = -32602i64;
25/// Internal error. Internal JSON-RPC error.
26pub const INTERNAL_ERROR: i64 = -32603i64;
27///Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
28///
29/// <details><summary>JSON schema</summary>
30///
31/// ```json
32///{
33///  "description": "Optional annotations for the client. The client can use annotations to inform how objects are used or displayed",
34///  "type": "object",
35///  "properties": {
36///    "audience": {
37///      "description": "Describes who the intended customer of this object or data is.\n\nIt can include multiple entries to indicate content useful for multiple audiences (e.g., [\"user\", \"assistant\"]).",
38///      "type": "array",
39///      "items": {
40///        "$ref": "#/definitions/Role"
41///      }
42///    },
43///    "lastModified": {
44///      "description": "The moment the resource was last modified, as an ISO 8601 formatted string.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").\n\nExamples: last activity timestamp in an open file, timestamp when the resource\nwas attached, etc.",
45///      "type": "string"
46///    },
47///    "priority": {
48///      "description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
49///      "type": "number",
50///      "maximum": 1.0,
51///      "minimum": 0.0
52///    }
53///  }
54///}
55/// ```
56/// </details>
57#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
58pub struct Annotations {
59    /**Describes who the intended customer of this object or data is.
60    It can include multiple entries to indicate content useful for multiple audiences (e.g., ["user", "assistant"]).*/
61    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
62    pub audience: ::std::vec::Vec<Role>,
63    /**The moment the resource was last modified, as an ISO 8601 formatted string.
64    Should be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z").
65    Examples: last activity timestamp in an open file, timestamp when the resource
66    was attached, etc.*/
67    #[serde(rename = "lastModified", default, skip_serializing_if = "::std::option::Option::is_none")]
68    pub last_modified: ::std::option::Option<::std::string::String>,
69    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
70    pub priority: ::std::option::Option<f64>,
71}
72///Audio provided to or from an LLM.
73///
74/// <details><summary>JSON schema</summary>
75///
76/// ```json
77///{
78///  "description": "Audio provided to or from an LLM.",
79///  "type": "object",
80///  "required": [
81///    "data",
82///    "mimeType",
83///    "type"
84///  ],
85///  "properties": {
86///    "_meta": {
87///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
88///      "type": "object",
89///      "additionalProperties": {}
90///    },
91///    "annotations": {
92///      "description": "Optional annotations for the client.",
93///      "$ref": "#/definitions/Annotations"
94///    },
95///    "data": {
96///      "description": "The base64-encoded audio data.",
97///      "type": "string",
98///      "format": "byte"
99///    },
100///    "mimeType": {
101///      "description": "The MIME type of the audio. Different providers may support different audio types.",
102///      "type": "string"
103///    },
104///    "type": {
105///      "type": "string",
106///      "const": "audio"
107///    }
108///  }
109///}
110/// ```
111/// </details>
112#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
113pub struct AudioContent {
114    ///Optional annotations for the client.
115    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
116    pub annotations: ::std::option::Option<Annotations>,
117    ///The base64-encoded audio data.
118    pub data: ::std::string::String,
119    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
120    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
121    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
122    ///The MIME type of the audio. Different providers may support different audio types.
123    #[serde(rename = "mimeType")]
124    pub mime_type: ::std::string::String,
125    #[serde(rename = "type", deserialize_with = "validate::audio_content_type_")]
126    type_: ::std::string::String,
127}
128impl AudioContent {
129    pub fn new(
130        data: ::std::string::String,
131        mime_type: ::std::string::String,
132        annotations: ::std::option::Option<Annotations>,
133        meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
134    ) -> Self {
135        Self {
136            annotations,
137            data,
138            meta,
139            mime_type,
140            type_: "audio".to_string(),
141        }
142    }
143    pub fn type_(&self) -> &::std::string::String {
144        &self.type_
145    }
146    pub fn type_name() -> ::std::string::String {
147        "audio".to_string()
148    }
149}
150///Base interface for metadata with name (identifier) and title (display name) properties.
151///
152/// <details><summary>JSON schema</summary>
153///
154/// ```json
155///{
156///  "description": "Base interface for metadata with name (identifier) and title (display name) properties.",
157///  "type": "object",
158///  "required": [
159///    "name"
160///  ],
161///  "properties": {
162///    "name": {
163///      "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
164///      "type": "string"
165///    },
166///    "title": {
167///      "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
168///      "type": "string"
169///    }
170///  }
171///}
172/// ```
173/// </details>
174#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
175pub struct BaseMetadata {
176    ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
177    pub name: ::std::string::String,
178    /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
179    even by those unfamiliar with domain-specific terminology.
180    If not provided, the name should be used for display (except for Tool,
181    where annotations.title should be given precedence over using name,
182    if present).*/
183    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
184    pub title: ::std::option::Option<::std::string::String>,
185}
186///BlobResourceContents
187///
188/// <details><summary>JSON schema</summary>
189///
190/// ```json
191///{
192///  "type": "object",
193///  "required": [
194///    "blob",
195///    "uri"
196///  ],
197///  "properties": {
198///    "_meta": {
199///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
200///      "type": "object",
201///      "additionalProperties": {}
202///    },
203///    "blob": {
204///      "description": "A base64-encoded string representing the binary data of the item.",
205///      "type": "string",
206///      "format": "byte"
207///    },
208///    "mimeType": {
209///      "description": "The MIME type of this resource, if known.",
210///      "type": "string"
211///    },
212///    "uri": {
213///      "description": "The URI of this resource.",
214///      "type": "string",
215///      "format": "uri"
216///    }
217///  }
218///}
219/// ```
220/// </details>
221#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
222pub struct BlobResourceContents {
223    ///A base64-encoded string representing the binary data of the item.
224    pub blob: ::std::string::String,
225    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
226    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
227    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
228    ///The MIME type of this resource, if known.
229    #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
230    pub mime_type: ::std::option::Option<::std::string::String>,
231    ///The URI of this resource.
232    pub uri: ::std::string::String,
233}
234///BooleanSchema
235///
236/// <details><summary>JSON schema</summary>
237///
238/// ```json
239///{
240///  "type": "object",
241///  "required": [
242///    "type"
243///  ],
244///  "properties": {
245///    "default": {
246///      "type": "boolean"
247///    },
248///    "description": {
249///      "type": "string"
250///    },
251///    "title": {
252///      "type": "string"
253///    },
254///    "type": {
255///      "type": "string",
256///      "const": "boolean"
257///    }
258///  }
259///}
260/// ```
261/// </details>
262#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
263pub struct BooleanSchema {
264    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
265    pub default: ::std::option::Option<bool>,
266    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
267    pub description: ::std::option::Option<::std::string::String>,
268    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
269    pub title: ::std::option::Option<::std::string::String>,
270    #[serde(rename = "type", deserialize_with = "validate::boolean_schema_type_")]
271    type_: ::std::string::String,
272}
273impl BooleanSchema {
274    pub fn new(
275        default: ::std::option::Option<bool>,
276        description: ::std::option::Option<::std::string::String>,
277        title: ::std::option::Option<::std::string::String>,
278    ) -> Self {
279        Self {
280            default,
281            description,
282            title,
283            type_: "boolean".to_string(),
284        }
285    }
286    pub fn type_(&self) -> &::std::string::String {
287        &self.type_
288    }
289    pub fn type_name() -> ::std::string::String {
290        "boolean".to_string()
291    }
292}
293///Used by the client to invoke a tool provided by the server.
294///
295/// <details><summary>JSON schema</summary>
296///
297/// ```json
298///{
299///  "description": "Used by the client to invoke a tool provided by the server.",
300///  "type": "object",
301///  "required": [
302///    "method",
303///    "params"
304///  ],
305///  "properties": {
306///    "method": {
307///      "type": "string",
308///      "const": "tools/call"
309///    },
310///    "params": {
311///      "type": "object",
312///      "required": [
313///        "name"
314///      ],
315///      "properties": {
316///        "arguments": {
317///          "type": "object",
318///          "additionalProperties": {}
319///        },
320///        "name": {
321///          "type": "string"
322///        }
323///      }
324///    }
325///  }
326///}
327/// ```
328/// </details>
329#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
330pub struct CallToolRequest {
331    #[serde(deserialize_with = "validate::call_tool_request_method")]
332    method: ::std::string::String,
333    pub params: CallToolRequestParams,
334}
335impl CallToolRequest {
336    pub fn new(params: CallToolRequestParams) -> Self {
337        Self {
338            method: "tools/call".to_string(),
339            params,
340        }
341    }
342    pub fn method(&self) -> &::std::string::String {
343        &self.method
344    }
345    pub fn method_name() -> ::std::string::String {
346        "tools/call".to_string()
347    }
348}
349///CallToolRequestParams
350///
351/// <details><summary>JSON schema</summary>
352///
353/// ```json
354///{
355///  "type": "object",
356///  "required": [
357///    "name"
358///  ],
359///  "properties": {
360///    "arguments": {
361///      "type": "object",
362///      "additionalProperties": {}
363///    },
364///    "name": {
365///      "type": "string"
366///    }
367///  }
368///}
369/// ```
370/// </details>
371#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
372pub struct CallToolRequestParams {
373    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
374    pub arguments: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
375    pub name: ::std::string::String,
376}
377///The server's response to a tool call.
378///
379/// <details><summary>JSON schema</summary>
380///
381/// ```json
382///{
383///  "description": "The server's response to a tool call.",
384///  "type": "object",
385///  "required": [
386///    "content"
387///  ],
388///  "properties": {
389///    "_meta": {
390///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
391///      "type": "object",
392///      "additionalProperties": {}
393///    },
394///    "content": {
395///      "description": "A list of content objects that represent the unstructured result of the tool call.",
396///      "type": "array",
397///      "items": {
398///        "$ref": "#/definitions/ContentBlock"
399///      }
400///    },
401///    "isError": {
402///      "description": "Whether the tool call ended in an error.\n\nIf not set, this is assumed to be false (the call was successful).\n\nAny errors that originate from the tool SHOULD be reported inside the result\nobject, with isError set to true, _not_ as an MCP protocol-level error\nresponse. Otherwise, the LLM would not be able to see that an error occurred\nand self-correct.\n\nHowever, any errors in _finding_ the tool, an error indicating that the\nserver does not support tool calls, or any other exceptional conditions,\nshould be reported as an MCP error response.",
403///      "type": "boolean"
404///    },
405///    "structuredContent": {
406///      "description": "An optional JSON object that represents the structured result of the tool call.",
407///      "type": "object",
408///      "additionalProperties": {}
409///    }
410///  }
411///}
412/// ```
413/// </details>
414#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
415pub struct CallToolResult {
416    ///A list of content objects that represent the unstructured result of the tool call.
417    pub content: ::std::vec::Vec<ContentBlock>,
418    /**Whether the tool call ended in an error.
419    If not set, this is assumed to be false (the call was successful).
420    Any errors that originate from the tool SHOULD be reported inside the result
421    object, with isError set to true, _not_ as an MCP protocol-level error
422    response. Otherwise, the LLM would not be able to see that an error occurred
423    and self-correct.
424    However, any errors in _finding_ the tool, an error indicating that the
425    server does not support tool calls, or any other exceptional conditions,
426    should be reported as an MCP error response.*/
427    #[serde(rename = "isError", default, skip_serializing_if = "::std::option::Option::is_none")]
428    pub is_error: ::std::option::Option<bool>,
429    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
430    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
431    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
432    ///An optional JSON object that represents the structured result of the tool call.
433    #[serde(
434        rename = "structuredContent",
435        default,
436        skip_serializing_if = "::std::option::Option::is_none"
437    )]
438    pub structured_content: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
439}
440/**This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
441The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.
442This notification indicates that the result will be unused, so any associated processing SHOULD cease.
443A client MUST NOT attempt to cancel its initialize request.*/
444///
445/// <details><summary>JSON schema</summary>
446///
447/// ```json
448///{
449///  "description": "This notification can be sent by either side to indicate that it is cancelling a previously-issued request.\n\nThe request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.\n\nThis notification indicates that the result will be unused, so any associated processing SHOULD cease.\n\nA client MUST NOT attempt to cancel its initialize request.",
450///  "type": "object",
451///  "required": [
452///    "method",
453///    "params"
454///  ],
455///  "properties": {
456///    "method": {
457///      "type": "string",
458///      "const": "notifications/cancelled"
459///    },
460///    "params": {
461///      "type": "object",
462///      "required": [
463///        "requestId"
464///      ],
465///      "properties": {
466///        "reason": {
467///          "description": "An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.",
468///          "type": "string"
469///        },
470///        "requestId": {
471///          "description": "The ID of the request to cancel.\n\nThis MUST correspond to the ID of a request previously issued in the same direction.",
472///          "$ref": "#/definitions/RequestId"
473///        }
474///      }
475///    }
476///  }
477///}
478/// ```
479/// </details>
480#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
481pub struct CancelledNotification {
482    #[serde(deserialize_with = "validate::cancelled_notification_method")]
483    method: ::std::string::String,
484    pub params: CancelledNotificationParams,
485}
486impl CancelledNotification {
487    pub fn new(params: CancelledNotificationParams) -> Self {
488        Self {
489            method: "notifications/cancelled".to_string(),
490            params,
491        }
492    }
493    pub fn method(&self) -> &::std::string::String {
494        &self.method
495    }
496    pub fn method_name() -> ::std::string::String {
497        "notifications/cancelled".to_string()
498    }
499}
500///CancelledNotificationParams
501///
502/// <details><summary>JSON schema</summary>
503///
504/// ```json
505///{
506///  "type": "object",
507///  "required": [
508///    "requestId"
509///  ],
510///  "properties": {
511///    "reason": {
512///      "description": "An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.",
513///      "type": "string"
514///    },
515///    "requestId": {
516///      "description": "The ID of the request to cancel.\n\nThis MUST correspond to the ID of a request previously issued in the same direction.",
517///      "$ref": "#/definitions/RequestId"
518///    }
519///  }
520///}
521/// ```
522/// </details>
523#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
524pub struct CancelledNotificationParams {
525    ///An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
526    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
527    pub reason: ::std::option::Option<::std::string::String>,
528    /**The ID of the request to cancel.
529    This MUST correspond to the ID of a request previously issued in the same direction.*/
530    #[serde(rename = "requestId")]
531    pub request_id: RequestId,
532}
533///Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.
534///
535/// <details><summary>JSON schema</summary>
536///
537/// ```json
538///{
539///  "description": "Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.",
540///  "type": "object",
541///  "properties": {
542///    "elicitation": {
543///      "description": "Present if the client supports elicitation from the server.",
544///      "type": "object",
545///      "additionalProperties": true
546///    },
547///    "experimental": {
548///      "description": "Experimental, non-standard capabilities that the client supports.",
549///      "type": "object",
550///      "additionalProperties": {
551///        "type": "object",
552///        "additionalProperties": true
553///      }
554///    },
555///    "roots": {
556///      "description": "Present if the client supports listing roots.",
557///      "type": "object",
558///      "properties": {
559///        "listChanged": {
560///          "description": "Whether the client supports notifications for changes to the roots list.",
561///          "type": "boolean"
562///        }
563///      }
564///    },
565///    "sampling": {
566///      "description": "Present if the client supports sampling from an LLM.",
567///      "type": "object",
568///      "additionalProperties": true
569///    }
570///  }
571///}
572/// ```
573/// </details>
574#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
575pub struct ClientCapabilities {
576    ///Present if the client supports elicitation from the server.
577    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
578    pub elicitation: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
579    ///Experimental, non-standard capabilities that the client supports.
580    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
581    pub experimental: ::std::option::Option<
582        ::std::collections::HashMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
583    >,
584    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
585    pub roots: ::std::option::Option<ClientCapabilitiesRoots>,
586    ///Present if the client supports sampling from an LLM.
587    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
588    pub sampling: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
589}
590///Present if the client supports listing roots.
591///
592/// <details><summary>JSON schema</summary>
593///
594/// ```json
595///{
596///  "description": "Present if the client supports listing roots.",
597///  "type": "object",
598///  "properties": {
599///    "listChanged": {
600///      "description": "Whether the client supports notifications for changes to the roots list.",
601///      "type": "boolean"
602///    }
603///  }
604///}
605/// ```
606/// </details>
607#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
608pub struct ClientCapabilitiesRoots {
609    ///Whether the client supports notifications for changes to the roots list.
610    #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
611    pub list_changed: ::std::option::Option<bool>,
612}
613///ClientNotification
614///
615/// <details><summary>JSON schema</summary>
616///
617/// ```json
618///{
619///  "anyOf": [
620///    {
621///      "$ref": "#/definitions/CancelledNotification"
622///    },
623///    {
624///      "$ref": "#/definitions/InitializedNotification"
625///    },
626///    {
627///      "$ref": "#/definitions/ProgressNotification"
628///    },
629///    {
630///      "$ref": "#/definitions/RootsListChangedNotification"
631///    }
632///  ]
633///}
634/// ```
635/// </details>
636#[derive(::serde::Serialize, Clone, Debug)]
637#[serde(untagged)]
638pub enum ClientNotification {
639    CancelledNotification(CancelledNotification),
640    InitializedNotification(InitializedNotification),
641    ProgressNotification(ProgressNotification),
642    RootsListChangedNotification(RootsListChangedNotification),
643}
644impl ::std::convert::From<CancelledNotification> for ClientNotification {
645    fn from(value: CancelledNotification) -> Self {
646        Self::CancelledNotification(value)
647    }
648}
649impl ::std::convert::From<InitializedNotification> for ClientNotification {
650    fn from(value: InitializedNotification) -> Self {
651        Self::InitializedNotification(value)
652    }
653}
654impl ::std::convert::From<ProgressNotification> for ClientNotification {
655    fn from(value: ProgressNotification) -> Self {
656        Self::ProgressNotification(value)
657    }
658}
659impl ::std::convert::From<RootsListChangedNotification> for ClientNotification {
660    fn from(value: RootsListChangedNotification) -> Self {
661        Self::RootsListChangedNotification(value)
662    }
663}
664///ClientRequest
665///
666/// <details><summary>JSON schema</summary>
667///
668/// ```json
669///{
670///  "anyOf": [
671///    {
672///      "$ref": "#/definitions/InitializeRequest"
673///    },
674///    {
675///      "$ref": "#/definitions/PingRequest"
676///    },
677///    {
678///      "$ref": "#/definitions/ListResourcesRequest"
679///    },
680///    {
681///      "$ref": "#/definitions/ListResourceTemplatesRequest"
682///    },
683///    {
684///      "$ref": "#/definitions/ReadResourceRequest"
685///    },
686///    {
687///      "$ref": "#/definitions/SubscribeRequest"
688///    },
689///    {
690///      "$ref": "#/definitions/UnsubscribeRequest"
691///    },
692///    {
693///      "$ref": "#/definitions/ListPromptsRequest"
694///    },
695///    {
696///      "$ref": "#/definitions/GetPromptRequest"
697///    },
698///    {
699///      "$ref": "#/definitions/ListToolsRequest"
700///    },
701///    {
702///      "$ref": "#/definitions/CallToolRequest"
703///    },
704///    {
705///      "$ref": "#/definitions/SetLevelRequest"
706///    },
707///    {
708///      "$ref": "#/definitions/CompleteRequest"
709///    }
710///  ]
711///}
712/// ```
713/// </details>
714#[derive(::serde::Serialize, Clone, Debug)]
715#[serde(untagged)]
716pub enum ClientRequest {
717    InitializeRequest(InitializeRequest),
718    PingRequest(PingRequest),
719    ListResourcesRequest(ListResourcesRequest),
720    ListResourceTemplatesRequest(ListResourceTemplatesRequest),
721    ReadResourceRequest(ReadResourceRequest),
722    SubscribeRequest(SubscribeRequest),
723    UnsubscribeRequest(UnsubscribeRequest),
724    ListPromptsRequest(ListPromptsRequest),
725    GetPromptRequest(GetPromptRequest),
726    ListToolsRequest(ListToolsRequest),
727    CallToolRequest(CallToolRequest),
728    SetLevelRequest(SetLevelRequest),
729    CompleteRequest(CompleteRequest),
730}
731impl ::std::convert::From<InitializeRequest> for ClientRequest {
732    fn from(value: InitializeRequest) -> Self {
733        Self::InitializeRequest(value)
734    }
735}
736impl ::std::convert::From<PingRequest> for ClientRequest {
737    fn from(value: PingRequest) -> Self {
738        Self::PingRequest(value)
739    }
740}
741impl ::std::convert::From<ListResourcesRequest> for ClientRequest {
742    fn from(value: ListResourcesRequest) -> Self {
743        Self::ListResourcesRequest(value)
744    }
745}
746impl ::std::convert::From<ListResourceTemplatesRequest> for ClientRequest {
747    fn from(value: ListResourceTemplatesRequest) -> Self {
748        Self::ListResourceTemplatesRequest(value)
749    }
750}
751impl ::std::convert::From<ReadResourceRequest> for ClientRequest {
752    fn from(value: ReadResourceRequest) -> Self {
753        Self::ReadResourceRequest(value)
754    }
755}
756impl ::std::convert::From<SubscribeRequest> for ClientRequest {
757    fn from(value: SubscribeRequest) -> Self {
758        Self::SubscribeRequest(value)
759    }
760}
761impl ::std::convert::From<UnsubscribeRequest> for ClientRequest {
762    fn from(value: UnsubscribeRequest) -> Self {
763        Self::UnsubscribeRequest(value)
764    }
765}
766impl ::std::convert::From<ListPromptsRequest> for ClientRequest {
767    fn from(value: ListPromptsRequest) -> Self {
768        Self::ListPromptsRequest(value)
769    }
770}
771impl ::std::convert::From<GetPromptRequest> for ClientRequest {
772    fn from(value: GetPromptRequest) -> Self {
773        Self::GetPromptRequest(value)
774    }
775}
776impl ::std::convert::From<ListToolsRequest> for ClientRequest {
777    fn from(value: ListToolsRequest) -> Self {
778        Self::ListToolsRequest(value)
779    }
780}
781impl ::std::convert::From<CallToolRequest> for ClientRequest {
782    fn from(value: CallToolRequest) -> Self {
783        Self::CallToolRequest(value)
784    }
785}
786impl ::std::convert::From<SetLevelRequest> for ClientRequest {
787    fn from(value: SetLevelRequest) -> Self {
788        Self::SetLevelRequest(value)
789    }
790}
791impl ::std::convert::From<CompleteRequest> for ClientRequest {
792    fn from(value: CompleteRequest) -> Self {
793        Self::CompleteRequest(value)
794    }
795}
796///ClientResult
797///
798/// <details><summary>JSON schema</summary>
799///
800/// ```json
801///{
802///  "anyOf": [
803///    {
804///      "$ref": "#/definitions/Result"
805///    },
806///    {
807///      "$ref": "#/definitions/CreateMessageResult"
808///    },
809///    {
810///      "$ref": "#/definitions/ListRootsResult"
811///    },
812///    {
813///      "$ref": "#/definitions/ElicitResult"
814///    }
815///  ]
816///}
817/// ```
818/// </details>
819#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
820#[serde(untagged)]
821pub enum ClientResult {
822    CreateMessageResult(CreateMessageResult),
823    ListRootsResult(ListRootsResult),
824    ElicitResult(ElicitResult),
825    Result(Result),
826}
827impl ::std::convert::From<CreateMessageResult> for ClientResult {
828    fn from(value: CreateMessageResult) -> Self {
829        Self::CreateMessageResult(value)
830    }
831}
832impl ::std::convert::From<ListRootsResult> for ClientResult {
833    fn from(value: ListRootsResult) -> Self {
834        Self::ListRootsResult(value)
835    }
836}
837impl ::std::convert::From<ElicitResult> for ClientResult {
838    fn from(value: ElicitResult) -> Self {
839        Self::ElicitResult(value)
840    }
841}
842impl ::std::convert::From<Result> for ClientResult {
843    fn from(value: Result) -> Self {
844        Self::Result(value)
845    }
846}
847///A request from the client to the server, to ask for completion options.
848///
849/// <details><summary>JSON schema</summary>
850///
851/// ```json
852///{
853///  "description": "A request from the client to the server, to ask for completion options.",
854///  "type": "object",
855///  "required": [
856///    "method",
857///    "params"
858///  ],
859///  "properties": {
860///    "method": {
861///      "type": "string",
862///      "const": "completion/complete"
863///    },
864///    "params": {
865///      "type": "object",
866///      "required": [
867///        "argument",
868///        "ref"
869///      ],
870///      "properties": {
871///        "argument": {
872///          "description": "The argument's information",
873///          "type": "object",
874///          "required": [
875///            "name",
876///            "value"
877///          ],
878///          "properties": {
879///            "name": {
880///              "description": "The name of the argument",
881///              "type": "string"
882///            },
883///            "value": {
884///              "description": "The value of the argument to use for completion matching.",
885///              "type": "string"
886///            }
887///          }
888///        },
889///        "context": {
890///          "description": "Additional, optional context for completions",
891///          "type": "object",
892///          "properties": {
893///            "arguments": {
894///              "description": "Previously-resolved variables in a URI template or prompt.",
895///              "type": "object",
896///              "additionalProperties": {
897///                "type": "string"
898///              }
899///            }
900///          }
901///        },
902///        "ref": {
903///          "anyOf": [
904///            {
905///              "$ref": "#/definitions/PromptReference"
906///            },
907///            {
908///              "$ref": "#/definitions/ResourceTemplateReference"
909///            }
910///          ]
911///        }
912///      }
913///    }
914///  }
915///}
916/// ```
917/// </details>
918#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
919pub struct CompleteRequest {
920    #[serde(deserialize_with = "validate::complete_request_method")]
921    method: ::std::string::String,
922    pub params: CompleteRequestParams,
923}
924impl CompleteRequest {
925    pub fn new(params: CompleteRequestParams) -> Self {
926        Self {
927            method: "completion/complete".to_string(),
928            params,
929        }
930    }
931    pub fn method(&self) -> &::std::string::String {
932        &self.method
933    }
934    pub fn method_name() -> ::std::string::String {
935        "completion/complete".to_string()
936    }
937}
938///CompleteRequestParams
939///
940/// <details><summary>JSON schema</summary>
941///
942/// ```json
943///{
944///  "type": "object",
945///  "required": [
946///    "argument",
947///    "ref"
948///  ],
949///  "properties": {
950///    "argument": {
951///      "description": "The argument's information",
952///      "type": "object",
953///      "required": [
954///        "name",
955///        "value"
956///      ],
957///      "properties": {
958///        "name": {
959///          "description": "The name of the argument",
960///          "type": "string"
961///        },
962///        "value": {
963///          "description": "The value of the argument to use for completion matching.",
964///          "type": "string"
965///        }
966///      }
967///    },
968///    "context": {
969///      "description": "Additional, optional context for completions",
970///      "type": "object",
971///      "properties": {
972///        "arguments": {
973///          "description": "Previously-resolved variables in a URI template or prompt.",
974///          "type": "object",
975///          "additionalProperties": {
976///            "type": "string"
977///          }
978///        }
979///      }
980///    },
981///    "ref": {
982///      "anyOf": [
983///        {
984///          "$ref": "#/definitions/PromptReference"
985///        },
986///        {
987///          "$ref": "#/definitions/ResourceTemplateReference"
988///        }
989///      ]
990///    }
991///  }
992///}
993/// ```
994/// </details>
995#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
996pub struct CompleteRequestParams {
997    pub argument: CompleteRequestParamsArgument,
998    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
999    pub context: ::std::option::Option<CompleteRequestParamsContext>,
1000    #[serde(rename = "ref")]
1001    pub ref_: CompleteRequestParamsRef,
1002}
1003///The argument's information
1004///
1005/// <details><summary>JSON schema</summary>
1006///
1007/// ```json
1008///{
1009///  "description": "The argument's information",
1010///  "type": "object",
1011///  "required": [
1012///    "name",
1013///    "value"
1014///  ],
1015///  "properties": {
1016///    "name": {
1017///      "description": "The name of the argument",
1018///      "type": "string"
1019///    },
1020///    "value": {
1021///      "description": "The value of the argument to use for completion matching.",
1022///      "type": "string"
1023///    }
1024///  }
1025///}
1026/// ```
1027/// </details>
1028#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1029pub struct CompleteRequestParamsArgument {
1030    ///The name of the argument
1031    pub name: ::std::string::String,
1032    ///The value of the argument to use for completion matching.
1033    pub value: ::std::string::String,
1034}
1035///Additional, optional context for completions
1036///
1037/// <details><summary>JSON schema</summary>
1038///
1039/// ```json
1040///{
1041///  "description": "Additional, optional context for completions",
1042///  "type": "object",
1043///  "properties": {
1044///    "arguments": {
1045///      "description": "Previously-resolved variables in a URI template or prompt.",
1046///      "type": "object",
1047///      "additionalProperties": {
1048///        "type": "string"
1049///      }
1050///    }
1051///  }
1052///}
1053/// ```
1054/// </details>
1055#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
1056pub struct CompleteRequestParamsContext {
1057    ///Previously-resolved variables in a URI template or prompt.
1058    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1059    pub arguments: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
1060}
1061///CompleteRequestParamsRef
1062///
1063/// <details><summary>JSON schema</summary>
1064///
1065/// ```json
1066///{
1067///  "anyOf": [
1068///    {
1069///      "$ref": "#/definitions/PromptReference"
1070///    },
1071///    {
1072///      "$ref": "#/definitions/ResourceTemplateReference"
1073///    }
1074///  ]
1075///}
1076/// ```
1077/// </details>
1078#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1079#[serde(untagged)]
1080pub enum CompleteRequestParamsRef {
1081    PromptReference(PromptReference),
1082    ResourceTemplateReference(ResourceTemplateReference),
1083}
1084impl ::std::convert::From<PromptReference> for CompleteRequestParamsRef {
1085    fn from(value: PromptReference) -> Self {
1086        Self::PromptReference(value)
1087    }
1088}
1089impl ::std::convert::From<ResourceTemplateReference> for CompleteRequestParamsRef {
1090    fn from(value: ResourceTemplateReference) -> Self {
1091        Self::ResourceTemplateReference(value)
1092    }
1093}
1094///The server's response to a completion/complete request
1095///
1096/// <details><summary>JSON schema</summary>
1097///
1098/// ```json
1099///{
1100///  "description": "The server's response to a completion/complete request",
1101///  "type": "object",
1102///  "required": [
1103///    "completion"
1104///  ],
1105///  "properties": {
1106///    "_meta": {
1107///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
1108///      "type": "object",
1109///      "additionalProperties": {}
1110///    },
1111///    "completion": {
1112///      "type": "object",
1113///      "required": [
1114///        "values"
1115///      ],
1116///      "properties": {
1117///        "hasMore": {
1118///          "description": "Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.",
1119///          "type": "boolean"
1120///        },
1121///        "total": {
1122///          "description": "The total number of completion options available. This can exceed the number of values actually sent in the response.",
1123///          "type": "integer"
1124///        },
1125///        "values": {
1126///          "description": "An array of completion values. Must not exceed 100 items.",
1127///          "type": "array",
1128///          "items": {
1129///            "type": "string"
1130///          }
1131///        }
1132///      }
1133///    }
1134///  }
1135///}
1136/// ```
1137/// </details>
1138#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1139pub struct CompleteResult {
1140    pub completion: CompleteResultCompletion,
1141    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
1142    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
1143    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1144}
1145///CompleteResultCompletion
1146///
1147/// <details><summary>JSON schema</summary>
1148///
1149/// ```json
1150///{
1151///  "type": "object",
1152///  "required": [
1153///    "values"
1154///  ],
1155///  "properties": {
1156///    "hasMore": {
1157///      "description": "Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.",
1158///      "type": "boolean"
1159///    },
1160///    "total": {
1161///      "description": "The total number of completion options available. This can exceed the number of values actually sent in the response.",
1162///      "type": "integer"
1163///    },
1164///    "values": {
1165///      "description": "An array of completion values. Must not exceed 100 items.",
1166///      "type": "array",
1167///      "items": {
1168///        "type": "string"
1169///      }
1170///    }
1171///  }
1172///}
1173/// ```
1174/// </details>
1175#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1176pub struct CompleteResultCompletion {
1177    ///Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
1178    #[serde(rename = "hasMore", default, skip_serializing_if = "::std::option::Option::is_none")]
1179    pub has_more: ::std::option::Option<bool>,
1180    ///The total number of completion options available. This can exceed the number of values actually sent in the response.
1181    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1182    pub total: ::std::option::Option<i64>,
1183    ///An array of completion values. Must not exceed 100 items.
1184    pub values: ::std::vec::Vec<::std::string::String>,
1185}
1186///ContentBlock
1187///
1188/// <details><summary>JSON schema</summary>
1189///
1190/// ```json
1191///{
1192///  "anyOf": [
1193///    {
1194///      "$ref": "#/definitions/TextContent"
1195///    },
1196///    {
1197///      "$ref": "#/definitions/ImageContent"
1198///    },
1199///    {
1200///      "$ref": "#/definitions/AudioContent"
1201///    },
1202///    {
1203///      "$ref": "#/definitions/ResourceLink"
1204///    },
1205///    {
1206///      "$ref": "#/definitions/EmbeddedResource"
1207///    }
1208///  ]
1209///}
1210/// ```
1211/// </details>
1212#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1213#[serde(untagged)]
1214pub enum ContentBlock {
1215    TextContent(TextContent),
1216    ImageContent(ImageContent),
1217    AudioContent(AudioContent),
1218    ResourceLink(ResourceLink),
1219    EmbeddedResource(EmbeddedResource),
1220}
1221impl ::std::convert::From<TextContent> for ContentBlock {
1222    fn from(value: TextContent) -> Self {
1223        Self::TextContent(value)
1224    }
1225}
1226impl ::std::convert::From<ImageContent> for ContentBlock {
1227    fn from(value: ImageContent) -> Self {
1228        Self::ImageContent(value)
1229    }
1230}
1231impl ::std::convert::From<AudioContent> for ContentBlock {
1232    fn from(value: AudioContent) -> Self {
1233        Self::AudioContent(value)
1234    }
1235}
1236impl ::std::convert::From<ResourceLink> for ContentBlock {
1237    fn from(value: ResourceLink) -> Self {
1238        Self::ResourceLink(value)
1239    }
1240}
1241impl ::std::convert::From<EmbeddedResource> for ContentBlock {
1242    fn from(value: EmbeddedResource) -> Self {
1243        Self::EmbeddedResource(value)
1244    }
1245}
1246///A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.
1247///
1248/// <details><summary>JSON schema</summary>
1249///
1250/// ```json
1251///{
1252///  "description": "A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.",
1253///  "type": "object",
1254///  "required": [
1255///    "method",
1256///    "params"
1257///  ],
1258///  "properties": {
1259///    "method": {
1260///      "type": "string",
1261///      "const": "sampling/createMessage"
1262///    },
1263///    "params": {
1264///      "type": "object",
1265///      "required": [
1266///        "maxTokens",
1267///        "messages"
1268///      ],
1269///      "properties": {
1270///        "includeContext": {
1271///          "description": "A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.",
1272///          "type": "string",
1273///          "enum": [
1274///            "allServers",
1275///            "none",
1276///            "thisServer"
1277///          ]
1278///        },
1279///        "maxTokens": {
1280///          "description": "The requested maximum number of tokens to sample (to prevent runaway completions).\n\nThe client MAY choose to sample fewer tokens than the requested maximum.",
1281///          "type": "integer"
1282///        },
1283///        "messages": {
1284///          "type": "array",
1285///          "items": {
1286///            "$ref": "#/definitions/SamplingMessage"
1287///          }
1288///        },
1289///        "metadata": {
1290///          "description": "Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.",
1291///          "type": "object",
1292///          "additionalProperties": true
1293///        },
1294///        "modelPreferences": {
1295///          "description": "The server's preferences for which model to select. The client MAY ignore these preferences.",
1296///          "$ref": "#/definitions/ModelPreferences"
1297///        },
1298///        "stopSequences": {
1299///          "type": "array",
1300///          "items": {
1301///            "type": "string"
1302///          }
1303///        },
1304///        "systemPrompt": {
1305///          "description": "An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.",
1306///          "type": "string"
1307///        },
1308///        "temperature": {
1309///          "type": "number"
1310///        }
1311///      }
1312///    }
1313///  }
1314///}
1315/// ```
1316/// </details>
1317#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1318pub struct CreateMessageRequest {
1319    #[serde(deserialize_with = "validate::create_message_request_method")]
1320    method: ::std::string::String,
1321    pub params: CreateMessageRequestParams,
1322}
1323impl CreateMessageRequest {
1324    pub fn new(params: CreateMessageRequestParams) -> Self {
1325        Self {
1326            method: "sampling/createMessage".to_string(),
1327            params,
1328        }
1329    }
1330    pub fn method(&self) -> &::std::string::String {
1331        &self.method
1332    }
1333    pub fn method_name() -> ::std::string::String {
1334        "sampling/createMessage".to_string()
1335    }
1336}
1337///CreateMessageRequestParams
1338///
1339/// <details><summary>JSON schema</summary>
1340///
1341/// ```json
1342///{
1343///  "type": "object",
1344///  "required": [
1345///    "maxTokens",
1346///    "messages"
1347///  ],
1348///  "properties": {
1349///    "includeContext": {
1350///      "description": "A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.",
1351///      "type": "string",
1352///      "enum": [
1353///        "allServers",
1354///        "none",
1355///        "thisServer"
1356///      ]
1357///    },
1358///    "maxTokens": {
1359///      "description": "The requested maximum number of tokens to sample (to prevent runaway completions).\n\nThe client MAY choose to sample fewer tokens than the requested maximum.",
1360///      "type": "integer"
1361///    },
1362///    "messages": {
1363///      "type": "array",
1364///      "items": {
1365///        "$ref": "#/definitions/SamplingMessage"
1366///      }
1367///    },
1368///    "metadata": {
1369///      "description": "Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.",
1370///      "type": "object",
1371///      "additionalProperties": true
1372///    },
1373///    "modelPreferences": {
1374///      "description": "The server's preferences for which model to select. The client MAY ignore these preferences.",
1375///      "$ref": "#/definitions/ModelPreferences"
1376///    },
1377///    "stopSequences": {
1378///      "type": "array",
1379///      "items": {
1380///        "type": "string"
1381///      }
1382///    },
1383///    "systemPrompt": {
1384///      "description": "An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.",
1385///      "type": "string"
1386///    },
1387///    "temperature": {
1388///      "type": "number"
1389///    }
1390///  }
1391///}
1392/// ```
1393/// </details>
1394#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1395pub struct CreateMessageRequestParams {
1396    ///A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.
1397    #[serde(rename = "includeContext", default, skip_serializing_if = "::std::option::Option::is_none")]
1398    pub include_context: ::std::option::Option<CreateMessageRequestParamsIncludeContext>,
1399    /**The requested maximum number of tokens to sample (to prevent runaway completions).
1400    The client MAY choose to sample fewer tokens than the requested maximum.*/
1401    #[serde(rename = "maxTokens")]
1402    pub max_tokens: i64,
1403    pub messages: ::std::vec::Vec<SamplingMessage>,
1404    ///Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
1405    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1406    pub metadata: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1407    ///The server's preferences for which model to select. The client MAY ignore these preferences.
1408    #[serde(
1409        rename = "modelPreferences",
1410        default,
1411        skip_serializing_if = "::std::option::Option::is_none"
1412    )]
1413    pub model_preferences: ::std::option::Option<ModelPreferences>,
1414    #[serde(rename = "stopSequences", default, skip_serializing_if = "::std::vec::Vec::is_empty")]
1415    pub stop_sequences: ::std::vec::Vec<::std::string::String>,
1416    ///An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
1417    #[serde(rename = "systemPrompt", default, skip_serializing_if = "::std::option::Option::is_none")]
1418    pub system_prompt: ::std::option::Option<::std::string::String>,
1419    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1420    pub temperature: ::std::option::Option<f64>,
1421}
1422///A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.
1423///
1424/// <details><summary>JSON schema</summary>
1425///
1426/// ```json
1427///{
1428///  "description": "A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.",
1429///  "type": "string",
1430///  "enum": [
1431///    "allServers",
1432///    "none",
1433///    "thisServer"
1434///  ]
1435///}
1436/// ```
1437/// </details>
1438#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1439pub enum CreateMessageRequestParamsIncludeContext {
1440    #[serde(rename = "allServers")]
1441    AllServers,
1442    #[serde(rename = "none")]
1443    None,
1444    #[serde(rename = "thisServer")]
1445    ThisServer,
1446}
1447impl ::std::fmt::Display for CreateMessageRequestParamsIncludeContext {
1448    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1449        match *self {
1450            Self::AllServers => write!(f, "allServers"),
1451            Self::None => write!(f, "none"),
1452            Self::ThisServer => write!(f, "thisServer"),
1453        }
1454    }
1455}
1456///The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.
1457///
1458/// <details><summary>JSON schema</summary>
1459///
1460/// ```json
1461///{
1462///  "description": "The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.",
1463///  "type": "object",
1464///  "required": [
1465///    "content",
1466///    "model",
1467///    "role"
1468///  ],
1469///  "properties": {
1470///    "_meta": {
1471///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
1472///      "type": "object",
1473///      "additionalProperties": {}
1474///    },
1475///    "content": {
1476///      "anyOf": [
1477///        {
1478///          "$ref": "#/definitions/TextContent"
1479///        },
1480///        {
1481///          "$ref": "#/definitions/ImageContent"
1482///        },
1483///        {
1484///          "$ref": "#/definitions/AudioContent"
1485///        }
1486///      ]
1487///    },
1488///    "model": {
1489///      "description": "The name of the model that generated the message.",
1490///      "type": "string"
1491///    },
1492///    "role": {
1493///      "$ref": "#/definitions/Role"
1494///    },
1495///    "stopReason": {
1496///      "description": "The reason why sampling stopped, if known.",
1497///      "type": "string"
1498///    }
1499///  }
1500///}
1501/// ```
1502/// </details>
1503#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1504pub struct CreateMessageResult {
1505    pub content: CreateMessageResultContent,
1506    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
1507    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
1508    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1509    ///The name of the model that generated the message.
1510    pub model: ::std::string::String,
1511    pub role: Role,
1512    ///The reason why sampling stopped, if known.
1513    #[serde(rename = "stopReason", default, skip_serializing_if = "::std::option::Option::is_none")]
1514    pub stop_reason: ::std::option::Option<::std::string::String>,
1515}
1516///CreateMessageResultContent
1517///
1518/// <details><summary>JSON schema</summary>
1519///
1520/// ```json
1521///{
1522///  "anyOf": [
1523///    {
1524///      "$ref": "#/definitions/TextContent"
1525///    },
1526///    {
1527///      "$ref": "#/definitions/ImageContent"
1528///    },
1529///    {
1530///      "$ref": "#/definitions/AudioContent"
1531///    }
1532///  ]
1533///}
1534/// ```
1535/// </details>
1536#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1537#[serde(untagged)]
1538pub enum CreateMessageResultContent {
1539    TextContent(TextContent),
1540    ImageContent(ImageContent),
1541    AudioContent(AudioContent),
1542}
1543impl ::std::convert::From<TextContent> for CreateMessageResultContent {
1544    fn from(value: TextContent) -> Self {
1545        Self::TextContent(value)
1546    }
1547}
1548impl ::std::convert::From<ImageContent> for CreateMessageResultContent {
1549    fn from(value: ImageContent) -> Self {
1550        Self::ImageContent(value)
1551    }
1552}
1553impl ::std::convert::From<AudioContent> for CreateMessageResultContent {
1554    fn from(value: AudioContent) -> Self {
1555        Self::AudioContent(value)
1556    }
1557}
1558///An opaque token used to represent a cursor for pagination.
1559///
1560/// <details><summary>JSON schema</summary>
1561///
1562/// ```json
1563///{
1564///  "description": "An opaque token used to represent a cursor for pagination.",
1565///  "type": "string"
1566///}
1567/// ```
1568/// </details>
1569#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1570#[serde(transparent)]
1571pub struct Cursor(pub ::std::string::String);
1572///A request from the server to elicit additional information from the user via the client.
1573///
1574/// <details><summary>JSON schema</summary>
1575///
1576/// ```json
1577///{
1578///  "description": "A request from the server to elicit additional information from the user via the client.",
1579///  "type": "object",
1580///  "required": [
1581///    "method",
1582///    "params"
1583///  ],
1584///  "properties": {
1585///    "method": {
1586///      "type": "string",
1587///      "const": "elicitation/create"
1588///    },
1589///    "params": {
1590///      "type": "object",
1591///      "required": [
1592///        "message",
1593///        "requestedSchema"
1594///      ],
1595///      "properties": {
1596///        "message": {
1597///          "description": "The message to present to the user.",
1598///          "type": "string"
1599///        },
1600///        "requestedSchema": {
1601///          "description": "A restricted subset of JSON Schema.\nOnly top-level properties are allowed, without nesting.",
1602///          "type": "object",
1603///          "required": [
1604///            "properties",
1605///            "type"
1606///          ],
1607///          "properties": {
1608///            "properties": {
1609///              "type": "object",
1610///              "additionalProperties": {
1611///                "$ref": "#/definitions/PrimitiveSchemaDefinition"
1612///              }
1613///            },
1614///            "required": {
1615///              "type": "array",
1616///              "items": {
1617///                "type": "string"
1618///              }
1619///            },
1620///            "type": {
1621///              "type": "string",
1622///              "const": "object"
1623///            }
1624///          }
1625///        }
1626///      }
1627///    }
1628///  }
1629///}
1630/// ```
1631/// </details>
1632#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1633pub struct ElicitRequest {
1634    #[serde(deserialize_with = "validate::elicit_request_method")]
1635    method: ::std::string::String,
1636    pub params: ElicitRequestParams,
1637}
1638impl ElicitRequest {
1639    pub fn new(params: ElicitRequestParams) -> Self {
1640        Self {
1641            method: "elicitation/create".to_string(),
1642            params,
1643        }
1644    }
1645    pub fn method(&self) -> &::std::string::String {
1646        &self.method
1647    }
1648    pub fn method_name() -> ::std::string::String {
1649        "elicitation/create".to_string()
1650    }
1651}
1652///ElicitRequestParams
1653///
1654/// <details><summary>JSON schema</summary>
1655///
1656/// ```json
1657///{
1658///  "type": "object",
1659///  "required": [
1660///    "message",
1661///    "requestedSchema"
1662///  ],
1663///  "properties": {
1664///    "message": {
1665///      "description": "The message to present to the user.",
1666///      "type": "string"
1667///    },
1668///    "requestedSchema": {
1669///      "description": "A restricted subset of JSON Schema.\nOnly top-level properties are allowed, without nesting.",
1670///      "type": "object",
1671///      "required": [
1672///        "properties",
1673///        "type"
1674///      ],
1675///      "properties": {
1676///        "properties": {
1677///          "type": "object",
1678///          "additionalProperties": {
1679///            "$ref": "#/definitions/PrimitiveSchemaDefinition"
1680///          }
1681///        },
1682///        "required": {
1683///          "type": "array",
1684///          "items": {
1685///            "type": "string"
1686///          }
1687///        },
1688///        "type": {
1689///          "type": "string",
1690///          "const": "object"
1691///        }
1692///      }
1693///    }
1694///  }
1695///}
1696/// ```
1697/// </details>
1698#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1699pub struct ElicitRequestParams {
1700    ///The message to present to the user.
1701    pub message: ::std::string::String,
1702    #[serde(rename = "requestedSchema")]
1703    pub requested_schema: ElicitRequestedSchema,
1704}
1705/**A restricted subset of JSON Schema.
1706Only top-level properties are allowed, without nesting.*/
1707///
1708/// <details><summary>JSON schema</summary>
1709///
1710/// ```json
1711///{
1712///  "description": "A restricted subset of JSON Schema.\nOnly top-level properties are allowed, without nesting.",
1713///  "type": "object",
1714///  "required": [
1715///    "properties",
1716///    "type"
1717///  ],
1718///  "properties": {
1719///    "properties": {
1720///      "type": "object",
1721///      "additionalProperties": {
1722///        "$ref": "#/definitions/PrimitiveSchemaDefinition"
1723///      }
1724///    },
1725///    "required": {
1726///      "type": "array",
1727///      "items": {
1728///        "type": "string"
1729///      }
1730///    },
1731///    "type": {
1732///      "type": "string",
1733///      "const": "object"
1734///    }
1735///  }
1736///}
1737/// ```
1738/// </details>
1739#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1740pub struct ElicitRequestedSchema {
1741    pub properties: ::std::collections::HashMap<::std::string::String, PrimitiveSchemaDefinition>,
1742    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
1743    pub required: ::std::vec::Vec<::std::string::String>,
1744    #[serde(rename = "type", deserialize_with = "validate::elicit_requested_schema_type_")]
1745    type_: ::std::string::String,
1746}
1747impl ElicitRequestedSchema {
1748    pub fn new(
1749        properties: ::std::collections::HashMap<::std::string::String, PrimitiveSchemaDefinition>,
1750        required: ::std::vec::Vec<::std::string::String>,
1751    ) -> Self {
1752        Self {
1753            properties,
1754            required,
1755            type_: "object".to_string(),
1756        }
1757    }
1758    pub fn type_(&self) -> &::std::string::String {
1759        &self.type_
1760    }
1761    pub fn type_name() -> ::std::string::String {
1762        "object".to_string()
1763    }
1764}
1765///The client's response to an elicitation request.
1766///
1767/// <details><summary>JSON schema</summary>
1768///
1769/// ```json
1770///{
1771///  "description": "The client's response to an elicitation request.",
1772///  "type": "object",
1773///  "required": [
1774///    "action"
1775///  ],
1776///  "properties": {
1777///    "_meta": {
1778///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
1779///      "type": "object",
1780///      "additionalProperties": {}
1781///    },
1782///    "action": {
1783///      "description": "The user action in response to the elicitation.\n- \"accept\": User submitted the form/confirmed the action\n- \"decline\": User explicitly declined the action\n- \"cancel\": User dismissed without making an explicit choice",
1784///      "type": "string",
1785///      "enum": [
1786///        "accept",
1787///        "cancel",
1788///        "decline"
1789///      ]
1790///    },
1791///    "content": {
1792///      "description": "The submitted form data, only present when action is \"accept\".\nContains values matching the requested schema.",
1793///      "type": "object",
1794///      "additionalProperties": {
1795///        "type": [
1796///          "string",
1797///          "integer",
1798///          "boolean"
1799///        ]
1800///      }
1801///    }
1802///  }
1803///}
1804/// ```
1805/// </details>
1806#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1807pub struct ElicitResult {
1808    /**The user action in response to the elicitation.
1809    - "accept": User submitted the form/confirmed the action
1810    - "decline": User explicitly declined the action
1811    - "cancel": User dismissed without making an explicit choice*/
1812    pub action: ElicitResultAction,
1813    /**The submitted form data, only present when action is "accept".
1814    Contains values matching the requested schema.*/
1815    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1816    pub content: ::std::option::Option<::std::collections::HashMap<::std::string::String, ElicitResultContentValue>>,
1817    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
1818    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
1819    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1820}
1821/**The user action in response to the elicitation.
1822- "accept": User submitted the form/confirmed the action
1823- "decline": User explicitly declined the action
1824- "cancel": User dismissed without making an explicit choice*/
1825///
1826/// <details><summary>JSON schema</summary>
1827///
1828/// ```json
1829///{
1830///  "description": "The user action in response to the elicitation.\n- \"accept\": User submitted the form/confirmed the action\n- \"decline\": User explicitly declined the action\n- \"cancel\": User dismissed without making an explicit choice",
1831///  "type": "string",
1832///  "enum": [
1833///    "accept",
1834///    "cancel",
1835///    "decline"
1836///  ]
1837///}
1838/// ```
1839/// </details>
1840#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1841pub enum ElicitResultAction {
1842    #[serde(rename = "accept")]
1843    Accept,
1844    #[serde(rename = "cancel")]
1845    Cancel,
1846    #[serde(rename = "decline")]
1847    Decline,
1848}
1849impl ::std::fmt::Display for ElicitResultAction {
1850    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1851        match *self {
1852            Self::Accept => write!(f, "accept"),
1853            Self::Cancel => write!(f, "cancel"),
1854            Self::Decline => write!(f, "decline"),
1855        }
1856    }
1857}
1858///ElicitResultContentValue
1859///
1860/// <details><summary>JSON schema</summary>
1861///
1862/// ```json
1863///{
1864///  "type": [
1865///    "string",
1866///    "integer",
1867///    "boolean"
1868///  ]
1869///}
1870/// ```
1871/// </details>
1872#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1873#[serde(untagged)]
1874pub enum ElicitResultContentValue {
1875    Boolean(bool),
1876    String(::std::string::String),
1877    Integer(i64),
1878}
1879impl ::std::convert::From<bool> for ElicitResultContentValue {
1880    fn from(value: bool) -> Self {
1881        Self::Boolean(value)
1882    }
1883}
1884impl ::std::convert::From<i64> for ElicitResultContentValue {
1885    fn from(value: i64) -> Self {
1886        Self::Integer(value)
1887    }
1888}
1889/**The contents of a resource, embedded into a prompt or tool call result.
1890It is up to the client how best to render embedded resources for the benefit
1891of the LLM and/or the user.*/
1892///
1893/// <details><summary>JSON schema</summary>
1894///
1895/// ```json
1896///{
1897///  "description": "The contents of a resource, embedded into a prompt or tool call result.\n\nIt is up to the client how best to render embedded resources for the benefit\nof the LLM and/or the user.",
1898///  "type": "object",
1899///  "required": [
1900///    "resource",
1901///    "type"
1902///  ],
1903///  "properties": {
1904///    "_meta": {
1905///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
1906///      "type": "object",
1907///      "additionalProperties": {}
1908///    },
1909///    "annotations": {
1910///      "description": "Optional annotations for the client.",
1911///      "$ref": "#/definitions/Annotations"
1912///    },
1913///    "resource": {
1914///      "anyOf": [
1915///        {
1916///          "$ref": "#/definitions/TextResourceContents"
1917///        },
1918///        {
1919///          "$ref": "#/definitions/BlobResourceContents"
1920///        }
1921///      ]
1922///    },
1923///    "type": {
1924///      "type": "string",
1925///      "const": "resource"
1926///    }
1927///  }
1928///}
1929/// ```
1930/// </details>
1931#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1932pub struct EmbeddedResource {
1933    ///Optional annotations for the client.
1934    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1935    pub annotations: ::std::option::Option<Annotations>,
1936    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
1937    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
1938    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1939    pub resource: EmbeddedResourceResource,
1940    #[serde(rename = "type", deserialize_with = "validate::embedded_resource_type_")]
1941    type_: ::std::string::String,
1942}
1943impl EmbeddedResource {
1944    pub fn new(
1945        resource: EmbeddedResourceResource,
1946        annotations: ::std::option::Option<Annotations>,
1947        meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1948    ) -> Self {
1949        Self {
1950            annotations,
1951            meta,
1952            resource,
1953            type_: "resource".to_string(),
1954        }
1955    }
1956    pub fn type_(&self) -> &::std::string::String {
1957        &self.type_
1958    }
1959    pub fn type_name() -> ::std::string::String {
1960        "resource".to_string()
1961    }
1962}
1963///EmbeddedResourceResource
1964///
1965/// <details><summary>JSON schema</summary>
1966///
1967/// ```json
1968///{
1969///  "anyOf": [
1970///    {
1971///      "$ref": "#/definitions/TextResourceContents"
1972///    },
1973///    {
1974///      "$ref": "#/definitions/BlobResourceContents"
1975///    }
1976///  ]
1977///}
1978/// ```
1979/// </details>
1980#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1981#[serde(untagged)]
1982pub enum EmbeddedResourceResource {
1983    TextResourceContents(TextResourceContents),
1984    BlobResourceContents(BlobResourceContents),
1985}
1986impl ::std::convert::From<TextResourceContents> for EmbeddedResourceResource {
1987    fn from(value: TextResourceContents) -> Self {
1988        Self::TextResourceContents(value)
1989    }
1990}
1991impl ::std::convert::From<BlobResourceContents> for EmbeddedResourceResource {
1992    fn from(value: BlobResourceContents) -> Self {
1993        Self::BlobResourceContents(value)
1994    }
1995}
1996///EmptyResult
1997///
1998/// <details><summary>JSON schema</summary>
1999///
2000/// ```json
2001///{
2002///  "$ref": "#/definitions/Result"
2003///}
2004/// ```
2005/// </details>
2006#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2007#[serde(transparent)]
2008pub struct EmptyResult(pub Result);
2009///EnumSchema
2010///
2011/// <details><summary>JSON schema</summary>
2012///
2013/// ```json
2014///{
2015///  "type": "object",
2016///  "required": [
2017///    "enum",
2018///    "type"
2019///  ],
2020///  "properties": {
2021///    "description": {
2022///      "type": "string"
2023///    },
2024///    "enum": {
2025///      "type": "array",
2026///      "items": {
2027///        "type": "string"
2028///      }
2029///    },
2030///    "enumNames": {
2031///      "type": "array",
2032///      "items": {
2033///        "type": "string"
2034///      }
2035///    },
2036///    "title": {
2037///      "type": "string"
2038///    },
2039///    "type": {
2040///      "type": "string",
2041///      "const": "string"
2042///    }
2043///  }
2044///}
2045/// ```
2046/// </details>
2047#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2048pub struct EnumSchema {
2049    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2050    pub description: ::std::option::Option<::std::string::String>,
2051    #[serde(rename = "enum")]
2052    pub enum_: ::std::vec::Vec<::std::string::String>,
2053    #[serde(rename = "enumNames", default, skip_serializing_if = "::std::vec::Vec::is_empty")]
2054    pub enum_names: ::std::vec::Vec<::std::string::String>,
2055    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2056    pub title: ::std::option::Option<::std::string::String>,
2057    #[serde(rename = "type", deserialize_with = "validate::enum_schema_type_")]
2058    type_: ::std::string::String,
2059}
2060impl EnumSchema {
2061    pub fn new(
2062        enum_: ::std::vec::Vec<::std::string::String>,
2063        enum_names: ::std::vec::Vec<::std::string::String>,
2064        description: ::std::option::Option<::std::string::String>,
2065        title: ::std::option::Option<::std::string::String>,
2066    ) -> Self {
2067        Self {
2068            description,
2069            enum_,
2070            enum_names,
2071            title,
2072            type_: "string".to_string(),
2073        }
2074    }
2075    pub fn type_(&self) -> &::std::string::String {
2076        &self.type_
2077    }
2078    pub fn type_name() -> ::std::string::String {
2079        "string".to_string()
2080    }
2081}
2082///Used by the client to get a prompt provided by the server.
2083///
2084/// <details><summary>JSON schema</summary>
2085///
2086/// ```json
2087///{
2088///  "description": "Used by the client to get a prompt provided by the server.",
2089///  "type": "object",
2090///  "required": [
2091///    "method",
2092///    "params"
2093///  ],
2094///  "properties": {
2095///    "method": {
2096///      "type": "string",
2097///      "const": "prompts/get"
2098///    },
2099///    "params": {
2100///      "type": "object",
2101///      "required": [
2102///        "name"
2103///      ],
2104///      "properties": {
2105///        "arguments": {
2106///          "description": "Arguments to use for templating the prompt.",
2107///          "type": "object",
2108///          "additionalProperties": {
2109///            "type": "string"
2110///          }
2111///        },
2112///        "name": {
2113///          "description": "The name of the prompt or prompt template.",
2114///          "type": "string"
2115///        }
2116///      }
2117///    }
2118///  }
2119///}
2120/// ```
2121/// </details>
2122#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2123pub struct GetPromptRequest {
2124    #[serde(deserialize_with = "validate::get_prompt_request_method")]
2125    method: ::std::string::String,
2126    pub params: GetPromptRequestParams,
2127}
2128impl GetPromptRequest {
2129    pub fn new(params: GetPromptRequestParams) -> Self {
2130        Self {
2131            method: "prompts/get".to_string(),
2132            params,
2133        }
2134    }
2135    pub fn method(&self) -> &::std::string::String {
2136        &self.method
2137    }
2138    pub fn method_name() -> ::std::string::String {
2139        "prompts/get".to_string()
2140    }
2141}
2142///GetPromptRequestParams
2143///
2144/// <details><summary>JSON schema</summary>
2145///
2146/// ```json
2147///{
2148///  "type": "object",
2149///  "required": [
2150///    "name"
2151///  ],
2152///  "properties": {
2153///    "arguments": {
2154///      "description": "Arguments to use for templating the prompt.",
2155///      "type": "object",
2156///      "additionalProperties": {
2157///        "type": "string"
2158///      }
2159///    },
2160///    "name": {
2161///      "description": "The name of the prompt or prompt template.",
2162///      "type": "string"
2163///    }
2164///  }
2165///}
2166/// ```
2167/// </details>
2168#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2169pub struct GetPromptRequestParams {
2170    ///Arguments to use for templating the prompt.
2171    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2172    pub arguments: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
2173    ///The name of the prompt or prompt template.
2174    pub name: ::std::string::String,
2175}
2176///The server's response to a prompts/get request from the client.
2177///
2178/// <details><summary>JSON schema</summary>
2179///
2180/// ```json
2181///{
2182///  "description": "The server's response to a prompts/get request from the client.",
2183///  "type": "object",
2184///  "required": [
2185///    "messages"
2186///  ],
2187///  "properties": {
2188///    "_meta": {
2189///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
2190///      "type": "object",
2191///      "additionalProperties": {}
2192///    },
2193///    "description": {
2194///      "description": "An optional description for the prompt.",
2195///      "type": "string"
2196///    },
2197///    "messages": {
2198///      "type": "array",
2199///      "items": {
2200///        "$ref": "#/definitions/PromptMessage"
2201///      }
2202///    }
2203///  }
2204///}
2205/// ```
2206/// </details>
2207#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2208pub struct GetPromptResult {
2209    ///An optional description for the prompt.
2210    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2211    pub description: ::std::option::Option<::std::string::String>,
2212    pub messages: ::std::vec::Vec<PromptMessage>,
2213    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
2214    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2215    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2216}
2217///An image provided to or from an LLM.
2218///
2219/// <details><summary>JSON schema</summary>
2220///
2221/// ```json
2222///{
2223///  "description": "An image provided to or from an LLM.",
2224///  "type": "object",
2225///  "required": [
2226///    "data",
2227///    "mimeType",
2228///    "type"
2229///  ],
2230///  "properties": {
2231///    "_meta": {
2232///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
2233///      "type": "object",
2234///      "additionalProperties": {}
2235///    },
2236///    "annotations": {
2237///      "description": "Optional annotations for the client.",
2238///      "$ref": "#/definitions/Annotations"
2239///    },
2240///    "data": {
2241///      "description": "The base64-encoded image data.",
2242///      "type": "string",
2243///      "format": "byte"
2244///    },
2245///    "mimeType": {
2246///      "description": "The MIME type of the image. Different providers may support different image types.",
2247///      "type": "string"
2248///    },
2249///    "type": {
2250///      "type": "string",
2251///      "const": "image"
2252///    }
2253///  }
2254///}
2255/// ```
2256/// </details>
2257#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2258pub struct ImageContent {
2259    ///Optional annotations for the client.
2260    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2261    pub annotations: ::std::option::Option<Annotations>,
2262    ///The base64-encoded image data.
2263    pub data: ::std::string::String,
2264    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
2265    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2266    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2267    ///The MIME type of the image. Different providers may support different image types.
2268    #[serde(rename = "mimeType")]
2269    pub mime_type: ::std::string::String,
2270    #[serde(rename = "type", deserialize_with = "validate::image_content_type_")]
2271    type_: ::std::string::String,
2272}
2273impl ImageContent {
2274    pub fn new(
2275        data: ::std::string::String,
2276        mime_type: ::std::string::String,
2277        annotations: ::std::option::Option<Annotations>,
2278        meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2279    ) -> Self {
2280        Self {
2281            annotations,
2282            data,
2283            meta,
2284            mime_type,
2285            type_: "image".to_string(),
2286        }
2287    }
2288    pub fn type_(&self) -> &::std::string::String {
2289        &self.type_
2290    }
2291    pub fn type_name() -> ::std::string::String {
2292        "image".to_string()
2293    }
2294}
2295///Describes the name and version of an MCP implementation, with an optional title for UI representation.
2296///
2297/// <details><summary>JSON schema</summary>
2298///
2299/// ```json
2300///{
2301///  "description": "Describes the name and version of an MCP implementation, with an optional title for UI representation.",
2302///  "type": "object",
2303///  "required": [
2304///    "name",
2305///    "version"
2306///  ],
2307///  "properties": {
2308///    "name": {
2309///      "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
2310///      "type": "string"
2311///    },
2312///    "title": {
2313///      "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
2314///      "type": "string"
2315///    },
2316///    "version": {
2317///      "type": "string"
2318///    }
2319///  }
2320///}
2321/// ```
2322/// </details>
2323#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2324pub struct Implementation {
2325    ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
2326    pub name: ::std::string::String,
2327    /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
2328    even by those unfamiliar with domain-specific terminology.
2329    If not provided, the name should be used for display (except for Tool,
2330    where annotations.title should be given precedence over using name,
2331    if present).*/
2332    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2333    pub title: ::std::option::Option<::std::string::String>,
2334    pub version: ::std::string::String,
2335}
2336///This request is sent from the client to the server when it first connects, asking it to begin initialization.
2337///
2338/// <details><summary>JSON schema</summary>
2339///
2340/// ```json
2341///{
2342///  "description": "This request is sent from the client to the server when it first connects, asking it to begin initialization.",
2343///  "type": "object",
2344///  "required": [
2345///    "method",
2346///    "params"
2347///  ],
2348///  "properties": {
2349///    "method": {
2350///      "type": "string",
2351///      "const": "initialize"
2352///    },
2353///    "params": {
2354///      "type": "object",
2355///      "required": [
2356///        "capabilities",
2357///        "clientInfo",
2358///        "protocolVersion"
2359///      ],
2360///      "properties": {
2361///        "capabilities": {
2362///          "$ref": "#/definitions/ClientCapabilities"
2363///        },
2364///        "clientInfo": {
2365///          "$ref": "#/definitions/Implementation"
2366///        },
2367///        "protocolVersion": {
2368///          "description": "The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.",
2369///          "type": "string"
2370///        }
2371///      }
2372///    }
2373///  }
2374///}
2375/// ```
2376/// </details>
2377#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2378pub struct InitializeRequest {
2379    #[serde(deserialize_with = "validate::initialize_request_method")]
2380    method: ::std::string::String,
2381    pub params: InitializeRequestParams,
2382}
2383impl InitializeRequest {
2384    pub fn new(params: InitializeRequestParams) -> Self {
2385        Self {
2386            method: "initialize".to_string(),
2387            params,
2388        }
2389    }
2390    pub fn method(&self) -> &::std::string::String {
2391        &self.method
2392    }
2393    pub fn method_name() -> ::std::string::String {
2394        "initialize".to_string()
2395    }
2396}
2397///InitializeRequestParams
2398///
2399/// <details><summary>JSON schema</summary>
2400///
2401/// ```json
2402///{
2403///  "type": "object",
2404///  "required": [
2405///    "capabilities",
2406///    "clientInfo",
2407///    "protocolVersion"
2408///  ],
2409///  "properties": {
2410///    "capabilities": {
2411///      "$ref": "#/definitions/ClientCapabilities"
2412///    },
2413///    "clientInfo": {
2414///      "$ref": "#/definitions/Implementation"
2415///    },
2416///    "protocolVersion": {
2417///      "description": "The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.",
2418///      "type": "string"
2419///    }
2420///  }
2421///}
2422/// ```
2423/// </details>
2424#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2425pub struct InitializeRequestParams {
2426    pub capabilities: ClientCapabilities,
2427    #[serde(rename = "clientInfo")]
2428    pub client_info: Implementation,
2429    ///The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
2430    #[serde(rename = "protocolVersion")]
2431    pub protocol_version: ::std::string::String,
2432}
2433///After receiving an initialize request from the client, the server sends this response.
2434///
2435/// <details><summary>JSON schema</summary>
2436///
2437/// ```json
2438///{
2439///  "description": "After receiving an initialize request from the client, the server sends this response.",
2440///  "type": "object",
2441///  "required": [
2442///    "capabilities",
2443///    "protocolVersion",
2444///    "serverInfo"
2445///  ],
2446///  "properties": {
2447///    "_meta": {
2448///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
2449///      "type": "object",
2450///      "additionalProperties": {}
2451///    },
2452///    "capabilities": {
2453///      "$ref": "#/definitions/ServerCapabilities"
2454///    },
2455///    "instructions": {
2456///      "description": "Instructions describing how to use the server and its features.\n\nThis can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a \"hint\" to the model. For example, this information MAY be added to the system prompt.",
2457///      "type": "string"
2458///    },
2459///    "protocolVersion": {
2460///      "description": "The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.",
2461///      "type": "string"
2462///    },
2463///    "serverInfo": {
2464///      "$ref": "#/definitions/Implementation"
2465///    }
2466///  }
2467///}
2468/// ```
2469/// </details>
2470#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2471pub struct InitializeResult {
2472    pub capabilities: ServerCapabilities,
2473    /**Instructions describing how to use the server and its features.
2474    This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.*/
2475    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2476    pub instructions: ::std::option::Option<::std::string::String>,
2477    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
2478    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2479    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2480    ///The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
2481    #[serde(rename = "protocolVersion")]
2482    pub protocol_version: ::std::string::String,
2483    #[serde(rename = "serverInfo")]
2484    pub server_info: Implementation,
2485}
2486///This notification is sent from the client to the server after initialization has finished.
2487///
2488/// <details><summary>JSON schema</summary>
2489///
2490/// ```json
2491///{
2492///  "description": "This notification is sent from the client to the server after initialization has finished.",
2493///  "type": "object",
2494///  "required": [
2495///    "method"
2496///  ],
2497///  "properties": {
2498///    "method": {
2499///      "type": "string",
2500///      "const": "notifications/initialized"
2501///    },
2502///    "params": {
2503///      "type": "object",
2504///      "properties": {
2505///        "_meta": {
2506///          "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
2507///          "type": "object",
2508///          "additionalProperties": {}
2509///        }
2510///      },
2511///      "additionalProperties": {}
2512///    }
2513///  }
2514///}
2515/// ```
2516/// </details>
2517#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2518pub struct InitializedNotification {
2519    #[serde(deserialize_with = "validate::initialized_notification_method")]
2520    method: ::std::string::String,
2521    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2522    pub params: ::std::option::Option<InitializedNotificationParams>,
2523}
2524impl InitializedNotification {
2525    pub fn new(params: ::std::option::Option<InitializedNotificationParams>) -> Self {
2526        Self {
2527            method: "notifications/initialized".to_string(),
2528            params,
2529        }
2530    }
2531    pub fn method(&self) -> &::std::string::String {
2532        &self.method
2533    }
2534    pub fn method_name() -> ::std::string::String {
2535        "notifications/initialized".to_string()
2536    }
2537}
2538///InitializedNotificationParams
2539///
2540/// <details><summary>JSON schema</summary>
2541///
2542/// ```json
2543///{
2544///  "type": "object",
2545///  "properties": {
2546///    "_meta": {
2547///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
2548///      "type": "object",
2549///      "additionalProperties": {}
2550///    }
2551///  },
2552///  "additionalProperties": {}
2553///}
2554/// ```
2555/// </details>
2556#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
2557pub struct InitializedNotificationParams {
2558    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
2559    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2560    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2561    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
2562    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2563}
2564///A response to a request that indicates an error occurred.
2565///
2566/// <details><summary>JSON schema</summary>
2567///
2568/// ```json
2569///{
2570///  "description": "A response to a request that indicates an error occurred.",
2571///  "type": "object",
2572///  "required": [
2573///    "error",
2574///    "id",
2575///    "jsonrpc"
2576///  ],
2577///  "properties": {
2578///    "error": {
2579///      "type": "object",
2580///      "required": [
2581///        "code",
2582///        "message"
2583///      ],
2584///      "properties": {
2585///        "code": {
2586///          "description": "The error type that occurred.",
2587///          "type": "integer"
2588///        },
2589///        "data": {
2590///          "description": "Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.)."
2591///        },
2592///        "message": {
2593///          "description": "A short description of the error. The message SHOULD be limited to a concise single sentence.",
2594///          "type": "string"
2595///        }
2596///      }
2597///    },
2598///    "id": {
2599///      "$ref": "#/definitions/RequestId"
2600///    },
2601///    "jsonrpc": {
2602///      "type": "string",
2603///      "const": "2.0"
2604///    }
2605///  }
2606///}
2607/// ```
2608/// </details>
2609#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2610pub struct JsonrpcError {
2611    pub error: RpcError,
2612    pub id: RequestId,
2613    #[serde(deserialize_with = "validate::jsonrpc_error_jsonrpc")]
2614    jsonrpc: ::std::string::String,
2615}
2616impl JsonrpcError {
2617    pub fn new(error: RpcError, id: RequestId) -> Self {
2618        Self {
2619            error,
2620            id,
2621            jsonrpc: JSONRPC_VERSION.to_string(),
2622        }
2623    }
2624    pub fn jsonrpc(&self) -> &::std::string::String {
2625        &self.jsonrpc
2626    }
2627}
2628///Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.
2629///
2630/// <details><summary>JSON schema</summary>
2631///
2632/// ```json
2633///{
2634///  "description": "Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.",
2635///  "anyOf": [
2636///    {
2637///      "$ref": "#/definitions/JSONRPCRequest"
2638///    },
2639///    {
2640///      "$ref": "#/definitions/JSONRPCNotification"
2641///    },
2642///    {
2643///      "$ref": "#/definitions/JSONRPCResponse"
2644///    },
2645///    {
2646///      "$ref": "#/definitions/JSONRPCError"
2647///    }
2648///  ]
2649///}
2650/// ```
2651/// </details>
2652#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2653#[serde(untagged)]
2654pub enum JsonrpcMessage {
2655    Request(JsonrpcRequest),
2656    Notification(JsonrpcNotification),
2657    Response(JsonrpcResponse),
2658    Error(JsonrpcError),
2659}
2660impl ::std::convert::From<JsonrpcRequest> for JsonrpcMessage {
2661    fn from(value: JsonrpcRequest) -> Self {
2662        Self::Request(value)
2663    }
2664}
2665impl ::std::convert::From<JsonrpcNotification> for JsonrpcMessage {
2666    fn from(value: JsonrpcNotification) -> Self {
2667        Self::Notification(value)
2668    }
2669}
2670impl ::std::convert::From<JsonrpcResponse> for JsonrpcMessage {
2671    fn from(value: JsonrpcResponse) -> Self {
2672        Self::Response(value)
2673    }
2674}
2675impl ::std::convert::From<JsonrpcError> for JsonrpcMessage {
2676    fn from(value: JsonrpcError) -> Self {
2677        Self::Error(value)
2678    }
2679}
2680///A notification which does not expect a response.
2681///
2682/// <details><summary>JSON schema</summary>
2683///
2684/// ```json
2685///{
2686///  "description": "A notification which does not expect a response.",
2687///  "type": "object",
2688///  "required": [
2689///    "jsonrpc",
2690///    "method"
2691///  ],
2692///  "properties": {
2693///    "jsonrpc": {
2694///      "type": "string",
2695///      "const": "2.0"
2696///    },
2697///    "method": {
2698///      "type": "string"
2699///    },
2700///    "params": {
2701///      "type": "object",
2702///      "properties": {
2703///        "_meta": {
2704///          "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
2705///          "type": "object",
2706///          "additionalProperties": {}
2707///        }
2708///      },
2709///      "additionalProperties": {}
2710///    }
2711///  }
2712///}
2713/// ```
2714/// </details>
2715#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2716pub struct JsonrpcNotification {
2717    #[serde(deserialize_with = "validate::jsonrpc_notification_jsonrpc")]
2718    jsonrpc: ::std::string::String,
2719    pub method: ::std::string::String,
2720    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2721    pub params: ::std::option::Option<JsonrpcNotificationParams>,
2722}
2723impl JsonrpcNotification {
2724    pub fn new(method: ::std::string::String, params: ::std::option::Option<JsonrpcNotificationParams>) -> Self {
2725        Self {
2726            jsonrpc: JSONRPC_VERSION.to_string(),
2727            method,
2728            params,
2729        }
2730    }
2731    pub fn jsonrpc(&self) -> &::std::string::String {
2732        &self.jsonrpc
2733    }
2734}
2735///JsonrpcNotificationParams
2736///
2737/// <details><summary>JSON schema</summary>
2738///
2739/// ```json
2740///{
2741///  "type": "object",
2742///  "properties": {
2743///    "_meta": {
2744///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
2745///      "type": "object",
2746///      "additionalProperties": {}
2747///    }
2748///  },
2749///  "additionalProperties": {}
2750///}
2751/// ```
2752/// </details>
2753#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
2754pub struct JsonrpcNotificationParams {
2755    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
2756    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2757    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2758    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
2759    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2760}
2761///A request that expects a response.
2762///
2763/// <details><summary>JSON schema</summary>
2764///
2765/// ```json
2766///{
2767///  "description": "A request that expects a response.",
2768///  "type": "object",
2769///  "required": [
2770///    "id",
2771///    "jsonrpc",
2772///    "method"
2773///  ],
2774///  "properties": {
2775///    "id": {
2776///      "$ref": "#/definitions/RequestId"
2777///    },
2778///    "jsonrpc": {
2779///      "type": "string",
2780///      "const": "2.0"
2781///    },
2782///    "method": {
2783///      "type": "string"
2784///    },
2785///    "params": {
2786///      "type": "object",
2787///      "properties": {
2788///        "_meta": {
2789///          "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
2790///          "type": "object",
2791///          "properties": {
2792///            "progressToken": {
2793///              "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
2794///              "$ref": "#/definitions/ProgressToken"
2795///            }
2796///          },
2797///          "additionalProperties": {}
2798///        }
2799///      },
2800///      "additionalProperties": {}
2801///    }
2802///  }
2803///}
2804/// ```
2805/// </details>
2806#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2807pub struct JsonrpcRequest {
2808    pub id: RequestId,
2809    #[serde(deserialize_with = "validate::jsonrpc_request_jsonrpc")]
2810    jsonrpc: ::std::string::String,
2811    pub method: ::std::string::String,
2812    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2813    pub params: ::std::option::Option<JsonrpcRequestParams>,
2814}
2815impl JsonrpcRequest {
2816    pub fn new(id: RequestId, method: ::std::string::String, params: ::std::option::Option<JsonrpcRequestParams>) -> Self {
2817        Self {
2818            id,
2819            jsonrpc: JSONRPC_VERSION.to_string(),
2820            method,
2821            params,
2822        }
2823    }
2824    pub fn jsonrpc(&self) -> &::std::string::String {
2825        &self.jsonrpc
2826    }
2827}
2828///JsonrpcRequestParams
2829///
2830/// <details><summary>JSON schema</summary>
2831///
2832/// ```json
2833///{
2834///  "type": "object",
2835///  "properties": {
2836///    "_meta": {
2837///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
2838///      "type": "object",
2839///      "properties": {
2840///        "progressToken": {
2841///          "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
2842///          "$ref": "#/definitions/ProgressToken"
2843///        }
2844///      },
2845///      "additionalProperties": {}
2846///    }
2847///  },
2848///  "additionalProperties": {}
2849///}
2850/// ```
2851/// </details>
2852#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
2853pub struct JsonrpcRequestParams {
2854    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2855    pub meta: ::std::option::Option<JsonrpcRequestParamsMeta>,
2856    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
2857    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2858}
2859///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
2860///
2861/// <details><summary>JSON schema</summary>
2862///
2863/// ```json
2864///{
2865///  "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
2866///  "type": "object",
2867///  "properties": {
2868///    "progressToken": {
2869///      "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
2870///      "$ref": "#/definitions/ProgressToken"
2871///    }
2872///  },
2873///  "additionalProperties": {}
2874///}
2875/// ```
2876/// </details>
2877#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
2878pub struct JsonrpcRequestParamsMeta {
2879    ///If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
2880    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
2881    pub progress_token: ::std::option::Option<ProgressToken>,
2882    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
2883    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2884}
2885///A successful (non-error) response to a request.
2886///
2887/// <details><summary>JSON schema</summary>
2888///
2889/// ```json
2890///{
2891///  "description": "A successful (non-error) response to a request.",
2892///  "type": "object",
2893///  "required": [
2894///    "id",
2895///    "jsonrpc",
2896///    "result"
2897///  ],
2898///  "properties": {
2899///    "id": {
2900///      "$ref": "#/definitions/RequestId"
2901///    },
2902///    "jsonrpc": {
2903///      "type": "string",
2904///      "const": "2.0"
2905///    },
2906///    "result": {
2907///      "$ref": "#/definitions/Result"
2908///    }
2909///  }
2910///}
2911/// ```
2912/// </details>
2913#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2914pub struct JsonrpcResponse {
2915    pub id: RequestId,
2916    #[serde(deserialize_with = "validate::jsonrpc_response_jsonrpc")]
2917    jsonrpc: ::std::string::String,
2918    pub result: Result,
2919}
2920impl JsonrpcResponse {
2921    pub fn new(id: RequestId, result: Result) -> Self {
2922        Self {
2923            id,
2924            jsonrpc: JSONRPC_VERSION.to_string(),
2925            result,
2926        }
2927    }
2928    pub fn jsonrpc(&self) -> &::std::string::String {
2929        &self.jsonrpc
2930    }
2931}
2932///Sent from the client to request a list of prompts and prompt templates the server has.
2933///
2934/// <details><summary>JSON schema</summary>
2935///
2936/// ```json
2937///{
2938///  "description": "Sent from the client to request a list of prompts and prompt templates the server has.",
2939///  "type": "object",
2940///  "required": [
2941///    "method"
2942///  ],
2943///  "properties": {
2944///    "method": {
2945///      "type": "string",
2946///      "const": "prompts/list"
2947///    },
2948///    "params": {
2949///      "type": "object",
2950///      "properties": {
2951///        "cursor": {
2952///          "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.",
2953///          "type": "string"
2954///        }
2955///      }
2956///    }
2957///  }
2958///}
2959/// ```
2960/// </details>
2961#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2962pub struct ListPromptsRequest {
2963    #[serde(deserialize_with = "validate::list_prompts_request_method")]
2964    method: ::std::string::String,
2965    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2966    pub params: ::std::option::Option<ListPromptsRequestParams>,
2967}
2968impl ListPromptsRequest {
2969    pub fn new(params: ::std::option::Option<ListPromptsRequestParams>) -> Self {
2970        Self {
2971            method: "prompts/list".to_string(),
2972            params,
2973        }
2974    }
2975    pub fn method(&self) -> &::std::string::String {
2976        &self.method
2977    }
2978    pub fn method_name() -> ::std::string::String {
2979        "prompts/list".to_string()
2980    }
2981}
2982///ListPromptsRequestParams
2983///
2984/// <details><summary>JSON schema</summary>
2985///
2986/// ```json
2987///{
2988///  "type": "object",
2989///  "properties": {
2990///    "cursor": {
2991///      "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.",
2992///      "type": "string"
2993///    }
2994///  }
2995///}
2996/// ```
2997/// </details>
2998#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
2999pub struct ListPromptsRequestParams {
3000    /**An opaque token representing the current pagination position.
3001    If provided, the server should return results starting after this cursor.*/
3002    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3003    pub cursor: ::std::option::Option<::std::string::String>,
3004}
3005///The server's response to a prompts/list request from the client.
3006///
3007/// <details><summary>JSON schema</summary>
3008///
3009/// ```json
3010///{
3011///  "description": "The server's response to a prompts/list request from the client.",
3012///  "type": "object",
3013///  "required": [
3014///    "prompts"
3015///  ],
3016///  "properties": {
3017///    "_meta": {
3018///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
3019///      "type": "object",
3020///      "additionalProperties": {}
3021///    },
3022///    "nextCursor": {
3023///      "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
3024///      "type": "string"
3025///    },
3026///    "prompts": {
3027///      "type": "array",
3028///      "items": {
3029///        "$ref": "#/definitions/Prompt"
3030///      }
3031///    }
3032///  }
3033///}
3034/// ```
3035/// </details>
3036#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3037pub struct ListPromptsResult {
3038    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
3039    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3040    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3041    /**An opaque token representing the pagination position after the last returned result.
3042    If present, there may be more results available.*/
3043    #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
3044    pub next_cursor: ::std::option::Option<::std::string::String>,
3045    pub prompts: ::std::vec::Vec<Prompt>,
3046}
3047///Sent from the client to request a list of resource templates the server has.
3048///
3049/// <details><summary>JSON schema</summary>
3050///
3051/// ```json
3052///{
3053///  "description": "Sent from the client to request a list of resource templates the server has.",
3054///  "type": "object",
3055///  "required": [
3056///    "method"
3057///  ],
3058///  "properties": {
3059///    "method": {
3060///      "type": "string",
3061///      "const": "resources/templates/list"
3062///    },
3063///    "params": {
3064///      "type": "object",
3065///      "properties": {
3066///        "cursor": {
3067///          "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.",
3068///          "type": "string"
3069///        }
3070///      }
3071///    }
3072///  }
3073///}
3074/// ```
3075/// </details>
3076#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3077pub struct ListResourceTemplatesRequest {
3078    #[serde(deserialize_with = "validate::list_resource_templates_request_method")]
3079    method: ::std::string::String,
3080    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3081    pub params: ::std::option::Option<ListResourceTemplatesRequestParams>,
3082}
3083impl ListResourceTemplatesRequest {
3084    pub fn new(params: ::std::option::Option<ListResourceTemplatesRequestParams>) -> Self {
3085        Self {
3086            method: "resources/templates/list".to_string(),
3087            params,
3088        }
3089    }
3090    pub fn method(&self) -> &::std::string::String {
3091        &self.method
3092    }
3093    pub fn method_name() -> ::std::string::String {
3094        "resources/templates/list".to_string()
3095    }
3096}
3097///ListResourceTemplatesRequestParams
3098///
3099/// <details><summary>JSON schema</summary>
3100///
3101/// ```json
3102///{
3103///  "type": "object",
3104///  "properties": {
3105///    "cursor": {
3106///      "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.",
3107///      "type": "string"
3108///    }
3109///  }
3110///}
3111/// ```
3112/// </details>
3113#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
3114pub struct ListResourceTemplatesRequestParams {
3115    /**An opaque token representing the current pagination position.
3116    If provided, the server should return results starting after this cursor.*/
3117    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3118    pub cursor: ::std::option::Option<::std::string::String>,
3119}
3120///The server's response to a resources/templates/list request from the client.
3121///
3122/// <details><summary>JSON schema</summary>
3123///
3124/// ```json
3125///{
3126///  "description": "The server's response to a resources/templates/list request from the client.",
3127///  "type": "object",
3128///  "required": [
3129///    "resourceTemplates"
3130///  ],
3131///  "properties": {
3132///    "_meta": {
3133///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
3134///      "type": "object",
3135///      "additionalProperties": {}
3136///    },
3137///    "nextCursor": {
3138///      "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
3139///      "type": "string"
3140///    },
3141///    "resourceTemplates": {
3142///      "type": "array",
3143///      "items": {
3144///        "$ref": "#/definitions/ResourceTemplate"
3145///      }
3146///    }
3147///  }
3148///}
3149/// ```
3150/// </details>
3151#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3152pub struct ListResourceTemplatesResult {
3153    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
3154    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3155    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3156    /**An opaque token representing the pagination position after the last returned result.
3157    If present, there may be more results available.*/
3158    #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
3159    pub next_cursor: ::std::option::Option<::std::string::String>,
3160    #[serde(rename = "resourceTemplates")]
3161    pub resource_templates: ::std::vec::Vec<ResourceTemplate>,
3162}
3163///Sent from the client to request a list of resources the server has.
3164///
3165/// <details><summary>JSON schema</summary>
3166///
3167/// ```json
3168///{
3169///  "description": "Sent from the client to request a list of resources the server has.",
3170///  "type": "object",
3171///  "required": [
3172///    "method"
3173///  ],
3174///  "properties": {
3175///    "method": {
3176///      "type": "string",
3177///      "const": "resources/list"
3178///    },
3179///    "params": {
3180///      "type": "object",
3181///      "properties": {
3182///        "cursor": {
3183///          "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.",
3184///          "type": "string"
3185///        }
3186///      }
3187///    }
3188///  }
3189///}
3190/// ```
3191/// </details>
3192#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3193pub struct ListResourcesRequest {
3194    #[serde(deserialize_with = "validate::list_resources_request_method")]
3195    method: ::std::string::String,
3196    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3197    pub params: ::std::option::Option<ListResourcesRequestParams>,
3198}
3199impl ListResourcesRequest {
3200    pub fn new(params: ::std::option::Option<ListResourcesRequestParams>) -> Self {
3201        Self {
3202            method: "resources/list".to_string(),
3203            params,
3204        }
3205    }
3206    pub fn method(&self) -> &::std::string::String {
3207        &self.method
3208    }
3209    pub fn method_name() -> ::std::string::String {
3210        "resources/list".to_string()
3211    }
3212}
3213///ListResourcesRequestParams
3214///
3215/// <details><summary>JSON schema</summary>
3216///
3217/// ```json
3218///{
3219///  "type": "object",
3220///  "properties": {
3221///    "cursor": {
3222///      "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.",
3223///      "type": "string"
3224///    }
3225///  }
3226///}
3227/// ```
3228/// </details>
3229#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
3230pub struct ListResourcesRequestParams {
3231    /**An opaque token representing the current pagination position.
3232    If provided, the server should return results starting after this cursor.*/
3233    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3234    pub cursor: ::std::option::Option<::std::string::String>,
3235}
3236///The server's response to a resources/list request from the client.
3237///
3238/// <details><summary>JSON schema</summary>
3239///
3240/// ```json
3241///{
3242///  "description": "The server's response to a resources/list request from the client.",
3243///  "type": "object",
3244///  "required": [
3245///    "resources"
3246///  ],
3247///  "properties": {
3248///    "_meta": {
3249///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
3250///      "type": "object",
3251///      "additionalProperties": {}
3252///    },
3253///    "nextCursor": {
3254///      "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
3255///      "type": "string"
3256///    },
3257///    "resources": {
3258///      "type": "array",
3259///      "items": {
3260///        "$ref": "#/definitions/Resource"
3261///      }
3262///    }
3263///  }
3264///}
3265/// ```
3266/// </details>
3267#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3268pub struct ListResourcesResult {
3269    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
3270    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3271    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3272    /**An opaque token representing the pagination position after the last returned result.
3273    If present, there may be more results available.*/
3274    #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
3275    pub next_cursor: ::std::option::Option<::std::string::String>,
3276    pub resources: ::std::vec::Vec<Resource>,
3277}
3278/**Sent from the server to request a list of root URIs from the client. Roots allow
3279servers to ask for specific directories or files to operate on. A common example
3280for roots is providing a set of repositories or directories a server should operate
3281on.
3282This request is typically used when the server needs to understand the file system
3283structure or access specific locations that the client has permission to read from.*/
3284///
3285/// <details><summary>JSON schema</summary>
3286///
3287/// ```json
3288///{
3289///  "description": "Sent from the server to request a list of root URIs from the client. Roots allow\nservers to ask for specific directories or files to operate on. A common example\nfor roots is providing a set of repositories or directories a server should operate\non.\n\nThis request is typically used when the server needs to understand the file system\nstructure or access specific locations that the client has permission to read from.",
3290///  "type": "object",
3291///  "required": [
3292///    "method"
3293///  ],
3294///  "properties": {
3295///    "method": {
3296///      "type": "string",
3297///      "const": "roots/list"
3298///    },
3299///    "params": {
3300///      "type": "object",
3301///      "properties": {
3302///        "_meta": {
3303///          "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
3304///          "type": "object",
3305///          "properties": {
3306///            "progressToken": {
3307///              "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
3308///              "$ref": "#/definitions/ProgressToken"
3309///            }
3310///          },
3311///          "additionalProperties": {}
3312///        }
3313///      },
3314///      "additionalProperties": {}
3315///    }
3316///  }
3317///}
3318/// ```
3319/// </details>
3320#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3321pub struct ListRootsRequest {
3322    #[serde(deserialize_with = "validate::list_roots_request_method")]
3323    method: ::std::string::String,
3324    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3325    pub params: ::std::option::Option<ListRootsRequestParams>,
3326}
3327impl ListRootsRequest {
3328    pub fn new(params: ::std::option::Option<ListRootsRequestParams>) -> Self {
3329        Self {
3330            method: "roots/list".to_string(),
3331            params,
3332        }
3333    }
3334    pub fn method(&self) -> &::std::string::String {
3335        &self.method
3336    }
3337    pub fn method_name() -> ::std::string::String {
3338        "roots/list".to_string()
3339    }
3340}
3341///ListRootsRequestParams
3342///
3343/// <details><summary>JSON schema</summary>
3344///
3345/// ```json
3346///{
3347///  "type": "object",
3348///  "properties": {
3349///    "_meta": {
3350///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
3351///      "type": "object",
3352///      "properties": {
3353///        "progressToken": {
3354///          "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
3355///          "$ref": "#/definitions/ProgressToken"
3356///        }
3357///      },
3358///      "additionalProperties": {}
3359///    }
3360///  },
3361///  "additionalProperties": {}
3362///}
3363/// ```
3364/// </details>
3365#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
3366pub struct ListRootsRequestParams {
3367    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3368    pub meta: ::std::option::Option<ListRootsRequestParamsMeta>,
3369    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
3370    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3371}
3372///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
3373///
3374/// <details><summary>JSON schema</summary>
3375///
3376/// ```json
3377///{
3378///  "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
3379///  "type": "object",
3380///  "properties": {
3381///    "progressToken": {
3382///      "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
3383///      "$ref": "#/definitions/ProgressToken"
3384///    }
3385///  },
3386///  "additionalProperties": {}
3387///}
3388/// ```
3389/// </details>
3390#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
3391pub struct ListRootsRequestParamsMeta {
3392    ///If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
3393    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
3394    pub progress_token: ::std::option::Option<ProgressToken>,
3395    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
3396    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3397}
3398/**The client's response to a roots/list request from the server.
3399This result contains an array of Root objects, each representing a root directory
3400or file that the server can operate on.*/
3401///
3402/// <details><summary>JSON schema</summary>
3403///
3404/// ```json
3405///{
3406///  "description": "The client's response to a roots/list request from the server.\nThis result contains an array of Root objects, each representing a root directory\nor file that the server can operate on.",
3407///  "type": "object",
3408///  "required": [
3409///    "roots"
3410///  ],
3411///  "properties": {
3412///    "_meta": {
3413///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
3414///      "type": "object",
3415///      "additionalProperties": {}
3416///    },
3417///    "roots": {
3418///      "type": "array",
3419///      "items": {
3420///        "$ref": "#/definitions/Root"
3421///      }
3422///    }
3423///  }
3424///}
3425/// ```
3426/// </details>
3427#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3428pub struct ListRootsResult {
3429    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
3430    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3431    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3432    pub roots: ::std::vec::Vec<Root>,
3433}
3434///Sent from the client to request a list of tools the server has.
3435///
3436/// <details><summary>JSON schema</summary>
3437///
3438/// ```json
3439///{
3440///  "description": "Sent from the client to request a list of tools the server has.",
3441///  "type": "object",
3442///  "required": [
3443///    "method"
3444///  ],
3445///  "properties": {
3446///    "method": {
3447///      "type": "string",
3448///      "const": "tools/list"
3449///    },
3450///    "params": {
3451///      "type": "object",
3452///      "properties": {
3453///        "cursor": {
3454///          "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.",
3455///          "type": "string"
3456///        }
3457///      }
3458///    }
3459///  }
3460///}
3461/// ```
3462/// </details>
3463#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3464pub struct ListToolsRequest {
3465    #[serde(deserialize_with = "validate::list_tools_request_method")]
3466    method: ::std::string::String,
3467    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3468    pub params: ::std::option::Option<ListToolsRequestParams>,
3469}
3470impl ListToolsRequest {
3471    pub fn new(params: ::std::option::Option<ListToolsRequestParams>) -> Self {
3472        Self {
3473            method: "tools/list".to_string(),
3474            params,
3475        }
3476    }
3477    pub fn method(&self) -> &::std::string::String {
3478        &self.method
3479    }
3480    pub fn method_name() -> ::std::string::String {
3481        "tools/list".to_string()
3482    }
3483}
3484///ListToolsRequestParams
3485///
3486/// <details><summary>JSON schema</summary>
3487///
3488/// ```json
3489///{
3490///  "type": "object",
3491///  "properties": {
3492///    "cursor": {
3493///      "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.",
3494///      "type": "string"
3495///    }
3496///  }
3497///}
3498/// ```
3499/// </details>
3500#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
3501pub struct ListToolsRequestParams {
3502    /**An opaque token representing the current pagination position.
3503    If provided, the server should return results starting after this cursor.*/
3504    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3505    pub cursor: ::std::option::Option<::std::string::String>,
3506}
3507///The server's response to a tools/list request from the client.
3508///
3509/// <details><summary>JSON schema</summary>
3510///
3511/// ```json
3512///{
3513///  "description": "The server's response to a tools/list request from the client.",
3514///  "type": "object",
3515///  "required": [
3516///    "tools"
3517///  ],
3518///  "properties": {
3519///    "_meta": {
3520///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
3521///      "type": "object",
3522///      "additionalProperties": {}
3523///    },
3524///    "nextCursor": {
3525///      "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
3526///      "type": "string"
3527///    },
3528///    "tools": {
3529///      "type": "array",
3530///      "items": {
3531///        "$ref": "#/definitions/Tool"
3532///      }
3533///    }
3534///  }
3535///}
3536/// ```
3537/// </details>
3538#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3539pub struct ListToolsResult {
3540    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
3541    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3542    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3543    /**An opaque token representing the pagination position after the last returned result.
3544    If present, there may be more results available.*/
3545    #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
3546    pub next_cursor: ::std::option::Option<::std::string::String>,
3547    pub tools: ::std::vec::Vec<Tool>,
3548}
3549/**The severity of a log message.
3550These map to syslog message severities, as specified in RFC-5424:
3551<https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1>*/
3552///
3553/// <details><summary>JSON schema</summary>
3554///
3555/// ```json
3556///{
3557///  "description": "The severity of a log message.\n\nThese map to syslog message severities, as specified in RFC-5424:\n<https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1>",
3558///  "type": "string",
3559///  "enum": [
3560///    "alert",
3561///    "critical",
3562///    "debug",
3563///    "emergency",
3564///    "error",
3565///    "info",
3566///    "notice",
3567///    "warning"
3568///  ]
3569///}
3570/// ```
3571/// </details>
3572#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3573pub enum LoggingLevel {
3574    #[serde(rename = "alert")]
3575    Alert,
3576    #[serde(rename = "critical")]
3577    Critical,
3578    #[serde(rename = "debug")]
3579    Debug,
3580    #[serde(rename = "emergency")]
3581    Emergency,
3582    #[serde(rename = "error")]
3583    Error,
3584    #[serde(rename = "info")]
3585    Info,
3586    #[serde(rename = "notice")]
3587    Notice,
3588    #[serde(rename = "warning")]
3589    Warning,
3590}
3591impl ::std::fmt::Display for LoggingLevel {
3592    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3593        match *self {
3594            Self::Alert => write!(f, "alert"),
3595            Self::Critical => write!(f, "critical"),
3596            Self::Debug => write!(f, "debug"),
3597            Self::Emergency => write!(f, "emergency"),
3598            Self::Error => write!(f, "error"),
3599            Self::Info => write!(f, "info"),
3600            Self::Notice => write!(f, "notice"),
3601            Self::Warning => write!(f, "warning"),
3602        }
3603    }
3604}
3605///Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.
3606///
3607/// <details><summary>JSON schema</summary>
3608///
3609/// ```json
3610///{
3611///  "description": "Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.",
3612///  "type": "object",
3613///  "required": [
3614///    "method",
3615///    "params"
3616///  ],
3617///  "properties": {
3618///    "method": {
3619///      "type": "string",
3620///      "const": "notifications/message"
3621///    },
3622///    "params": {
3623///      "type": "object",
3624///      "required": [
3625///        "data",
3626///        "level"
3627///      ],
3628///      "properties": {
3629///        "data": {
3630///          "description": "The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here."
3631///        },
3632///        "level": {
3633///          "description": "The severity of this log message.",
3634///          "$ref": "#/definitions/LoggingLevel"
3635///        },
3636///        "logger": {
3637///          "description": "An optional name of the logger issuing this message.",
3638///          "type": "string"
3639///        }
3640///      }
3641///    }
3642///  }
3643///}
3644/// ```
3645/// </details>
3646#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3647pub struct LoggingMessageNotification {
3648    #[serde(deserialize_with = "validate::logging_message_notification_method")]
3649    method: ::std::string::String,
3650    pub params: LoggingMessageNotificationParams,
3651}
3652impl LoggingMessageNotification {
3653    pub fn new(params: LoggingMessageNotificationParams) -> Self {
3654        Self {
3655            method: "notifications/message".to_string(),
3656            params,
3657        }
3658    }
3659    pub fn method(&self) -> &::std::string::String {
3660        &self.method
3661    }
3662    pub fn method_name() -> ::std::string::String {
3663        "notifications/message".to_string()
3664    }
3665}
3666///LoggingMessageNotificationParams
3667///
3668/// <details><summary>JSON schema</summary>
3669///
3670/// ```json
3671///{
3672///  "type": "object",
3673///  "required": [
3674///    "data",
3675///    "level"
3676///  ],
3677///  "properties": {
3678///    "data": {
3679///      "description": "The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here."
3680///    },
3681///    "level": {
3682///      "description": "The severity of this log message.",
3683///      "$ref": "#/definitions/LoggingLevel"
3684///    },
3685///    "logger": {
3686///      "description": "An optional name of the logger issuing this message.",
3687///      "type": "string"
3688///    }
3689///  }
3690///}
3691/// ```
3692/// </details>
3693#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3694pub struct LoggingMessageNotificationParams {
3695    ///The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
3696    pub data: ::serde_json::Value,
3697    ///The severity of this log message.
3698    pub level: LoggingLevel,
3699    ///An optional name of the logger issuing this message.
3700    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3701    pub logger: ::std::option::Option<::std::string::String>,
3702}
3703/**Hints to use for model selection.
3704Keys not declared here are currently left unspecified by the spec and are up
3705to the client to interpret.*/
3706///
3707/// <details><summary>JSON schema</summary>
3708///
3709/// ```json
3710///{
3711///  "description": "Hints to use for model selection.\n\nKeys not declared here are currently left unspecified by the spec and are up\nto the client to interpret.",
3712///  "type": "object",
3713///  "properties": {
3714///    "name": {
3715///      "description": "A hint for a model name.\n\nThe client SHOULD treat this as a substring of a model name; for example:\n - claude-3-5-sonnet should match claude-3-5-sonnet-20241022\n - sonnet should match claude-3-5-sonnet-20241022, claude-3-sonnet-20240229, etc.\n - claude should match any Claude model\n\nThe client MAY also map the string to a different provider's model name or a different model family, as long as it fills a similar niche; for example:\n - gemini-1.5-flash could match claude-3-haiku-20240307",
3716///      "type": "string"
3717///    }
3718///  }
3719///}
3720/// ```
3721/// </details>
3722#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
3723pub struct ModelHint {
3724    /**A hint for a model name.
3725    The client SHOULD treat this as a substring of a model name; for example:
3726     - claude-3-5-sonnet should match claude-3-5-sonnet-20241022
3727     - sonnet should match claude-3-5-sonnet-20241022, claude-3-sonnet-20240229, etc.
3728     - claude should match any Claude model
3729    The client MAY also map the string to a different provider's model name or a different model family, as long as it fills a similar niche; for example:
3730     - gemini-1.5-flash could match claude-3-haiku-20240307*/
3731    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3732    pub name: ::std::option::Option<::std::string::String>,
3733}
3734/**The server's preferences for model selection, requested of the client during sampling.
3735Because LLMs can vary along multiple dimensions, choosing the "best" model is
3736rarely straightforward.  Different models excel in different areas—some are
3737faster but less capable, others are more capable but more expensive, and so
3738on. This interface allows servers to express their priorities across multiple
3739dimensions to help clients make an appropriate selection for their use case.
3740These preferences are always advisory. The client MAY ignore them. It is also
3741up to the client to decide how to interpret these preferences and how to
3742balance them against other considerations.*/
3743///
3744/// <details><summary>JSON schema</summary>
3745///
3746/// ```json
3747///{
3748///  "description": "The server's preferences for model selection, requested of the client during sampling.\n\nBecause LLMs can vary along multiple dimensions, choosing the \"best\" model is\nrarely straightforward.  Different models excel in different areas—some are\nfaster but less capable, others are more capable but more expensive, and so\non. This interface allows servers to express their priorities across multiple\ndimensions to help clients make an appropriate selection for their use case.\n\nThese preferences are always advisory. The client MAY ignore them. It is also\nup to the client to decide how to interpret these preferences and how to\nbalance them against other considerations.",
3749///  "type": "object",
3750///  "properties": {
3751///    "costPriority": {
3752///      "description": "How much to prioritize cost when selecting a model. A value of 0 means cost\nis not important, while a value of 1 means cost is the most important\nfactor.",
3753///      "type": "number",
3754///      "maximum": 1.0,
3755///      "minimum": 0.0
3756///    },
3757///    "hints": {
3758///      "description": "Optional hints to use for model selection.\n\nIf multiple hints are specified, the client MUST evaluate them in order\n(such that the first match is taken).\n\nThe client SHOULD prioritize these hints over the numeric priorities, but\nMAY still use the priorities to select from ambiguous matches.",
3759///      "type": "array",
3760///      "items": {
3761///        "$ref": "#/definitions/ModelHint"
3762///      }
3763///    },
3764///    "intelligencePriority": {
3765///      "description": "How much to prioritize intelligence and capabilities when selecting a\nmodel. A value of 0 means intelligence is not important, while a value of 1\nmeans intelligence is the most important factor.",
3766///      "type": "number",
3767///      "maximum": 1.0,
3768///      "minimum": 0.0
3769///    },
3770///    "speedPriority": {
3771///      "description": "How much to prioritize sampling speed (latency) when selecting a model. A\nvalue of 0 means speed is not important, while a value of 1 means speed is\nthe most important factor.",
3772///      "type": "number",
3773///      "maximum": 1.0,
3774///      "minimum": 0.0
3775///    }
3776///  }
3777///}
3778/// ```
3779/// </details>
3780#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
3781pub struct ModelPreferences {
3782    #[serde(rename = "costPriority", default, skip_serializing_if = "::std::option::Option::is_none")]
3783    pub cost_priority: ::std::option::Option<f64>,
3784    /**Optional hints to use for model selection.
3785    If multiple hints are specified, the client MUST evaluate them in order
3786    (such that the first match is taken).
3787    The client SHOULD prioritize these hints over the numeric priorities, but
3788    MAY still use the priorities to select from ambiguous matches.*/
3789    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
3790    pub hints: ::std::vec::Vec<ModelHint>,
3791    #[serde(
3792        rename = "intelligencePriority",
3793        default,
3794        skip_serializing_if = "::std::option::Option::is_none"
3795    )]
3796    pub intelligence_priority: ::std::option::Option<f64>,
3797    #[serde(rename = "speedPriority", default, skip_serializing_if = "::std::option::Option::is_none")]
3798    pub speed_priority: ::std::option::Option<f64>,
3799}
3800///Notification
3801///
3802/// <details><summary>JSON schema</summary>
3803///
3804/// ```json
3805///{
3806///  "type": "object",
3807///  "required": [
3808///    "method"
3809///  ],
3810///  "properties": {
3811///    "method": {
3812///      "type": "string"
3813///    },
3814///    "params": {
3815///      "type": "object",
3816///      "properties": {
3817///        "_meta": {
3818///          "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
3819///          "type": "object",
3820///          "additionalProperties": {}
3821///        }
3822///      },
3823///      "additionalProperties": {}
3824///    }
3825///  }
3826///}
3827/// ```
3828/// </details>
3829#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3830pub struct Notification {
3831    pub method: ::std::string::String,
3832    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3833    pub params: ::std::option::Option<NotificationParams>,
3834}
3835///NotificationParams
3836///
3837/// <details><summary>JSON schema</summary>
3838///
3839/// ```json
3840///{
3841///  "type": "object",
3842///  "properties": {
3843///    "_meta": {
3844///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
3845///      "type": "object",
3846///      "additionalProperties": {}
3847///    }
3848///  },
3849///  "additionalProperties": {}
3850///}
3851/// ```
3852/// </details>
3853#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
3854pub struct NotificationParams {
3855    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
3856    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3857    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3858    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
3859    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3860}
3861///NumberSchema
3862///
3863/// <details><summary>JSON schema</summary>
3864///
3865/// ```json
3866///{
3867///  "type": "object",
3868///  "required": [
3869///    "type"
3870///  ],
3871///  "properties": {
3872///    "description": {
3873///      "type": "string"
3874///    },
3875///    "maximum": {
3876///      "type": "integer"
3877///    },
3878///    "minimum": {
3879///      "type": "integer"
3880///    },
3881///    "title": {
3882///      "type": "string"
3883///    },
3884///    "type": {
3885///      "type": "string",
3886///      "enum": [
3887///        "integer",
3888///        "number"
3889///      ]
3890///    }
3891///  }
3892///}
3893/// ```
3894/// </details>
3895#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3896pub struct NumberSchema {
3897    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3898    pub description: ::std::option::Option<::std::string::String>,
3899    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3900    pub maximum: ::std::option::Option<i64>,
3901    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3902    pub minimum: ::std::option::Option<i64>,
3903    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3904    pub title: ::std::option::Option<::std::string::String>,
3905    #[serde(rename = "type")]
3906    pub type_: NumberSchemaType,
3907}
3908///NumberSchemaType
3909///
3910/// <details><summary>JSON schema</summary>
3911///
3912/// ```json
3913///{
3914///  "type": "string",
3915///  "enum": [
3916///    "integer",
3917///    "number"
3918///  ]
3919///}
3920/// ```
3921/// </details>
3922#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3923pub enum NumberSchemaType {
3924    #[serde(rename = "integer")]
3925    Integer,
3926    #[serde(rename = "number")]
3927    Number,
3928}
3929impl ::std::fmt::Display for NumberSchemaType {
3930    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3931        match *self {
3932            Self::Integer => write!(f, "integer"),
3933            Self::Number => write!(f, "number"),
3934        }
3935    }
3936}
3937///PaginatedRequest
3938///
3939/// <details><summary>JSON schema</summary>
3940///
3941/// ```json
3942///{
3943///  "type": "object",
3944///  "required": [
3945///    "method"
3946///  ],
3947///  "properties": {
3948///    "method": {
3949///      "type": "string"
3950///    },
3951///    "params": {
3952///      "type": "object",
3953///      "properties": {
3954///        "cursor": {
3955///          "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.",
3956///          "type": "string"
3957///        }
3958///      }
3959///    }
3960///  }
3961///}
3962/// ```
3963/// </details>
3964#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3965pub struct PaginatedRequest {
3966    pub method: ::std::string::String,
3967    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3968    pub params: ::std::option::Option<PaginatedRequestParams>,
3969}
3970///PaginatedRequestParams
3971///
3972/// <details><summary>JSON schema</summary>
3973///
3974/// ```json
3975///{
3976///  "type": "object",
3977///  "properties": {
3978///    "cursor": {
3979///      "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.",
3980///      "type": "string"
3981///    }
3982///  }
3983///}
3984/// ```
3985/// </details>
3986#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
3987pub struct PaginatedRequestParams {
3988    /**An opaque token representing the current pagination position.
3989    If provided, the server should return results starting after this cursor.*/
3990    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3991    pub cursor: ::std::option::Option<::std::string::String>,
3992}
3993///PaginatedResult
3994///
3995/// <details><summary>JSON schema</summary>
3996///
3997/// ```json
3998///{
3999///  "type": "object",
4000///  "properties": {
4001///    "_meta": {
4002///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
4003///      "type": "object",
4004///      "additionalProperties": {}
4005///    },
4006///    "nextCursor": {
4007///      "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
4008///      "type": "string"
4009///    }
4010///  }
4011///}
4012/// ```
4013/// </details>
4014#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
4015pub struct PaginatedResult {
4016    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
4017    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4018    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4019    /**An opaque token representing the pagination position after the last returned result.
4020    If present, there may be more results available.*/
4021    #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
4022    pub next_cursor: ::std::option::Option<::std::string::String>,
4023}
4024///A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.
4025///
4026/// <details><summary>JSON schema</summary>
4027///
4028/// ```json
4029///{
4030///  "description": "A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.",
4031///  "type": "object",
4032///  "required": [
4033///    "method"
4034///  ],
4035///  "properties": {
4036///    "method": {
4037///      "type": "string",
4038///      "const": "ping"
4039///    },
4040///    "params": {
4041///      "type": "object",
4042///      "properties": {
4043///        "_meta": {
4044///          "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
4045///          "type": "object",
4046///          "properties": {
4047///            "progressToken": {
4048///              "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
4049///              "$ref": "#/definitions/ProgressToken"
4050///            }
4051///          },
4052///          "additionalProperties": {}
4053///        }
4054///      },
4055///      "additionalProperties": {}
4056///    }
4057///  }
4058///}
4059/// ```
4060/// </details>
4061#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4062pub struct PingRequest {
4063    #[serde(deserialize_with = "validate::ping_request_method")]
4064    method: ::std::string::String,
4065    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4066    pub params: ::std::option::Option<PingRequestParams>,
4067}
4068impl PingRequest {
4069    pub fn new(params: ::std::option::Option<PingRequestParams>) -> Self {
4070        Self {
4071            method: "ping".to_string(),
4072            params,
4073        }
4074    }
4075    pub fn method(&self) -> &::std::string::String {
4076        &self.method
4077    }
4078    pub fn method_name() -> ::std::string::String {
4079        "ping".to_string()
4080    }
4081}
4082///PingRequestParams
4083///
4084/// <details><summary>JSON schema</summary>
4085///
4086/// ```json
4087///{
4088///  "type": "object",
4089///  "properties": {
4090///    "_meta": {
4091///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
4092///      "type": "object",
4093///      "properties": {
4094///        "progressToken": {
4095///          "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
4096///          "$ref": "#/definitions/ProgressToken"
4097///        }
4098///      },
4099///      "additionalProperties": {}
4100///    }
4101///  },
4102///  "additionalProperties": {}
4103///}
4104/// ```
4105/// </details>
4106#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
4107pub struct PingRequestParams {
4108    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4109    pub meta: ::std::option::Option<PingRequestParamsMeta>,
4110    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
4111    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4112}
4113///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
4114///
4115/// <details><summary>JSON schema</summary>
4116///
4117/// ```json
4118///{
4119///  "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
4120///  "type": "object",
4121///  "properties": {
4122///    "progressToken": {
4123///      "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
4124///      "$ref": "#/definitions/ProgressToken"
4125///    }
4126///  },
4127///  "additionalProperties": {}
4128///}
4129/// ```
4130/// </details>
4131#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
4132pub struct PingRequestParamsMeta {
4133    ///If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
4134    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
4135    pub progress_token: ::std::option::Option<ProgressToken>,
4136    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
4137    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4138}
4139/**Restricted schema definitions that only allow primitive types
4140without nested objects or arrays.*/
4141///
4142/// <details><summary>JSON schema</summary>
4143///
4144/// ```json
4145///{
4146///  "description": "Restricted schema definitions that only allow primitive types\nwithout nested objects or arrays.",
4147///  "anyOf": [
4148///    {
4149///      "$ref": "#/definitions/StringSchema"
4150///    },
4151///    {
4152///      "$ref": "#/definitions/NumberSchema"
4153///    },
4154///    {
4155///      "$ref": "#/definitions/BooleanSchema"
4156///    },
4157///    {
4158///      "$ref": "#/definitions/EnumSchema"
4159///    }
4160///  ]
4161///}
4162/// ```
4163/// </details>
4164#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4165#[serde(untagged)]
4166pub enum PrimitiveSchemaDefinition {
4167    StringSchema(StringSchema),
4168    NumberSchema(NumberSchema),
4169    BooleanSchema(BooleanSchema),
4170    EnumSchema(EnumSchema),
4171}
4172impl ::std::convert::From<StringSchema> for PrimitiveSchemaDefinition {
4173    fn from(value: StringSchema) -> Self {
4174        Self::StringSchema(value)
4175    }
4176}
4177impl ::std::convert::From<NumberSchema> for PrimitiveSchemaDefinition {
4178    fn from(value: NumberSchema) -> Self {
4179        Self::NumberSchema(value)
4180    }
4181}
4182impl ::std::convert::From<BooleanSchema> for PrimitiveSchemaDefinition {
4183    fn from(value: BooleanSchema) -> Self {
4184        Self::BooleanSchema(value)
4185    }
4186}
4187impl ::std::convert::From<EnumSchema> for PrimitiveSchemaDefinition {
4188    fn from(value: EnumSchema) -> Self {
4189        Self::EnumSchema(value)
4190    }
4191}
4192///An out-of-band notification used to inform the receiver of a progress update for a long-running request.
4193///
4194/// <details><summary>JSON schema</summary>
4195///
4196/// ```json
4197///{
4198///  "description": "An out-of-band notification used to inform the receiver of a progress update for a long-running request.",
4199///  "type": "object",
4200///  "required": [
4201///    "method",
4202///    "params"
4203///  ],
4204///  "properties": {
4205///    "method": {
4206///      "type": "string",
4207///      "const": "notifications/progress"
4208///    },
4209///    "params": {
4210///      "type": "object",
4211///      "required": [
4212///        "progress",
4213///        "progressToken"
4214///      ],
4215///      "properties": {
4216///        "message": {
4217///          "description": "An optional message describing the current progress.",
4218///          "type": "string"
4219///        },
4220///        "progress": {
4221///          "description": "The progress thus far. This should increase every time progress is made, even if the total is unknown.",
4222///          "type": "number"
4223///        },
4224///        "progressToken": {
4225///          "description": "The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.",
4226///          "$ref": "#/definitions/ProgressToken"
4227///        },
4228///        "total": {
4229///          "description": "Total number of items to process (or total progress required), if known.",
4230///          "type": "number"
4231///        }
4232///      }
4233///    }
4234///  }
4235///}
4236/// ```
4237/// </details>
4238#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4239pub struct ProgressNotification {
4240    #[serde(deserialize_with = "validate::progress_notification_method")]
4241    method: ::std::string::String,
4242    pub params: ProgressNotificationParams,
4243}
4244impl ProgressNotification {
4245    pub fn new(params: ProgressNotificationParams) -> Self {
4246        Self {
4247            method: "notifications/progress".to_string(),
4248            params,
4249        }
4250    }
4251    pub fn method(&self) -> &::std::string::String {
4252        &self.method
4253    }
4254    pub fn method_name() -> ::std::string::String {
4255        "notifications/progress".to_string()
4256    }
4257}
4258///ProgressNotificationParams
4259///
4260/// <details><summary>JSON schema</summary>
4261///
4262/// ```json
4263///{
4264///  "type": "object",
4265///  "required": [
4266///    "progress",
4267///    "progressToken"
4268///  ],
4269///  "properties": {
4270///    "message": {
4271///      "description": "An optional message describing the current progress.",
4272///      "type": "string"
4273///    },
4274///    "progress": {
4275///      "description": "The progress thus far. This should increase every time progress is made, even if the total is unknown.",
4276///      "type": "number"
4277///    },
4278///    "progressToken": {
4279///      "description": "The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.",
4280///      "$ref": "#/definitions/ProgressToken"
4281///    },
4282///    "total": {
4283///      "description": "Total number of items to process (or total progress required), if known.",
4284///      "type": "number"
4285///    }
4286///  }
4287///}
4288/// ```
4289/// </details>
4290#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4291pub struct ProgressNotificationParams {
4292    ///An optional message describing the current progress.
4293    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4294    pub message: ::std::option::Option<::std::string::String>,
4295    pub progress: f64,
4296    ///The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
4297    #[serde(rename = "progressToken")]
4298    pub progress_token: ProgressToken,
4299    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4300    pub total: ::std::option::Option<f64>,
4301}
4302///A progress token, used to associate progress notifications with the original request.
4303///
4304/// <details><summary>JSON schema</summary>
4305///
4306/// ```json
4307///{
4308///  "description": "A progress token, used to associate progress notifications with the original request.",
4309///  "type": [
4310///    "string",
4311///    "integer"
4312///  ]
4313///}
4314/// ```
4315/// </details>
4316#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4317#[serde(untagged)]
4318pub enum ProgressToken {
4319    String(::std::string::String),
4320    Integer(i64),
4321}
4322impl ::std::convert::From<i64> for ProgressToken {
4323    fn from(value: i64) -> Self {
4324        Self::Integer(value)
4325    }
4326}
4327///A prompt or prompt template that the server offers.
4328///
4329/// <details><summary>JSON schema</summary>
4330///
4331/// ```json
4332///{
4333///  "description": "A prompt or prompt template that the server offers.",
4334///  "type": "object",
4335///  "required": [
4336///    "name"
4337///  ],
4338///  "properties": {
4339///    "_meta": {
4340///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
4341///      "type": "object",
4342///      "additionalProperties": {}
4343///    },
4344///    "arguments": {
4345///      "description": "A list of arguments to use for templating the prompt.",
4346///      "type": "array",
4347///      "items": {
4348///        "$ref": "#/definitions/PromptArgument"
4349///      }
4350///    },
4351///    "description": {
4352///      "description": "An optional description of what this prompt provides",
4353///      "type": "string"
4354///    },
4355///    "name": {
4356///      "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
4357///      "type": "string"
4358///    },
4359///    "title": {
4360///      "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
4361///      "type": "string"
4362///    }
4363///  }
4364///}
4365/// ```
4366/// </details>
4367#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4368pub struct Prompt {
4369    ///A list of arguments to use for templating the prompt.
4370    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
4371    pub arguments: ::std::vec::Vec<PromptArgument>,
4372    ///An optional description of what this prompt provides
4373    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4374    pub description: ::std::option::Option<::std::string::String>,
4375    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
4376    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4377    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4378    ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
4379    pub name: ::std::string::String,
4380    /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
4381    even by those unfamiliar with domain-specific terminology.
4382    If not provided, the name should be used for display (except for Tool,
4383    where annotations.title should be given precedence over using name,
4384    if present).*/
4385    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4386    pub title: ::std::option::Option<::std::string::String>,
4387}
4388///Describes an argument that a prompt can accept.
4389///
4390/// <details><summary>JSON schema</summary>
4391///
4392/// ```json
4393///{
4394///  "description": "Describes an argument that a prompt can accept.",
4395///  "type": "object",
4396///  "required": [
4397///    "name"
4398///  ],
4399///  "properties": {
4400///    "description": {
4401///      "description": "A human-readable description of the argument.",
4402///      "type": "string"
4403///    },
4404///    "name": {
4405///      "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
4406///      "type": "string"
4407///    },
4408///    "required": {
4409///      "description": "Whether this argument must be provided.",
4410///      "type": "boolean"
4411///    },
4412///    "title": {
4413///      "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
4414///      "type": "string"
4415///    }
4416///  }
4417///}
4418/// ```
4419/// </details>
4420#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4421pub struct PromptArgument {
4422    ///A human-readable description of the argument.
4423    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4424    pub description: ::std::option::Option<::std::string::String>,
4425    ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
4426    pub name: ::std::string::String,
4427    ///Whether this argument must be provided.
4428    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4429    pub required: ::std::option::Option<bool>,
4430    /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
4431    even by those unfamiliar with domain-specific terminology.
4432    If not provided, the name should be used for display (except for Tool,
4433    where annotations.title should be given precedence over using name,
4434    if present).*/
4435    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4436    pub title: ::std::option::Option<::std::string::String>,
4437}
4438///An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.
4439///
4440/// <details><summary>JSON schema</summary>
4441///
4442/// ```json
4443///{
4444///  "description": "An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.",
4445///  "type": "object",
4446///  "required": [
4447///    "method"
4448///  ],
4449///  "properties": {
4450///    "method": {
4451///      "type": "string",
4452///      "const": "notifications/prompts/list_changed"
4453///    },
4454///    "params": {
4455///      "type": "object",
4456///      "properties": {
4457///        "_meta": {
4458///          "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
4459///          "type": "object",
4460///          "additionalProperties": {}
4461///        }
4462///      },
4463///      "additionalProperties": {}
4464///    }
4465///  }
4466///}
4467/// ```
4468/// </details>
4469#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4470pub struct PromptListChangedNotification {
4471    #[serde(deserialize_with = "validate::prompt_list_changed_notification_method")]
4472    method: ::std::string::String,
4473    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4474    pub params: ::std::option::Option<PromptListChangedNotificationParams>,
4475}
4476impl PromptListChangedNotification {
4477    pub fn new(params: ::std::option::Option<PromptListChangedNotificationParams>) -> Self {
4478        Self {
4479            method: "notifications/prompts/list_changed".to_string(),
4480            params,
4481        }
4482    }
4483    pub fn method(&self) -> &::std::string::String {
4484        &self.method
4485    }
4486    pub fn method_name() -> ::std::string::String {
4487        "notifications/prompts/list_changed".to_string()
4488    }
4489}
4490///PromptListChangedNotificationParams
4491///
4492/// <details><summary>JSON schema</summary>
4493///
4494/// ```json
4495///{
4496///  "type": "object",
4497///  "properties": {
4498///    "_meta": {
4499///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
4500///      "type": "object",
4501///      "additionalProperties": {}
4502///    }
4503///  },
4504///  "additionalProperties": {}
4505///}
4506/// ```
4507/// </details>
4508#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
4509pub struct PromptListChangedNotificationParams {
4510    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
4511    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4512    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4513    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
4514    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4515}
4516/**Describes a message returned as part of a prompt.
4517This is similar to SamplingMessage, but also supports the embedding of
4518resources from the MCP server.*/
4519///
4520/// <details><summary>JSON schema</summary>
4521///
4522/// ```json
4523///{
4524///  "description": "Describes a message returned as part of a prompt.\n\nThis is similar to SamplingMessage, but also supports the embedding of\nresources from the MCP server.",
4525///  "type": "object",
4526///  "required": [
4527///    "content",
4528///    "role"
4529///  ],
4530///  "properties": {
4531///    "content": {
4532///      "$ref": "#/definitions/ContentBlock"
4533///    },
4534///    "role": {
4535///      "$ref": "#/definitions/Role"
4536///    }
4537///  }
4538///}
4539/// ```
4540/// </details>
4541#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4542pub struct PromptMessage {
4543    pub content: ContentBlock,
4544    pub role: Role,
4545}
4546///Identifies a prompt.
4547///
4548/// <details><summary>JSON schema</summary>
4549///
4550/// ```json
4551///{
4552///  "description": "Identifies a prompt.",
4553///  "type": "object",
4554///  "required": [
4555///    "name",
4556///    "type"
4557///  ],
4558///  "properties": {
4559///    "name": {
4560///      "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
4561///      "type": "string"
4562///    },
4563///    "title": {
4564///      "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
4565///      "type": "string"
4566///    },
4567///    "type": {
4568///      "type": "string",
4569///      "const": "ref/prompt"
4570///    }
4571///  }
4572///}
4573/// ```
4574/// </details>
4575#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4576pub struct PromptReference {
4577    ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
4578    pub name: ::std::string::String,
4579    /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
4580    even by those unfamiliar with domain-specific terminology.
4581    If not provided, the name should be used for display (except for Tool,
4582    where annotations.title should be given precedence over using name,
4583    if present).*/
4584    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4585    pub title: ::std::option::Option<::std::string::String>,
4586    #[serde(rename = "type", deserialize_with = "validate::prompt_reference_type_")]
4587    type_: ::std::string::String,
4588}
4589impl PromptReference {
4590    pub fn new(name: ::std::string::String, title: ::std::option::Option<::std::string::String>) -> Self {
4591        Self {
4592            name,
4593            title,
4594            type_: "ref/prompt".to_string(),
4595        }
4596    }
4597    pub fn type_(&self) -> &::std::string::String {
4598        &self.type_
4599    }
4600    pub fn type_name() -> ::std::string::String {
4601        "ref/prompt".to_string()
4602    }
4603}
4604///Sent from the client to the server, to read a specific resource URI.
4605///
4606/// <details><summary>JSON schema</summary>
4607///
4608/// ```json
4609///{
4610///  "description": "Sent from the client to the server, to read a specific resource URI.",
4611///  "type": "object",
4612///  "required": [
4613///    "method",
4614///    "params"
4615///  ],
4616///  "properties": {
4617///    "method": {
4618///      "type": "string",
4619///      "const": "resources/read"
4620///    },
4621///    "params": {
4622///      "type": "object",
4623///      "required": [
4624///        "uri"
4625///      ],
4626///      "properties": {
4627///        "uri": {
4628///          "description": "The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.",
4629///          "type": "string",
4630///          "format": "uri"
4631///        }
4632///      }
4633///    }
4634///  }
4635///}
4636/// ```
4637/// </details>
4638#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4639pub struct ReadResourceRequest {
4640    #[serde(deserialize_with = "validate::read_resource_request_method")]
4641    method: ::std::string::String,
4642    pub params: ReadResourceRequestParams,
4643}
4644impl ReadResourceRequest {
4645    pub fn new(params: ReadResourceRequestParams) -> Self {
4646        Self {
4647            method: "resources/read".to_string(),
4648            params,
4649        }
4650    }
4651    pub fn method(&self) -> &::std::string::String {
4652        &self.method
4653    }
4654    pub fn method_name() -> ::std::string::String {
4655        "resources/read".to_string()
4656    }
4657}
4658///ReadResourceRequestParams
4659///
4660/// <details><summary>JSON schema</summary>
4661///
4662/// ```json
4663///{
4664///  "type": "object",
4665///  "required": [
4666///    "uri"
4667///  ],
4668///  "properties": {
4669///    "uri": {
4670///      "description": "The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.",
4671///      "type": "string",
4672///      "format": "uri"
4673///    }
4674///  }
4675///}
4676/// ```
4677/// </details>
4678#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4679pub struct ReadResourceRequestParams {
4680    ///The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
4681    pub uri: ::std::string::String,
4682}
4683///The server's response to a resources/read request from the client.
4684///
4685/// <details><summary>JSON schema</summary>
4686///
4687/// ```json
4688///{
4689///  "description": "The server's response to a resources/read request from the client.",
4690///  "type": "object",
4691///  "required": [
4692///    "contents"
4693///  ],
4694///  "properties": {
4695///    "_meta": {
4696///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
4697///      "type": "object",
4698///      "additionalProperties": {}
4699///    },
4700///    "contents": {
4701///      "type": "array",
4702///      "items": {
4703///        "anyOf": [
4704///          {
4705///            "$ref": "#/definitions/TextResourceContents"
4706///          },
4707///          {
4708///            "$ref": "#/definitions/BlobResourceContents"
4709///          }
4710///        ]
4711///      }
4712///    }
4713///  }
4714///}
4715/// ```
4716/// </details>
4717#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4718pub struct ReadResourceResult {
4719    pub contents: ::std::vec::Vec<ReadResourceResultContentsItem>,
4720    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
4721    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4722    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4723}
4724///ReadResourceResultContentsItem
4725///
4726/// <details><summary>JSON schema</summary>
4727///
4728/// ```json
4729///{
4730///  "anyOf": [
4731///    {
4732///      "$ref": "#/definitions/TextResourceContents"
4733///    },
4734///    {
4735///      "$ref": "#/definitions/BlobResourceContents"
4736///    }
4737///  ]
4738///}
4739/// ```
4740/// </details>
4741#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4742#[serde(untagged)]
4743pub enum ReadResourceResultContentsItem {
4744    TextResourceContents(TextResourceContents),
4745    BlobResourceContents(BlobResourceContents),
4746}
4747impl ::std::convert::From<TextResourceContents> for ReadResourceResultContentsItem {
4748    fn from(value: TextResourceContents) -> Self {
4749        Self::TextResourceContents(value)
4750    }
4751}
4752impl ::std::convert::From<BlobResourceContents> for ReadResourceResultContentsItem {
4753    fn from(value: BlobResourceContents) -> Self {
4754        Self::BlobResourceContents(value)
4755    }
4756}
4757///Request
4758///
4759/// <details><summary>JSON schema</summary>
4760///
4761/// ```json
4762///{
4763///  "type": "object",
4764///  "required": [
4765///    "method"
4766///  ],
4767///  "properties": {
4768///    "method": {
4769///      "type": "string"
4770///    },
4771///    "params": {
4772///      "type": "object",
4773///      "properties": {
4774///        "_meta": {
4775///          "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
4776///          "type": "object",
4777///          "properties": {
4778///            "progressToken": {
4779///              "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
4780///              "$ref": "#/definitions/ProgressToken"
4781///            }
4782///          },
4783///          "additionalProperties": {}
4784///        }
4785///      },
4786///      "additionalProperties": {}
4787///    }
4788///  }
4789///}
4790/// ```
4791/// </details>
4792#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4793pub struct Request {
4794    pub method: ::std::string::String,
4795    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4796    pub params: ::std::option::Option<RequestParams>,
4797}
4798///A uniquely identifying ID for a request in JSON-RPC.
4799///
4800/// <details><summary>JSON schema</summary>
4801///
4802/// ```json
4803///{
4804///  "description": "A uniquely identifying ID for a request in JSON-RPC.",
4805///  "type": [
4806///    "string",
4807///    "integer"
4808///  ]
4809///}
4810/// ```
4811/// </details>
4812#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4813#[serde(untagged)]
4814pub enum RequestId {
4815    String(::std::string::String),
4816    Integer(i64),
4817}
4818impl ::std::convert::From<i64> for RequestId {
4819    fn from(value: i64) -> Self {
4820        Self::Integer(value)
4821    }
4822}
4823///RequestParams
4824///
4825/// <details><summary>JSON schema</summary>
4826///
4827/// ```json
4828///{
4829///  "type": "object",
4830///  "properties": {
4831///    "_meta": {
4832///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
4833///      "type": "object",
4834///      "properties": {
4835///        "progressToken": {
4836///          "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
4837///          "$ref": "#/definitions/ProgressToken"
4838///        }
4839///      },
4840///      "additionalProperties": {}
4841///    }
4842///  },
4843///  "additionalProperties": {}
4844///}
4845/// ```
4846/// </details>
4847#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
4848pub struct RequestParams {
4849    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4850    pub meta: ::std::option::Option<RequestParamsMeta>,
4851    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
4852    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4853}
4854///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
4855///
4856/// <details><summary>JSON schema</summary>
4857///
4858/// ```json
4859///{
4860///  "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
4861///  "type": "object",
4862///  "properties": {
4863///    "progressToken": {
4864///      "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
4865///      "$ref": "#/definitions/ProgressToken"
4866///    }
4867///  },
4868///  "additionalProperties": {}
4869///}
4870/// ```
4871/// </details>
4872#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
4873pub struct RequestParamsMeta {
4874    ///If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
4875    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
4876    pub progress_token: ::std::option::Option<ProgressToken>,
4877    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
4878    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4879}
4880///A known resource that the server is capable of reading.
4881///
4882/// <details><summary>JSON schema</summary>
4883///
4884/// ```json
4885///{
4886///  "description": "A known resource that the server is capable of reading.",
4887///  "type": "object",
4888///  "required": [
4889///    "name",
4890///    "uri"
4891///  ],
4892///  "properties": {
4893///    "_meta": {
4894///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
4895///      "type": "object",
4896///      "additionalProperties": {}
4897///    },
4898///    "annotations": {
4899///      "description": "Optional annotations for the client.",
4900///      "$ref": "#/definitions/Annotations"
4901///    },
4902///    "description": {
4903///      "description": "A description of what this resource represents.\n\nThis can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.",
4904///      "type": "string"
4905///    },
4906///    "mimeType": {
4907///      "description": "The MIME type of this resource, if known.",
4908///      "type": "string"
4909///    },
4910///    "name": {
4911///      "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
4912///      "type": "string"
4913///    },
4914///    "size": {
4915///      "description": "The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.\n\nThis can be used by Hosts to display file sizes and estimate context window usage.",
4916///      "type": "integer"
4917///    },
4918///    "title": {
4919///      "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
4920///      "type": "string"
4921///    },
4922///    "uri": {
4923///      "description": "The URI of this resource.",
4924///      "type": "string",
4925///      "format": "uri"
4926///    }
4927///  }
4928///}
4929/// ```
4930/// </details>
4931#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4932pub struct Resource {
4933    ///Optional annotations for the client.
4934    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4935    pub annotations: ::std::option::Option<Annotations>,
4936    /**A description of what this resource represents.
4937    This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.*/
4938    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4939    pub description: ::std::option::Option<::std::string::String>,
4940    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
4941    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4942    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4943    ///The MIME type of this resource, if known.
4944    #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
4945    pub mime_type: ::std::option::Option<::std::string::String>,
4946    ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
4947    pub name: ::std::string::String,
4948    /**The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
4949    This can be used by Hosts to display file sizes and estimate context window usage.*/
4950    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4951    pub size: ::std::option::Option<i64>,
4952    /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
4953    even by those unfamiliar with domain-specific terminology.
4954    If not provided, the name should be used for display (except for Tool,
4955    where annotations.title should be given precedence over using name,
4956    if present).*/
4957    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4958    pub title: ::std::option::Option<::std::string::String>,
4959    ///The URI of this resource.
4960    pub uri: ::std::string::String,
4961}
4962///The contents of a specific resource or sub-resource.
4963///
4964/// <details><summary>JSON schema</summary>
4965///
4966/// ```json
4967///{
4968///  "description": "The contents of a specific resource or sub-resource.",
4969///  "type": "object",
4970///  "required": [
4971///    "uri"
4972///  ],
4973///  "properties": {
4974///    "_meta": {
4975///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
4976///      "type": "object",
4977///      "additionalProperties": {}
4978///    },
4979///    "mimeType": {
4980///      "description": "The MIME type of this resource, if known.",
4981///      "type": "string"
4982///    },
4983///    "uri": {
4984///      "description": "The URI of this resource.",
4985///      "type": "string",
4986///      "format": "uri"
4987///    }
4988///  }
4989///}
4990/// ```
4991/// </details>
4992#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4993pub struct ResourceContents {
4994    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
4995    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4996    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4997    ///The MIME type of this resource, if known.
4998    #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
4999    pub mime_type: ::std::option::Option<::std::string::String>,
5000    ///The URI of this resource.
5001    pub uri: ::std::string::String,
5002}
5003/**A resource that the server is capable of reading, included in a prompt or tool call result.
5004Note: resource links returned by tools are not guaranteed to appear in the results of resources/list requests.*/
5005///
5006/// <details><summary>JSON schema</summary>
5007///
5008/// ```json
5009///{
5010///  "description": "A resource that the server is capable of reading, included in a prompt or tool call result.\n\nNote: resource links returned by tools are not guaranteed to appear in the results of resources/list requests.",
5011///  "type": "object",
5012///  "required": [
5013///    "name",
5014///    "type",
5015///    "uri"
5016///  ],
5017///  "properties": {
5018///    "_meta": {
5019///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
5020///      "type": "object",
5021///      "additionalProperties": {}
5022///    },
5023///    "annotations": {
5024///      "description": "Optional annotations for the client.",
5025///      "$ref": "#/definitions/Annotations"
5026///    },
5027///    "description": {
5028///      "description": "A description of what this resource represents.\n\nThis can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.",
5029///      "type": "string"
5030///    },
5031///    "mimeType": {
5032///      "description": "The MIME type of this resource, if known.",
5033///      "type": "string"
5034///    },
5035///    "name": {
5036///      "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
5037///      "type": "string"
5038///    },
5039///    "size": {
5040///      "description": "The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.\n\nThis can be used by Hosts to display file sizes and estimate context window usage.",
5041///      "type": "integer"
5042///    },
5043///    "title": {
5044///      "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
5045///      "type": "string"
5046///    },
5047///    "type": {
5048///      "type": "string",
5049///      "const": "resource_link"
5050///    },
5051///    "uri": {
5052///      "description": "The URI of this resource.",
5053///      "type": "string",
5054///      "format": "uri"
5055///    }
5056///  }
5057///}
5058/// ```
5059/// </details>
5060#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5061pub struct ResourceLink {
5062    ///Optional annotations for the client.
5063    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5064    pub annotations: ::std::option::Option<Annotations>,
5065    /**A description of what this resource represents.
5066    This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.*/
5067    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5068    pub description: ::std::option::Option<::std::string::String>,
5069    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
5070    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
5071    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5072    ///The MIME type of this resource, if known.
5073    #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
5074    pub mime_type: ::std::option::Option<::std::string::String>,
5075    ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
5076    pub name: ::std::string::String,
5077    /**The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
5078    This can be used by Hosts to display file sizes and estimate context window usage.*/
5079    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5080    pub size: ::std::option::Option<i64>,
5081    /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
5082    even by those unfamiliar with domain-specific terminology.
5083    If not provided, the name should be used for display (except for Tool,
5084    where annotations.title should be given precedence over using name,
5085    if present).*/
5086    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5087    pub title: ::std::option::Option<::std::string::String>,
5088    #[serde(rename = "type", deserialize_with = "validate::resource_link_type_")]
5089    type_: ::std::string::String,
5090    ///The URI of this resource.
5091    pub uri: ::std::string::String,
5092}
5093impl ResourceLink {
5094    #[allow(clippy::too_many_arguments)]
5095    pub fn new(
5096        name: ::std::string::String,
5097        uri: ::std::string::String,
5098        annotations: ::std::option::Option<Annotations>,
5099        description: ::std::option::Option<::std::string::String>,
5100        meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5101        mime_type: ::std::option::Option<::std::string::String>,
5102        size: ::std::option::Option<i64>,
5103        title: ::std::option::Option<::std::string::String>,
5104    ) -> Self {
5105        Self {
5106            annotations,
5107            description,
5108            meta,
5109            mime_type,
5110            name,
5111            size,
5112            title,
5113            type_: "resource_link".to_string(),
5114            uri,
5115        }
5116    }
5117    pub fn type_(&self) -> &::std::string::String {
5118        &self.type_
5119    }
5120    pub fn type_name() -> ::std::string::String {
5121        "resource_link".to_string()
5122    }
5123}
5124///An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.
5125///
5126/// <details><summary>JSON schema</summary>
5127///
5128/// ```json
5129///{
5130///  "description": "An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.",
5131///  "type": "object",
5132///  "required": [
5133///    "method"
5134///  ],
5135///  "properties": {
5136///    "method": {
5137///      "type": "string",
5138///      "const": "notifications/resources/list_changed"
5139///    },
5140///    "params": {
5141///      "type": "object",
5142///      "properties": {
5143///        "_meta": {
5144///          "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
5145///          "type": "object",
5146///          "additionalProperties": {}
5147///        }
5148///      },
5149///      "additionalProperties": {}
5150///    }
5151///  }
5152///}
5153/// ```
5154/// </details>
5155#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5156pub struct ResourceListChangedNotification {
5157    #[serde(deserialize_with = "validate::resource_list_changed_notification_method")]
5158    method: ::std::string::String,
5159    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5160    pub params: ::std::option::Option<ResourceListChangedNotificationParams>,
5161}
5162impl ResourceListChangedNotification {
5163    pub fn new(params: ::std::option::Option<ResourceListChangedNotificationParams>) -> Self {
5164        Self {
5165            method: "notifications/resources/list_changed".to_string(),
5166            params,
5167        }
5168    }
5169    pub fn method(&self) -> &::std::string::String {
5170        &self.method
5171    }
5172    pub fn method_name() -> ::std::string::String {
5173        "notifications/resources/list_changed".to_string()
5174    }
5175}
5176///ResourceListChangedNotificationParams
5177///
5178/// <details><summary>JSON schema</summary>
5179///
5180/// ```json
5181///{
5182///  "type": "object",
5183///  "properties": {
5184///    "_meta": {
5185///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
5186///      "type": "object",
5187///      "additionalProperties": {}
5188///    }
5189///  },
5190///  "additionalProperties": {}
5191///}
5192/// ```
5193/// </details>
5194#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5195pub struct ResourceListChangedNotificationParams {
5196    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
5197    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
5198    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5199    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
5200    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5201}
5202///A template description for resources available on the server.
5203///
5204/// <details><summary>JSON schema</summary>
5205///
5206/// ```json
5207///{
5208///  "description": "A template description for resources available on the server.",
5209///  "type": "object",
5210///  "required": [
5211///    "name",
5212///    "uriTemplate"
5213///  ],
5214///  "properties": {
5215///    "_meta": {
5216///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
5217///      "type": "object",
5218///      "additionalProperties": {}
5219///    },
5220///    "annotations": {
5221///      "description": "Optional annotations for the client.",
5222///      "$ref": "#/definitions/Annotations"
5223///    },
5224///    "description": {
5225///      "description": "A description of what this template is for.\n\nThis can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.",
5226///      "type": "string"
5227///    },
5228///    "mimeType": {
5229///      "description": "The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.",
5230///      "type": "string"
5231///    },
5232///    "name": {
5233///      "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
5234///      "type": "string"
5235///    },
5236///    "title": {
5237///      "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
5238///      "type": "string"
5239///    },
5240///    "uriTemplate": {
5241///      "description": "A URI template (according to RFC 6570) that can be used to construct resource URIs.",
5242///      "type": "string",
5243///      "format": "uri-template"
5244///    }
5245///  }
5246///}
5247/// ```
5248/// </details>
5249#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5250pub struct ResourceTemplate {
5251    ///Optional annotations for the client.
5252    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5253    pub annotations: ::std::option::Option<Annotations>,
5254    /**A description of what this template is for.
5255    This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.*/
5256    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5257    pub description: ::std::option::Option<::std::string::String>,
5258    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
5259    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
5260    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5261    ///The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.
5262    #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
5263    pub mime_type: ::std::option::Option<::std::string::String>,
5264    ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
5265    pub name: ::std::string::String,
5266    /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
5267    even by those unfamiliar with domain-specific terminology.
5268    If not provided, the name should be used for display (except for Tool,
5269    where annotations.title should be given precedence over using name,
5270    if present).*/
5271    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5272    pub title: ::std::option::Option<::std::string::String>,
5273    ///A URI template (according to RFC 6570) that can be used to construct resource URIs.
5274    #[serde(rename = "uriTemplate")]
5275    pub uri_template: ::std::string::String,
5276}
5277///A reference to a resource or resource template definition.
5278///
5279/// <details><summary>JSON schema</summary>
5280///
5281/// ```json
5282///{
5283///  "description": "A reference to a resource or resource template definition.",
5284///  "type": "object",
5285///  "required": [
5286///    "type",
5287///    "uri"
5288///  ],
5289///  "properties": {
5290///    "type": {
5291///      "type": "string",
5292///      "const": "ref/resource"
5293///    },
5294///    "uri": {
5295///      "description": "The URI or URI template of the resource.",
5296///      "type": "string",
5297///      "format": "uri-template"
5298///    }
5299///  }
5300///}
5301/// ```
5302/// </details>
5303#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5304pub struct ResourceTemplateReference {
5305    #[serde(rename = "type", deserialize_with = "validate::resource_template_reference_type_")]
5306    type_: ::std::string::String,
5307    ///The URI or URI template of the resource.
5308    pub uri: ::std::string::String,
5309}
5310impl ResourceTemplateReference {
5311    pub fn new(uri: ::std::string::String) -> Self {
5312        Self {
5313            type_: "ref/resource".to_string(),
5314            uri,
5315        }
5316    }
5317    pub fn type_(&self) -> &::std::string::String {
5318        &self.type_
5319    }
5320    pub fn type_name() -> ::std::string::String {
5321        "ref/resource".to_string()
5322    }
5323}
5324///A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.
5325///
5326/// <details><summary>JSON schema</summary>
5327///
5328/// ```json
5329///{
5330///  "description": "A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.",
5331///  "type": "object",
5332///  "required": [
5333///    "method",
5334///    "params"
5335///  ],
5336///  "properties": {
5337///    "method": {
5338///      "type": "string",
5339///      "const": "notifications/resources/updated"
5340///    },
5341///    "params": {
5342///      "type": "object",
5343///      "required": [
5344///        "uri"
5345///      ],
5346///      "properties": {
5347///        "uri": {
5348///          "description": "The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.",
5349///          "type": "string",
5350///          "format": "uri"
5351///        }
5352///      }
5353///    }
5354///  }
5355///}
5356/// ```
5357/// </details>
5358#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5359pub struct ResourceUpdatedNotification {
5360    #[serde(deserialize_with = "validate::resource_updated_notification_method")]
5361    method: ::std::string::String,
5362    pub params: ResourceUpdatedNotificationParams,
5363}
5364impl ResourceUpdatedNotification {
5365    pub fn new(params: ResourceUpdatedNotificationParams) -> Self {
5366        Self {
5367            method: "notifications/resources/updated".to_string(),
5368            params,
5369        }
5370    }
5371    pub fn method(&self) -> &::std::string::String {
5372        &self.method
5373    }
5374    pub fn method_name() -> ::std::string::String {
5375        "notifications/resources/updated".to_string()
5376    }
5377}
5378///ResourceUpdatedNotificationParams
5379///
5380/// <details><summary>JSON schema</summary>
5381///
5382/// ```json
5383///{
5384///  "type": "object",
5385///  "required": [
5386///    "uri"
5387///  ],
5388///  "properties": {
5389///    "uri": {
5390///      "description": "The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.",
5391///      "type": "string",
5392///      "format": "uri"
5393///    }
5394///  }
5395///}
5396/// ```
5397/// </details>
5398#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5399pub struct ResourceUpdatedNotificationParams {
5400    ///The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
5401    pub uri: ::std::string::String,
5402}
5403///Result
5404///
5405/// <details><summary>JSON schema</summary>
5406///
5407/// ```json
5408///{
5409///  "type": "object",
5410///  "properties": {
5411///    "_meta": {
5412///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
5413///      "type": "object",
5414///      "additionalProperties": {}
5415///    }
5416///  },
5417///  "additionalProperties": {}
5418///}
5419/// ```
5420/// </details>
5421#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5422pub struct Result {
5423    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
5424    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
5425    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5426    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
5427    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5428}
5429///The sender or recipient of messages and data in a conversation.
5430///
5431/// <details><summary>JSON schema</summary>
5432///
5433/// ```json
5434///{
5435///  "description": "The sender or recipient of messages and data in a conversation.",
5436///  "type": "string",
5437///  "enum": [
5438///    "assistant",
5439///    "user"
5440///  ]
5441///}
5442/// ```
5443/// </details>
5444#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
5445pub enum Role {
5446    #[serde(rename = "assistant")]
5447    Assistant,
5448    #[serde(rename = "user")]
5449    User,
5450}
5451impl ::std::fmt::Display for Role {
5452    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5453        match *self {
5454            Self::Assistant => write!(f, "assistant"),
5455            Self::User => write!(f, "user"),
5456        }
5457    }
5458}
5459///Represents a root directory or file that the server can operate on.
5460///
5461/// <details><summary>JSON schema</summary>
5462///
5463/// ```json
5464///{
5465///  "description": "Represents a root directory or file that the server can operate on.",
5466///  "type": "object",
5467///  "required": [
5468///    "uri"
5469///  ],
5470///  "properties": {
5471///    "_meta": {
5472///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
5473///      "type": "object",
5474///      "additionalProperties": {}
5475///    },
5476///    "name": {
5477///      "description": "An optional name for the root. This can be used to provide a human-readable\nidentifier for the root, which may be useful for display purposes or for\nreferencing the root in other parts of the application.",
5478///      "type": "string"
5479///    },
5480///    "uri": {
5481///      "description": "The URI identifying the root. This *must* start with file:// for now.\nThis restriction may be relaxed in future versions of the protocol to allow\nother URI schemes.",
5482///      "type": "string",
5483///      "format": "uri"
5484///    }
5485///  }
5486///}
5487/// ```
5488/// </details>
5489#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5490pub struct Root {
5491    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
5492    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
5493    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5494    /**An optional name for the root. This can be used to provide a human-readable
5495    identifier for the root, which may be useful for display purposes or for
5496    referencing the root in other parts of the application.*/
5497    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5498    pub name: ::std::option::Option<::std::string::String>,
5499    /**The URI identifying the root. This *must* start with file:// for now.
5500    This restriction may be relaxed in future versions of the protocol to allow
5501    other URI schemes.*/
5502    pub uri: ::std::string::String,
5503}
5504/**A notification from the client to the server, informing it that the list of roots has changed.
5505This notification should be sent whenever the client adds, removes, or modifies any root.
5506The server should then request an updated list of roots using the ListRootsRequest.*/
5507///
5508/// <details><summary>JSON schema</summary>
5509///
5510/// ```json
5511///{
5512///  "description": "A notification from the client to the server, informing it that the list of roots has changed.\nThis notification should be sent whenever the client adds, removes, or modifies any root.\nThe server should then request an updated list of roots using the ListRootsRequest.",
5513///  "type": "object",
5514///  "required": [
5515///    "method"
5516///  ],
5517///  "properties": {
5518///    "method": {
5519///      "type": "string",
5520///      "const": "notifications/roots/list_changed"
5521///    },
5522///    "params": {
5523///      "type": "object",
5524///      "properties": {
5525///        "_meta": {
5526///          "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
5527///          "type": "object",
5528///          "additionalProperties": {}
5529///        }
5530///      },
5531///      "additionalProperties": {}
5532///    }
5533///  }
5534///}
5535/// ```
5536/// </details>
5537#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5538pub struct RootsListChangedNotification {
5539    #[serde(deserialize_with = "validate::roots_list_changed_notification_method")]
5540    method: ::std::string::String,
5541    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5542    pub params: ::std::option::Option<RootsListChangedNotificationParams>,
5543}
5544impl RootsListChangedNotification {
5545    pub fn new(params: ::std::option::Option<RootsListChangedNotificationParams>) -> Self {
5546        Self {
5547            method: "notifications/roots/list_changed".to_string(),
5548            params,
5549        }
5550    }
5551    pub fn method(&self) -> &::std::string::String {
5552        &self.method
5553    }
5554    pub fn method_name() -> ::std::string::String {
5555        "notifications/roots/list_changed".to_string()
5556    }
5557}
5558///RootsListChangedNotificationParams
5559///
5560/// <details><summary>JSON schema</summary>
5561///
5562/// ```json
5563///{
5564///  "type": "object",
5565///  "properties": {
5566///    "_meta": {
5567///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
5568///      "type": "object",
5569///      "additionalProperties": {}
5570///    }
5571///  },
5572///  "additionalProperties": {}
5573///}
5574/// ```
5575/// </details>
5576#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5577pub struct RootsListChangedNotificationParams {
5578    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
5579    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
5580    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5581    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
5582    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5583}
5584///RpcError
5585///
5586/// <details><summary>JSON schema</summary>
5587///
5588/// ```json
5589///{
5590///  "type": "object",
5591///  "required": [
5592///    "code",
5593///    "message"
5594///  ],
5595///  "properties": {
5596///    "code": {
5597///      "description": "The error type that occurred.",
5598///      "type": "integer"
5599///    },
5600///    "data": {
5601///      "description": "Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.)."
5602///    },
5603///    "message": {
5604///      "description": "A short description of the error. The message SHOULD be limited to a concise single sentence.",
5605///      "type": "string"
5606///    }
5607///  }
5608///}
5609/// ```
5610/// </details>
5611#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5612pub struct RpcError {
5613    ///The error type that occurred.
5614    pub code: i64,
5615    ///Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
5616    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5617    pub data: ::std::option::Option<::serde_json::Value>,
5618    ///A short description of the error. The message SHOULD be limited to a concise single sentence.
5619    pub message: ::std::string::String,
5620}
5621///Describes a message issued to or received from an LLM API.
5622///
5623/// <details><summary>JSON schema</summary>
5624///
5625/// ```json
5626///{
5627///  "description": "Describes a message issued to or received from an LLM API.",
5628///  "type": "object",
5629///  "required": [
5630///    "content",
5631///    "role"
5632///  ],
5633///  "properties": {
5634///    "content": {
5635///      "anyOf": [
5636///        {
5637///          "$ref": "#/definitions/TextContent"
5638///        },
5639///        {
5640///          "$ref": "#/definitions/ImageContent"
5641///        },
5642///        {
5643///          "$ref": "#/definitions/AudioContent"
5644///        }
5645///      ]
5646///    },
5647///    "role": {
5648///      "$ref": "#/definitions/Role"
5649///    }
5650///  }
5651///}
5652/// ```
5653/// </details>
5654#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5655pub struct SamplingMessage {
5656    pub content: SamplingMessageContent,
5657    pub role: Role,
5658}
5659///SamplingMessageContent
5660///
5661/// <details><summary>JSON schema</summary>
5662///
5663/// ```json
5664///{
5665///  "anyOf": [
5666///    {
5667///      "$ref": "#/definitions/TextContent"
5668///    },
5669///    {
5670///      "$ref": "#/definitions/ImageContent"
5671///    },
5672///    {
5673///      "$ref": "#/definitions/AudioContent"
5674///    }
5675///  ]
5676///}
5677/// ```
5678/// </details>
5679#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5680#[serde(untagged)]
5681pub enum SamplingMessageContent {
5682    TextContent(TextContent),
5683    ImageContent(ImageContent),
5684    AudioContent(AudioContent),
5685}
5686impl ::std::convert::From<TextContent> for SamplingMessageContent {
5687    fn from(value: TextContent) -> Self {
5688        Self::TextContent(value)
5689    }
5690}
5691impl ::std::convert::From<ImageContent> for SamplingMessageContent {
5692    fn from(value: ImageContent) -> Self {
5693        Self::ImageContent(value)
5694    }
5695}
5696impl ::std::convert::From<AudioContent> for SamplingMessageContent {
5697    fn from(value: AudioContent) -> Self {
5698        Self::AudioContent(value)
5699    }
5700}
5701///Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.
5702///
5703/// <details><summary>JSON schema</summary>
5704///
5705/// ```json
5706///{
5707///  "description": "Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.",
5708///  "type": "object",
5709///  "properties": {
5710///    "completions": {
5711///      "description": "Present if the server supports argument autocompletion suggestions.",
5712///      "type": "object",
5713///      "additionalProperties": true
5714///    },
5715///    "experimental": {
5716///      "description": "Experimental, non-standard capabilities that the server supports.",
5717///      "type": "object",
5718///      "additionalProperties": {
5719///        "type": "object",
5720///        "additionalProperties": true
5721///      }
5722///    },
5723///    "logging": {
5724///      "description": "Present if the server supports sending log messages to the client.",
5725///      "type": "object",
5726///      "additionalProperties": true
5727///    },
5728///    "prompts": {
5729///      "description": "Present if the server offers any prompt templates.",
5730///      "type": "object",
5731///      "properties": {
5732///        "listChanged": {
5733///          "description": "Whether this server supports notifications for changes to the prompt list.",
5734///          "type": "boolean"
5735///        }
5736///      }
5737///    },
5738///    "resources": {
5739///      "description": "Present if the server offers any resources to read.",
5740///      "type": "object",
5741///      "properties": {
5742///        "listChanged": {
5743///          "description": "Whether this server supports notifications for changes to the resource list.",
5744///          "type": "boolean"
5745///        },
5746///        "subscribe": {
5747///          "description": "Whether this server supports subscribing to resource updates.",
5748///          "type": "boolean"
5749///        }
5750///      }
5751///    },
5752///    "tools": {
5753///      "description": "Present if the server offers any tools to call.",
5754///      "type": "object",
5755///      "properties": {
5756///        "listChanged": {
5757///          "description": "Whether this server supports notifications for changes to the tool list.",
5758///          "type": "boolean"
5759///        }
5760///      }
5761///    }
5762///  }
5763///}
5764/// ```
5765/// </details>
5766#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5767pub struct ServerCapabilities {
5768    ///Present if the server supports argument autocompletion suggestions.
5769    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5770    pub completions: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5771    ///Experimental, non-standard capabilities that the server supports.
5772    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5773    pub experimental: ::std::option::Option<
5774        ::std::collections::HashMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5775    >,
5776    ///Present if the server supports sending log messages to the client.
5777    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5778    pub logging: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5779    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5780    pub prompts: ::std::option::Option<ServerCapabilitiesPrompts>,
5781    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5782    pub resources: ::std::option::Option<ServerCapabilitiesResources>,
5783    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5784    pub tools: ::std::option::Option<ServerCapabilitiesTools>,
5785}
5786///Present if the server offers any prompt templates.
5787///
5788/// <details><summary>JSON schema</summary>
5789///
5790/// ```json
5791///{
5792///  "description": "Present if the server offers any prompt templates.",
5793///  "type": "object",
5794///  "properties": {
5795///    "listChanged": {
5796///      "description": "Whether this server supports notifications for changes to the prompt list.",
5797///      "type": "boolean"
5798///    }
5799///  }
5800///}
5801/// ```
5802/// </details>
5803#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5804pub struct ServerCapabilitiesPrompts {
5805    ///Whether this server supports notifications for changes to the prompt list.
5806    #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
5807    pub list_changed: ::std::option::Option<bool>,
5808}
5809///Present if the server offers any resources to read.
5810///
5811/// <details><summary>JSON schema</summary>
5812///
5813/// ```json
5814///{
5815///  "description": "Present if the server offers any resources to read.",
5816///  "type": "object",
5817///  "properties": {
5818///    "listChanged": {
5819///      "description": "Whether this server supports notifications for changes to the resource list.",
5820///      "type": "boolean"
5821///    },
5822///    "subscribe": {
5823///      "description": "Whether this server supports subscribing to resource updates.",
5824///      "type": "boolean"
5825///    }
5826///  }
5827///}
5828/// ```
5829/// </details>
5830#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5831pub struct ServerCapabilitiesResources {
5832    ///Whether this server supports notifications for changes to the resource list.
5833    #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
5834    pub list_changed: ::std::option::Option<bool>,
5835    ///Whether this server supports subscribing to resource updates.
5836    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5837    pub subscribe: ::std::option::Option<bool>,
5838}
5839///Present if the server offers any tools to call.
5840///
5841/// <details><summary>JSON schema</summary>
5842///
5843/// ```json
5844///{
5845///  "description": "Present if the server offers any tools to call.",
5846///  "type": "object",
5847///  "properties": {
5848///    "listChanged": {
5849///      "description": "Whether this server supports notifications for changes to the tool list.",
5850///      "type": "boolean"
5851///    }
5852///  }
5853///}
5854/// ```
5855/// </details>
5856#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5857pub struct ServerCapabilitiesTools {
5858    ///Whether this server supports notifications for changes to the tool list.
5859    #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
5860    pub list_changed: ::std::option::Option<bool>,
5861}
5862///ServerNotification
5863///
5864/// <details><summary>JSON schema</summary>
5865///
5866/// ```json
5867///{
5868///  "anyOf": [
5869///    {
5870///      "$ref": "#/definitions/CancelledNotification"
5871///    },
5872///    {
5873///      "$ref": "#/definitions/ProgressNotification"
5874///    },
5875///    {
5876///      "$ref": "#/definitions/ResourceListChangedNotification"
5877///    },
5878///    {
5879///      "$ref": "#/definitions/ResourceUpdatedNotification"
5880///    },
5881///    {
5882///      "$ref": "#/definitions/PromptListChangedNotification"
5883///    },
5884///    {
5885///      "$ref": "#/definitions/ToolListChangedNotification"
5886///    },
5887///    {
5888///      "$ref": "#/definitions/LoggingMessageNotification"
5889///    }
5890///  ]
5891///}
5892/// ```
5893/// </details>
5894#[derive(::serde::Serialize, Clone, Debug)]
5895#[serde(untagged)]
5896pub enum ServerNotification {
5897    CancelledNotification(CancelledNotification),
5898    ProgressNotification(ProgressNotification),
5899    ResourceListChangedNotification(ResourceListChangedNotification),
5900    ResourceUpdatedNotification(ResourceUpdatedNotification),
5901    PromptListChangedNotification(PromptListChangedNotification),
5902    ToolListChangedNotification(ToolListChangedNotification),
5903    LoggingMessageNotification(LoggingMessageNotification),
5904}
5905impl ::std::convert::From<CancelledNotification> for ServerNotification {
5906    fn from(value: CancelledNotification) -> Self {
5907        Self::CancelledNotification(value)
5908    }
5909}
5910impl ::std::convert::From<ProgressNotification> for ServerNotification {
5911    fn from(value: ProgressNotification) -> Self {
5912        Self::ProgressNotification(value)
5913    }
5914}
5915impl ::std::convert::From<ResourceListChangedNotification> for ServerNotification {
5916    fn from(value: ResourceListChangedNotification) -> Self {
5917        Self::ResourceListChangedNotification(value)
5918    }
5919}
5920impl ::std::convert::From<ResourceUpdatedNotification> for ServerNotification {
5921    fn from(value: ResourceUpdatedNotification) -> Self {
5922        Self::ResourceUpdatedNotification(value)
5923    }
5924}
5925impl ::std::convert::From<PromptListChangedNotification> for ServerNotification {
5926    fn from(value: PromptListChangedNotification) -> Self {
5927        Self::PromptListChangedNotification(value)
5928    }
5929}
5930impl ::std::convert::From<ToolListChangedNotification> for ServerNotification {
5931    fn from(value: ToolListChangedNotification) -> Self {
5932        Self::ToolListChangedNotification(value)
5933    }
5934}
5935impl ::std::convert::From<LoggingMessageNotification> for ServerNotification {
5936    fn from(value: LoggingMessageNotification) -> Self {
5937        Self::LoggingMessageNotification(value)
5938    }
5939}
5940///ServerRequest
5941///
5942/// <details><summary>JSON schema</summary>
5943///
5944/// ```json
5945///{
5946///  "anyOf": [
5947///    {
5948///      "$ref": "#/definitions/PingRequest"
5949///    },
5950///    {
5951///      "$ref": "#/definitions/CreateMessageRequest"
5952///    },
5953///    {
5954///      "$ref": "#/definitions/ListRootsRequest"
5955///    },
5956///    {
5957///      "$ref": "#/definitions/ElicitRequest"
5958///    }
5959///  ]
5960///}
5961/// ```
5962/// </details>
5963#[derive(::serde::Serialize, Clone, Debug)]
5964#[serde(untagged)]
5965#[allow(clippy::large_enum_variant)]
5966pub enum ServerRequest {
5967    PingRequest(PingRequest),
5968    CreateMessageRequest(CreateMessageRequest),
5969    ListRootsRequest(ListRootsRequest),
5970    ElicitRequest(ElicitRequest),
5971}
5972impl ::std::convert::From<PingRequest> for ServerRequest {
5973    fn from(value: PingRequest) -> Self {
5974        Self::PingRequest(value)
5975    }
5976}
5977impl ::std::convert::From<CreateMessageRequest> for ServerRequest {
5978    fn from(value: CreateMessageRequest) -> Self {
5979        Self::CreateMessageRequest(value)
5980    }
5981}
5982impl ::std::convert::From<ListRootsRequest> for ServerRequest {
5983    fn from(value: ListRootsRequest) -> Self {
5984        Self::ListRootsRequest(value)
5985    }
5986}
5987impl ::std::convert::From<ElicitRequest> for ServerRequest {
5988    fn from(value: ElicitRequest) -> Self {
5989        Self::ElicitRequest(value)
5990    }
5991}
5992///ServerResult
5993///
5994/// <details><summary>JSON schema</summary>
5995///
5996/// ```json
5997///{
5998///  "anyOf": [
5999///    {
6000///      "$ref": "#/definitions/Result"
6001///    },
6002///    {
6003///      "$ref": "#/definitions/InitializeResult"
6004///    },
6005///    {
6006///      "$ref": "#/definitions/ListResourcesResult"
6007///    },
6008///    {
6009///      "$ref": "#/definitions/ListResourceTemplatesResult"
6010///    },
6011///    {
6012///      "$ref": "#/definitions/ReadResourceResult"
6013///    },
6014///    {
6015///      "$ref": "#/definitions/ListPromptsResult"
6016///    },
6017///    {
6018///      "$ref": "#/definitions/GetPromptResult"
6019///    },
6020///    {
6021///      "$ref": "#/definitions/ListToolsResult"
6022///    },
6023///    {
6024///      "$ref": "#/definitions/CallToolResult"
6025///    },
6026///    {
6027///      "$ref": "#/definitions/CompleteResult"
6028///    }
6029///  ]
6030///}
6031/// ```
6032/// </details>
6033#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6034#[serde(untagged)]
6035#[allow(clippy::large_enum_variant)]
6036pub enum ServerResult {
6037    InitializeResult(InitializeResult),
6038    ListResourcesResult(ListResourcesResult),
6039    ListResourceTemplatesResult(ListResourceTemplatesResult),
6040    ReadResourceResult(ReadResourceResult),
6041    ListPromptsResult(ListPromptsResult),
6042    GetPromptResult(GetPromptResult),
6043    ListToolsResult(ListToolsResult),
6044    CallToolResult(CallToolResult),
6045    CompleteResult(CompleteResult),
6046    Result(Result),
6047}
6048impl ::std::convert::From<InitializeResult> for ServerResult {
6049    fn from(value: InitializeResult) -> Self {
6050        Self::InitializeResult(value)
6051    }
6052}
6053impl ::std::convert::From<ListResourcesResult> for ServerResult {
6054    fn from(value: ListResourcesResult) -> Self {
6055        Self::ListResourcesResult(value)
6056    }
6057}
6058impl ::std::convert::From<ListResourceTemplatesResult> for ServerResult {
6059    fn from(value: ListResourceTemplatesResult) -> Self {
6060        Self::ListResourceTemplatesResult(value)
6061    }
6062}
6063impl ::std::convert::From<ReadResourceResult> for ServerResult {
6064    fn from(value: ReadResourceResult) -> Self {
6065        Self::ReadResourceResult(value)
6066    }
6067}
6068impl ::std::convert::From<ListPromptsResult> for ServerResult {
6069    fn from(value: ListPromptsResult) -> Self {
6070        Self::ListPromptsResult(value)
6071    }
6072}
6073impl ::std::convert::From<GetPromptResult> for ServerResult {
6074    fn from(value: GetPromptResult) -> Self {
6075        Self::GetPromptResult(value)
6076    }
6077}
6078impl ::std::convert::From<ListToolsResult> for ServerResult {
6079    fn from(value: ListToolsResult) -> Self {
6080        Self::ListToolsResult(value)
6081    }
6082}
6083impl ::std::convert::From<CallToolResult> for ServerResult {
6084    fn from(value: CallToolResult) -> Self {
6085        Self::CallToolResult(value)
6086    }
6087}
6088impl ::std::convert::From<CompleteResult> for ServerResult {
6089    fn from(value: CompleteResult) -> Self {
6090        Self::CompleteResult(value)
6091    }
6092}
6093impl ::std::convert::From<Result> for ServerResult {
6094    fn from(value: Result) -> Self {
6095        Self::Result(value)
6096    }
6097}
6098///A request from the client to the server, to enable or adjust logging.
6099///
6100/// <details><summary>JSON schema</summary>
6101///
6102/// ```json
6103///{
6104///  "description": "A request from the client to the server, to enable or adjust logging.",
6105///  "type": "object",
6106///  "required": [
6107///    "method",
6108///    "params"
6109///  ],
6110///  "properties": {
6111///    "method": {
6112///      "type": "string",
6113///      "const": "logging/setLevel"
6114///    },
6115///    "params": {
6116///      "type": "object",
6117///      "required": [
6118///        "level"
6119///      ],
6120///      "properties": {
6121///        "level": {
6122///          "description": "The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/message.",
6123///          "$ref": "#/definitions/LoggingLevel"
6124///        }
6125///      }
6126///    }
6127///  }
6128///}
6129/// ```
6130/// </details>
6131#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6132pub struct SetLevelRequest {
6133    #[serde(deserialize_with = "validate::set_level_request_method")]
6134    method: ::std::string::String,
6135    pub params: SetLevelRequestParams,
6136}
6137impl SetLevelRequest {
6138    pub fn new(params: SetLevelRequestParams) -> Self {
6139        Self {
6140            method: "logging/setLevel".to_string(),
6141            params,
6142        }
6143    }
6144    pub fn method(&self) -> &::std::string::String {
6145        &self.method
6146    }
6147    pub fn method_name() -> ::std::string::String {
6148        "logging/setLevel".to_string()
6149    }
6150}
6151///SetLevelRequestParams
6152///
6153/// <details><summary>JSON schema</summary>
6154///
6155/// ```json
6156///{
6157///  "type": "object",
6158///  "required": [
6159///    "level"
6160///  ],
6161///  "properties": {
6162///    "level": {
6163///      "description": "The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/message.",
6164///      "$ref": "#/definitions/LoggingLevel"
6165///    }
6166///  }
6167///}
6168/// ```
6169/// </details>
6170#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6171pub struct SetLevelRequestParams {
6172    ///The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/message.
6173    pub level: LoggingLevel,
6174}
6175///StringSchema
6176///
6177/// <details><summary>JSON schema</summary>
6178///
6179/// ```json
6180///{
6181///  "type": "object",
6182///  "required": [
6183///    "type"
6184///  ],
6185///  "properties": {
6186///    "description": {
6187///      "type": "string"
6188///    },
6189///    "format": {
6190///      "type": "string",
6191///      "enum": [
6192///        "date",
6193///        "date-time",
6194///        "email",
6195///        "uri"
6196///      ]
6197///    },
6198///    "maxLength": {
6199///      "type": "integer"
6200///    },
6201///    "minLength": {
6202///      "type": "integer"
6203///    },
6204///    "title": {
6205///      "type": "string"
6206///    },
6207///    "type": {
6208///      "type": "string",
6209///      "const": "string"
6210///    }
6211///  }
6212///}
6213/// ```
6214/// </details>
6215#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6216pub struct StringSchema {
6217    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6218    pub description: ::std::option::Option<::std::string::String>,
6219    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6220    pub format: ::std::option::Option<StringSchemaFormat>,
6221    #[serde(rename = "maxLength", default, skip_serializing_if = "::std::option::Option::is_none")]
6222    pub max_length: ::std::option::Option<i64>,
6223    #[serde(rename = "minLength", default, skip_serializing_if = "::std::option::Option::is_none")]
6224    pub min_length: ::std::option::Option<i64>,
6225    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6226    pub title: ::std::option::Option<::std::string::String>,
6227    #[serde(rename = "type", deserialize_with = "validate::string_schema_type_")]
6228    type_: ::std::string::String,
6229}
6230impl StringSchema {
6231    pub fn new(
6232        description: ::std::option::Option<::std::string::String>,
6233        format: ::std::option::Option<StringSchemaFormat>,
6234        max_length: ::std::option::Option<i64>,
6235        min_length: ::std::option::Option<i64>,
6236        title: ::std::option::Option<::std::string::String>,
6237    ) -> Self {
6238        Self {
6239            description,
6240            format,
6241            max_length,
6242            min_length,
6243            title,
6244            type_: "string".to_string(),
6245        }
6246    }
6247    pub fn type_(&self) -> &::std::string::String {
6248        &self.type_
6249    }
6250    pub fn type_name() -> ::std::string::String {
6251        "string".to_string()
6252    }
6253}
6254///StringSchemaFormat
6255///
6256/// <details><summary>JSON schema</summary>
6257///
6258/// ```json
6259///{
6260///  "type": "string",
6261///  "enum": [
6262///    "date",
6263///    "date-time",
6264///    "email",
6265///    "uri"
6266///  ]
6267///}
6268/// ```
6269/// </details>
6270#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
6271pub enum StringSchemaFormat {
6272    #[serde(rename = "date")]
6273    Date,
6274    #[serde(rename = "date-time")]
6275    DateTime,
6276    #[serde(rename = "email")]
6277    Email,
6278    #[serde(rename = "uri")]
6279    Uri,
6280}
6281impl ::std::fmt::Display for StringSchemaFormat {
6282    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
6283        match *self {
6284            Self::Date => write!(f, "date"),
6285            Self::DateTime => write!(f, "date-time"),
6286            Self::Email => write!(f, "email"),
6287            Self::Uri => write!(f, "uri"),
6288        }
6289    }
6290}
6291///Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
6292///
6293/// <details><summary>JSON schema</summary>
6294///
6295/// ```json
6296///{
6297///  "description": "Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.",
6298///  "type": "object",
6299///  "required": [
6300///    "method",
6301///    "params"
6302///  ],
6303///  "properties": {
6304///    "method": {
6305///      "type": "string",
6306///      "const": "resources/subscribe"
6307///    },
6308///    "params": {
6309///      "type": "object",
6310///      "required": [
6311///        "uri"
6312///      ],
6313///      "properties": {
6314///        "uri": {
6315///          "description": "The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.",
6316///          "type": "string",
6317///          "format": "uri"
6318///        }
6319///      }
6320///    }
6321///  }
6322///}
6323/// ```
6324/// </details>
6325#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6326pub struct SubscribeRequest {
6327    #[serde(deserialize_with = "validate::subscribe_request_method")]
6328    method: ::std::string::String,
6329    pub params: SubscribeRequestParams,
6330}
6331impl SubscribeRequest {
6332    pub fn new(params: SubscribeRequestParams) -> Self {
6333        Self {
6334            method: "resources/subscribe".to_string(),
6335            params,
6336        }
6337    }
6338    pub fn method(&self) -> &::std::string::String {
6339        &self.method
6340    }
6341    pub fn method_name() -> ::std::string::String {
6342        "resources/subscribe".to_string()
6343    }
6344}
6345///SubscribeRequestParams
6346///
6347/// <details><summary>JSON schema</summary>
6348///
6349/// ```json
6350///{
6351///  "type": "object",
6352///  "required": [
6353///    "uri"
6354///  ],
6355///  "properties": {
6356///    "uri": {
6357///      "description": "The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.",
6358///      "type": "string",
6359///      "format": "uri"
6360///    }
6361///  }
6362///}
6363/// ```
6364/// </details>
6365#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6366pub struct SubscribeRequestParams {
6367    ///The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.
6368    pub uri: ::std::string::String,
6369}
6370///Text provided to or from an LLM.
6371///
6372/// <details><summary>JSON schema</summary>
6373///
6374/// ```json
6375///{
6376///  "description": "Text provided to or from an LLM.",
6377///  "type": "object",
6378///  "required": [
6379///    "text",
6380///    "type"
6381///  ],
6382///  "properties": {
6383///    "_meta": {
6384///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
6385///      "type": "object",
6386///      "additionalProperties": {}
6387///    },
6388///    "annotations": {
6389///      "description": "Optional annotations for the client.",
6390///      "$ref": "#/definitions/Annotations"
6391///    },
6392///    "text": {
6393///      "description": "The text content of the message.",
6394///      "type": "string"
6395///    },
6396///    "type": {
6397///      "type": "string",
6398///      "const": "text"
6399///    }
6400///  }
6401///}
6402/// ```
6403/// </details>
6404#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6405pub struct TextContent {
6406    ///Optional annotations for the client.
6407    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6408    pub annotations: ::std::option::Option<Annotations>,
6409    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
6410    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6411    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6412    ///The text content of the message.
6413    pub text: ::std::string::String,
6414    #[serde(rename = "type", deserialize_with = "validate::text_content_type_")]
6415    type_: ::std::string::String,
6416}
6417impl TextContent {
6418    pub fn new(
6419        text: ::std::string::String,
6420        annotations: ::std::option::Option<Annotations>,
6421        meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6422    ) -> Self {
6423        Self {
6424            annotations,
6425            meta,
6426            text,
6427            type_: "text".to_string(),
6428        }
6429    }
6430    pub fn type_(&self) -> &::std::string::String {
6431        &self.type_
6432    }
6433    pub fn type_name() -> ::std::string::String {
6434        "text".to_string()
6435    }
6436}
6437///TextResourceContents
6438///
6439/// <details><summary>JSON schema</summary>
6440///
6441/// ```json
6442///{
6443///  "type": "object",
6444///  "required": [
6445///    "text",
6446///    "uri"
6447///  ],
6448///  "properties": {
6449///    "_meta": {
6450///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
6451///      "type": "object",
6452///      "additionalProperties": {}
6453///    },
6454///    "mimeType": {
6455///      "description": "The MIME type of this resource, if known.",
6456///      "type": "string"
6457///    },
6458///    "text": {
6459///      "description": "The text of the item. This must only be set if the item can actually be represented as text (not binary data).",
6460///      "type": "string"
6461///    },
6462///    "uri": {
6463///      "description": "The URI of this resource.",
6464///      "type": "string",
6465///      "format": "uri"
6466///    }
6467///  }
6468///}
6469/// ```
6470/// </details>
6471#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6472pub struct TextResourceContents {
6473    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
6474    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6475    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6476    ///The MIME type of this resource, if known.
6477    #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
6478    pub mime_type: ::std::option::Option<::std::string::String>,
6479    ///The text of the item. This must only be set if the item can actually be represented as text (not binary data).
6480    pub text: ::std::string::String,
6481    ///The URI of this resource.
6482    pub uri: ::std::string::String,
6483}
6484///Definition for a tool the client can call.
6485///
6486/// <details><summary>JSON schema</summary>
6487///
6488/// ```json
6489///{
6490///  "description": "Definition for a tool the client can call.",
6491///  "type": "object",
6492///  "required": [
6493///    "inputSchema",
6494///    "name"
6495///  ],
6496///  "properties": {
6497///    "_meta": {
6498///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
6499///      "type": "object",
6500///      "additionalProperties": {}
6501///    },
6502///    "annotations": {
6503///      "description": "Optional additional tool information.\n\nDisplay name precedence order is: title, annotations.title, then name.",
6504///      "$ref": "#/definitions/ToolAnnotations"
6505///    },
6506///    "description": {
6507///      "description": "A human-readable description of the tool.\n\nThis can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a \"hint\" to the model.",
6508///      "type": "string"
6509///    },
6510///    "inputSchema": {
6511///      "description": "A JSON Schema object defining the expected parameters for the tool.",
6512///      "type": "object",
6513///      "required": [
6514///        "type"
6515///      ],
6516///      "properties": {
6517///        "properties": {
6518///          "type": "object",
6519///          "additionalProperties": {
6520///            "type": "object",
6521///            "additionalProperties": true
6522///          }
6523///        },
6524///        "required": {
6525///          "type": "array",
6526///          "items": {
6527///            "type": "string"
6528///          }
6529///        },
6530///        "type": {
6531///          "type": "string",
6532///          "const": "object"
6533///        }
6534///      }
6535///    },
6536///    "name": {
6537///      "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
6538///      "type": "string"
6539///    },
6540///    "outputSchema": {
6541///      "description": "An optional JSON Schema object defining the structure of the tool's output returned in\nthe structuredContent field of a CallToolResult.",
6542///      "type": "object",
6543///      "required": [
6544///        "type"
6545///      ],
6546///      "properties": {
6547///        "properties": {
6548///          "type": "object",
6549///          "additionalProperties": {
6550///            "type": "object",
6551///            "additionalProperties": true
6552///          }
6553///        },
6554///        "required": {
6555///          "type": "array",
6556///          "items": {
6557///            "type": "string"
6558///          }
6559///        },
6560///        "type": {
6561///          "type": "string",
6562///          "const": "object"
6563///        }
6564///      }
6565///    },
6566///    "title": {
6567///      "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
6568///      "type": "string"
6569///    }
6570///  }
6571///}
6572/// ```
6573/// </details>
6574#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6575pub struct Tool {
6576    /**Optional additional tool information.
6577    Display name precedence order is: title, annotations.title, then name.*/
6578    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6579    pub annotations: ::std::option::Option<ToolAnnotations>,
6580    /**A human-readable description of the tool.
6581    This can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a "hint" to the model.*/
6582    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6583    pub description: ::std::option::Option<::std::string::String>,
6584    #[serde(rename = "inputSchema")]
6585    pub input_schema: ToolInputSchema,
6586    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
6587    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6588    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6589    ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
6590    pub name: ::std::string::String,
6591    #[serde(rename = "outputSchema", default, skip_serializing_if = "::std::option::Option::is_none")]
6592    pub output_schema: ::std::option::Option<ToolOutputSchema>,
6593    /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
6594    even by those unfamiliar with domain-specific terminology.
6595    If not provided, the name should be used for display (except for Tool,
6596    where annotations.title should be given precedence over using name,
6597    if present).*/
6598    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6599    pub title: ::std::option::Option<::std::string::String>,
6600}
6601/**Additional properties describing a Tool to clients.
6602NOTE: all properties in ToolAnnotations are **hints**.
6603They are not guaranteed to provide a faithful description of
6604tool behavior (including descriptive properties like title).
6605Clients should never make tool use decisions based on ToolAnnotations
6606received from untrusted servers.*/
6607///
6608/// <details><summary>JSON schema</summary>
6609///
6610/// ```json
6611///{
6612///  "description": "Additional properties describing a Tool to clients.\n\nNOTE: all properties in ToolAnnotations are **hints**.\nThey are not guaranteed to provide a faithful description of\ntool behavior (including descriptive properties like title).\n\nClients should never make tool use decisions based on ToolAnnotations\nreceived from untrusted servers.",
6613///  "type": "object",
6614///  "properties": {
6615///    "destructiveHint": {
6616///      "description": "If true, the tool may perform destructive updates to its environment.\nIf false, the tool performs only additive updates.\n\n(This property is meaningful only when readOnlyHint == false)\n\nDefault: true",
6617///      "type": "boolean"
6618///    },
6619///    "idempotentHint": {
6620///      "description": "If true, calling the tool repeatedly with the same arguments\nwill have no additional effect on the its environment.\n\n(This property is meaningful only when readOnlyHint == false)\n\nDefault: false",
6621///      "type": "boolean"
6622///    },
6623///    "openWorldHint": {
6624///      "description": "If true, this tool may interact with an \"open world\" of external\nentities. If false, the tool's domain of interaction is closed.\nFor example, the world of a web search tool is open, whereas that\nof a memory tool is not.\n\nDefault: true",
6625///      "type": "boolean"
6626///    },
6627///    "readOnlyHint": {
6628///      "description": "If true, the tool does not modify its environment.\n\nDefault: false",
6629///      "type": "boolean"
6630///    },
6631///    "title": {
6632///      "description": "A human-readable title for the tool.",
6633///      "type": "string"
6634///    }
6635///  }
6636///}
6637/// ```
6638/// </details>
6639#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
6640pub struct ToolAnnotations {
6641    /**If true, the tool may perform destructive updates to its environment.
6642    If false, the tool performs only additive updates.
6643    (This property is meaningful only when readOnlyHint == false)
6644    Default: true*/
6645    #[serde(rename = "destructiveHint", default, skip_serializing_if = "::std::option::Option::is_none")]
6646    pub destructive_hint: ::std::option::Option<bool>,
6647    /**If true, calling the tool repeatedly with the same arguments
6648    will have no additional effect on the its environment.
6649    (This property is meaningful only when readOnlyHint == false)
6650    Default: false*/
6651    #[serde(rename = "idempotentHint", default, skip_serializing_if = "::std::option::Option::is_none")]
6652    pub idempotent_hint: ::std::option::Option<bool>,
6653    /**If true, this tool may interact with an "open world" of external
6654    entities. If false, the tool's domain of interaction is closed.
6655    For example, the world of a web search tool is open, whereas that
6656    of a memory tool is not.
6657    Default: true*/
6658    #[serde(rename = "openWorldHint", default, skip_serializing_if = "::std::option::Option::is_none")]
6659    pub open_world_hint: ::std::option::Option<bool>,
6660    /**If true, the tool does not modify its environment.
6661    Default: false*/
6662    #[serde(rename = "readOnlyHint", default, skip_serializing_if = "::std::option::Option::is_none")]
6663    pub read_only_hint: ::std::option::Option<bool>,
6664    ///A human-readable title for the tool.
6665    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6666    pub title: ::std::option::Option<::std::string::String>,
6667}
6668///A JSON Schema object defining the expected parameters for the tool.
6669///
6670/// <details><summary>JSON schema</summary>
6671///
6672/// ```json
6673///{
6674///  "description": "A JSON Schema object defining the expected parameters for the tool.",
6675///  "type": "object",
6676///  "required": [
6677///    "type"
6678///  ],
6679///  "properties": {
6680///    "properties": {
6681///      "type": "object",
6682///      "additionalProperties": {
6683///        "type": "object",
6684///        "additionalProperties": true
6685///      }
6686///    },
6687///    "required": {
6688///      "type": "array",
6689///      "items": {
6690///        "type": "string"
6691///      }
6692///    },
6693///    "type": {
6694///      "type": "string",
6695///      "const": "object"
6696///    }
6697///  }
6698///}
6699/// ```
6700/// </details>
6701#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6702pub struct ToolInputSchema {
6703    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6704    pub properties: ::std::option::Option<
6705        ::std::collections::HashMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6706    >,
6707    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
6708    pub required: ::std::vec::Vec<::std::string::String>,
6709    #[serde(rename = "type", deserialize_with = "validate::tool_input_schema_type_")]
6710    type_: ::std::string::String,
6711}
6712impl ToolInputSchema {
6713    pub fn new(
6714        required: ::std::vec::Vec<::std::string::String>,
6715        properties: ::std::option::Option<
6716            ::std::collections::HashMap<
6717                ::std::string::String,
6718                ::serde_json::Map<::std::string::String, ::serde_json::Value>,
6719            >,
6720        >,
6721    ) -> Self {
6722        Self {
6723            properties,
6724            required,
6725            type_: "object".to_string(),
6726        }
6727    }
6728    pub fn type_(&self) -> &::std::string::String {
6729        &self.type_
6730    }
6731    pub fn type_name() -> ::std::string::String {
6732        "object".to_string()
6733    }
6734}
6735///An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.
6736///
6737/// <details><summary>JSON schema</summary>
6738///
6739/// ```json
6740///{
6741///  "description": "An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.",
6742///  "type": "object",
6743///  "required": [
6744///    "method"
6745///  ],
6746///  "properties": {
6747///    "method": {
6748///      "type": "string",
6749///      "const": "notifications/tools/list_changed"
6750///    },
6751///    "params": {
6752///      "type": "object",
6753///      "properties": {
6754///        "_meta": {
6755///          "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
6756///          "type": "object",
6757///          "additionalProperties": {}
6758///        }
6759///      },
6760///      "additionalProperties": {}
6761///    }
6762///  }
6763///}
6764/// ```
6765/// </details>
6766#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6767pub struct ToolListChangedNotification {
6768    #[serde(deserialize_with = "validate::tool_list_changed_notification_method")]
6769    method: ::std::string::String,
6770    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6771    pub params: ::std::option::Option<ToolListChangedNotificationParams>,
6772}
6773impl ToolListChangedNotification {
6774    pub fn new(params: ::std::option::Option<ToolListChangedNotificationParams>) -> Self {
6775        Self {
6776            method: "notifications/tools/list_changed".to_string(),
6777            params,
6778        }
6779    }
6780    pub fn method(&self) -> &::std::string::String {
6781        &self.method
6782    }
6783    pub fn method_name() -> ::std::string::String {
6784        "notifications/tools/list_changed".to_string()
6785    }
6786}
6787///ToolListChangedNotificationParams
6788///
6789/// <details><summary>JSON schema</summary>
6790///
6791/// ```json
6792///{
6793///  "type": "object",
6794///  "properties": {
6795///    "_meta": {
6796///      "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
6797///      "type": "object",
6798///      "additionalProperties": {}
6799///    }
6800///  },
6801///  "additionalProperties": {}
6802///}
6803/// ```
6804/// </details>
6805#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
6806pub struct ToolListChangedNotificationParams {
6807    ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
6808    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6809    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6810    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
6811    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6812}
6813/**An optional JSON Schema object defining the structure of the tool's output returned in
6814the structuredContent field of a CallToolResult.*/
6815///
6816/// <details><summary>JSON schema</summary>
6817///
6818/// ```json
6819///{
6820///  "description": "An optional JSON Schema object defining the structure of the tool's output returned in\nthe structuredContent field of a CallToolResult.",
6821///  "type": "object",
6822///  "required": [
6823///    "type"
6824///  ],
6825///  "properties": {
6826///    "properties": {
6827///      "type": "object",
6828///      "additionalProperties": {
6829///        "type": "object",
6830///        "additionalProperties": true
6831///      }
6832///    },
6833///    "required": {
6834///      "type": "array",
6835///      "items": {
6836///        "type": "string"
6837///      }
6838///    },
6839///    "type": {
6840///      "type": "string",
6841///      "const": "object"
6842///    }
6843///  }
6844///}
6845/// ```
6846/// </details>
6847#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6848pub struct ToolOutputSchema {
6849    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6850    pub properties: ::std::option::Option<
6851        ::std::collections::HashMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6852    >,
6853    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
6854    pub required: ::std::vec::Vec<::std::string::String>,
6855    #[serde(rename = "type", deserialize_with = "validate::tool_output_schema_type_")]
6856    type_: ::std::string::String,
6857}
6858impl ToolOutputSchema {
6859    pub fn new(
6860        required: ::std::vec::Vec<::std::string::String>,
6861        properties: ::std::option::Option<
6862            ::std::collections::HashMap<
6863                ::std::string::String,
6864                ::serde_json::Map<::std::string::String, ::serde_json::Value>,
6865            >,
6866        >,
6867    ) -> Self {
6868        Self {
6869            properties,
6870            required,
6871            type_: "object".to_string(),
6872        }
6873    }
6874    pub fn type_(&self) -> &::std::string::String {
6875        &self.type_
6876    }
6877    pub fn type_name() -> ::std::string::String {
6878        "object".to_string()
6879    }
6880}
6881///Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
6882///
6883/// <details><summary>JSON schema</summary>
6884///
6885/// ```json
6886///{
6887///  "description": "Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.",
6888///  "type": "object",
6889///  "required": [
6890///    "method",
6891///    "params"
6892///  ],
6893///  "properties": {
6894///    "method": {
6895///      "type": "string",
6896///      "const": "resources/unsubscribe"
6897///    },
6898///    "params": {
6899///      "type": "object",
6900///      "required": [
6901///        "uri"
6902///      ],
6903///      "properties": {
6904///        "uri": {
6905///          "description": "The URI of the resource to unsubscribe from.",
6906///          "type": "string",
6907///          "format": "uri"
6908///        }
6909///      }
6910///    }
6911///  }
6912///}
6913/// ```
6914/// </details>
6915#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6916pub struct UnsubscribeRequest {
6917    #[serde(deserialize_with = "validate::unsubscribe_request_method")]
6918    method: ::std::string::String,
6919    pub params: UnsubscribeRequestParams,
6920}
6921impl UnsubscribeRequest {
6922    pub fn new(params: UnsubscribeRequestParams) -> Self {
6923        Self {
6924            method: "resources/unsubscribe".to_string(),
6925            params,
6926        }
6927    }
6928    pub fn method(&self) -> &::std::string::String {
6929        &self.method
6930    }
6931    pub fn method_name() -> ::std::string::String {
6932        "resources/unsubscribe".to_string()
6933    }
6934}
6935///UnsubscribeRequestParams
6936///
6937/// <details><summary>JSON schema</summary>
6938///
6939/// ```json
6940///{
6941///  "type": "object",
6942///  "required": [
6943///    "uri"
6944///  ],
6945///  "properties": {
6946///    "uri": {
6947///      "description": "The URI of the resource to unsubscribe from.",
6948///      "type": "string",
6949///      "format": "uri"
6950///    }
6951///  }
6952///}
6953/// ```
6954/// </details>
6955#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6956pub struct UnsubscribeRequestParams {
6957    ///The URI of the resource to unsubscribe from.
6958    pub uri: ::std::string::String,
6959}
6960/// Implementing the Deserialize trait
6961/// This allows enum to be deserialized into correct type based on the value of the "method"
6962impl<'de> serde::Deserialize<'de> for ClientRequest {
6963    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6964    where
6965        D: serde::Deserializer<'de>,
6966    {
6967        let value: serde_json::Value = serde::Deserialize::deserialize(deserializer)?;
6968        let method_option = value.get("method").and_then(|v| v.as_str());
6969        if let Some(method) = method_option {
6970            match method {
6971                "initialize" => {
6972                    let req = serde_json::from_value::<InitializeRequest>(value).map_err(serde::de::Error::custom)?;
6973                    Ok(ClientRequest::InitializeRequest(req))
6974                }
6975                "ping" => {
6976                    let req = serde_json::from_value::<PingRequest>(value).map_err(serde::de::Error::custom)?;
6977                    Ok(ClientRequest::PingRequest(req))
6978                }
6979                "resources/list" => {
6980                    let req = serde_json::from_value::<ListResourcesRequest>(value).map_err(serde::de::Error::custom)?;
6981                    Ok(ClientRequest::ListResourcesRequest(req))
6982                }
6983                "resources/templates/list" => {
6984                    let req =
6985                        serde_json::from_value::<ListResourceTemplatesRequest>(value).map_err(serde::de::Error::custom)?;
6986                    Ok(ClientRequest::ListResourceTemplatesRequest(req))
6987                }
6988                "resources/read" => {
6989                    let req = serde_json::from_value::<ReadResourceRequest>(value).map_err(serde::de::Error::custom)?;
6990                    Ok(ClientRequest::ReadResourceRequest(req))
6991                }
6992                "resources/subscribe" => {
6993                    let req = serde_json::from_value::<SubscribeRequest>(value).map_err(serde::de::Error::custom)?;
6994                    Ok(ClientRequest::SubscribeRequest(req))
6995                }
6996                "resources/unsubscribe" => {
6997                    let req = serde_json::from_value::<UnsubscribeRequest>(value).map_err(serde::de::Error::custom)?;
6998                    Ok(ClientRequest::UnsubscribeRequest(req))
6999                }
7000                "prompts/list" => {
7001                    let req = serde_json::from_value::<ListPromptsRequest>(value).map_err(serde::de::Error::custom)?;
7002                    Ok(ClientRequest::ListPromptsRequest(req))
7003                }
7004                "prompts/get" => {
7005                    let req = serde_json::from_value::<GetPromptRequest>(value).map_err(serde::de::Error::custom)?;
7006                    Ok(ClientRequest::GetPromptRequest(req))
7007                }
7008                "tools/list" => {
7009                    let req = serde_json::from_value::<ListToolsRequest>(value).map_err(serde::de::Error::custom)?;
7010                    Ok(ClientRequest::ListToolsRequest(req))
7011                }
7012                "tools/call" => {
7013                    let req = serde_json::from_value::<CallToolRequest>(value).map_err(serde::de::Error::custom)?;
7014                    Ok(ClientRequest::CallToolRequest(req))
7015                }
7016                "logging/setLevel" => {
7017                    let req = serde_json::from_value::<SetLevelRequest>(value).map_err(serde::de::Error::custom)?;
7018                    Ok(ClientRequest::SetLevelRequest(req))
7019                }
7020                "completion/complete" => {
7021                    let req = serde_json::from_value::<CompleteRequest>(value).map_err(serde::de::Error::custom)?;
7022                    Ok(ClientRequest::CompleteRequest(req))
7023                }
7024                _ => Err(serde::de::Error::unknown_variant("method", &[""])),
7025            }
7026        } else {
7027            Err(serde::de::Error::missing_field("method"))
7028        }
7029    }
7030}
7031impl ClientRequest {
7032    pub fn method(&self) -> &str {
7033        match self {
7034            ClientRequest::InitializeRequest(request) => request.method(),
7035            ClientRequest::PingRequest(request) => request.method(),
7036            ClientRequest::ListResourcesRequest(request) => request.method(),
7037            ClientRequest::ListResourceTemplatesRequest(request) => request.method(),
7038            ClientRequest::ReadResourceRequest(request) => request.method(),
7039            ClientRequest::SubscribeRequest(request) => request.method(),
7040            ClientRequest::UnsubscribeRequest(request) => request.method(),
7041            ClientRequest::ListPromptsRequest(request) => request.method(),
7042            ClientRequest::GetPromptRequest(request) => request.method(),
7043            ClientRequest::ListToolsRequest(request) => request.method(),
7044            ClientRequest::CallToolRequest(request) => request.method(),
7045            ClientRequest::SetLevelRequest(request) => request.method(),
7046            ClientRequest::CompleteRequest(request) => request.method(),
7047        }
7048    }
7049}
7050/// Implementing the Deserialize trait
7051/// This allows enum to be deserialized into correct type based on the value of the "method"
7052impl<'de> serde::Deserialize<'de> for ClientNotification {
7053    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7054    where
7055        D: serde::Deserializer<'de>,
7056    {
7057        let value: serde_json::Value = serde::Deserialize::deserialize(deserializer)?;
7058        let method_option = value.get("method").and_then(|v| v.as_str());
7059        if let Some(method) = method_option {
7060            match method {
7061                "notifications/cancelled" => {
7062                    let req = serde_json::from_value::<CancelledNotification>(value).map_err(serde::de::Error::custom)?;
7063                    Ok(ClientNotification::CancelledNotification(req))
7064                }
7065                "notifications/initialized" => {
7066                    let req = serde_json::from_value::<InitializedNotification>(value).map_err(serde::de::Error::custom)?;
7067                    Ok(ClientNotification::InitializedNotification(req))
7068                }
7069                "notifications/progress" => {
7070                    let req = serde_json::from_value::<ProgressNotification>(value).map_err(serde::de::Error::custom)?;
7071                    Ok(ClientNotification::ProgressNotification(req))
7072                }
7073                "notifications/roots/list_changed" => {
7074                    let req =
7075                        serde_json::from_value::<RootsListChangedNotification>(value).map_err(serde::de::Error::custom)?;
7076                    Ok(ClientNotification::RootsListChangedNotification(req))
7077                }
7078                _ => Err(serde::de::Error::unknown_variant("method", &[""])),
7079            }
7080        } else {
7081            Err(serde::de::Error::missing_field("method"))
7082        }
7083    }
7084}
7085impl ClientNotification {
7086    pub fn method(&self) -> &str {
7087        match self {
7088            ClientNotification::CancelledNotification(request) => request.method(),
7089            ClientNotification::InitializedNotification(request) => request.method(),
7090            ClientNotification::ProgressNotification(request) => request.method(),
7091            ClientNotification::RootsListChangedNotification(request) => request.method(),
7092        }
7093    }
7094}
7095/// Implementing the Deserialize trait
7096/// This allows enum to be deserialized into correct type based on the value of the "method"
7097impl<'de> serde::Deserialize<'de> for ServerRequest {
7098    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7099    where
7100        D: serde::Deserializer<'de>,
7101    {
7102        let value: serde_json::Value = serde::Deserialize::deserialize(deserializer)?;
7103        let method_option = value.get("method").and_then(|v| v.as_str());
7104        if let Some(method) = method_option {
7105            match method {
7106                "ping" => {
7107                    let req = serde_json::from_value::<PingRequest>(value).map_err(serde::de::Error::custom)?;
7108                    Ok(ServerRequest::PingRequest(req))
7109                }
7110                "sampling/createMessage" => {
7111                    let req = serde_json::from_value::<CreateMessageRequest>(value).map_err(serde::de::Error::custom)?;
7112                    Ok(ServerRequest::CreateMessageRequest(req))
7113                }
7114                "roots/list" => {
7115                    let req = serde_json::from_value::<ListRootsRequest>(value).map_err(serde::de::Error::custom)?;
7116                    Ok(ServerRequest::ListRootsRequest(req))
7117                }
7118                "elicitation/create" => {
7119                    let req = serde_json::from_value::<ElicitRequest>(value).map_err(serde::de::Error::custom)?;
7120                    Ok(ServerRequest::ElicitRequest(req))
7121                }
7122                _ => Err(serde::de::Error::unknown_variant("method", &[""])),
7123            }
7124        } else {
7125            Err(serde::de::Error::missing_field("method"))
7126        }
7127    }
7128}
7129impl ServerRequest {
7130    pub fn method(&self) -> &str {
7131        match self {
7132            ServerRequest::PingRequest(request) => request.method(),
7133            ServerRequest::CreateMessageRequest(request) => request.method(),
7134            ServerRequest::ListRootsRequest(request) => request.method(),
7135            ServerRequest::ElicitRequest(request) => request.method(),
7136        }
7137    }
7138}
7139/// Implementing the Deserialize trait
7140/// This allows enum to be deserialized into correct type based on the value of the "method"
7141impl<'de> serde::Deserialize<'de> for ServerNotification {
7142    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7143    where
7144        D: serde::Deserializer<'de>,
7145    {
7146        let value: serde_json::Value = serde::Deserialize::deserialize(deserializer)?;
7147        let method_option = value.get("method").and_then(|v| v.as_str());
7148        if let Some(method) = method_option {
7149            match method {
7150                "notifications/cancelled" => {
7151                    let req = serde_json::from_value::<CancelledNotification>(value).map_err(serde::de::Error::custom)?;
7152                    Ok(ServerNotification::CancelledNotification(req))
7153                }
7154                "notifications/progress" => {
7155                    let req = serde_json::from_value::<ProgressNotification>(value).map_err(serde::de::Error::custom)?;
7156                    Ok(ServerNotification::ProgressNotification(req))
7157                }
7158                "notifications/resources/list_changed" => {
7159                    let req = serde_json::from_value::<ResourceListChangedNotification>(value)
7160                        .map_err(serde::de::Error::custom)?;
7161                    Ok(ServerNotification::ResourceListChangedNotification(req))
7162                }
7163                "notifications/resources/updated" => {
7164                    let req =
7165                        serde_json::from_value::<ResourceUpdatedNotification>(value).map_err(serde::de::Error::custom)?;
7166                    Ok(ServerNotification::ResourceUpdatedNotification(req))
7167                }
7168                "notifications/prompts/list_changed" => {
7169                    let req =
7170                        serde_json::from_value::<PromptListChangedNotification>(value).map_err(serde::de::Error::custom)?;
7171                    Ok(ServerNotification::PromptListChangedNotification(req))
7172                }
7173                "notifications/tools/list_changed" => {
7174                    let req =
7175                        serde_json::from_value::<ToolListChangedNotification>(value).map_err(serde::de::Error::custom)?;
7176                    Ok(ServerNotification::ToolListChangedNotification(req))
7177                }
7178                "notifications/message" => {
7179                    let req =
7180                        serde_json::from_value::<LoggingMessageNotification>(value).map_err(serde::de::Error::custom)?;
7181                    Ok(ServerNotification::LoggingMessageNotification(req))
7182                }
7183                _ => Err(serde::de::Error::unknown_variant("method", &[""])),
7184            }
7185        } else {
7186            Err(serde::de::Error::missing_field("method"))
7187        }
7188    }
7189}
7190impl ServerNotification {
7191    pub fn method(&self) -> &str {
7192        match self {
7193            ServerNotification::CancelledNotification(request) => request.method(),
7194            ServerNotification::ProgressNotification(request) => request.method(),
7195            ServerNotification::ResourceListChangedNotification(request) => request.method(),
7196            ServerNotification::ResourceUpdatedNotification(request) => request.method(),
7197            ServerNotification::PromptListChangedNotification(request) => request.method(),
7198            ServerNotification::ToolListChangedNotification(request) => request.method(),
7199            ServerNotification::LoggingMessageNotification(request) => request.method(),
7200        }
7201    }
7202}
7203#[deprecated(since = "0.3.0", note = "Use `RpcError` instead.")]
7204pub type JsonrpcErrorError = RpcError;
7205#[deprecated(since = "0.7.0", note = "Use `ElicitRequestedSchema` instead.")]
7206pub type ElicitRequestParamsRequestedSchema = ElicitRequestedSchema;