rust_mcp_schema/generated_schema/2024_11_05/
mcp_schema.rs

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