rust_mcp_schema/generated_schema/2025_11_25/
mcp_schema.rs

1/// Copyright (c) 2025 Ali Hashemi (rust-mcp-stack)
2/// Licensed under the MIT License. See LICENSE in the project root.
3/// ----------------------------------------------------------------------------
4/// This file is auto-generated by mcp-schema-gen v0.5.0.
5/// WARNING:
6/// It is not recommended to modify this file directly. You are free to
7/// modify or extend the implementations as needed, but please do so at your own risk.
8///
9/// Generated from : <https://github.com/modelcontextprotocol/specification.git>
10/// Hash : 391c69f42f21bab3a5df0923b45b9ad3174414b9
11/// Generated at : 2025-12-01 18:52:55
12/// ----------------------------------------------------------------------------
13///
14use super::validators as validate;
15/// MCP Protocol Version
16pub const LATEST_PROTOCOL_VERSION: &str = "DRAFT-2025-v3";
17/// JSON-RPC Version
18pub const JSONRPC_VERSION: &str = "2.0";
19/// Parse error. Invalid JSON was received. An error occurred while parsing the JSON text.
20pub const PARSE_ERROR: i64 = -32700i64;
21/// Invalid Request. The JSON sent is not a valid Request object.
22pub const INVALID_REQUEST: i64 = -32600i64;
23/// Method not found. The method does not exist / is not available.
24pub const METHOD_NOT_FOUND: i64 = -32601i64;
25/// Invalid param. Invalid method parameter(s).
26pub const INVALID_PARAMS: i64 = -32602i64;
27/// Internal error. Internal JSON-RPC error.
28pub const INTERNAL_ERROR: i64 = -32603i64;
29/// The server cannot proceed without additional client input.
30pub const URL_ELICITATION_REQUIRED: i64 = -32042i64;
31///Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
32///
33/// <details><summary>JSON schema</summary>
34///
35/// ```json
36///{
37///  "description": "Optional annotations for the client. The client can use annotations to inform how objects are used or displayed",
38///  "type": "object",
39///  "properties": {
40///    "audience": {
41///      "description": "Describes who the intended audience of this object or data is.\n\nIt can include multiple entries to indicate content useful for multiple audiences (e.g., [\"user\", \"assistant\"]).",
42///      "type": "array",
43///      "items": {
44///        "$ref": "#/$defs/Role"
45///      }
46///    },
47///    "lastModified": {
48///      "description": "The moment the resource was last modified, as an ISO 8601 formatted string.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").\n\nExamples: last activity timestamp in an open file, timestamp when the resource\nwas attached, etc.",
49///      "type": "string"
50///    },
51///    "priority": {
52///      "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.",
53///      "type": "number",
54///      "maximum": 1.0,
55///      "minimum": 0.0
56///    }
57///  }
58///}
59/// ```
60/// </details>
61#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
62pub struct Annotations {
63    /**Describes who the intended audience of this object or data is.
64    It can include multiple entries to indicate content useful for multiple audiences (e.g., ["user", "assistant"]).*/
65    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
66    pub audience: ::std::vec::Vec<Role>,
67    /**The moment the resource was last modified, as an ISO 8601 formatted string.
68    Should be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z").
69    Examples: last activity timestamp in an open file, timestamp when the resource
70    was attached, etc.*/
71    #[serde(rename = "lastModified", default, skip_serializing_if = "::std::option::Option::is_none")]
72    pub last_modified: ::std::option::Option<::std::string::String>,
73    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
74    pub priority: ::std::option::Option<f64>,
75}
76///Audio provided to or from an LLM.
77///
78/// <details><summary>JSON schema</summary>
79///
80/// ```json
81///{
82///  "description": "Audio provided to or from an LLM.",
83///  "type": "object",
84///  "required": [
85///    "data",
86///    "mimeType",
87///    "type"
88///  ],
89///  "properties": {
90///    "_meta": {
91///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
92///      "type": "object",
93///      "additionalProperties": {}
94///    },
95///    "annotations": {
96///      "description": "Optional annotations for the client.",
97///      "$ref": "#/$defs/Annotations"
98///    },
99///    "data": {
100///      "description": "The base64-encoded audio data.",
101///      "type": "string",
102///      "format": "byte"
103///    },
104///    "mimeType": {
105///      "description": "The MIME type of the audio. Different providers may support different audio types.",
106///      "type": "string"
107///    },
108///    "type": {
109///      "type": "string",
110///      "const": "audio"
111///    }
112///  }
113///}
114/// ```
115/// </details>
116#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
117pub struct AudioContent {
118    ///Optional annotations for the client.
119    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
120    pub annotations: ::std::option::Option<Annotations>,
121    ///The base64-encoded audio data.
122    pub data: ::std::string::String,
123    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
124    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
125    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
126    ///The MIME type of the audio. Different providers may support different audio types.
127    #[serde(rename = "mimeType")]
128    pub mime_type: ::std::string::String,
129    #[serde(rename = "type", deserialize_with = "validate::audio_content_type_")]
130    type_: ::std::string::String,
131}
132impl AudioContent {
133    pub fn new(
134        data: ::std::string::String,
135        mime_type: ::std::string::String,
136        annotations: ::std::option::Option<Annotations>,
137        meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
138    ) -> Self {
139        Self {
140            annotations,
141            data,
142            meta,
143            mime_type,
144            type_: "audio".to_string(),
145        }
146    }
147    pub fn type_(&self) -> &::std::string::String {
148        &self.type_
149    }
150    /// returns "audio"
151    pub fn type_value() -> ::std::string::String {
152        "audio".to_string()
153    }
154    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
155    pub fn type_name() -> ::std::string::String {
156        "audio".to_string()
157    }
158}
159///Base interface for metadata with name (identifier) and title (display name) properties.
160///
161/// <details><summary>JSON schema</summary>
162///
163/// ```json
164///{
165///  "description": "Base interface for metadata with name (identifier) and title (display name) properties.",
166///  "type": "object",
167///  "required": [
168///    "name"
169///  ],
170///  "properties": {
171///    "name": {
172///      "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
173///      "type": "string"
174///    },
175///    "title": {
176///      "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
177///      "type": "string"
178///    }
179///  }
180///}
181/// ```
182/// </details>
183#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
184pub struct BaseMetadata {
185    ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
186    pub name: ::std::string::String,
187    /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
188    even by those unfamiliar with domain-specific terminology.
189    If not provided, the name should be used for display (except for Tool,
190    where annotations.title should be given precedence over using name,
191    if present).*/
192    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
193    pub title: ::std::option::Option<::std::string::String>,
194}
195///BlobResourceContents
196///
197/// <details><summary>JSON schema</summary>
198///
199/// ```json
200///{
201///  "type": "object",
202///  "required": [
203///    "blob",
204///    "uri"
205///  ],
206///  "properties": {
207///    "_meta": {
208///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
209///      "type": "object",
210///      "additionalProperties": {}
211///    },
212///    "blob": {
213///      "description": "A base64-encoded string representing the binary data of the item.",
214///      "type": "string",
215///      "format": "byte"
216///    },
217///    "mimeType": {
218///      "description": "The MIME type of this resource, if known.",
219///      "type": "string"
220///    },
221///    "uri": {
222///      "description": "The URI of this resource.",
223///      "type": "string",
224///      "format": "uri"
225///    }
226///  }
227///}
228/// ```
229/// </details>
230#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
231pub struct BlobResourceContents {
232    ///A base64-encoded string representing the binary data of the item.
233    pub blob: ::std::string::String,
234    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
235    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
236    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
237    ///The MIME type of this resource, if known.
238    #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
239    pub mime_type: ::std::option::Option<::std::string::String>,
240    ///The URI of this resource.
241    pub uri: ::std::string::String,
242}
243///BooleanSchema
244///
245/// <details><summary>JSON schema</summary>
246///
247/// ```json
248///{
249///  "type": "object",
250///  "required": [
251///    "type"
252///  ],
253///  "properties": {
254///    "default": {
255///      "type": "boolean"
256///    },
257///    "description": {
258///      "type": "string"
259///    },
260///    "title": {
261///      "type": "string"
262///    },
263///    "type": {
264///      "type": "string",
265///      "const": "boolean"
266///    }
267///  }
268///}
269/// ```
270/// </details>
271#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
272pub struct BooleanSchema {
273    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
274    pub default: ::std::option::Option<bool>,
275    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
276    pub description: ::std::option::Option<::std::string::String>,
277    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
278    pub title: ::std::option::Option<::std::string::String>,
279    #[serde(rename = "type", deserialize_with = "validate::boolean_schema_type_")]
280    type_: ::std::string::String,
281}
282impl BooleanSchema {
283    pub fn new(
284        default: ::std::option::Option<bool>,
285        description: ::std::option::Option<::std::string::String>,
286        title: ::std::option::Option<::std::string::String>,
287    ) -> Self {
288        Self {
289            default,
290            description,
291            title,
292            type_: "boolean".to_string(),
293        }
294    }
295    pub fn type_(&self) -> &::std::string::String {
296        &self.type_
297    }
298    /// returns "boolean"
299    pub fn type_value() -> ::std::string::String {
300        "boolean".to_string()
301    }
302    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
303    pub fn type_name() -> ::std::string::String {
304        "boolean".to_string()
305    }
306}
307///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
308///
309/// <details><summary>JSON schema</summary>
310///
311/// ```json
312///{
313///  "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
314///  "type": "object",
315///  "properties": {
316///    "progressToken": {
317///      "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.",
318///      "$ref": "#/$defs/ProgressToken"
319///    }
320///  },
321///  "additionalProperties": {}
322///}
323/// ```
324/// </details>
325#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
326pub struct CallToolMeta {
327    ///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.
328    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
329    pub progress_token: ::std::option::Option<ProgressToken>,
330    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
331    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
332}
333///Used by the client to invoke a tool provided by the server.
334///
335/// <details><summary>JSON schema</summary>
336///
337/// ```json
338///{
339///  "description": "Used by the client to invoke a tool provided by the server.",
340///  "type": "object",
341///  "required": [
342///    "id",
343///    "jsonrpc",
344///    "method",
345///    "params"
346///  ],
347///  "properties": {
348///    "id": {
349///      "$ref": "#/$defs/RequestId"
350///    },
351///    "jsonrpc": {
352///      "type": "string",
353///      "const": "2.0"
354///    },
355///    "method": {
356///      "type": "string",
357///      "const": "tools/call"
358///    },
359///    "params": {
360///      "$ref": "#/$defs/CallToolRequestParams"
361///    }
362///  }
363///}
364/// ```
365/// </details>
366#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
367pub struct CallToolRequest {
368    pub id: RequestId,
369    #[serde(deserialize_with = "validate::call_tool_request_jsonrpc")]
370    jsonrpc: ::std::string::String,
371    #[serde(deserialize_with = "validate::call_tool_request_method")]
372    method: ::std::string::String,
373    pub params: CallToolRequestParams,
374}
375impl CallToolRequest {
376    pub fn new(id: RequestId, params: CallToolRequestParams) -> Self {
377        Self {
378            id,
379            jsonrpc: JSONRPC_VERSION.to_string(),
380            method: "tools/call".to_string(),
381            params,
382        }
383    }
384    pub fn jsonrpc(&self) -> &::std::string::String {
385        &self.jsonrpc
386    }
387    pub fn method(&self) -> &::std::string::String {
388        &self.method
389    }
390    /// returns "tools/call"
391    pub fn method_value() -> ::std::string::String {
392        "tools/call".to_string()
393    }
394    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
395    pub fn method_name() -> ::std::string::String {
396        "tools/call".to_string()
397    }
398}
399///Parameters for a tools/call request.
400///
401/// <details><summary>JSON schema</summary>
402///
403/// ```json
404///{
405///  "description": "Parameters for a tools/call request.",
406///  "type": "object",
407///  "required": [
408///    "name"
409///  ],
410///  "properties": {
411///    "_meta": {
412///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
413///      "type": "object",
414///      "properties": {
415///        "progressToken": {
416///          "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.",
417///          "$ref": "#/$defs/ProgressToken"
418///        }
419///      },
420///      "additionalProperties": {}
421///    },
422///    "arguments": {
423///      "description": "Arguments to use for the tool call.",
424///      "type": "object",
425///      "additionalProperties": {}
426///    },
427///    "name": {
428///      "description": "The name of the tool.",
429///      "type": "string"
430///    },
431///    "task": {
432///      "description": "If specified, the caller is requesting task-augmented execution for this request.\nThe request will return a CreateTaskResult immediately, and the actual result can be\nretrieved later via tasks/result.\n\nTask augmentation is subject to capability negotiation - receivers MUST declare support\nfor task augmentation of specific request types in their capabilities.",
433///      "$ref": "#/$defs/TaskMetadata"
434///    }
435///  }
436///}
437/// ```
438/// </details>
439#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
440pub struct CallToolRequestParams {
441    ///Arguments to use for the tool call.
442    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
443    pub arguments: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
444    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
445    pub meta: ::std::option::Option<CallToolMeta>,
446    ///The name of the tool.
447    pub name: ::std::string::String,
448    /**If specified, the caller is requesting task-augmented execution for this request.
449    The request will return a CreateTaskResult immediately, and the actual result can be
450    retrieved later via tasks/result.
451    Task augmentation is subject to capability negotiation - receivers MUST declare support
452    for task augmentation of specific request types in their capabilities.*/
453    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
454    pub task: ::std::option::Option<TaskMetadata>,
455}
456///The server's response to a tool call.
457///
458/// <details><summary>JSON schema</summary>
459///
460/// ```json
461///{
462///  "description": "The server's response to a tool call.",
463///  "type": "object",
464///  "required": [
465///    "content"
466///  ],
467///  "properties": {
468///    "_meta": {
469///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
470///      "type": "object",
471///      "additionalProperties": {}
472///    },
473///    "content": {
474///      "description": "A list of content objects that represent the unstructured result of the tool call.",
475///      "type": "array",
476///      "items": {
477///        "$ref": "#/$defs/ContentBlock"
478///      }
479///    },
480///    "isError": {
481///      "description": "Whether the tool call ended in an error.\n\nIf not set, this is assumed to be false (the call was successful).\n\nAny errors that originate from the tool SHOULD be reported inside the result\nobject, with isError set to true, _not_ as an MCP protocol-level error\nresponse. Otherwise, the LLM would not be able to see that an error occurred\nand self-correct.\n\nHowever, any errors in _finding_ the tool, an error indicating that the\nserver does not support tool calls, or any other exceptional conditions,\nshould be reported as an MCP error response.",
482///      "type": "boolean"
483///    },
484///    "structuredContent": {
485///      "description": "An optional JSON object that represents the structured result of the tool call.",
486///      "type": "object",
487///      "additionalProperties": {}
488///    }
489///  }
490///}
491/// ```
492/// </details>
493#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
494pub struct CallToolResult {
495    ///A list of content objects that represent the unstructured result of the tool call.
496    pub content: ::std::vec::Vec<ContentBlock>,
497    /**Whether the tool call ended in an error.
498    If not set, this is assumed to be false (the call was successful).
499    Any errors that originate from the tool SHOULD be reported inside the result
500    object, with isError set to true, _not_ as an MCP protocol-level error
501    response. Otherwise, the LLM would not be able to see that an error occurred
502    and self-correct.
503    However, any errors in _finding_ the tool, an error indicating that the
504    server does not support tool calls, or any other exceptional conditions,
505    should be reported as an MCP error response.*/
506    #[serde(rename = "isError", default, skip_serializing_if = "::std::option::Option::is_none")]
507    pub is_error: ::std::option::Option<bool>,
508    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
509    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
510    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
511    ///An optional JSON object that represents the structured result of the tool call.
512    #[serde(
513        rename = "structuredContent",
514        default,
515        skip_serializing_if = "::std::option::Option::is_none"
516    )]
517    pub structured_content: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
518}
519///CancelTaskParams
520///
521/// <details><summary>JSON schema</summary>
522///
523/// ```json
524///{
525///  "type": "object",
526///  "required": [
527///    "taskId"
528///  ],
529///  "properties": {
530///    "taskId": {
531///      "description": "The task identifier to cancel.",
532///      "type": "string"
533///    }
534///  }
535///}
536/// ```
537/// </details>
538#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
539pub struct CancelTaskParams {
540    ///The task identifier to cancel.
541    #[serde(rename = "taskId")]
542    pub task_id: ::std::string::String,
543}
544///A request to cancel a task.
545///
546/// <details><summary>JSON schema</summary>
547///
548/// ```json
549///{
550///  "description": "A request to cancel a task.",
551///  "type": "object",
552///  "required": [
553///    "id",
554///    "jsonrpc",
555///    "method",
556///    "params"
557///  ],
558///  "properties": {
559///    "id": {
560///      "$ref": "#/$defs/RequestId"
561///    },
562///    "jsonrpc": {
563///      "type": "string",
564///      "const": "2.0"
565///    },
566///    "method": {
567///      "type": "string",
568///      "const": "tasks/cancel"
569///    },
570///    "params": {
571///      "type": "object",
572///      "required": [
573///        "taskId"
574///      ],
575///      "properties": {
576///        "taskId": {
577///          "description": "The task identifier to cancel.",
578///          "type": "string"
579///        }
580///      }
581///    }
582///  }
583///}
584/// ```
585/// </details>
586#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
587pub struct CancelTaskRequest {
588    pub id: RequestId,
589    #[serde(deserialize_with = "validate::cancel_task_request_jsonrpc")]
590    jsonrpc: ::std::string::String,
591    #[serde(deserialize_with = "validate::cancel_task_request_method")]
592    method: ::std::string::String,
593    pub params: CancelTaskParams,
594}
595impl CancelTaskRequest {
596    pub fn new(id: RequestId, params: CancelTaskParams) -> Self {
597        Self {
598            id,
599            jsonrpc: JSONRPC_VERSION.to_string(),
600            method: "tasks/cancel".to_string(),
601            params,
602        }
603    }
604    pub fn jsonrpc(&self) -> &::std::string::String {
605        &self.jsonrpc
606    }
607    pub fn method(&self) -> &::std::string::String {
608        &self.method
609    }
610    /// returns "tasks/cancel"
611    pub fn method_value() -> ::std::string::String {
612        "tasks/cancel".to_string()
613    }
614    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
615    pub fn method_name() -> ::std::string::String {
616        "tasks/cancel".to_string()
617    }
618}
619///The response to a tasks/cancel request.
620///
621/// <details><summary>JSON schema</summary>
622///
623/// ```json
624///{
625///  "description": "The response to a tasks/cancel request.",
626///  "allOf": [
627///    {
628///      "$ref": "#/$defs/Result"
629///    },
630///    {
631///      "$ref": "#/$defs/Task"
632///    }
633///  ]
634///}
635/// ```
636/// </details>
637#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
638pub struct CancelTaskResult {
639    #[serde(rename = "createdAt")]
640    pub created_at: ::std::string::String,
641    #[serde(rename = "lastUpdatedAt")]
642    pub last_updated_at: ::std::string::String,
643    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
644    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
645    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
646    #[serde(rename = "pollInterval", default, skip_serializing_if = "::std::option::Option::is_none")]
647    pub poll_interval: ::std::option::Option<i64>,
648    pub status: TaskStatus,
649    #[serde(rename = "statusMessage", default, skip_serializing_if = "::std::option::Option::is_none")]
650    pub status_message: ::std::option::Option<::std::string::String>,
651    #[serde(rename = "taskId")]
652    pub task_id: ::std::string::String,
653    pub ttl: i64,
654    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
655    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
656}
657/**This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
658The 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.
659This notification indicates that the result will be unused, so any associated processing SHOULD cease.
660A client MUST NOT attempt to cancel its initialize request.
661For task cancellation, use the tasks/cancel request instead of this notification.*/
662///
663/// <details><summary>JSON schema</summary>
664///
665/// ```json
666///{
667///  "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.\n\nFor task cancellation, use the tasks/cancel request instead of this notification.",
668///  "type": "object",
669///  "required": [
670///    "jsonrpc",
671///    "method",
672///    "params"
673///  ],
674///  "properties": {
675///    "jsonrpc": {
676///      "type": "string",
677///      "const": "2.0"
678///    },
679///    "method": {
680///      "type": "string",
681///      "const": "notifications/cancelled"
682///    },
683///    "params": {
684///      "$ref": "#/$defs/CancelledNotificationParams"
685///    }
686///  }
687///}
688/// ```
689/// </details>
690#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
691pub struct CancelledNotification {
692    #[serde(deserialize_with = "validate::cancelled_notification_jsonrpc")]
693    jsonrpc: ::std::string::String,
694    #[serde(deserialize_with = "validate::cancelled_notification_method")]
695    method: ::std::string::String,
696    pub params: CancelledNotificationParams,
697}
698impl CancelledNotification {
699    pub fn new(params: CancelledNotificationParams) -> Self {
700        Self {
701            jsonrpc: JSONRPC_VERSION.to_string(),
702            method: "notifications/cancelled".to_string(),
703            params,
704        }
705    }
706    pub fn jsonrpc(&self) -> &::std::string::String {
707        &self.jsonrpc
708    }
709    pub fn method(&self) -> &::std::string::String {
710        &self.method
711    }
712    /// returns "notifications/cancelled"
713    pub fn method_value() -> ::std::string::String {
714        "notifications/cancelled".to_string()
715    }
716    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
717    pub fn method_name() -> ::std::string::String {
718        "notifications/cancelled".to_string()
719    }
720}
721///Parameters for a notifications/cancelled notification.
722///
723/// <details><summary>JSON schema</summary>
724///
725/// ```json
726///{
727///  "description": "Parameters for a notifications/cancelled notification.",
728///  "type": "object",
729///  "properties": {
730///    "_meta": {
731///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
732///      "type": "object",
733///      "additionalProperties": {}
734///    },
735///    "reason": {
736///      "description": "An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.",
737///      "type": "string"
738///    },
739///    "requestId": {
740///      "description": "The ID of the request to cancel.\n\nThis MUST correspond to the ID of a request previously issued in the same direction.\nThis MUST be provided for cancelling non-task requests.\nThis MUST NOT be used for cancelling tasks (use the tasks/cancel request instead).",
741///      "$ref": "#/$defs/RequestId"
742///    }
743///  }
744///}
745/// ```
746/// </details>
747#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
748pub struct CancelledNotificationParams {
749    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
750    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
751    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
752    ///An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
753    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
754    pub reason: ::std::option::Option<::std::string::String>,
755    /**The ID of the request to cancel.
756    This MUST correspond to the ID of a request previously issued in the same direction.
757    This MUST be provided for cancelling non-task requests.
758    This MUST NOT be used for cancelling tasks (use the tasks/cancel request instead).*/
759    #[serde(rename = "requestId", default, skip_serializing_if = "::std::option::Option::is_none")]
760    pub request_id: ::std::option::Option<RequestId>,
761}
762///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.
763///
764/// <details><summary>JSON schema</summary>
765///
766/// ```json
767///{
768///  "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.",
769///  "type": "object",
770///  "properties": {
771///    "elicitation": {
772///      "description": "Present if the client supports elicitation from the server.",
773///      "type": "object",
774///      "properties": {
775///        "form": {
776///          "type": "object",
777///          "additionalProperties": true
778///        },
779///        "url": {
780///          "type": "object",
781///          "additionalProperties": true
782///        }
783///      }
784///    },
785///    "experimental": {
786///      "description": "Experimental, non-standard capabilities that the client supports.",
787///      "type": "object",
788///      "additionalProperties": {
789///        "type": "object",
790///        "additionalProperties": true
791///      }
792///    },
793///    "roots": {
794///      "description": "Present if the client supports listing roots.",
795///      "type": "object",
796///      "properties": {
797///        "listChanged": {
798///          "description": "Whether the client supports notifications for changes to the roots list.",
799///          "type": "boolean"
800///        }
801///      }
802///    },
803///    "sampling": {
804///      "description": "Present if the client supports sampling from an LLM.",
805///      "type": "object",
806///      "properties": {
807///        "context": {
808///          "description": "Whether the client supports context inclusion via includeContext parameter.\nIf not declared, servers SHOULD only use includeContext: \"none\" (or omit it).",
809///          "type": "object",
810///          "additionalProperties": true
811///        },
812///        "tools": {
813///          "description": "Whether the client supports tool use via tools and toolChoice parameters.",
814///          "type": "object",
815///          "additionalProperties": true
816///        }
817///      }
818///    },
819///    "tasks": {
820///      "description": "Present if the client supports task-augmented requests.",
821///      "type": "object",
822///      "properties": {
823///        "cancel": {
824///          "description": "Whether this client supports tasks/cancel.",
825///          "type": "object",
826///          "additionalProperties": true
827///        },
828///        "list": {
829///          "description": "Whether this client supports tasks/list.",
830///          "type": "object",
831///          "additionalProperties": true
832///        },
833///        "requests": {
834///          "description": "Specifies which request types can be augmented with tasks.",
835///          "type": "object",
836///          "properties": {
837///            "elicitation": {
838///              "description": "Task support for elicitation-related requests.",
839///              "type": "object",
840///              "properties": {
841///                "create": {
842///                  "description": "Whether the client supports task-augmented elicitation/create requests.",
843///                  "type": "object",
844///                  "additionalProperties": true
845///                }
846///              }
847///            },
848///            "sampling": {
849///              "description": "Task support for sampling-related requests.",
850///              "type": "object",
851///              "properties": {
852///                "createMessage": {
853///                  "description": "Whether the client supports task-augmented sampling/createMessage requests.",
854///                  "type": "object",
855///                  "additionalProperties": true
856///                }
857///              }
858///            }
859///          }
860///        }
861///      }
862///    }
863///  }
864///}
865/// ```
866/// </details>
867#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
868pub struct ClientCapabilities {
869    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
870    pub elicitation: ::std::option::Option<ClientElicitation>,
871    ///Experimental, non-standard capabilities that the client supports.
872    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
873    pub experimental: ::std::option::Option<
874        ::std::collections::HashMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
875    >,
876    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
877    pub roots: ::std::option::Option<ClientRoots>,
878    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
879    pub sampling: ::std::option::Option<ClientSampling>,
880    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
881    pub tasks: ::std::option::Option<ClientTasks>,
882}
883///Present if the client supports elicitation from the server.
884///
885/// <details><summary>JSON schema</summary>
886///
887/// ```json
888///{
889///  "description": "Present if the client supports elicitation from the server.",
890///  "type": "object",
891///  "properties": {
892///    "form": {
893///      "type": "object",
894///      "additionalProperties": true
895///    },
896///    "url": {
897///      "type": "object",
898///      "additionalProperties": true
899///    }
900///  }
901///}
902/// ```
903/// </details>
904#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
905pub struct ClientElicitation {
906    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
907    pub form: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
908    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
909    pub url: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
910}
911///ClientNotification
912///
913/// <details><summary>JSON schema</summary>
914///
915/// ```json
916///{
917///  "anyOf": [
918///    {
919///      "$ref": "#/$defs/CancelledNotification"
920///    },
921///    {
922///      "$ref": "#/$defs/InitializedNotification"
923///    },
924///    {
925///      "$ref": "#/$defs/ProgressNotification"
926///    },
927///    {
928///      "$ref": "#/$defs/TaskStatusNotification"
929///    },
930///    {
931///      "$ref": "#/$defs/RootsListChangedNotification"
932///    }
933///  ]
934///}
935/// ```
936/// </details>
937#[derive(::serde::Serialize, Clone, Debug)]
938#[serde(untagged)]
939pub enum ClientNotification {
940    CancelledNotification(CancelledNotification),
941    InitializedNotification(InitializedNotification),
942    ProgressNotification(ProgressNotification),
943    TaskStatusNotification(TaskStatusNotification),
944    RootsListChangedNotification(RootsListChangedNotification),
945}
946impl ::std::convert::From<CancelledNotification> for ClientNotification {
947    fn from(value: CancelledNotification) -> Self {
948        Self::CancelledNotification(value)
949    }
950}
951impl ::std::convert::From<InitializedNotification> for ClientNotification {
952    fn from(value: InitializedNotification) -> Self {
953        Self::InitializedNotification(value)
954    }
955}
956impl ::std::convert::From<ProgressNotification> for ClientNotification {
957    fn from(value: ProgressNotification) -> Self {
958        Self::ProgressNotification(value)
959    }
960}
961impl ::std::convert::From<TaskStatusNotification> for ClientNotification {
962    fn from(value: TaskStatusNotification) -> Self {
963        Self::TaskStatusNotification(value)
964    }
965}
966impl ::std::convert::From<RootsListChangedNotification> for ClientNotification {
967    fn from(value: RootsListChangedNotification) -> Self {
968        Self::RootsListChangedNotification(value)
969    }
970}
971///ClientRequest
972///
973/// <details><summary>JSON schema</summary>
974///
975/// ```json
976///{
977///  "anyOf": [
978///    {
979///      "$ref": "#/$defs/InitializeRequest"
980///    },
981///    {
982///      "$ref": "#/$defs/PingRequest"
983///    },
984///    {
985///      "$ref": "#/$defs/ListResourcesRequest"
986///    },
987///    {
988///      "$ref": "#/$defs/ListResourceTemplatesRequest"
989///    },
990///    {
991///      "$ref": "#/$defs/ReadResourceRequest"
992///    },
993///    {
994///      "$ref": "#/$defs/SubscribeRequest"
995///    },
996///    {
997///      "$ref": "#/$defs/UnsubscribeRequest"
998///    },
999///    {
1000///      "$ref": "#/$defs/ListPromptsRequest"
1001///    },
1002///    {
1003///      "$ref": "#/$defs/GetPromptRequest"
1004///    },
1005///    {
1006///      "$ref": "#/$defs/ListToolsRequest"
1007///    },
1008///    {
1009///      "$ref": "#/$defs/CallToolRequest"
1010///    },
1011///    {
1012///      "$ref": "#/$defs/GetTaskRequest"
1013///    },
1014///    {
1015///      "$ref": "#/$defs/GetTaskPayloadRequest"
1016///    },
1017///    {
1018///      "$ref": "#/$defs/CancelTaskRequest"
1019///    },
1020///    {
1021///      "$ref": "#/$defs/ListTasksRequest"
1022///    },
1023///    {
1024///      "$ref": "#/$defs/SetLevelRequest"
1025///    },
1026///    {
1027///      "$ref": "#/$defs/CompleteRequest"
1028///    }
1029///  ]
1030///}
1031/// ```
1032/// </details>
1033#[derive(::serde::Serialize, Clone, Debug)]
1034#[serde(untagged)]
1035pub enum ClientRequest {
1036    InitializeRequest(InitializeRequest),
1037    PingRequest(PingRequest),
1038    ListResourcesRequest(ListResourcesRequest),
1039    ListResourceTemplatesRequest(ListResourceTemplatesRequest),
1040    ReadResourceRequest(ReadResourceRequest),
1041    SubscribeRequest(SubscribeRequest),
1042    UnsubscribeRequest(UnsubscribeRequest),
1043    ListPromptsRequest(ListPromptsRequest),
1044    GetPromptRequest(GetPromptRequest),
1045    ListToolsRequest(ListToolsRequest),
1046    CallToolRequest(CallToolRequest),
1047    GetTaskRequest(GetTaskRequest),
1048    GetTaskPayloadRequest(GetTaskPayloadRequest),
1049    CancelTaskRequest(CancelTaskRequest),
1050    ListTasksRequest(ListTasksRequest),
1051    SetLevelRequest(SetLevelRequest),
1052    CompleteRequest(CompleteRequest),
1053}
1054impl ::std::convert::From<InitializeRequest> for ClientRequest {
1055    fn from(value: InitializeRequest) -> Self {
1056        Self::InitializeRequest(value)
1057    }
1058}
1059impl ::std::convert::From<PingRequest> for ClientRequest {
1060    fn from(value: PingRequest) -> Self {
1061        Self::PingRequest(value)
1062    }
1063}
1064impl ::std::convert::From<ListResourcesRequest> for ClientRequest {
1065    fn from(value: ListResourcesRequest) -> Self {
1066        Self::ListResourcesRequest(value)
1067    }
1068}
1069impl ::std::convert::From<ListResourceTemplatesRequest> for ClientRequest {
1070    fn from(value: ListResourceTemplatesRequest) -> Self {
1071        Self::ListResourceTemplatesRequest(value)
1072    }
1073}
1074impl ::std::convert::From<ReadResourceRequest> for ClientRequest {
1075    fn from(value: ReadResourceRequest) -> Self {
1076        Self::ReadResourceRequest(value)
1077    }
1078}
1079impl ::std::convert::From<SubscribeRequest> for ClientRequest {
1080    fn from(value: SubscribeRequest) -> Self {
1081        Self::SubscribeRequest(value)
1082    }
1083}
1084impl ::std::convert::From<UnsubscribeRequest> for ClientRequest {
1085    fn from(value: UnsubscribeRequest) -> Self {
1086        Self::UnsubscribeRequest(value)
1087    }
1088}
1089impl ::std::convert::From<ListPromptsRequest> for ClientRequest {
1090    fn from(value: ListPromptsRequest) -> Self {
1091        Self::ListPromptsRequest(value)
1092    }
1093}
1094impl ::std::convert::From<GetPromptRequest> for ClientRequest {
1095    fn from(value: GetPromptRequest) -> Self {
1096        Self::GetPromptRequest(value)
1097    }
1098}
1099impl ::std::convert::From<ListToolsRequest> for ClientRequest {
1100    fn from(value: ListToolsRequest) -> Self {
1101        Self::ListToolsRequest(value)
1102    }
1103}
1104impl ::std::convert::From<CallToolRequest> for ClientRequest {
1105    fn from(value: CallToolRequest) -> Self {
1106        Self::CallToolRequest(value)
1107    }
1108}
1109impl ::std::convert::From<GetTaskRequest> for ClientRequest {
1110    fn from(value: GetTaskRequest) -> Self {
1111        Self::GetTaskRequest(value)
1112    }
1113}
1114impl ::std::convert::From<GetTaskPayloadRequest> for ClientRequest {
1115    fn from(value: GetTaskPayloadRequest) -> Self {
1116        Self::GetTaskPayloadRequest(value)
1117    }
1118}
1119impl ::std::convert::From<CancelTaskRequest> for ClientRequest {
1120    fn from(value: CancelTaskRequest) -> Self {
1121        Self::CancelTaskRequest(value)
1122    }
1123}
1124impl ::std::convert::From<ListTasksRequest> for ClientRequest {
1125    fn from(value: ListTasksRequest) -> Self {
1126        Self::ListTasksRequest(value)
1127    }
1128}
1129impl ::std::convert::From<SetLevelRequest> for ClientRequest {
1130    fn from(value: SetLevelRequest) -> Self {
1131        Self::SetLevelRequest(value)
1132    }
1133}
1134impl ::std::convert::From<CompleteRequest> for ClientRequest {
1135    fn from(value: CompleteRequest) -> Self {
1136        Self::CompleteRequest(value)
1137    }
1138}
1139///ClientResult
1140///
1141/// <details><summary>JSON schema</summary>
1142///
1143/// ```json
1144///{
1145///  "anyOf": [
1146///    {
1147///      "$ref": "#/$defs/Result"
1148///    },
1149///    {
1150///      "description": "The response to a tasks/get request.",
1151///      "$ref": "#/$defs/GetTaskResult"
1152///    },
1153///    {
1154///      "$ref": "#/$defs/GetTaskPayloadResult"
1155///    },
1156///    {
1157///      "description": "The response to a tasks/cancel request.",
1158///      "$ref": "#/$defs/CancelTaskResult"
1159///    },
1160///    {
1161///      "$ref": "#/$defs/ListTasksResult"
1162///    },
1163///    {
1164///      "$ref": "#/$defs/CreateMessageResult"
1165///    },
1166///    {
1167///      "$ref": "#/$defs/ListRootsResult"
1168///    },
1169///    {
1170///      "$ref": "#/$defs/ElicitResult"
1171///    }
1172///  ]
1173///}
1174/// ```
1175/// </details>
1176#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1177#[serde(untagged)]
1178pub enum ClientResult {
1179    GetTaskResult(GetTaskResult),
1180    GetTaskPayloadResult(GetTaskPayloadResult),
1181    CancelTaskResult(CancelTaskResult),
1182    ListTasksResult(ListTasksResult),
1183    CreateMessageResult(CreateMessageResult),
1184    ListRootsResult(ListRootsResult),
1185    ElicitResult(ElicitResult),
1186    Result(Result),
1187}
1188impl ::std::convert::From<GetTaskResult> for ClientResult {
1189    fn from(value: GetTaskResult) -> Self {
1190        Self::GetTaskResult(value)
1191    }
1192}
1193impl ::std::convert::From<GetTaskPayloadResult> for ClientResult {
1194    fn from(value: GetTaskPayloadResult) -> Self {
1195        Self::GetTaskPayloadResult(value)
1196    }
1197}
1198impl ::std::convert::From<CancelTaskResult> for ClientResult {
1199    fn from(value: CancelTaskResult) -> Self {
1200        Self::CancelTaskResult(value)
1201    }
1202}
1203impl ::std::convert::From<ListTasksResult> for ClientResult {
1204    fn from(value: ListTasksResult) -> Self {
1205        Self::ListTasksResult(value)
1206    }
1207}
1208impl ::std::convert::From<CreateMessageResult> for ClientResult {
1209    fn from(value: CreateMessageResult) -> Self {
1210        Self::CreateMessageResult(value)
1211    }
1212}
1213impl ::std::convert::From<ListRootsResult> for ClientResult {
1214    fn from(value: ListRootsResult) -> Self {
1215        Self::ListRootsResult(value)
1216    }
1217}
1218impl ::std::convert::From<ElicitResult> for ClientResult {
1219    fn from(value: ElicitResult) -> Self {
1220        Self::ElicitResult(value)
1221    }
1222}
1223impl ::std::convert::From<Result> for ClientResult {
1224    fn from(value: Result) -> Self {
1225        Self::Result(value)
1226    }
1227}
1228///Present if the client supports listing roots.
1229///
1230/// <details><summary>JSON schema</summary>
1231///
1232/// ```json
1233///{
1234///  "description": "Present if the client supports listing roots.",
1235///  "type": "object",
1236///  "properties": {
1237///    "listChanged": {
1238///      "description": "Whether the client supports notifications for changes to the roots list.",
1239///      "type": "boolean"
1240///    }
1241///  }
1242///}
1243/// ```
1244/// </details>
1245#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
1246pub struct ClientRoots {
1247    ///Whether the client supports notifications for changes to the roots list.
1248    #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
1249    pub list_changed: ::std::option::Option<bool>,
1250}
1251///Present if the client supports sampling from an LLM.
1252///
1253/// <details><summary>JSON schema</summary>
1254///
1255/// ```json
1256///{
1257///  "description": "Present if the client supports sampling from an LLM.",
1258///  "type": "object",
1259///  "properties": {
1260///    "context": {
1261///      "description": "Whether the client supports context inclusion via includeContext parameter.\nIf not declared, servers SHOULD only use includeContext: \"none\" (or omit it).",
1262///      "type": "object",
1263///      "additionalProperties": true
1264///    },
1265///    "tools": {
1266///      "description": "Whether the client supports tool use via tools and toolChoice parameters.",
1267///      "type": "object",
1268///      "additionalProperties": true
1269///    }
1270///  }
1271///}
1272/// ```
1273/// </details>
1274#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
1275pub struct ClientSampling {
1276    /**Whether the client supports context inclusion via includeContext parameter.
1277    If not declared, servers SHOULD only use includeContext: "none" (or omit it).*/
1278    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1279    pub context: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1280    ///Whether the client supports tool use via tools and toolChoice parameters.
1281    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1282    pub tools: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1283}
1284///Task support for elicitation-related requests.
1285///
1286/// <details><summary>JSON schema</summary>
1287///
1288/// ```json
1289///{
1290///  "description": "Task support for elicitation-related requests.",
1291///  "type": "object",
1292///  "properties": {
1293///    "create": {
1294///      "description": "Whether the client supports task-augmented elicitation/create requests.",
1295///      "type": "object",
1296///      "additionalProperties": true
1297///    }
1298///  }
1299///}
1300/// ```
1301/// </details>
1302#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
1303pub struct ClientTaskElicitation {
1304    ///Whether the client supports task-augmented elicitation/create requests.
1305    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1306    pub create: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1307}
1308///Specifies which request types can be augmented with tasks.
1309///
1310/// <details><summary>JSON schema</summary>
1311///
1312/// ```json
1313///{
1314///  "description": "Specifies which request types can be augmented with tasks.",
1315///  "type": "object",
1316///  "properties": {
1317///    "elicitation": {
1318///      "description": "Task support for elicitation-related requests.",
1319///      "type": "object",
1320///      "properties": {
1321///        "create": {
1322///          "description": "Whether the client supports task-augmented elicitation/create requests.",
1323///          "type": "object",
1324///          "additionalProperties": true
1325///        }
1326///      }
1327///    },
1328///    "sampling": {
1329///      "description": "Task support for sampling-related requests.",
1330///      "type": "object",
1331///      "properties": {
1332///        "createMessage": {
1333///          "description": "Whether the client supports task-augmented sampling/createMessage requests.",
1334///          "type": "object",
1335///          "additionalProperties": true
1336///        }
1337///      }
1338///    }
1339///  }
1340///}
1341/// ```
1342/// </details>
1343#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
1344pub struct ClientTaskRequest {
1345    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1346    pub elicitation: ::std::option::Option<ClientTaskElicitation>,
1347    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1348    pub sampling: ::std::option::Option<ClientTaskSampling>,
1349}
1350///Task support for sampling-related requests.
1351///
1352/// <details><summary>JSON schema</summary>
1353///
1354/// ```json
1355///{
1356///  "description": "Task support for sampling-related requests.",
1357///  "type": "object",
1358///  "properties": {
1359///    "createMessage": {
1360///      "description": "Whether the client supports task-augmented sampling/createMessage requests.",
1361///      "type": "object",
1362///      "additionalProperties": true
1363///    }
1364///  }
1365///}
1366/// ```
1367/// </details>
1368#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
1369pub struct ClientTaskSampling {
1370    ///Whether the client supports task-augmented sampling/createMessage requests.
1371    #[serde(rename = "createMessage", default, skip_serializing_if = "::std::option::Option::is_none")]
1372    pub create_message: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1373}
1374///Present if the client supports task-augmented requests.
1375///
1376/// <details><summary>JSON schema</summary>
1377///
1378/// ```json
1379///{
1380///  "description": "Present if the client supports task-augmented requests.",
1381///  "type": "object",
1382///  "properties": {
1383///    "cancel": {
1384///      "description": "Whether this client supports tasks/cancel.",
1385///      "type": "object",
1386///      "additionalProperties": true
1387///    },
1388///    "list": {
1389///      "description": "Whether this client supports tasks/list.",
1390///      "type": "object",
1391///      "additionalProperties": true
1392///    },
1393///    "requests": {
1394///      "description": "Specifies which request types can be augmented with tasks.",
1395///      "type": "object",
1396///      "properties": {
1397///        "elicitation": {
1398///          "description": "Task support for elicitation-related requests.",
1399///          "type": "object",
1400///          "properties": {
1401///            "create": {
1402///              "description": "Whether the client supports task-augmented elicitation/create requests.",
1403///              "type": "object",
1404///              "additionalProperties": true
1405///            }
1406///          }
1407///        },
1408///        "sampling": {
1409///          "description": "Task support for sampling-related requests.",
1410///          "type": "object",
1411///          "properties": {
1412///            "createMessage": {
1413///              "description": "Whether the client supports task-augmented sampling/createMessage requests.",
1414///              "type": "object",
1415///              "additionalProperties": true
1416///            }
1417///          }
1418///        }
1419///      }
1420///    }
1421///  }
1422///}
1423/// ```
1424/// </details>
1425#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
1426pub struct ClientTasks {
1427    ///Whether this client supports tasks/cancel.
1428    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1429    pub cancel: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1430    ///Whether this client supports tasks/list.
1431    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1432    pub list: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1433    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1434    pub requests: ::std::option::Option<ClientTaskRequest>,
1435}
1436///A request from the client to the server, to ask for completion options.
1437///
1438/// <details><summary>JSON schema</summary>
1439///
1440/// ```json
1441///{
1442///  "description": "A request from the client to the server, to ask for completion options.",
1443///  "type": "object",
1444///  "required": [
1445///    "id",
1446///    "jsonrpc",
1447///    "method",
1448///    "params"
1449///  ],
1450///  "properties": {
1451///    "id": {
1452///      "$ref": "#/$defs/RequestId"
1453///    },
1454///    "jsonrpc": {
1455///      "type": "string",
1456///      "const": "2.0"
1457///    },
1458///    "method": {
1459///      "type": "string",
1460///      "const": "completion/complete"
1461///    },
1462///    "params": {
1463///      "$ref": "#/$defs/CompleteRequestParams"
1464///    }
1465///  }
1466///}
1467/// ```
1468/// </details>
1469#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1470pub struct CompleteRequest {
1471    pub id: RequestId,
1472    #[serde(deserialize_with = "validate::complete_request_jsonrpc")]
1473    jsonrpc: ::std::string::String,
1474    #[serde(deserialize_with = "validate::complete_request_method")]
1475    method: ::std::string::String,
1476    pub params: CompleteRequestParams,
1477}
1478impl CompleteRequest {
1479    pub fn new(id: RequestId, params: CompleteRequestParams) -> Self {
1480        Self {
1481            id,
1482            jsonrpc: JSONRPC_VERSION.to_string(),
1483            method: "completion/complete".to_string(),
1484            params,
1485        }
1486    }
1487    pub fn jsonrpc(&self) -> &::std::string::String {
1488        &self.jsonrpc
1489    }
1490    pub fn method(&self) -> &::std::string::String {
1491        &self.method
1492    }
1493    /// returns "completion/complete"
1494    pub fn method_value() -> ::std::string::String {
1495        "completion/complete".to_string()
1496    }
1497    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
1498    pub fn method_name() -> ::std::string::String {
1499        "completion/complete".to_string()
1500    }
1501}
1502///The argument's information
1503///
1504/// <details><summary>JSON schema</summary>
1505///
1506/// ```json
1507///{
1508///  "description": "The argument's information",
1509///  "type": "object",
1510///  "required": [
1511///    "name",
1512///    "value"
1513///  ],
1514///  "properties": {
1515///    "name": {
1516///      "description": "The name of the argument",
1517///      "type": "string"
1518///    },
1519///    "value": {
1520///      "description": "The value of the argument to use for completion matching.",
1521///      "type": "string"
1522///    }
1523///  }
1524///}
1525/// ```
1526/// </details>
1527#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1528pub struct CompleteRequestArgument {
1529    ///The name of the argument
1530    pub name: ::std::string::String,
1531    ///The value of the argument to use for completion matching.
1532    pub value: ::std::string::String,
1533}
1534///Additional, optional context for completions
1535///
1536/// <details><summary>JSON schema</summary>
1537///
1538/// ```json
1539///{
1540///  "description": "Additional, optional context for completions",
1541///  "type": "object",
1542///  "properties": {
1543///    "arguments": {
1544///      "description": "Previously-resolved variables in a URI template or prompt.",
1545///      "type": "object",
1546///      "additionalProperties": {
1547///        "type": "string"
1548///      }
1549///    }
1550///  }
1551///}
1552/// ```
1553/// </details>
1554#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
1555pub struct CompleteRequestContext {
1556    ///Previously-resolved variables in a URI template or prompt.
1557    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1558    pub arguments: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
1559}
1560///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
1561///
1562/// <details><summary>JSON schema</summary>
1563///
1564/// ```json
1565///{
1566///  "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
1567///  "type": "object",
1568///  "properties": {
1569///    "progressToken": {
1570///      "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.",
1571///      "$ref": "#/$defs/ProgressToken"
1572///    }
1573///  },
1574///  "additionalProperties": {}
1575///}
1576/// ```
1577/// </details>
1578#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
1579pub struct CompleteRequestMeta {
1580    ///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.
1581    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
1582    pub progress_token: ::std::option::Option<ProgressToken>,
1583    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
1584    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1585}
1586///Parameters for a completion/complete request.
1587///
1588/// <details><summary>JSON schema</summary>
1589///
1590/// ```json
1591///{
1592///  "description": "Parameters for a completion/complete request.",
1593///  "type": "object",
1594///  "required": [
1595///    "argument",
1596///    "ref"
1597///  ],
1598///  "properties": {
1599///    "_meta": {
1600///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
1601///      "type": "object",
1602///      "properties": {
1603///        "progressToken": {
1604///          "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.",
1605///          "$ref": "#/$defs/ProgressToken"
1606///        }
1607///      },
1608///      "additionalProperties": {}
1609///    },
1610///    "argument": {
1611///      "description": "The argument's information",
1612///      "type": "object",
1613///      "required": [
1614///        "name",
1615///        "value"
1616///      ],
1617///      "properties": {
1618///        "name": {
1619///          "description": "The name of the argument",
1620///          "type": "string"
1621///        },
1622///        "value": {
1623///          "description": "The value of the argument to use for completion matching.",
1624///          "type": "string"
1625///        }
1626///      }
1627///    },
1628///    "context": {
1629///      "description": "Additional, optional context for completions",
1630///      "type": "object",
1631///      "properties": {
1632///        "arguments": {
1633///          "description": "Previously-resolved variables in a URI template or prompt.",
1634///          "type": "object",
1635///          "additionalProperties": {
1636///            "type": "string"
1637///          }
1638///        }
1639///      }
1640///    },
1641///    "ref": {
1642///      "anyOf": [
1643///        {
1644///          "$ref": "#/$defs/PromptReference"
1645///        },
1646///        {
1647///          "$ref": "#/$defs/ResourceTemplateReference"
1648///        }
1649///      ]
1650///    }
1651///  }
1652///}
1653/// ```
1654/// </details>
1655#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1656pub struct CompleteRequestParams {
1657    pub argument: CompleteRequestArgument,
1658    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1659    pub context: ::std::option::Option<CompleteRequestContext>,
1660    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
1661    pub meta: ::std::option::Option<CompleteRequestMeta>,
1662    #[serde(rename = "ref")]
1663    pub ref_: CompleteRequestRef,
1664}
1665///CompleteRequestRef
1666///
1667/// <details><summary>JSON schema</summary>
1668///
1669/// ```json
1670///{
1671///  "anyOf": [
1672///    {
1673///      "$ref": "#/$defs/PromptReference"
1674///    },
1675///    {
1676///      "$ref": "#/$defs/ResourceTemplateReference"
1677///    }
1678///  ]
1679///}
1680/// ```
1681/// </details>
1682#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1683#[serde(untagged)]
1684pub enum CompleteRequestRef {
1685    PromptReference(PromptReference),
1686    ResourceTemplateReference(ResourceTemplateReference),
1687}
1688impl ::std::convert::From<PromptReference> for CompleteRequestRef {
1689    fn from(value: PromptReference) -> Self {
1690        Self::PromptReference(value)
1691    }
1692}
1693impl ::std::convert::From<ResourceTemplateReference> for CompleteRequestRef {
1694    fn from(value: ResourceTemplateReference) -> Self {
1695        Self::ResourceTemplateReference(value)
1696    }
1697}
1698///The server's response to a completion/complete request
1699///
1700/// <details><summary>JSON schema</summary>
1701///
1702/// ```json
1703///{
1704///  "description": "The server's response to a completion/complete request",
1705///  "type": "object",
1706///  "required": [
1707///    "completion"
1708///  ],
1709///  "properties": {
1710///    "_meta": {
1711///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
1712///      "type": "object",
1713///      "additionalProperties": {}
1714///    },
1715///    "completion": {
1716///      "type": "object",
1717///      "required": [
1718///        "values"
1719///      ],
1720///      "properties": {
1721///        "hasMore": {
1722///          "description": "Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.",
1723///          "type": "boolean"
1724///        },
1725///        "total": {
1726///          "description": "The total number of completion options available. This can exceed the number of values actually sent in the response.",
1727///          "type": "integer"
1728///        },
1729///        "values": {
1730///          "description": "An array of completion values. Must not exceed 100 items.",
1731///          "type": "array",
1732///          "items": {
1733///            "type": "string"
1734///          }
1735///        }
1736///      }
1737///    }
1738///  }
1739///}
1740/// ```
1741/// </details>
1742#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1743pub struct CompleteResult {
1744    pub completion: CompleteResultCompletion,
1745    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
1746    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
1747    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1748}
1749///CompleteResultCompletion
1750///
1751/// <details><summary>JSON schema</summary>
1752///
1753/// ```json
1754///{
1755///  "type": "object",
1756///  "required": [
1757///    "values"
1758///  ],
1759///  "properties": {
1760///    "hasMore": {
1761///      "description": "Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.",
1762///      "type": "boolean"
1763///    },
1764///    "total": {
1765///      "description": "The total number of completion options available. This can exceed the number of values actually sent in the response.",
1766///      "type": "integer"
1767///    },
1768///    "values": {
1769///      "description": "An array of completion values. Must not exceed 100 items.",
1770///      "type": "array",
1771///      "items": {
1772///        "type": "string"
1773///      }
1774///    }
1775///  }
1776///}
1777/// ```
1778/// </details>
1779#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1780pub struct CompleteResultCompletion {
1781    ///Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
1782    #[serde(rename = "hasMore", default, skip_serializing_if = "::std::option::Option::is_none")]
1783    pub has_more: ::std::option::Option<bool>,
1784    ///The total number of completion options available. This can exceed the number of values actually sent in the response.
1785    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1786    pub total: ::std::option::Option<i64>,
1787    ///An array of completion values. Must not exceed 100 items.
1788    pub values: ::std::vec::Vec<::std::string::String>,
1789}
1790///ContentBlock
1791///
1792/// <details><summary>JSON schema</summary>
1793///
1794/// ```json
1795///{
1796///  "anyOf": [
1797///    {
1798///      "$ref": "#/$defs/TextContent"
1799///    },
1800///    {
1801///      "$ref": "#/$defs/ImageContent"
1802///    },
1803///    {
1804///      "$ref": "#/$defs/AudioContent"
1805///    },
1806///    {
1807///      "$ref": "#/$defs/ResourceLink"
1808///    },
1809///    {
1810///      "$ref": "#/$defs/EmbeddedResource"
1811///    }
1812///  ]
1813///}
1814/// ```
1815/// </details>
1816#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1817#[serde(untagged)]
1818pub enum ContentBlock {
1819    TextContent(TextContent),
1820    ImageContent(ImageContent),
1821    AudioContent(AudioContent),
1822    ResourceLink(ResourceLink),
1823    EmbeddedResource(EmbeddedResource),
1824}
1825impl ::std::convert::From<TextContent> for ContentBlock {
1826    fn from(value: TextContent) -> Self {
1827        Self::TextContent(value)
1828    }
1829}
1830impl ::std::convert::From<ImageContent> for ContentBlock {
1831    fn from(value: ImageContent) -> Self {
1832        Self::ImageContent(value)
1833    }
1834}
1835impl ::std::convert::From<AudioContent> for ContentBlock {
1836    fn from(value: AudioContent) -> Self {
1837        Self::AudioContent(value)
1838    }
1839}
1840impl ::std::convert::From<ResourceLink> for ContentBlock {
1841    fn from(value: ResourceLink) -> Self {
1842        Self::ResourceLink(value)
1843    }
1844}
1845impl ::std::convert::From<EmbeddedResource> for ContentBlock {
1846    fn from(value: EmbeddedResource) -> Self {
1847        Self::EmbeddedResource(value)
1848    }
1849}
1850///CreateMessageContent
1851///
1852/// <details><summary>JSON schema</summary>
1853///
1854/// ```json
1855///{
1856///  "anyOf": [
1857///    {
1858///      "$ref": "#/$defs/TextContent"
1859///    },
1860///    {
1861///      "$ref": "#/$defs/ImageContent"
1862///    },
1863///    {
1864///      "$ref": "#/$defs/AudioContent"
1865///    },
1866///    {
1867///      "$ref": "#/$defs/ToolUseContent"
1868///    },
1869///    {
1870///      "$ref": "#/$defs/ToolResultContent"
1871///    },
1872///    {
1873///      "type": "array",
1874///      "items": {
1875///        "$ref": "#/$defs/SamplingMessageContentBlock"
1876///      }
1877///    }
1878///  ]
1879///}
1880/// ```
1881/// </details>
1882#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1883#[serde(untagged)]
1884pub enum CreateMessageContent {
1885    TextContent(TextContent),
1886    ImageContent(ImageContent),
1887    AudioContent(AudioContent),
1888    ToolUseContent(ToolUseContent),
1889    ToolResultContent(ToolResultContent),
1890    SamplingMessageContentBlock(::std::vec::Vec<SamplingMessageContentBlock>),
1891}
1892impl ::std::convert::From<TextContent> for CreateMessageContent {
1893    fn from(value: TextContent) -> Self {
1894        Self::TextContent(value)
1895    }
1896}
1897impl ::std::convert::From<ImageContent> for CreateMessageContent {
1898    fn from(value: ImageContent) -> Self {
1899        Self::ImageContent(value)
1900    }
1901}
1902impl ::std::convert::From<AudioContent> for CreateMessageContent {
1903    fn from(value: AudioContent) -> Self {
1904        Self::AudioContent(value)
1905    }
1906}
1907impl ::std::convert::From<ToolUseContent> for CreateMessageContent {
1908    fn from(value: ToolUseContent) -> Self {
1909        Self::ToolUseContent(value)
1910    }
1911}
1912impl ::std::convert::From<ToolResultContent> for CreateMessageContent {
1913    fn from(value: ToolResultContent) -> Self {
1914        Self::ToolResultContent(value)
1915    }
1916}
1917impl ::std::convert::From<::std::vec::Vec<SamplingMessageContentBlock>> for CreateMessageContent {
1918    fn from(value: ::std::vec::Vec<SamplingMessageContentBlock>) -> Self {
1919        Self::SamplingMessageContentBlock(value)
1920    }
1921}
1922///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.
1923///
1924/// <details><summary>JSON schema</summary>
1925///
1926/// ```json
1927///{
1928///  "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.",
1929///  "type": "object",
1930///  "required": [
1931///    "id",
1932///    "jsonrpc",
1933///    "method",
1934///    "params"
1935///  ],
1936///  "properties": {
1937///    "id": {
1938///      "$ref": "#/$defs/RequestId"
1939///    },
1940///    "jsonrpc": {
1941///      "type": "string",
1942///      "const": "2.0"
1943///    },
1944///    "method": {
1945///      "type": "string",
1946///      "const": "sampling/createMessage"
1947///    },
1948///    "params": {
1949///      "$ref": "#/$defs/CreateMessageRequestParams"
1950///    }
1951///  }
1952///}
1953/// ```
1954/// </details>
1955#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1956pub struct CreateMessageRequest {
1957    pub id: RequestId,
1958    #[serde(deserialize_with = "validate::create_message_request_jsonrpc")]
1959    jsonrpc: ::std::string::String,
1960    #[serde(deserialize_with = "validate::create_message_request_method")]
1961    method: ::std::string::String,
1962    pub params: CreateMessageRequestParams,
1963}
1964impl CreateMessageRequest {
1965    pub fn new(id: RequestId, params: CreateMessageRequestParams) -> Self {
1966        Self {
1967            id,
1968            jsonrpc: JSONRPC_VERSION.to_string(),
1969            method: "sampling/createMessage".to_string(),
1970            params,
1971        }
1972    }
1973    pub fn jsonrpc(&self) -> &::std::string::String {
1974        &self.jsonrpc
1975    }
1976    pub fn method(&self) -> &::std::string::String {
1977        &self.method
1978    }
1979    /// returns "sampling/createMessage"
1980    pub fn method_value() -> ::std::string::String {
1981        "sampling/createMessage".to_string()
1982    }
1983    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
1984    pub fn method_name() -> ::std::string::String {
1985        "sampling/createMessage".to_string()
1986    }
1987}
1988///Parameters for a sampling/createMessage request.
1989///
1990/// <details><summary>JSON schema</summary>
1991///
1992/// ```json
1993///{
1994///  "description": "Parameters for a sampling/createMessage request.",
1995///  "type": "object",
1996///  "required": [
1997///    "maxTokens",
1998///    "messages"
1999///  ],
2000///  "properties": {
2001///    "_meta": {
2002///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
2003///      "type": "object",
2004///      "properties": {
2005///        "progressToken": {
2006///          "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.",
2007///          "$ref": "#/$defs/ProgressToken"
2008///        }
2009///      },
2010///      "additionalProperties": {}
2011///    },
2012///    "includeContext": {
2013///      "description": "A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.\nThe client MAY ignore this request.\n\nDefault is \"none\". Values \"thisServer\" and \"allServers\" are soft-deprecated. Servers SHOULD only use these values if the client\ndeclares ClientCapabilities.sampling.context. These values may be removed in future spec releases.",
2014///      "type": "string",
2015///      "enum": [
2016///        "allServers",
2017///        "none",
2018///        "thisServer"
2019///      ]
2020///    },
2021///    "maxTokens": {
2022///      "description": "The requested maximum number of tokens to sample (to prevent runaway completions).\n\nThe client MAY choose to sample fewer tokens than the requested maximum.",
2023///      "type": "integer"
2024///    },
2025///    "messages": {
2026///      "type": "array",
2027///      "items": {
2028///        "$ref": "#/$defs/SamplingMessage"
2029///      }
2030///    },
2031///    "metadata": {
2032///      "description": "Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.",
2033///      "type": "object",
2034///      "additionalProperties": true
2035///    },
2036///    "modelPreferences": {
2037///      "description": "The server's preferences for which model to select. The client MAY ignore these preferences.",
2038///      "$ref": "#/$defs/ModelPreferences"
2039///    },
2040///    "stopSequences": {
2041///      "type": "array",
2042///      "items": {
2043///        "type": "string"
2044///      }
2045///    },
2046///    "systemPrompt": {
2047///      "description": "An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.",
2048///      "type": "string"
2049///    },
2050///    "task": {
2051///      "description": "If specified, the caller is requesting task-augmented execution for this request.\nThe request will return a CreateTaskResult immediately, and the actual result can be\nretrieved later via tasks/result.\n\nTask augmentation is subject to capability negotiation - receivers MUST declare support\nfor task augmentation of specific request types in their capabilities.",
2052///      "$ref": "#/$defs/TaskMetadata"
2053///    },
2054///    "temperature": {
2055///      "type": "number"
2056///    },
2057///    "toolChoice": {
2058///      "description": "Controls how the model uses tools.\nThe client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.\nDefault is { mode: \"auto\" }.",
2059///      "$ref": "#/$defs/ToolChoice"
2060///    },
2061///    "tools": {
2062///      "description": "Tools that the model may use during generation.\nThe client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.",
2063///      "type": "array",
2064///      "items": {
2065///        "$ref": "#/$defs/Tool"
2066///      }
2067///    }
2068///  }
2069///}
2070/// ```
2071/// </details>
2072#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2073pub struct CreateMessageRequestParams {
2074    /**A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
2075    The client MAY ignore this request.
2076    Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
2077    declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.*/
2078    #[serde(rename = "includeContext", default, skip_serializing_if = "::std::option::Option::is_none")]
2079    pub include_context: ::std::option::Option<IncludeContext>,
2080    /**The requested maximum number of tokens to sample (to prevent runaway completions).
2081    The client MAY choose to sample fewer tokens than the requested maximum.*/
2082    #[serde(rename = "maxTokens")]
2083    pub max_tokens: i64,
2084    pub messages: ::std::vec::Vec<SamplingMessage>,
2085    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2086    pub meta: ::std::option::Option<MessageMeta>,
2087    ///Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
2088    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2089    pub metadata: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2090    ///The server's preferences for which model to select. The client MAY ignore these preferences.
2091    #[serde(
2092        rename = "modelPreferences",
2093        default,
2094        skip_serializing_if = "::std::option::Option::is_none"
2095    )]
2096    pub model_preferences: ::std::option::Option<ModelPreferences>,
2097    #[serde(rename = "stopSequences", default, skip_serializing_if = "::std::vec::Vec::is_empty")]
2098    pub stop_sequences: ::std::vec::Vec<::std::string::String>,
2099    ///An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
2100    #[serde(rename = "systemPrompt", default, skip_serializing_if = "::std::option::Option::is_none")]
2101    pub system_prompt: ::std::option::Option<::std::string::String>,
2102    /**If specified, the caller is requesting task-augmented execution for this request.
2103    The request will return a CreateTaskResult immediately, and the actual result can be
2104    retrieved later via tasks/result.
2105    Task augmentation is subject to capability negotiation - receivers MUST declare support
2106    for task augmentation of specific request types in their capabilities.*/
2107    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2108    pub task: ::std::option::Option<TaskMetadata>,
2109    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2110    pub temperature: ::std::option::Option<f64>,
2111    /**Controls how the model uses tools.
2112    The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
2113    Default is { mode: "auto" }.*/
2114    #[serde(rename = "toolChoice", default, skip_serializing_if = "::std::option::Option::is_none")]
2115    pub tool_choice: ::std::option::Option<ToolChoice>,
2116    /**Tools that the model may use during generation.
2117    The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.*/
2118    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
2119    pub tools: ::std::vec::Vec<Tool>,
2120}
2121/**The client's response to a sampling/createMessage request from the server.
2122The client should inform the user before returning the sampled message, to allow them
2123to inspect the response (human in the loop) and decide whether to allow the server to see it.*/
2124///
2125/// <details><summary>JSON schema</summary>
2126///
2127/// ```json
2128///{
2129///  "description": "The client's response to a sampling/createMessage request from the server.\nThe client should inform the user before returning the sampled message, to allow them\nto inspect the response (human in the loop) and decide whether to allow the server to see it.",
2130///  "type": "object",
2131///  "required": [
2132///    "content",
2133///    "model",
2134///    "role"
2135///  ],
2136///  "properties": {
2137///    "_meta": {
2138///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
2139///      "type": "object",
2140///      "additionalProperties": {}
2141///    },
2142///    "content": {
2143///      "anyOf": [
2144///        {
2145///          "$ref": "#/$defs/TextContent"
2146///        },
2147///        {
2148///          "$ref": "#/$defs/ImageContent"
2149///        },
2150///        {
2151///          "$ref": "#/$defs/AudioContent"
2152///        },
2153///        {
2154///          "$ref": "#/$defs/ToolUseContent"
2155///        },
2156///        {
2157///          "$ref": "#/$defs/ToolResultContent"
2158///        },
2159///        {
2160///          "type": "array",
2161///          "items": {
2162///            "$ref": "#/$defs/SamplingMessageContentBlock"
2163///          }
2164///        }
2165///      ]
2166///    },
2167///    "model": {
2168///      "description": "The name of the model that generated the message.",
2169///      "type": "string"
2170///    },
2171///    "role": {
2172///      "$ref": "#/$defs/Role"
2173///    },
2174///    "stopReason": {
2175///      "description": "The reason why sampling stopped, if known.\n\nStandard values:\n- \"endTurn\": Natural end of the assistant's turn\n- \"stopSequence\": A stop sequence was encountered\n- \"maxTokens\": Maximum token limit was reached\n- \"toolUse\": The model wants to use one or more tools\n\nThis field is an open string to allow for provider-specific stop reasons.",
2176///      "type": "string"
2177///    }
2178///  }
2179///}
2180/// ```
2181/// </details>
2182#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2183pub struct CreateMessageResult {
2184    pub content: CreateMessageContent,
2185    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
2186    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2187    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2188    ///The name of the model that generated the message.
2189    pub model: ::std::string::String,
2190    pub role: Role,
2191    /**The reason why sampling stopped, if known.
2192    Standard values:
2193    - "endTurn": Natural end of the assistant's turn
2194    - "stopSequence": A stop sequence was encountered
2195    - "maxTokens": Maximum token limit was reached
2196    - "toolUse": The model wants to use one or more tools
2197    This field is an open string to allow for provider-specific stop reasons.*/
2198    #[serde(rename = "stopReason", default, skip_serializing_if = "::std::option::Option::is_none")]
2199    pub stop_reason: ::std::option::Option<::std::string::String>,
2200}
2201///A response to a task-augmented request.
2202///
2203/// <details><summary>JSON schema</summary>
2204///
2205/// ```json
2206///{
2207///  "description": "A response to a task-augmented request.",
2208///  "type": "object",
2209///  "required": [
2210///    "task"
2211///  ],
2212///  "properties": {
2213///    "_meta": {
2214///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
2215///      "type": "object",
2216///      "additionalProperties": {}
2217///    },
2218///    "task": {
2219///      "$ref": "#/$defs/Task"
2220///    }
2221///  }
2222///}
2223/// ```
2224/// </details>
2225#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2226pub struct CreateTaskResult {
2227    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
2228    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2229    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2230    pub task: Task,
2231}
2232///An opaque token used to represent a cursor for pagination.
2233///
2234/// <details><summary>JSON schema</summary>
2235///
2236/// ```json
2237///{
2238///  "description": "An opaque token used to represent a cursor for pagination.",
2239///  "type": "string"
2240///}
2241/// ```
2242/// </details>
2243#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2244#[serde(transparent)]
2245pub struct Cursor(pub ::std::string::String);
2246///ElicitCompleteParams
2247///
2248/// <details><summary>JSON schema</summary>
2249///
2250/// ```json
2251///{
2252///  "type": "object",
2253///  "required": [
2254///    "elicitationId"
2255///  ],
2256///  "properties": {
2257///    "elicitationId": {
2258///      "description": "The ID of the elicitation that completed.",
2259///      "type": "string"
2260///    }
2261///  }
2262///}
2263/// ```
2264/// </details>
2265#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2266pub struct ElicitCompleteParams {
2267    ///The ID of the elicitation that completed.
2268    #[serde(rename = "elicitationId")]
2269    pub elicitation_id: ::std::string::String,
2270}
2271///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
2272///
2273/// <details><summary>JSON schema</summary>
2274///
2275/// ```json
2276///{
2277///  "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
2278///  "type": "object",
2279///  "properties": {
2280///    "progressToken": {
2281///      "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.",
2282///      "$ref": "#/$defs/ProgressToken"
2283///    }
2284///  },
2285///  "additionalProperties": {}
2286///}
2287/// ```
2288/// </details>
2289#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
2290pub struct ElicitFormMeta {
2291    ///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.
2292    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
2293    pub progress_token: ::std::option::Option<ProgressToken>,
2294    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
2295    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2296}
2297/**A restricted subset of JSON Schema.
2298Only top-level properties are allowed, without nesting.*/
2299///
2300/// <details><summary>JSON schema</summary>
2301///
2302/// ```json
2303///{
2304///  "description": "A restricted subset of JSON Schema.\nOnly top-level properties are allowed, without nesting.",
2305///  "type": "object",
2306///  "required": [
2307///    "properties",
2308///    "type"
2309///  ],
2310///  "properties": {
2311///    "$schema": {
2312///      "type": "string"
2313///    },
2314///    "properties": {
2315///      "type": "object",
2316///      "additionalProperties": {
2317///        "$ref": "#/$defs/PrimitiveSchemaDefinition"
2318///      }
2319///    },
2320///    "required": {
2321///      "type": "array",
2322///      "items": {
2323///        "type": "string"
2324///      }
2325///    },
2326///    "type": {
2327///      "type": "string",
2328///      "const": "object"
2329///    }
2330///  }
2331///}
2332/// ```
2333/// </details>
2334#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2335pub struct ElicitFormSchema {
2336    pub properties: ::std::collections::HashMap<::std::string::String, PrimitiveSchemaDefinition>,
2337    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
2338    pub required: ::std::vec::Vec<::std::string::String>,
2339    #[serde(rename = "$schema", default, skip_serializing_if = "::std::option::Option::is_none")]
2340    pub schema: ::std::option::Option<::std::string::String>,
2341    #[serde(rename = "type", deserialize_with = "validate::elicit_form_schema_type_")]
2342    type_: ::std::string::String,
2343}
2344impl ElicitFormSchema {
2345    pub fn new(
2346        properties: ::std::collections::HashMap<::std::string::String, PrimitiveSchemaDefinition>,
2347        required: ::std::vec::Vec<::std::string::String>,
2348        schema: ::std::option::Option<::std::string::String>,
2349    ) -> Self {
2350        Self {
2351            properties,
2352            required,
2353            schema,
2354            type_: "object".to_string(),
2355        }
2356    }
2357    pub fn type_(&self) -> &::std::string::String {
2358        &self.type_
2359    }
2360    /// returns "object"
2361    pub fn type_value() -> ::std::string::String {
2362        "object".to_string()
2363    }
2364    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
2365    pub fn type_name() -> ::std::string::String {
2366        "object".to_string()
2367    }
2368}
2369///A request from the server to elicit additional information from the user via the client.
2370///
2371/// <details><summary>JSON schema</summary>
2372///
2373/// ```json
2374///{
2375///  "description": "A request from the server to elicit additional information from the user via the client.",
2376///  "type": "object",
2377///  "required": [
2378///    "id",
2379///    "jsonrpc",
2380///    "method",
2381///    "params"
2382///  ],
2383///  "properties": {
2384///    "id": {
2385///      "$ref": "#/$defs/RequestId"
2386///    },
2387///    "jsonrpc": {
2388///      "type": "string",
2389///      "const": "2.0"
2390///    },
2391///    "method": {
2392///      "type": "string",
2393///      "const": "elicitation/create"
2394///    },
2395///    "params": {
2396///      "$ref": "#/$defs/ElicitRequestParams"
2397///    }
2398///  }
2399///}
2400/// ```
2401/// </details>
2402#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2403pub struct ElicitRequest {
2404    pub id: RequestId,
2405    #[serde(deserialize_with = "validate::elicit_request_jsonrpc")]
2406    jsonrpc: ::std::string::String,
2407    #[serde(deserialize_with = "validate::elicit_request_method")]
2408    method: ::std::string::String,
2409    pub params: ElicitRequestParams,
2410}
2411impl ElicitRequest {
2412    pub fn new(id: RequestId, params: ElicitRequestParams) -> Self {
2413        Self {
2414            id,
2415            jsonrpc: JSONRPC_VERSION.to_string(),
2416            method: "elicitation/create".to_string(),
2417            params,
2418        }
2419    }
2420    pub fn jsonrpc(&self) -> &::std::string::String {
2421        &self.jsonrpc
2422    }
2423    pub fn method(&self) -> &::std::string::String {
2424        &self.method
2425    }
2426    /// returns "elicitation/create"
2427    pub fn method_value() -> ::std::string::String {
2428        "elicitation/create".to_string()
2429    }
2430    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
2431    pub fn method_name() -> ::std::string::String {
2432        "elicitation/create".to_string()
2433    }
2434}
2435///The parameters for a request to elicit non-sensitive information from the user via a form in the client.
2436///
2437/// <details><summary>JSON schema</summary>
2438///
2439/// ```json
2440///{
2441///  "description": "The parameters for a request to elicit non-sensitive information from the user via a form in the client.",
2442///  "type": "object",
2443///  "required": [
2444///    "message",
2445///    "requestedSchema"
2446///  ],
2447///  "properties": {
2448///    "_meta": {
2449///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
2450///      "type": "object",
2451///      "properties": {
2452///        "progressToken": {
2453///          "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.",
2454///          "$ref": "#/$defs/ProgressToken"
2455///        }
2456///      },
2457///      "additionalProperties": {}
2458///    },
2459///    "message": {
2460///      "description": "The message to present to the user describing what information is being requested.",
2461///      "type": "string"
2462///    },
2463///    "mode": {
2464///      "description": "The elicitation mode.",
2465///      "type": "string",
2466///      "const": "form"
2467///    },
2468///    "requestedSchema": {
2469///      "description": "A restricted subset of JSON Schema.\nOnly top-level properties are allowed, without nesting.",
2470///      "type": "object",
2471///      "required": [
2472///        "properties",
2473///        "type"
2474///      ],
2475///      "properties": {
2476///        "$schema": {
2477///          "type": "string"
2478///        },
2479///        "properties": {
2480///          "type": "object",
2481///          "additionalProperties": {
2482///            "$ref": "#/$defs/PrimitiveSchemaDefinition"
2483///          }
2484///        },
2485///        "required": {
2486///          "type": "array",
2487///          "items": {
2488///            "type": "string"
2489///          }
2490///        },
2491///        "type": {
2492///          "type": "string",
2493///          "const": "object"
2494///        }
2495///      }
2496///    },
2497///    "task": {
2498///      "description": "If specified, the caller is requesting task-augmented execution for this request.\nThe request will return a CreateTaskResult immediately, and the actual result can be\nretrieved later via tasks/result.\n\nTask augmentation is subject to capability negotiation - receivers MUST declare support\nfor task augmentation of specific request types in their capabilities.",
2499///      "$ref": "#/$defs/TaskMetadata"
2500///    }
2501///  }
2502///}
2503/// ```
2504/// </details>
2505#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2506pub struct ElicitRequestFormParams {
2507    ///The message to present to the user describing what information is being requested.
2508    pub message: ::std::string::String,
2509    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2510    pub meta: ::std::option::Option<ElicitFormMeta>,
2511    ///The elicitation mode.
2512    #[serde(
2513        default,
2514        skip_serializing_if = "::std::option::Option::is_none",
2515        deserialize_with = "validate::elicit_request_form_params_mode"
2516    )]
2517    mode: ::std::option::Option<::std::string::String>,
2518    #[serde(rename = "requestedSchema")]
2519    pub requested_schema: ElicitFormSchema,
2520    /**If specified, the caller is requesting task-augmented execution for this request.
2521    The request will return a CreateTaskResult immediately, and the actual result can be
2522    retrieved later via tasks/result.
2523    Task augmentation is subject to capability negotiation - receivers MUST declare support
2524    for task augmentation of specific request types in their capabilities.*/
2525    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2526    pub task: ::std::option::Option<TaskMetadata>,
2527}
2528impl ElicitRequestFormParams {
2529    pub fn new(
2530        message: ::std::string::String,
2531        requested_schema: ElicitFormSchema,
2532        meta: ::std::option::Option<ElicitFormMeta>,
2533        task: ::std::option::Option<TaskMetadata>,
2534    ) -> Self {
2535        Self {
2536            message,
2537            meta,
2538            mode: Some("form".to_string()),
2539            requested_schema,
2540            task,
2541        }
2542    }
2543    pub fn mode(&self) -> &::std::option::Option<::std::string::String> {
2544        &self.mode
2545    }
2546    /// returns "form"
2547    pub fn mode_value() -> ::std::string::String {
2548        "form".to_string()
2549    }
2550    #[deprecated(since = "0.8.0", note = "Use `mode_value()` instead.")]
2551    pub fn mode_name() -> ::std::string::String {
2552        "form".to_string()
2553    }
2554}
2555///The parameters for a request to elicit additional information from the user via the client.
2556///
2557/// <details><summary>JSON schema</summary>
2558///
2559/// ```json
2560///{
2561///  "description": "The parameters for a request to elicit additional information from the user via the client.",
2562///  "anyOf": [
2563///    {
2564///      "$ref": "#/$defs/ElicitRequestURLParams"
2565///    },
2566///    {
2567///      "$ref": "#/$defs/ElicitRequestFormParams"
2568///    }
2569///  ]
2570///}
2571/// ```
2572/// </details>
2573#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2574#[serde(untagged)]
2575pub enum ElicitRequestParams {
2576    UrlParams(ElicitRequestUrlParams),
2577    FormParams(ElicitRequestFormParams),
2578}
2579impl ::std::convert::From<ElicitRequestUrlParams> for ElicitRequestParams {
2580    fn from(value: ElicitRequestUrlParams) -> Self {
2581        Self::UrlParams(value)
2582    }
2583}
2584impl ::std::convert::From<ElicitRequestFormParams> for ElicitRequestParams {
2585    fn from(value: ElicitRequestFormParams) -> Self {
2586        Self::FormParams(value)
2587    }
2588}
2589///The parameters for a request to elicit information from the user via a URL in the client.
2590///
2591/// <details><summary>JSON schema</summary>
2592///
2593/// ```json
2594///{
2595///  "description": "The parameters for a request to elicit information from the user via a URL in the client.",
2596///  "type": "object",
2597///  "required": [
2598///    "elicitationId",
2599///    "message",
2600///    "mode",
2601///    "url"
2602///  ],
2603///  "properties": {
2604///    "_meta": {
2605///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
2606///      "type": "object",
2607///      "properties": {
2608///        "progressToken": {
2609///          "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.",
2610///          "$ref": "#/$defs/ProgressToken"
2611///        }
2612///      },
2613///      "additionalProperties": {}
2614///    },
2615///    "elicitationId": {
2616///      "description": "The ID of the elicitation, which must be unique within the context of the server.\nThe client MUST treat this ID as an opaque value.",
2617///      "type": "string"
2618///    },
2619///    "message": {
2620///      "description": "The message to present to the user explaining why the interaction is needed.",
2621///      "type": "string"
2622///    },
2623///    "mode": {
2624///      "description": "The elicitation mode.",
2625///      "type": "string",
2626///      "const": "url"
2627///    },
2628///    "task": {
2629///      "description": "If specified, the caller is requesting task-augmented execution for this request.\nThe request will return a CreateTaskResult immediately, and the actual result can be\nretrieved later via tasks/result.\n\nTask augmentation is subject to capability negotiation - receivers MUST declare support\nfor task augmentation of specific request types in their capabilities.",
2630///      "$ref": "#/$defs/TaskMetadata"
2631///    },
2632///    "url": {
2633///      "description": "The URL that the user should navigate to.",
2634///      "type": "string",
2635///      "format": "uri"
2636///    }
2637///  }
2638///}
2639/// ```
2640/// </details>
2641#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2642pub struct ElicitRequestUrlParams {
2643    /**The ID of the elicitation, which must be unique within the context of the server.
2644    The client MUST treat this ID as an opaque value.*/
2645    #[serde(rename = "elicitationId")]
2646    pub elicitation_id: ::std::string::String,
2647    ///The message to present to the user explaining why the interaction is needed.
2648    pub message: ::std::string::String,
2649    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2650    pub meta: ::std::option::Option<ElicitUrlMeta>,
2651    ///The elicitation mode.
2652    #[serde(deserialize_with = "validate::elicit_request_url_params_mode")]
2653    mode: ::std::string::String,
2654    /**If specified, the caller is requesting task-augmented execution for this request.
2655    The request will return a CreateTaskResult immediately, and the actual result can be
2656    retrieved later via tasks/result.
2657    Task augmentation is subject to capability negotiation - receivers MUST declare support
2658    for task augmentation of specific request types in their capabilities.*/
2659    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2660    pub task: ::std::option::Option<TaskMetadata>,
2661    ///The URL that the user should navigate to.
2662    pub url: ::std::string::String,
2663}
2664impl ElicitRequestUrlParams {
2665    pub fn new(
2666        elicitation_id: ::std::string::String,
2667        message: ::std::string::String,
2668        url: ::std::string::String,
2669        meta: ::std::option::Option<ElicitUrlMeta>,
2670        task: ::std::option::Option<TaskMetadata>,
2671    ) -> Self {
2672        Self {
2673            elicitation_id,
2674            message,
2675            meta,
2676            mode: "url".to_string(),
2677            task,
2678            url,
2679        }
2680    }
2681    pub fn mode(&self) -> &::std::string::String {
2682        &self.mode
2683    }
2684    /// returns "url"
2685    pub fn mode_value() -> ::std::string::String {
2686        "url".to_string()
2687    }
2688    #[deprecated(since = "0.8.0", note = "Use `mode_value()` instead.")]
2689    pub fn mode_name() -> ::std::string::String {
2690        "url".to_string()
2691    }
2692}
2693///The client's response to an elicitation request.
2694///
2695/// <details><summary>JSON schema</summary>
2696///
2697/// ```json
2698///{
2699///  "description": "The client's response to an elicitation request.",
2700///  "type": "object",
2701///  "required": [
2702///    "action"
2703///  ],
2704///  "properties": {
2705///    "_meta": {
2706///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
2707///      "type": "object",
2708///      "additionalProperties": {}
2709///    },
2710///    "action": {
2711///      "description": "The user action in response to the elicitation.\n- \"accept\": User submitted the form/confirmed the action\n- \"decline\": User explicitly decline the action\n- \"cancel\": User dismissed without making an explicit choice",
2712///      "type": "string",
2713///      "enum": [
2714///        "accept",
2715///        "cancel",
2716///        "decline"
2717///      ]
2718///    },
2719///    "content": {
2720///      "description": "The submitted form data, only present when action is \"accept\" and mode was \"form\".\nContains values matching the requested schema.\nOmitted for out-of-band mode responses.",
2721///      "type": "object",
2722///      "additionalProperties": {
2723///        "anyOf": [
2724///          {
2725///            "type": "array",
2726///            "items": {
2727///              "type": "string"
2728///            }
2729///          },
2730///          {
2731///            "type": [
2732///              "string",
2733///              "integer",
2734///              "boolean"
2735///            ]
2736///          }
2737///        ]
2738///      }
2739///    }
2740///  }
2741///}
2742/// ```
2743/// </details>
2744#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2745pub struct ElicitResult {
2746    /**The user action in response to the elicitation.
2747    - "accept": User submitted the form/confirmed the action
2748    - "decline": User explicitly decline the action
2749    - "cancel": User dismissed without making an explicit choice*/
2750    pub action: ElicitResultAction,
2751    /**The submitted form data, only present when action is "accept" and mode was "form".
2752    Contains values matching the requested schema.
2753    Omitted for out-of-band mode responses.*/
2754    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2755    pub content: ::std::option::Option<::std::collections::HashMap<::std::string::String, ElicitResultContent>>,
2756    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
2757    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2758    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2759}
2760/**The user action in response to the elicitation.
2761- "accept": User submitted the form/confirmed the action
2762- "decline": User explicitly decline the action
2763- "cancel": User dismissed without making an explicit choice*/
2764///
2765/// <details><summary>JSON schema</summary>
2766///
2767/// ```json
2768///{
2769///  "description": "The user action in response to the elicitation.\n- \"accept\": User submitted the form/confirmed the action\n- \"decline\": User explicitly decline the action\n- \"cancel\": User dismissed without making an explicit choice",
2770///  "type": "string",
2771///  "enum": [
2772///    "accept",
2773///    "cancel",
2774///    "decline"
2775///  ]
2776///}
2777/// ```
2778/// </details>
2779#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2780pub enum ElicitResultAction {
2781    #[serde(rename = "accept")]
2782    Accept,
2783    #[serde(rename = "cancel")]
2784    Cancel,
2785    #[serde(rename = "decline")]
2786    Decline,
2787}
2788impl ::std::fmt::Display for ElicitResultAction {
2789    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2790        match *self {
2791            Self::Accept => write!(f, "accept"),
2792            Self::Cancel => write!(f, "cancel"),
2793            Self::Decline => write!(f, "decline"),
2794        }
2795    }
2796}
2797///ElicitResultContent
2798///
2799/// <details><summary>JSON schema</summary>
2800///
2801/// ```json
2802///{
2803///  "anyOf": [
2804///    {
2805///      "type": "array",
2806///      "items": {
2807///        "type": "string"
2808///      }
2809///    },
2810///    {
2811///      "type": [
2812///        "string",
2813///        "integer",
2814///        "boolean"
2815///      ]
2816///    }
2817///  ]
2818///}
2819/// ```
2820/// </details>
2821#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2822#[serde(untagged)]
2823pub enum ElicitResultContent {
2824    StringArray(::std::vec::Vec<::std::string::String>),
2825    Primitive(ElicitResultContentPrimitive),
2826}
2827impl ::std::convert::From<::std::vec::Vec<::std::string::String>> for ElicitResultContent {
2828    fn from(value: ::std::vec::Vec<::std::string::String>) -> Self {
2829        Self::StringArray(value)
2830    }
2831}
2832impl ::std::convert::From<ElicitResultContentPrimitive> for ElicitResultContent {
2833    fn from(value: ElicitResultContentPrimitive) -> Self {
2834        Self::Primitive(value)
2835    }
2836}
2837///ElicitResultContentPrimitive
2838///
2839/// <details><summary>JSON schema</summary>
2840///
2841/// ```json
2842///{
2843///  "type": [
2844///    "string",
2845///    "integer",
2846///    "boolean"
2847///  ]
2848///}
2849/// ```
2850/// </details>
2851#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2852#[serde(untagged)]
2853pub enum ElicitResultContentPrimitive {
2854    Boolean(bool),
2855    String(::std::string::String),
2856    Integer(i64),
2857}
2858impl ::std::convert::From<bool> for ElicitResultContentPrimitive {
2859    fn from(value: bool) -> Self {
2860        Self::Boolean(value)
2861    }
2862}
2863impl ::std::convert::From<i64> for ElicitResultContentPrimitive {
2864    fn from(value: i64) -> Self {
2865        Self::Integer(value)
2866    }
2867}
2868///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
2869///
2870/// <details><summary>JSON schema</summary>
2871///
2872/// ```json
2873///{
2874///  "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
2875///  "type": "object",
2876///  "properties": {
2877///    "progressToken": {
2878///      "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.",
2879///      "$ref": "#/$defs/ProgressToken"
2880///    }
2881///  },
2882///  "additionalProperties": {}
2883///}
2884/// ```
2885/// </details>
2886#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
2887pub struct ElicitUrlMeta {
2888    ///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.
2889    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
2890    pub progress_token: ::std::option::Option<ProgressToken>,
2891    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
2892    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2893}
2894///An optional notification from the server to the client, informing it of a completion of a out-of-band elicitation request.
2895///
2896/// <details><summary>JSON schema</summary>
2897///
2898/// ```json
2899///{
2900///  "description": "An optional notification from the server to the client, informing it of a completion of a out-of-band elicitation request.",
2901///  "type": "object",
2902///  "required": [
2903///    "jsonrpc",
2904///    "method",
2905///    "params"
2906///  ],
2907///  "properties": {
2908///    "jsonrpc": {
2909///      "type": "string",
2910///      "const": "2.0"
2911///    },
2912///    "method": {
2913///      "type": "string",
2914///      "const": "notifications/elicitation/complete"
2915///    },
2916///    "params": {
2917///      "type": "object",
2918///      "required": [
2919///        "elicitationId"
2920///      ],
2921///      "properties": {
2922///        "elicitationId": {
2923///          "description": "The ID of the elicitation that completed.",
2924///          "type": "string"
2925///        }
2926///      }
2927///    }
2928///  }
2929///}
2930/// ```
2931/// </details>
2932#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2933pub struct ElicitationCompleteNotification {
2934    #[serde(deserialize_with = "validate::elicitation_complete_notification_jsonrpc")]
2935    jsonrpc: ::std::string::String,
2936    #[serde(deserialize_with = "validate::elicitation_complete_notification_method")]
2937    method: ::std::string::String,
2938    pub params: ElicitCompleteParams,
2939}
2940impl ElicitationCompleteNotification {
2941    pub fn new(params: ElicitCompleteParams) -> Self {
2942        Self {
2943            jsonrpc: JSONRPC_VERSION.to_string(),
2944            method: "notifications/elicitation/complete".to_string(),
2945            params,
2946        }
2947    }
2948    pub fn jsonrpc(&self) -> &::std::string::String {
2949        &self.jsonrpc
2950    }
2951    pub fn method(&self) -> &::std::string::String {
2952        &self.method
2953    }
2954    /// returns "notifications/elicitation/complete"
2955    pub fn method_value() -> ::std::string::String {
2956        "notifications/elicitation/complete".to_string()
2957    }
2958    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
2959    pub fn method_name() -> ::std::string::String {
2960        "notifications/elicitation/complete".to_string()
2961    }
2962}
2963/**The contents of a resource, embedded into a prompt or tool call result.
2964It is up to the client how best to render embedded resources for the benefit
2965of the LLM and/or the user.*/
2966///
2967/// <details><summary>JSON schema</summary>
2968///
2969/// ```json
2970///{
2971///  "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.",
2972///  "type": "object",
2973///  "required": [
2974///    "resource",
2975///    "type"
2976///  ],
2977///  "properties": {
2978///    "_meta": {
2979///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
2980///      "type": "object",
2981///      "additionalProperties": {}
2982///    },
2983///    "annotations": {
2984///      "description": "Optional annotations for the client.",
2985///      "$ref": "#/$defs/Annotations"
2986///    },
2987///    "resource": {
2988///      "anyOf": [
2989///        {
2990///          "$ref": "#/$defs/TextResourceContents"
2991///        },
2992///        {
2993///          "$ref": "#/$defs/BlobResourceContents"
2994///        }
2995///      ]
2996///    },
2997///    "type": {
2998///      "type": "string",
2999///      "const": "resource"
3000///    }
3001///  }
3002///}
3003/// ```
3004/// </details>
3005#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3006pub struct EmbeddedResource {
3007    ///Optional annotations for the client.
3008    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3009    pub annotations: ::std::option::Option<Annotations>,
3010    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
3011    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3012    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3013    pub resource: EmbeddedResourceResource,
3014    #[serde(rename = "type", deserialize_with = "validate::embedded_resource_type_")]
3015    type_: ::std::string::String,
3016}
3017impl EmbeddedResource {
3018    pub fn new(
3019        resource: EmbeddedResourceResource,
3020        annotations: ::std::option::Option<Annotations>,
3021        meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3022    ) -> Self {
3023        Self {
3024            annotations,
3025            meta,
3026            resource,
3027            type_: "resource".to_string(),
3028        }
3029    }
3030    pub fn type_(&self) -> &::std::string::String {
3031        &self.type_
3032    }
3033    /// returns "resource"
3034    pub fn type_value() -> ::std::string::String {
3035        "resource".to_string()
3036    }
3037    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
3038    pub fn type_name() -> ::std::string::String {
3039        "resource".to_string()
3040    }
3041}
3042///EmbeddedResourceResource
3043///
3044/// <details><summary>JSON schema</summary>
3045///
3046/// ```json
3047///{
3048///  "anyOf": [
3049///    {
3050///      "$ref": "#/$defs/TextResourceContents"
3051///    },
3052///    {
3053///      "$ref": "#/$defs/BlobResourceContents"
3054///    }
3055///  ]
3056///}
3057/// ```
3058/// </details>
3059#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3060#[serde(untagged)]
3061pub enum EmbeddedResourceResource {
3062    TextResourceContents(TextResourceContents),
3063    BlobResourceContents(BlobResourceContents),
3064}
3065impl ::std::convert::From<TextResourceContents> for EmbeddedResourceResource {
3066    fn from(value: TextResourceContents) -> Self {
3067        Self::TextResourceContents(value)
3068    }
3069}
3070impl ::std::convert::From<BlobResourceContents> for EmbeddedResourceResource {
3071    fn from(value: BlobResourceContents) -> Self {
3072        Self::BlobResourceContents(value)
3073    }
3074}
3075///EmptyResult
3076///
3077/// <details><summary>JSON schema</summary>
3078///
3079/// ```json
3080///{
3081///  "$ref": "#/$defs/Result"
3082///}
3083/// ```
3084/// </details>
3085#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3086#[serde(transparent)]
3087pub struct EmptyResult(pub Result);
3088///EnumSchema
3089///
3090/// <details><summary>JSON schema</summary>
3091///
3092/// ```json
3093///{
3094///  "anyOf": [
3095///    {
3096///      "$ref": "#/$defs/UntitledSingleSelectEnumSchema"
3097///    },
3098///    {
3099///      "$ref": "#/$defs/TitledSingleSelectEnumSchema"
3100///    },
3101///    {
3102///      "$ref": "#/$defs/UntitledMultiSelectEnumSchema"
3103///    },
3104///    {
3105///      "$ref": "#/$defs/TitledMultiSelectEnumSchema"
3106///    },
3107///    {
3108///      "$ref": "#/$defs/LegacyTitledEnumSchema"
3109///    }
3110///  ]
3111///}
3112/// ```
3113/// </details>
3114#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3115#[serde(untagged)]
3116pub enum EnumSchema {
3117    UntitledSingleSelectEnumSchema(UntitledSingleSelectEnumSchema),
3118    TitledSingleSelectEnumSchema(TitledSingleSelectEnumSchema),
3119    UntitledMultiSelectEnumSchema(UntitledMultiSelectEnumSchema),
3120    TitledMultiSelectEnumSchema(TitledMultiSelectEnumSchema),
3121    LegacyTitledEnumSchema(LegacyTitledEnumSchema),
3122}
3123impl ::std::convert::From<UntitledSingleSelectEnumSchema> for EnumSchema {
3124    fn from(value: UntitledSingleSelectEnumSchema) -> Self {
3125        Self::UntitledSingleSelectEnumSchema(value)
3126    }
3127}
3128impl ::std::convert::From<TitledSingleSelectEnumSchema> for EnumSchema {
3129    fn from(value: TitledSingleSelectEnumSchema) -> Self {
3130        Self::TitledSingleSelectEnumSchema(value)
3131    }
3132}
3133impl ::std::convert::From<UntitledMultiSelectEnumSchema> for EnumSchema {
3134    fn from(value: UntitledMultiSelectEnumSchema) -> Self {
3135        Self::UntitledMultiSelectEnumSchema(value)
3136    }
3137}
3138impl ::std::convert::From<TitledMultiSelectEnumSchema> for EnumSchema {
3139    fn from(value: TitledMultiSelectEnumSchema) -> Self {
3140        Self::TitledMultiSelectEnumSchema(value)
3141    }
3142}
3143impl ::std::convert::From<LegacyTitledEnumSchema> for EnumSchema {
3144    fn from(value: LegacyTitledEnumSchema) -> Self {
3145        Self::LegacyTitledEnumSchema(value)
3146    }
3147}
3148///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
3149///
3150/// <details><summary>JSON schema</summary>
3151///
3152/// ```json
3153///{
3154///  "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
3155///  "type": "object",
3156///  "properties": {
3157///    "progressToken": {
3158///      "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.",
3159///      "$ref": "#/$defs/ProgressToken"
3160///    }
3161///  },
3162///  "additionalProperties": {}
3163///}
3164/// ```
3165/// </details>
3166#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
3167pub struct GetPromptMeta {
3168    ///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.
3169    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
3170    pub progress_token: ::std::option::Option<ProgressToken>,
3171    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
3172    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3173}
3174///Used by the client to get a prompt provided by the server.
3175///
3176/// <details><summary>JSON schema</summary>
3177///
3178/// ```json
3179///{
3180///  "description": "Used by the client to get a prompt provided by the server.",
3181///  "type": "object",
3182///  "required": [
3183///    "id",
3184///    "jsonrpc",
3185///    "method",
3186///    "params"
3187///  ],
3188///  "properties": {
3189///    "id": {
3190///      "$ref": "#/$defs/RequestId"
3191///    },
3192///    "jsonrpc": {
3193///      "type": "string",
3194///      "const": "2.0"
3195///    },
3196///    "method": {
3197///      "type": "string",
3198///      "const": "prompts/get"
3199///    },
3200///    "params": {
3201///      "$ref": "#/$defs/GetPromptRequestParams"
3202///    }
3203///  }
3204///}
3205/// ```
3206/// </details>
3207#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3208pub struct GetPromptRequest {
3209    pub id: RequestId,
3210    #[serde(deserialize_with = "validate::get_prompt_request_jsonrpc")]
3211    jsonrpc: ::std::string::String,
3212    #[serde(deserialize_with = "validate::get_prompt_request_method")]
3213    method: ::std::string::String,
3214    pub params: GetPromptRequestParams,
3215}
3216impl GetPromptRequest {
3217    pub fn new(id: RequestId, params: GetPromptRequestParams) -> Self {
3218        Self {
3219            id,
3220            jsonrpc: JSONRPC_VERSION.to_string(),
3221            method: "prompts/get".to_string(),
3222            params,
3223        }
3224    }
3225    pub fn jsonrpc(&self) -> &::std::string::String {
3226        &self.jsonrpc
3227    }
3228    pub fn method(&self) -> &::std::string::String {
3229        &self.method
3230    }
3231    /// returns "prompts/get"
3232    pub fn method_value() -> ::std::string::String {
3233        "prompts/get".to_string()
3234    }
3235    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
3236    pub fn method_name() -> ::std::string::String {
3237        "prompts/get".to_string()
3238    }
3239}
3240///Parameters for a prompts/get request.
3241///
3242/// <details><summary>JSON schema</summary>
3243///
3244/// ```json
3245///{
3246///  "description": "Parameters for a prompts/get request.",
3247///  "type": "object",
3248///  "required": [
3249///    "name"
3250///  ],
3251///  "properties": {
3252///    "_meta": {
3253///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
3254///      "type": "object",
3255///      "properties": {
3256///        "progressToken": {
3257///          "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.",
3258///          "$ref": "#/$defs/ProgressToken"
3259///        }
3260///      },
3261///      "additionalProperties": {}
3262///    },
3263///    "arguments": {
3264///      "description": "Arguments to use for templating the prompt.",
3265///      "type": "object",
3266///      "additionalProperties": {
3267///        "type": "string"
3268///      }
3269///    },
3270///    "name": {
3271///      "description": "The name of the prompt or prompt template.",
3272///      "type": "string"
3273///    }
3274///  }
3275///}
3276/// ```
3277/// </details>
3278#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3279pub struct GetPromptRequestParams {
3280    ///Arguments to use for templating the prompt.
3281    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3282    pub arguments: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
3283    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3284    pub meta: ::std::option::Option<GetPromptMeta>,
3285    ///The name of the prompt or prompt template.
3286    pub name: ::std::string::String,
3287}
3288///The server's response to a prompts/get request from the client.
3289///
3290/// <details><summary>JSON schema</summary>
3291///
3292/// ```json
3293///{
3294///  "description": "The server's response to a prompts/get request from the client.",
3295///  "type": "object",
3296///  "required": [
3297///    "messages"
3298///  ],
3299///  "properties": {
3300///    "_meta": {
3301///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
3302///      "type": "object",
3303///      "additionalProperties": {}
3304///    },
3305///    "description": {
3306///      "description": "An optional description for the prompt.",
3307///      "type": "string"
3308///    },
3309///    "messages": {
3310///      "type": "array",
3311///      "items": {
3312///        "$ref": "#/$defs/PromptMessage"
3313///      }
3314///    }
3315///  }
3316///}
3317/// ```
3318/// </details>
3319#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3320pub struct GetPromptResult {
3321    ///An optional description for the prompt.
3322    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3323    pub description: ::std::option::Option<::std::string::String>,
3324    pub messages: ::std::vec::Vec<PromptMessage>,
3325    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
3326    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3327    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3328}
3329///GetTaskParams
3330///
3331/// <details><summary>JSON schema</summary>
3332///
3333/// ```json
3334///{
3335///  "type": "object",
3336///  "required": [
3337///    "taskId"
3338///  ],
3339///  "properties": {
3340///    "taskId": {
3341///      "description": "The task identifier to query.",
3342///      "type": "string"
3343///    }
3344///  }
3345///}
3346/// ```
3347/// </details>
3348#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3349pub struct GetTaskParams {
3350    ///The task identifier to query.
3351    #[serde(rename = "taskId")]
3352    pub task_id: ::std::string::String,
3353}
3354///GetTaskPayloadParams
3355///
3356/// <details><summary>JSON schema</summary>
3357///
3358/// ```json
3359///{
3360///  "type": "object",
3361///  "required": [
3362///    "taskId"
3363///  ],
3364///  "properties": {
3365///    "taskId": {
3366///      "description": "The task identifier to retrieve results for.",
3367///      "type": "string"
3368///    }
3369///  }
3370///}
3371/// ```
3372/// </details>
3373#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3374pub struct GetTaskPayloadParams {
3375    ///The task identifier to retrieve results for.
3376    #[serde(rename = "taskId")]
3377    pub task_id: ::std::string::String,
3378}
3379///A request to retrieve the result of a completed task.
3380///
3381/// <details><summary>JSON schema</summary>
3382///
3383/// ```json
3384///{
3385///  "description": "A request to retrieve the result of a completed task.",
3386///  "type": "object",
3387///  "required": [
3388///    "id",
3389///    "jsonrpc",
3390///    "method",
3391///    "params"
3392///  ],
3393///  "properties": {
3394///    "id": {
3395///      "$ref": "#/$defs/RequestId"
3396///    },
3397///    "jsonrpc": {
3398///      "type": "string",
3399///      "const": "2.0"
3400///    },
3401///    "method": {
3402///      "type": "string",
3403///      "const": "tasks/result"
3404///    },
3405///    "params": {
3406///      "type": "object",
3407///      "required": [
3408///        "taskId"
3409///      ],
3410///      "properties": {
3411///        "taskId": {
3412///          "description": "The task identifier to retrieve results for.",
3413///          "type": "string"
3414///        }
3415///      }
3416///    }
3417///  }
3418///}
3419/// ```
3420/// </details>
3421#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3422pub struct GetTaskPayloadRequest {
3423    pub id: RequestId,
3424    #[serde(deserialize_with = "validate::get_task_payload_request_jsonrpc")]
3425    jsonrpc: ::std::string::String,
3426    #[serde(deserialize_with = "validate::get_task_payload_request_method")]
3427    method: ::std::string::String,
3428    pub params: GetTaskPayloadParams,
3429}
3430impl GetTaskPayloadRequest {
3431    pub fn new(id: RequestId, params: GetTaskPayloadParams) -> Self {
3432        Self {
3433            id,
3434            jsonrpc: JSONRPC_VERSION.to_string(),
3435            method: "tasks/result".to_string(),
3436            params,
3437        }
3438    }
3439    pub fn jsonrpc(&self) -> &::std::string::String {
3440        &self.jsonrpc
3441    }
3442    pub fn method(&self) -> &::std::string::String {
3443        &self.method
3444    }
3445    /// returns "tasks/result"
3446    pub fn method_value() -> ::std::string::String {
3447        "tasks/result".to_string()
3448    }
3449    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
3450    pub fn method_name() -> ::std::string::String {
3451        "tasks/result".to_string()
3452    }
3453}
3454/**The response to a tasks/result request.
3455The structure matches the result type of the original request.
3456For example, a tools/call task would return the CallToolResult structure.*/
3457///
3458/// <details><summary>JSON schema</summary>
3459///
3460/// ```json
3461///{
3462///  "description": "The response to a tasks/result request.\nThe structure matches the result type of the original request.\nFor example, a tools/call task would return the CallToolResult structure.",
3463///  "type": "object",
3464///  "properties": {
3465///    "_meta": {
3466///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
3467///      "type": "object",
3468///      "additionalProperties": {}
3469///    }
3470///  },
3471///  "additionalProperties": {}
3472///}
3473/// ```
3474/// </details>
3475#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
3476pub struct GetTaskPayloadResult {
3477    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
3478    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3479    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3480    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
3481    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3482}
3483///A request to retrieve the state of a task.
3484///
3485/// <details><summary>JSON schema</summary>
3486///
3487/// ```json
3488///{
3489///  "description": "A request to retrieve the state of a task.",
3490///  "type": "object",
3491///  "required": [
3492///    "id",
3493///    "jsonrpc",
3494///    "method",
3495///    "params"
3496///  ],
3497///  "properties": {
3498///    "id": {
3499///      "$ref": "#/$defs/RequestId"
3500///    },
3501///    "jsonrpc": {
3502///      "type": "string",
3503///      "const": "2.0"
3504///    },
3505///    "method": {
3506///      "type": "string",
3507///      "const": "tasks/get"
3508///    },
3509///    "params": {
3510///      "type": "object",
3511///      "required": [
3512///        "taskId"
3513///      ],
3514///      "properties": {
3515///        "taskId": {
3516///          "description": "The task identifier to query.",
3517///          "type": "string"
3518///        }
3519///      }
3520///    }
3521///  }
3522///}
3523/// ```
3524/// </details>
3525#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3526pub struct GetTaskRequest {
3527    pub id: RequestId,
3528    #[serde(deserialize_with = "validate::get_task_request_jsonrpc")]
3529    jsonrpc: ::std::string::String,
3530    #[serde(deserialize_with = "validate::get_task_request_method")]
3531    method: ::std::string::String,
3532    pub params: GetTaskParams,
3533}
3534impl GetTaskRequest {
3535    pub fn new(id: RequestId, params: GetTaskParams) -> Self {
3536        Self {
3537            id,
3538            jsonrpc: JSONRPC_VERSION.to_string(),
3539            method: "tasks/get".to_string(),
3540            params,
3541        }
3542    }
3543    pub fn jsonrpc(&self) -> &::std::string::String {
3544        &self.jsonrpc
3545    }
3546    pub fn method(&self) -> &::std::string::String {
3547        &self.method
3548    }
3549    /// returns "tasks/get"
3550    pub fn method_value() -> ::std::string::String {
3551        "tasks/get".to_string()
3552    }
3553    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
3554    pub fn method_name() -> ::std::string::String {
3555        "tasks/get".to_string()
3556    }
3557}
3558///The response to a tasks/get request.
3559///
3560/// <details><summary>JSON schema</summary>
3561///
3562/// ```json
3563///{
3564///  "description": "The response to a tasks/get request.",
3565///  "allOf": [
3566///    {
3567///      "$ref": "#/$defs/Result"
3568///    },
3569///    {
3570///      "$ref": "#/$defs/Task"
3571///    }
3572///  ]
3573///}
3574/// ```
3575/// </details>
3576#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3577pub struct GetTaskResult {
3578    #[serde(rename = "createdAt")]
3579    pub created_at: ::std::string::String,
3580    #[serde(rename = "lastUpdatedAt")]
3581    pub last_updated_at: ::std::string::String,
3582    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
3583    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3584    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3585    #[serde(rename = "pollInterval", default, skip_serializing_if = "::std::option::Option::is_none")]
3586    pub poll_interval: ::std::option::Option<i64>,
3587    pub status: TaskStatus,
3588    #[serde(rename = "statusMessage", default, skip_serializing_if = "::std::option::Option::is_none")]
3589    pub status_message: ::std::option::Option<::std::string::String>,
3590    #[serde(rename = "taskId")]
3591    pub task_id: ::std::string::String,
3592    pub ttl: i64,
3593    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
3594    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3595}
3596///An optionally-sized icon that can be displayed in a user interface.
3597///
3598/// <details><summary>JSON schema</summary>
3599///
3600/// ```json
3601///{
3602///  "description": "An optionally-sized icon that can be displayed in a user interface.",
3603///  "type": "object",
3604///  "required": [
3605///    "src"
3606///  ],
3607///  "properties": {
3608///    "mimeType": {
3609///      "description": "Optional MIME type override if the source MIME type is missing or generic.\nFor example: \"image/png\", \"image/jpeg\", or \"image/svg+xml\".",
3610///      "type": "string"
3611///    },
3612///    "sizes": {
3613///      "description": "Optional array of strings that specify sizes at which the icon can be used.\nEach string should be in WxH format (e.g., \"48x48\", \"96x96\") or \"any\" for scalable formats like SVG.\n\nIf not provided, the client should assume that the icon can be used at any size.",
3614///      "type": "array",
3615///      "items": {
3616///        "type": "string"
3617///      }
3618///    },
3619///    "src": {
3620///      "description": "A standard URI pointing to an icon resource. May be an HTTP/HTTPS URL or a\ndata: URI with Base64-encoded image data.\n\nConsumers SHOULD takes steps to ensure URLs serving icons are from the\nsame domain as the client/server or a trusted domain.\n\nConsumers SHOULD take appropriate precautions when consuming SVGs as they can contain\nexecutable JavaScript.",
3621///      "type": "string",
3622///      "format": "uri"
3623///    },
3624///    "theme": {
3625///      "description": "Optional specifier for the theme this icon is designed for. light indicates\nthe icon is designed to be used with a light background, and dark indicates\nthe icon is designed to be used with a dark background.\n\nIf not provided, the client should assume the icon can be used with any theme.",
3626///      "type": "string",
3627///      "enum": [
3628///        "dark",
3629///        "light"
3630///      ]
3631///    }
3632///  }
3633///}
3634/// ```
3635/// </details>
3636#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3637pub struct Icon {
3638    /**Optional MIME type override if the source MIME type is missing or generic.
3639    For example: "image/png", "image/jpeg", or "image/svg+xml".*/
3640    #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
3641    pub mime_type: ::std::option::Option<::std::string::String>,
3642    /**Optional array of strings that specify sizes at which the icon can be used.
3643    Each string should be in WxH format (e.g., "48x48", "96x96") or "any" for scalable formats like SVG.
3644    If not provided, the client should assume that the icon can be used at any size.*/
3645    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
3646    pub sizes: ::std::vec::Vec<::std::string::String>,
3647    /**A standard URI pointing to an icon resource. May be an HTTP/HTTPS URL or a
3648    data: URI with Base64-encoded image data.
3649    Consumers SHOULD takes steps to ensure URLs serving icons are from the
3650    same domain as the client/server or a trusted domain.
3651    Consumers SHOULD take appropriate precautions when consuming SVGs as they can contain
3652    executable JavaScript.*/
3653    pub src: ::std::string::String,
3654    /**Optional specifier for the theme this icon is designed for. light indicates
3655    the icon is designed to be used with a light background, and dark indicates
3656    the icon is designed to be used with a dark background.
3657    If not provided, the client should assume the icon can be used with any theme.*/
3658    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3659    pub theme: ::std::option::Option<IconTheme>,
3660}
3661/**Optional specifier for the theme this icon is designed for. light indicates
3662the icon is designed to be used with a light background, and dark indicates
3663the icon is designed to be used with a dark background.
3664If not provided, the client should assume the icon can be used with any theme.*/
3665///
3666/// <details><summary>JSON schema</summary>
3667///
3668/// ```json
3669///{
3670///  "description": "Optional specifier for the theme this icon is designed for. light indicates\nthe icon is designed to be used with a light background, and dark indicates\nthe icon is designed to be used with a dark background.\n\nIf not provided, the client should assume the icon can be used with any theme.",
3671///  "type": "string",
3672///  "enum": [
3673///    "dark",
3674///    "light"
3675///  ]
3676///}
3677/// ```
3678/// </details>
3679#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3680pub enum IconTheme {
3681    #[serde(rename = "dark")]
3682    Dark,
3683    #[serde(rename = "light")]
3684    Light,
3685}
3686impl ::std::fmt::Display for IconTheme {
3687    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3688        match *self {
3689            Self::Dark => write!(f, "dark"),
3690            Self::Light => write!(f, "light"),
3691        }
3692    }
3693}
3694///Base interface to add icons property.
3695///
3696/// <details><summary>JSON schema</summary>
3697///
3698/// ```json
3699///{
3700///  "description": "Base interface to add icons property.",
3701///  "type": "object",
3702///  "properties": {
3703///    "icons": {
3704///      "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
3705///      "type": "array",
3706///      "items": {
3707///        "$ref": "#/$defs/Icon"
3708///      }
3709///    }
3710///  }
3711///}
3712/// ```
3713/// </details>
3714#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
3715pub struct Icons {
3716    /**Optional set of sized icons that the client can display in a user interface.
3717    Clients that support rendering icons MUST support at least the following MIME types:
3718    - image/png - PNG images (safe, universal compatibility)
3719    - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
3720    Clients that support rendering icons SHOULD also support:
3721    - image/svg+xml - SVG images (scalable but requires security precautions)
3722    - image/webp - WebP images (modern, efficient format)*/
3723    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
3724    pub icons: ::std::vec::Vec<Icon>,
3725}
3726///An image provided to or from an LLM.
3727///
3728/// <details><summary>JSON schema</summary>
3729///
3730/// ```json
3731///{
3732///  "description": "An image provided to or from an LLM.",
3733///  "type": "object",
3734///  "required": [
3735///    "data",
3736///    "mimeType",
3737///    "type"
3738///  ],
3739///  "properties": {
3740///    "_meta": {
3741///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
3742///      "type": "object",
3743///      "additionalProperties": {}
3744///    },
3745///    "annotations": {
3746///      "description": "Optional annotations for the client.",
3747///      "$ref": "#/$defs/Annotations"
3748///    },
3749///    "data": {
3750///      "description": "The base64-encoded image data.",
3751///      "type": "string",
3752///      "format": "byte"
3753///    },
3754///    "mimeType": {
3755///      "description": "The MIME type of the image. Different providers may support different image types.",
3756///      "type": "string"
3757///    },
3758///    "type": {
3759///      "type": "string",
3760///      "const": "image"
3761///    }
3762///  }
3763///}
3764/// ```
3765/// </details>
3766#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3767pub struct ImageContent {
3768    ///Optional annotations for the client.
3769    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3770    pub annotations: ::std::option::Option<Annotations>,
3771    ///The base64-encoded image data.
3772    pub data: ::std::string::String,
3773    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
3774    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3775    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3776    ///The MIME type of the image. Different providers may support different image types.
3777    #[serde(rename = "mimeType")]
3778    pub mime_type: ::std::string::String,
3779    #[serde(rename = "type", deserialize_with = "validate::image_content_type_")]
3780    type_: ::std::string::String,
3781}
3782impl ImageContent {
3783    pub fn new(
3784        data: ::std::string::String,
3785        mime_type: ::std::string::String,
3786        annotations: ::std::option::Option<Annotations>,
3787        meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3788    ) -> Self {
3789        Self {
3790            annotations,
3791            data,
3792            meta,
3793            mime_type,
3794            type_: "image".to_string(),
3795        }
3796    }
3797    pub fn type_(&self) -> &::std::string::String {
3798        &self.type_
3799    }
3800    /// returns "image"
3801    pub fn type_value() -> ::std::string::String {
3802        "image".to_string()
3803    }
3804    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
3805    pub fn type_name() -> ::std::string::String {
3806        "image".to_string()
3807    }
3808}
3809///Describes the MCP implementation.
3810///
3811/// <details><summary>JSON schema</summary>
3812///
3813/// ```json
3814///{
3815///  "description": "Describes the MCP implementation.",
3816///  "type": "object",
3817///  "required": [
3818///    "name",
3819///    "version"
3820///  ],
3821///  "properties": {
3822///    "description": {
3823///      "description": "An optional human-readable description of what this implementation does.\n\nThis can be used by clients or servers to provide context about their purpose\nand capabilities. For example, a server might describe the types of resources\nor tools it provides, while a client might describe its intended use case.",
3824///      "type": "string"
3825///    },
3826///    "icons": {
3827///      "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
3828///      "type": "array",
3829///      "items": {
3830///        "$ref": "#/$defs/Icon"
3831///      }
3832///    },
3833///    "name": {
3834///      "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
3835///      "type": "string"
3836///    },
3837///    "title": {
3838///      "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
3839///      "type": "string"
3840///    },
3841///    "version": {
3842///      "type": "string"
3843///    },
3844///    "websiteUrl": {
3845///      "description": "An optional URL of the website for this implementation.",
3846///      "type": "string",
3847///      "format": "uri"
3848///    }
3849///  }
3850///}
3851/// ```
3852/// </details>
3853#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3854pub struct Implementation {
3855    /**An optional human-readable description of what this implementation does.
3856    This can be used by clients or servers to provide context about their purpose
3857    and capabilities. For example, a server might describe the types of resources
3858    or tools it provides, while a client might describe its intended use case.*/
3859    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3860    pub description: ::std::option::Option<::std::string::String>,
3861    /**Optional set of sized icons that the client can display in a user interface.
3862    Clients that support rendering icons MUST support at least the following MIME types:
3863    - image/png - PNG images (safe, universal compatibility)
3864    - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
3865    Clients that support rendering icons SHOULD also support:
3866    - image/svg+xml - SVG images (scalable but requires security precautions)
3867    - image/webp - WebP images (modern, efficient format)*/
3868    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
3869    pub icons: ::std::vec::Vec<Icon>,
3870    ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
3871    pub name: ::std::string::String,
3872    /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
3873    even by those unfamiliar with domain-specific terminology.
3874    If not provided, the name should be used for display (except for Tool,
3875    where annotations.title should be given precedence over using name,
3876    if present).*/
3877    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3878    pub title: ::std::option::Option<::std::string::String>,
3879    pub version: ::std::string::String,
3880    ///An optional URL of the website for this implementation.
3881    #[serde(rename = "websiteUrl", default, skip_serializing_if = "::std::option::Option::is_none")]
3882    pub website_url: ::std::option::Option<::std::string::String>,
3883}
3884/**A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
3885The client MAY ignore this request.
3886Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
3887declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.*/
3888///
3889/// <details><summary>JSON schema</summary>
3890///
3891/// ```json
3892///{
3893///  "description": "A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.\nThe client MAY ignore this request.\n\nDefault is \"none\". Values \"thisServer\" and \"allServers\" are soft-deprecated. Servers SHOULD only use these values if the client\ndeclares ClientCapabilities.sampling.context. These values may be removed in future spec releases.",
3894///  "type": "string",
3895///  "enum": [
3896///    "allServers",
3897///    "none",
3898///    "thisServer"
3899///  ]
3900///}
3901/// ```
3902/// </details>
3903#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3904pub enum IncludeContext {
3905    #[serde(rename = "allServers")]
3906    AllServers,
3907    #[serde(rename = "none")]
3908    None,
3909    #[serde(rename = "thisServer")]
3910    ThisServer,
3911}
3912impl ::std::fmt::Display for IncludeContext {
3913    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3914        match *self {
3915            Self::AllServers => write!(f, "allServers"),
3916            Self::None => write!(f, "none"),
3917            Self::ThisServer => write!(f, "thisServer"),
3918        }
3919    }
3920}
3921///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
3922///
3923/// <details><summary>JSON schema</summary>
3924///
3925/// ```json
3926///{
3927///  "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
3928///  "type": "object",
3929///  "properties": {
3930///    "progressToken": {
3931///      "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.",
3932///      "$ref": "#/$defs/ProgressToken"
3933///    }
3934///  },
3935///  "additionalProperties": {}
3936///}
3937/// ```
3938/// </details>
3939#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
3940pub struct InitializeMeta {
3941    ///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.
3942    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
3943    pub progress_token: ::std::option::Option<ProgressToken>,
3944    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
3945    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3946}
3947///This request is sent from the client to the server when it first connects, asking it to begin initialization.
3948///
3949/// <details><summary>JSON schema</summary>
3950///
3951/// ```json
3952///{
3953///  "description": "This request is sent from the client to the server when it first connects, asking it to begin initialization.",
3954///  "type": "object",
3955///  "required": [
3956///    "id",
3957///    "jsonrpc",
3958///    "method",
3959///    "params"
3960///  ],
3961///  "properties": {
3962///    "id": {
3963///      "$ref": "#/$defs/RequestId"
3964///    },
3965///    "jsonrpc": {
3966///      "type": "string",
3967///      "const": "2.0"
3968///    },
3969///    "method": {
3970///      "type": "string",
3971///      "const": "initialize"
3972///    },
3973///    "params": {
3974///      "$ref": "#/$defs/InitializeRequestParams"
3975///    }
3976///  }
3977///}
3978/// ```
3979/// </details>
3980#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3981pub struct InitializeRequest {
3982    pub id: RequestId,
3983    #[serde(deserialize_with = "validate::initialize_request_jsonrpc")]
3984    jsonrpc: ::std::string::String,
3985    #[serde(deserialize_with = "validate::initialize_request_method")]
3986    method: ::std::string::String,
3987    pub params: InitializeRequestParams,
3988}
3989impl InitializeRequest {
3990    pub fn new(id: RequestId, params: InitializeRequestParams) -> Self {
3991        Self {
3992            id,
3993            jsonrpc: JSONRPC_VERSION.to_string(),
3994            method: "initialize".to_string(),
3995            params,
3996        }
3997    }
3998    pub fn jsonrpc(&self) -> &::std::string::String {
3999        &self.jsonrpc
4000    }
4001    pub fn method(&self) -> &::std::string::String {
4002        &self.method
4003    }
4004    /// returns "initialize"
4005    pub fn method_value() -> ::std::string::String {
4006        "initialize".to_string()
4007    }
4008    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
4009    pub fn method_name() -> ::std::string::String {
4010        "initialize".to_string()
4011    }
4012}
4013///Parameters for an initialize request.
4014///
4015/// <details><summary>JSON schema</summary>
4016///
4017/// ```json
4018///{
4019///  "description": "Parameters for an initialize request.",
4020///  "type": "object",
4021///  "required": [
4022///    "capabilities",
4023///    "clientInfo",
4024///    "protocolVersion"
4025///  ],
4026///  "properties": {
4027///    "_meta": {
4028///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
4029///      "type": "object",
4030///      "properties": {
4031///        "progressToken": {
4032///          "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.",
4033///          "$ref": "#/$defs/ProgressToken"
4034///        }
4035///      },
4036///      "additionalProperties": {}
4037///    },
4038///    "capabilities": {
4039///      "$ref": "#/$defs/ClientCapabilities"
4040///    },
4041///    "clientInfo": {
4042///      "$ref": "#/$defs/Implementation"
4043///    },
4044///    "protocolVersion": {
4045///      "description": "The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.",
4046///      "type": "string"
4047///    }
4048///  }
4049///}
4050/// ```
4051/// </details>
4052#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4053pub struct InitializeRequestParams {
4054    pub capabilities: ClientCapabilities,
4055    #[serde(rename = "clientInfo")]
4056    pub client_info: Implementation,
4057    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4058    pub meta: ::std::option::Option<InitializeMeta>,
4059    ///The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
4060    #[serde(rename = "protocolVersion")]
4061    pub protocol_version: ::std::string::String,
4062}
4063///After receiving an initialize request from the client, the server sends this response.
4064///
4065/// <details><summary>JSON schema</summary>
4066///
4067/// ```json
4068///{
4069///  "description": "After receiving an initialize request from the client, the server sends this response.",
4070///  "type": "object",
4071///  "required": [
4072///    "capabilities",
4073///    "protocolVersion",
4074///    "serverInfo"
4075///  ],
4076///  "properties": {
4077///    "_meta": {
4078///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
4079///      "type": "object",
4080///      "additionalProperties": {}
4081///    },
4082///    "capabilities": {
4083///      "$ref": "#/$defs/ServerCapabilities"
4084///    },
4085///    "instructions": {
4086///      "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.",
4087///      "type": "string"
4088///    },
4089///    "protocolVersion": {
4090///      "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.",
4091///      "type": "string"
4092///    },
4093///    "serverInfo": {
4094///      "$ref": "#/$defs/Implementation"
4095///    }
4096///  }
4097///}
4098/// ```
4099/// </details>
4100#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4101pub struct InitializeResult {
4102    pub capabilities: ServerCapabilities,
4103    /**Instructions describing how to use the server and its features.
4104    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.*/
4105    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4106    pub instructions: ::std::option::Option<::std::string::String>,
4107    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
4108    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4109    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4110    ///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.
4111    #[serde(rename = "protocolVersion")]
4112    pub protocol_version: ::std::string::String,
4113    #[serde(rename = "serverInfo")]
4114    pub server_info: Implementation,
4115}
4116///This notification is sent from the client to the server after initialization has finished.
4117///
4118/// <details><summary>JSON schema</summary>
4119///
4120/// ```json
4121///{
4122///  "description": "This notification is sent from the client to the server after initialization has finished.",
4123///  "type": "object",
4124///  "required": [
4125///    "jsonrpc",
4126///    "method"
4127///  ],
4128///  "properties": {
4129///    "jsonrpc": {
4130///      "type": "string",
4131///      "const": "2.0"
4132///    },
4133///    "method": {
4134///      "type": "string",
4135///      "const": "notifications/initialized"
4136///    },
4137///    "params": {
4138///      "$ref": "#/$defs/NotificationParams"
4139///    }
4140///  }
4141///}
4142/// ```
4143/// </details>
4144#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4145pub struct InitializedNotification {
4146    #[serde(deserialize_with = "validate::initialized_notification_jsonrpc")]
4147    jsonrpc: ::std::string::String,
4148    #[serde(deserialize_with = "validate::initialized_notification_method")]
4149    method: ::std::string::String,
4150    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4151    pub params: ::std::option::Option<NotificationParams>,
4152}
4153impl InitializedNotification {
4154    pub fn new(params: ::std::option::Option<NotificationParams>) -> Self {
4155        Self {
4156            jsonrpc: JSONRPC_VERSION.to_string(),
4157            method: "notifications/initialized".to_string(),
4158            params,
4159        }
4160    }
4161    pub fn jsonrpc(&self) -> &::std::string::String {
4162        &self.jsonrpc
4163    }
4164    pub fn method(&self) -> &::std::string::String {
4165        &self.method
4166    }
4167    /// returns "notifications/initialized"
4168    pub fn method_value() -> ::std::string::String {
4169        "notifications/initialized".to_string()
4170    }
4171    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
4172    pub fn method_name() -> ::std::string::String {
4173        "notifications/initialized".to_string()
4174    }
4175}
4176///A response to a request that indicates an error occurred.
4177///
4178/// <details><summary>JSON schema</summary>
4179///
4180/// ```json
4181///{
4182///  "description": "A response to a request that indicates an error occurred.",
4183///  "type": "object",
4184///  "required": [
4185///    "error",
4186///    "jsonrpc"
4187///  ],
4188///  "properties": {
4189///    "error": {
4190///      "$ref": "#/$defs/Error"
4191///    },
4192///    "id": {
4193///      "$ref": "#/$defs/RequestId"
4194///    },
4195///    "jsonrpc": {
4196///      "type": "string",
4197///      "const": "2.0"
4198///    }
4199///  }
4200///}
4201/// ```
4202/// </details>
4203#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4204pub struct JsonrpcErrorResponse {
4205    pub error: RpcError,
4206    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4207    pub id: ::std::option::Option<RequestId>,
4208    #[serde(deserialize_with = "validate::jsonrpc_error_response_jsonrpc")]
4209    jsonrpc: ::std::string::String,
4210}
4211impl JsonrpcErrorResponse {
4212    pub fn new(error: RpcError, id: ::std::option::Option<RequestId>) -> Self {
4213        Self {
4214            error,
4215            id,
4216            jsonrpc: JSONRPC_VERSION.to_string(),
4217        }
4218    }
4219    pub fn jsonrpc(&self) -> &::std::string::String {
4220        &self.jsonrpc
4221    }
4222}
4223///Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.
4224///
4225/// <details><summary>JSON schema</summary>
4226///
4227/// ```json
4228///{
4229///  "description": "Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.",
4230///  "anyOf": [
4231///    {
4232///      "$ref": "#/$defs/JSONRPCRequest"
4233///    },
4234///    {
4235///      "$ref": "#/$defs/JSONRPCNotification"
4236///    },
4237///    {
4238///      "$ref": "#/$defs/JSONRPCResultResponse"
4239///    },
4240///    {
4241///      "$ref": "#/$defs/JSONRPCErrorResponse"
4242///    }
4243///  ]
4244///}
4245/// ```
4246/// </details>
4247#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4248#[serde(untagged)]
4249pub enum JsonrpcMessage {
4250    Request(JsonrpcRequest),
4251    Notification(JsonrpcNotification),
4252    ResultResponse(JsonrpcResultResponse),
4253    ErrorResponse(JsonrpcErrorResponse),
4254}
4255impl ::std::convert::From<JsonrpcRequest> for JsonrpcMessage {
4256    fn from(value: JsonrpcRequest) -> Self {
4257        Self::Request(value)
4258    }
4259}
4260impl ::std::convert::From<JsonrpcNotification> for JsonrpcMessage {
4261    fn from(value: JsonrpcNotification) -> Self {
4262        Self::Notification(value)
4263    }
4264}
4265impl ::std::convert::From<JsonrpcResultResponse> for JsonrpcMessage {
4266    fn from(value: JsonrpcResultResponse) -> Self {
4267        Self::ResultResponse(value)
4268    }
4269}
4270impl ::std::convert::From<JsonrpcErrorResponse> for JsonrpcMessage {
4271    fn from(value: JsonrpcErrorResponse) -> Self {
4272        Self::ErrorResponse(value)
4273    }
4274}
4275///A notification which does not expect a response.
4276///
4277/// <details><summary>JSON schema</summary>
4278///
4279/// ```json
4280///{
4281///  "description": "A notification which does not expect a response.",
4282///  "type": "object",
4283///  "required": [
4284///    "jsonrpc",
4285///    "method"
4286///  ],
4287///  "properties": {
4288///    "jsonrpc": {
4289///      "type": "string",
4290///      "const": "2.0"
4291///    },
4292///    "method": {
4293///      "type": "string"
4294///    },
4295///    "params": {
4296///      "type": "object",
4297///      "additionalProperties": {}
4298///    }
4299///  }
4300///}
4301/// ```
4302/// </details>
4303#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4304pub struct JsonrpcNotification {
4305    #[serde(deserialize_with = "validate::jsonrpc_notification_jsonrpc")]
4306    jsonrpc: ::std::string::String,
4307    pub method: ::std::string::String,
4308    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4309    pub params: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4310}
4311impl JsonrpcNotification {
4312    pub fn new(
4313        method: ::std::string::String,
4314        params: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4315    ) -> Self {
4316        Self {
4317            jsonrpc: JSONRPC_VERSION.to_string(),
4318            method,
4319            params,
4320        }
4321    }
4322    pub fn jsonrpc(&self) -> &::std::string::String {
4323        &self.jsonrpc
4324    }
4325}
4326///A request that expects a response.
4327///
4328/// <details><summary>JSON schema</summary>
4329///
4330/// ```json
4331///{
4332///  "description": "A request that expects a response.",
4333///  "type": "object",
4334///  "required": [
4335///    "id",
4336///    "jsonrpc",
4337///    "method"
4338///  ],
4339///  "properties": {
4340///    "id": {
4341///      "$ref": "#/$defs/RequestId"
4342///    },
4343///    "jsonrpc": {
4344///      "type": "string",
4345///      "const": "2.0"
4346///    },
4347///    "method": {
4348///      "type": "string"
4349///    },
4350///    "params": {
4351///      "type": "object",
4352///      "additionalProperties": {}
4353///    }
4354///  }
4355///}
4356/// ```
4357/// </details>
4358#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4359pub struct JsonrpcRequest {
4360    pub id: RequestId,
4361    #[serde(deserialize_with = "validate::jsonrpc_request_jsonrpc")]
4362    jsonrpc: ::std::string::String,
4363    pub method: ::std::string::String,
4364    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4365    pub params: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4366}
4367impl JsonrpcRequest {
4368    pub fn new(
4369        id: RequestId,
4370        method: ::std::string::String,
4371        params: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4372    ) -> Self {
4373        Self {
4374            id,
4375            jsonrpc: JSONRPC_VERSION.to_string(),
4376            method,
4377            params,
4378        }
4379    }
4380    pub fn jsonrpc(&self) -> &::std::string::String {
4381        &self.jsonrpc
4382    }
4383}
4384///A response to a request, containing either the result or error.
4385///
4386/// <details><summary>JSON schema</summary>
4387///
4388/// ```json
4389///{
4390///  "description": "A response to a request, containing either the result or error.",
4391///  "anyOf": [
4392///    {
4393///      "$ref": "#/$defs/JSONRPCResultResponse"
4394///    },
4395///    {
4396///      "$ref": "#/$defs/JSONRPCErrorResponse"
4397///    }
4398///  ]
4399///}
4400/// ```
4401/// </details>
4402#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4403#[serde(untagged)]
4404pub enum JsonrpcResponse {
4405    ResultResponse(JsonrpcResultResponse),
4406    ErrorResponse(JsonrpcErrorResponse),
4407}
4408impl ::std::convert::From<JsonrpcResultResponse> for JsonrpcResponse {
4409    fn from(value: JsonrpcResultResponse) -> Self {
4410        Self::ResultResponse(value)
4411    }
4412}
4413impl ::std::convert::From<JsonrpcErrorResponse> for JsonrpcResponse {
4414    fn from(value: JsonrpcErrorResponse) -> Self {
4415        Self::ErrorResponse(value)
4416    }
4417}
4418///A successful (non-error) response to a request.
4419///
4420/// <details><summary>JSON schema</summary>
4421///
4422/// ```json
4423///{
4424///  "description": "A successful (non-error) response to a request.",
4425///  "type": "object",
4426///  "required": [
4427///    "id",
4428///    "jsonrpc",
4429///    "result"
4430///  ],
4431///  "properties": {
4432///    "id": {
4433///      "$ref": "#/$defs/RequestId"
4434///    },
4435///    "jsonrpc": {
4436///      "type": "string",
4437///      "const": "2.0"
4438///    },
4439///    "result": {
4440///      "$ref": "#/$defs/Result"
4441///    }
4442///  }
4443///}
4444/// ```
4445/// </details>
4446#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4447pub struct JsonrpcResultResponse {
4448    pub id: RequestId,
4449    #[serde(deserialize_with = "validate::jsonrpc_result_response_jsonrpc")]
4450    jsonrpc: ::std::string::String,
4451    pub result: Result,
4452}
4453impl JsonrpcResultResponse {
4454    pub fn new(id: RequestId, result: Result) -> Self {
4455        Self {
4456            id,
4457            jsonrpc: JSONRPC_VERSION.to_string(),
4458            result,
4459        }
4460    }
4461    pub fn jsonrpc(&self) -> &::std::string::String {
4462        &self.jsonrpc
4463    }
4464}
4465/**Use TitledSingleSelectEnumSchema instead.
4466This interface will be removed in a future version.*/
4467///
4468/// <details><summary>JSON schema</summary>
4469///
4470/// ```json
4471///{
4472///  "description": "Use TitledSingleSelectEnumSchema instead.\nThis interface will be removed in a future version.",
4473///  "type": "object",
4474///  "required": [
4475///    "enum",
4476///    "type"
4477///  ],
4478///  "properties": {
4479///    "default": {
4480///      "type": "string"
4481///    },
4482///    "description": {
4483///      "type": "string"
4484///    },
4485///    "enum": {
4486///      "type": "array",
4487///      "items": {
4488///        "type": "string"
4489///      }
4490///    },
4491///    "enumNames": {
4492///      "description": "(Legacy) Display names for enum values.\nNon-standard according to JSON schema 2020-12.",
4493///      "type": "array",
4494///      "items": {
4495///        "type": "string"
4496///      }
4497///    },
4498///    "title": {
4499///      "type": "string"
4500///    },
4501///    "type": {
4502///      "type": "string",
4503///      "const": "string"
4504///    }
4505///  }
4506///}
4507/// ```
4508/// </details>
4509#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4510pub struct LegacyTitledEnumSchema {
4511    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4512    pub default: ::std::option::Option<::std::string::String>,
4513    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4514    pub description: ::std::option::Option<::std::string::String>,
4515    #[serde(rename = "enum")]
4516    pub enum_: ::std::vec::Vec<::std::string::String>,
4517    /**(Legacy) Display names for enum values.
4518    Non-standard according to JSON schema 2020-12.*/
4519    #[serde(rename = "enumNames", default, skip_serializing_if = "::std::vec::Vec::is_empty")]
4520    pub enum_names: ::std::vec::Vec<::std::string::String>,
4521    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4522    pub title: ::std::option::Option<::std::string::String>,
4523    #[serde(rename = "type", deserialize_with = "validate::legacy_titled_enum_schema_type_")]
4524    type_: ::std::string::String,
4525}
4526impl LegacyTitledEnumSchema {
4527    pub fn new(
4528        enum_: ::std::vec::Vec<::std::string::String>,
4529        enum_names: ::std::vec::Vec<::std::string::String>,
4530        default: ::std::option::Option<::std::string::String>,
4531        description: ::std::option::Option<::std::string::String>,
4532        title: ::std::option::Option<::std::string::String>,
4533    ) -> Self {
4534        Self {
4535            default,
4536            description,
4537            enum_,
4538            enum_names,
4539            title,
4540            type_: "string".to_string(),
4541        }
4542    }
4543    pub fn type_(&self) -> &::std::string::String {
4544        &self.type_
4545    }
4546    /// returns "string"
4547    pub fn type_value() -> ::std::string::String {
4548        "string".to_string()
4549    }
4550    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
4551    pub fn type_name() -> ::std::string::String {
4552        "string".to_string()
4553    }
4554}
4555///Sent from the client to request a list of prompts and prompt templates the server has.
4556///
4557/// <details><summary>JSON schema</summary>
4558///
4559/// ```json
4560///{
4561///  "description": "Sent from the client to request a list of prompts and prompt templates the server has.",
4562///  "type": "object",
4563///  "required": [
4564///    "id",
4565///    "jsonrpc",
4566///    "method"
4567///  ],
4568///  "properties": {
4569///    "id": {
4570///      "$ref": "#/$defs/RequestId"
4571///    },
4572///    "jsonrpc": {
4573///      "type": "string",
4574///      "const": "2.0"
4575///    },
4576///    "method": {
4577///      "type": "string",
4578///      "const": "prompts/list"
4579///    },
4580///    "params": {
4581///      "$ref": "#/$defs/PaginatedRequestParams"
4582///    }
4583///  }
4584///}
4585/// ```
4586/// </details>
4587#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4588pub struct ListPromptsRequest {
4589    pub id: RequestId,
4590    #[serde(deserialize_with = "validate::list_prompts_request_jsonrpc")]
4591    jsonrpc: ::std::string::String,
4592    #[serde(deserialize_with = "validate::list_prompts_request_method")]
4593    method: ::std::string::String,
4594    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4595    pub params: ::std::option::Option<PaginatedRequestParams>,
4596}
4597impl ListPromptsRequest {
4598    pub fn new(id: RequestId, params: ::std::option::Option<PaginatedRequestParams>) -> Self {
4599        Self {
4600            id,
4601            jsonrpc: JSONRPC_VERSION.to_string(),
4602            method: "prompts/list".to_string(),
4603            params,
4604        }
4605    }
4606    pub fn jsonrpc(&self) -> &::std::string::String {
4607        &self.jsonrpc
4608    }
4609    pub fn method(&self) -> &::std::string::String {
4610        &self.method
4611    }
4612    /// returns "prompts/list"
4613    pub fn method_value() -> ::std::string::String {
4614        "prompts/list".to_string()
4615    }
4616    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
4617    pub fn method_name() -> ::std::string::String {
4618        "prompts/list".to_string()
4619    }
4620}
4621///The server's response to a prompts/list request from the client.
4622///
4623/// <details><summary>JSON schema</summary>
4624///
4625/// ```json
4626///{
4627///  "description": "The server's response to a prompts/list request from the client.",
4628///  "type": "object",
4629///  "required": [
4630///    "prompts"
4631///  ],
4632///  "properties": {
4633///    "_meta": {
4634///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
4635///      "type": "object",
4636///      "additionalProperties": {}
4637///    },
4638///    "nextCursor": {
4639///      "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
4640///      "type": "string"
4641///    },
4642///    "prompts": {
4643///      "type": "array",
4644///      "items": {
4645///        "$ref": "#/$defs/Prompt"
4646///      }
4647///    }
4648///  }
4649///}
4650/// ```
4651/// </details>
4652#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4653pub struct ListPromptsResult {
4654    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
4655    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4656    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4657    /**An opaque token representing the pagination position after the last returned result.
4658    If present, there may be more results available.*/
4659    #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
4660    pub next_cursor: ::std::option::Option<::std::string::String>,
4661    pub prompts: ::std::vec::Vec<Prompt>,
4662}
4663///Sent from the client to request a list of resource templates the server has.
4664///
4665/// <details><summary>JSON schema</summary>
4666///
4667/// ```json
4668///{
4669///  "description": "Sent from the client to request a list of resource templates the server has.",
4670///  "type": "object",
4671///  "required": [
4672///    "id",
4673///    "jsonrpc",
4674///    "method"
4675///  ],
4676///  "properties": {
4677///    "id": {
4678///      "$ref": "#/$defs/RequestId"
4679///    },
4680///    "jsonrpc": {
4681///      "type": "string",
4682///      "const": "2.0"
4683///    },
4684///    "method": {
4685///      "type": "string",
4686///      "const": "resources/templates/list"
4687///    },
4688///    "params": {
4689///      "$ref": "#/$defs/PaginatedRequestParams"
4690///    }
4691///  }
4692///}
4693/// ```
4694/// </details>
4695#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4696pub struct ListResourceTemplatesRequest {
4697    pub id: RequestId,
4698    #[serde(deserialize_with = "validate::list_resource_templates_request_jsonrpc")]
4699    jsonrpc: ::std::string::String,
4700    #[serde(deserialize_with = "validate::list_resource_templates_request_method")]
4701    method: ::std::string::String,
4702    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4703    pub params: ::std::option::Option<PaginatedRequestParams>,
4704}
4705impl ListResourceTemplatesRequest {
4706    pub fn new(id: RequestId, params: ::std::option::Option<PaginatedRequestParams>) -> Self {
4707        Self {
4708            id,
4709            jsonrpc: JSONRPC_VERSION.to_string(),
4710            method: "resources/templates/list".to_string(),
4711            params,
4712        }
4713    }
4714    pub fn jsonrpc(&self) -> &::std::string::String {
4715        &self.jsonrpc
4716    }
4717    pub fn method(&self) -> &::std::string::String {
4718        &self.method
4719    }
4720    /// returns "resources/templates/list"
4721    pub fn method_value() -> ::std::string::String {
4722        "resources/templates/list".to_string()
4723    }
4724    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
4725    pub fn method_name() -> ::std::string::String {
4726        "resources/templates/list".to_string()
4727    }
4728}
4729///The server's response to a resources/templates/list request from the client.
4730///
4731/// <details><summary>JSON schema</summary>
4732///
4733/// ```json
4734///{
4735///  "description": "The server's response to a resources/templates/list request from the client.",
4736///  "type": "object",
4737///  "required": [
4738///    "resourceTemplates"
4739///  ],
4740///  "properties": {
4741///    "_meta": {
4742///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
4743///      "type": "object",
4744///      "additionalProperties": {}
4745///    },
4746///    "nextCursor": {
4747///      "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
4748///      "type": "string"
4749///    },
4750///    "resourceTemplates": {
4751///      "type": "array",
4752///      "items": {
4753///        "$ref": "#/$defs/ResourceTemplate"
4754///      }
4755///    }
4756///  }
4757///}
4758/// ```
4759/// </details>
4760#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4761pub struct ListResourceTemplatesResult {
4762    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
4763    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4764    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4765    /**An opaque token representing the pagination position after the last returned result.
4766    If present, there may be more results available.*/
4767    #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
4768    pub next_cursor: ::std::option::Option<::std::string::String>,
4769    #[serde(rename = "resourceTemplates")]
4770    pub resource_templates: ::std::vec::Vec<ResourceTemplate>,
4771}
4772///Sent from the client to request a list of resources the server has.
4773///
4774/// <details><summary>JSON schema</summary>
4775///
4776/// ```json
4777///{
4778///  "description": "Sent from the client to request a list of resources the server has.",
4779///  "type": "object",
4780///  "required": [
4781///    "id",
4782///    "jsonrpc",
4783///    "method"
4784///  ],
4785///  "properties": {
4786///    "id": {
4787///      "$ref": "#/$defs/RequestId"
4788///    },
4789///    "jsonrpc": {
4790///      "type": "string",
4791///      "const": "2.0"
4792///    },
4793///    "method": {
4794///      "type": "string",
4795///      "const": "resources/list"
4796///    },
4797///    "params": {
4798///      "$ref": "#/$defs/PaginatedRequestParams"
4799///    }
4800///  }
4801///}
4802/// ```
4803/// </details>
4804#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4805pub struct ListResourcesRequest {
4806    pub id: RequestId,
4807    #[serde(deserialize_with = "validate::list_resources_request_jsonrpc")]
4808    jsonrpc: ::std::string::String,
4809    #[serde(deserialize_with = "validate::list_resources_request_method")]
4810    method: ::std::string::String,
4811    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4812    pub params: ::std::option::Option<PaginatedRequestParams>,
4813}
4814impl ListResourcesRequest {
4815    pub fn new(id: RequestId, params: ::std::option::Option<PaginatedRequestParams>) -> Self {
4816        Self {
4817            id,
4818            jsonrpc: JSONRPC_VERSION.to_string(),
4819            method: "resources/list".to_string(),
4820            params,
4821        }
4822    }
4823    pub fn jsonrpc(&self) -> &::std::string::String {
4824        &self.jsonrpc
4825    }
4826    pub fn method(&self) -> &::std::string::String {
4827        &self.method
4828    }
4829    /// returns "resources/list"
4830    pub fn method_value() -> ::std::string::String {
4831        "resources/list".to_string()
4832    }
4833    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
4834    pub fn method_name() -> ::std::string::String {
4835        "resources/list".to_string()
4836    }
4837}
4838///The server's response to a resources/list request from the client.
4839///
4840/// <details><summary>JSON schema</summary>
4841///
4842/// ```json
4843///{
4844///  "description": "The server's response to a resources/list request from the client.",
4845///  "type": "object",
4846///  "required": [
4847///    "resources"
4848///  ],
4849///  "properties": {
4850///    "_meta": {
4851///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
4852///      "type": "object",
4853///      "additionalProperties": {}
4854///    },
4855///    "nextCursor": {
4856///      "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
4857///      "type": "string"
4858///    },
4859///    "resources": {
4860///      "type": "array",
4861///      "items": {
4862///        "$ref": "#/$defs/Resource"
4863///      }
4864///    }
4865///  }
4866///}
4867/// ```
4868/// </details>
4869#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4870pub struct ListResourcesResult {
4871    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
4872    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4873    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4874    /**An opaque token representing the pagination position after the last returned result.
4875    If present, there may be more results available.*/
4876    #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
4877    pub next_cursor: ::std::option::Option<::std::string::String>,
4878    pub resources: ::std::vec::Vec<Resource>,
4879}
4880/**Sent from the server to request a list of root URIs from the client. Roots allow
4881servers to ask for specific directories or files to operate on. A common example
4882for roots is providing a set of repositories or directories a server should operate
4883on.
4884This request is typically used when the server needs to understand the file system
4885structure or access specific locations that the client has permission to read from.*/
4886///
4887/// <details><summary>JSON schema</summary>
4888///
4889/// ```json
4890///{
4891///  "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.",
4892///  "type": "object",
4893///  "required": [
4894///    "id",
4895///    "jsonrpc",
4896///    "method"
4897///  ],
4898///  "properties": {
4899///    "id": {
4900///      "$ref": "#/$defs/RequestId"
4901///    },
4902///    "jsonrpc": {
4903///      "type": "string",
4904///      "const": "2.0"
4905///    },
4906///    "method": {
4907///      "type": "string",
4908///      "const": "roots/list"
4909///    },
4910///    "params": {
4911///      "$ref": "#/$defs/RequestParams"
4912///    }
4913///  }
4914///}
4915/// ```
4916/// </details>
4917#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4918pub struct ListRootsRequest {
4919    pub id: RequestId,
4920    #[serde(deserialize_with = "validate::list_roots_request_jsonrpc")]
4921    jsonrpc: ::std::string::String,
4922    #[serde(deserialize_with = "validate::list_roots_request_method")]
4923    method: ::std::string::String,
4924    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4925    pub params: ::std::option::Option<RequestParams>,
4926}
4927impl ListRootsRequest {
4928    pub fn new(id: RequestId, params: ::std::option::Option<RequestParams>) -> Self {
4929        Self {
4930            id,
4931            jsonrpc: JSONRPC_VERSION.to_string(),
4932            method: "roots/list".to_string(),
4933            params,
4934        }
4935    }
4936    pub fn jsonrpc(&self) -> &::std::string::String {
4937        &self.jsonrpc
4938    }
4939    pub fn method(&self) -> &::std::string::String {
4940        &self.method
4941    }
4942    /// returns "roots/list"
4943    pub fn method_value() -> ::std::string::String {
4944        "roots/list".to_string()
4945    }
4946    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
4947    pub fn method_name() -> ::std::string::String {
4948        "roots/list".to_string()
4949    }
4950}
4951/**The client's response to a roots/list request from the server.
4952This result contains an array of Root objects, each representing a root directory
4953or file that the server can operate on.*/
4954///
4955/// <details><summary>JSON schema</summary>
4956///
4957/// ```json
4958///{
4959///  "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.",
4960///  "type": "object",
4961///  "required": [
4962///    "roots"
4963///  ],
4964///  "properties": {
4965///    "_meta": {
4966///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
4967///      "type": "object",
4968///      "additionalProperties": {}
4969///    },
4970///    "roots": {
4971///      "type": "array",
4972///      "items": {
4973///        "$ref": "#/$defs/Root"
4974///      }
4975///    }
4976///  }
4977///}
4978/// ```
4979/// </details>
4980#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4981pub struct ListRootsResult {
4982    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
4983    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4984    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4985    pub roots: ::std::vec::Vec<Root>,
4986}
4987///A request to retrieve a list of tasks.
4988///
4989/// <details><summary>JSON schema</summary>
4990///
4991/// ```json
4992///{
4993///  "description": "A request to retrieve a list of tasks.",
4994///  "type": "object",
4995///  "required": [
4996///    "id",
4997///    "jsonrpc",
4998///    "method"
4999///  ],
5000///  "properties": {
5001///    "id": {
5002///      "$ref": "#/$defs/RequestId"
5003///    },
5004///    "jsonrpc": {
5005///      "type": "string",
5006///      "const": "2.0"
5007///    },
5008///    "method": {
5009///      "type": "string",
5010///      "const": "tasks/list"
5011///    },
5012///    "params": {
5013///      "$ref": "#/$defs/PaginatedRequestParams"
5014///    }
5015///  }
5016///}
5017/// ```
5018/// </details>
5019#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5020pub struct ListTasksRequest {
5021    pub id: RequestId,
5022    #[serde(deserialize_with = "validate::list_tasks_request_jsonrpc")]
5023    jsonrpc: ::std::string::String,
5024    #[serde(deserialize_with = "validate::list_tasks_request_method")]
5025    method: ::std::string::String,
5026    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5027    pub params: ::std::option::Option<PaginatedRequestParams>,
5028}
5029impl ListTasksRequest {
5030    pub fn new(id: RequestId, params: ::std::option::Option<PaginatedRequestParams>) -> Self {
5031        Self {
5032            id,
5033            jsonrpc: JSONRPC_VERSION.to_string(),
5034            method: "tasks/list".to_string(),
5035            params,
5036        }
5037    }
5038    pub fn jsonrpc(&self) -> &::std::string::String {
5039        &self.jsonrpc
5040    }
5041    pub fn method(&self) -> &::std::string::String {
5042        &self.method
5043    }
5044    /// returns "tasks/list"
5045    pub fn method_value() -> ::std::string::String {
5046        "tasks/list".to_string()
5047    }
5048    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
5049    pub fn method_name() -> ::std::string::String {
5050        "tasks/list".to_string()
5051    }
5052}
5053///The response to a tasks/list request.
5054///
5055/// <details><summary>JSON schema</summary>
5056///
5057/// ```json
5058///{
5059///  "description": "The response to a tasks/list request.",
5060///  "type": "object",
5061///  "required": [
5062///    "tasks"
5063///  ],
5064///  "properties": {
5065///    "_meta": {
5066///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
5067///      "type": "object",
5068///      "additionalProperties": {}
5069///    },
5070///    "nextCursor": {
5071///      "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
5072///      "type": "string"
5073///    },
5074///    "tasks": {
5075///      "type": "array",
5076///      "items": {
5077///        "$ref": "#/$defs/Task"
5078///      }
5079///    }
5080///  }
5081///}
5082/// ```
5083/// </details>
5084#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5085pub struct ListTasksResult {
5086    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
5087    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
5088    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5089    /**An opaque token representing the pagination position after the last returned result.
5090    If present, there may be more results available.*/
5091    #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
5092    pub next_cursor: ::std::option::Option<::std::string::String>,
5093    pub tasks: ::std::vec::Vec<Task>,
5094}
5095///Sent from the client to request a list of tools the server has.
5096///
5097/// <details><summary>JSON schema</summary>
5098///
5099/// ```json
5100///{
5101///  "description": "Sent from the client to request a list of tools the server has.",
5102///  "type": "object",
5103///  "required": [
5104///    "id",
5105///    "jsonrpc",
5106///    "method"
5107///  ],
5108///  "properties": {
5109///    "id": {
5110///      "$ref": "#/$defs/RequestId"
5111///    },
5112///    "jsonrpc": {
5113///      "type": "string",
5114///      "const": "2.0"
5115///    },
5116///    "method": {
5117///      "type": "string",
5118///      "const": "tools/list"
5119///    },
5120///    "params": {
5121///      "$ref": "#/$defs/PaginatedRequestParams"
5122///    }
5123///  }
5124///}
5125/// ```
5126/// </details>
5127#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5128pub struct ListToolsRequest {
5129    pub id: RequestId,
5130    #[serde(deserialize_with = "validate::list_tools_request_jsonrpc")]
5131    jsonrpc: ::std::string::String,
5132    #[serde(deserialize_with = "validate::list_tools_request_method")]
5133    method: ::std::string::String,
5134    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5135    pub params: ::std::option::Option<PaginatedRequestParams>,
5136}
5137impl ListToolsRequest {
5138    pub fn new(id: RequestId, params: ::std::option::Option<PaginatedRequestParams>) -> Self {
5139        Self {
5140            id,
5141            jsonrpc: JSONRPC_VERSION.to_string(),
5142            method: "tools/list".to_string(),
5143            params,
5144        }
5145    }
5146    pub fn jsonrpc(&self) -> &::std::string::String {
5147        &self.jsonrpc
5148    }
5149    pub fn method(&self) -> &::std::string::String {
5150        &self.method
5151    }
5152    /// returns "tools/list"
5153    pub fn method_value() -> ::std::string::String {
5154        "tools/list".to_string()
5155    }
5156    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
5157    pub fn method_name() -> ::std::string::String {
5158        "tools/list".to_string()
5159    }
5160}
5161///The server's response to a tools/list request from the client.
5162///
5163/// <details><summary>JSON schema</summary>
5164///
5165/// ```json
5166///{
5167///  "description": "The server's response to a tools/list request from the client.",
5168///  "type": "object",
5169///  "required": [
5170///    "tools"
5171///  ],
5172///  "properties": {
5173///    "_meta": {
5174///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
5175///      "type": "object",
5176///      "additionalProperties": {}
5177///    },
5178///    "nextCursor": {
5179///      "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
5180///      "type": "string"
5181///    },
5182///    "tools": {
5183///      "type": "array",
5184///      "items": {
5185///        "$ref": "#/$defs/Tool"
5186///      }
5187///    }
5188///  }
5189///}
5190/// ```
5191/// </details>
5192#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5193pub struct ListToolsResult {
5194    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
5195    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
5196    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5197    /**An opaque token representing the pagination position after the last returned result.
5198    If present, there may be more results available.*/
5199    #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
5200    pub next_cursor: ::std::option::Option<::std::string::String>,
5201    pub tools: ::std::vec::Vec<Tool>,
5202}
5203/**The severity of a log message.
5204These map to syslog message severities, as specified in RFC-5424:
5205<https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1>*/
5206///
5207/// <details><summary>JSON schema</summary>
5208///
5209/// ```json
5210///{
5211///  "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>",
5212///  "type": "string",
5213///  "enum": [
5214///    "alert",
5215///    "critical",
5216///    "debug",
5217///    "emergency",
5218///    "error",
5219///    "info",
5220///    "notice",
5221///    "warning"
5222///  ]
5223///}
5224/// ```
5225/// </details>
5226#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
5227pub enum LoggingLevel {
5228    #[serde(rename = "alert")]
5229    Alert,
5230    #[serde(rename = "critical")]
5231    Critical,
5232    #[serde(rename = "debug")]
5233    Debug,
5234    #[serde(rename = "emergency")]
5235    Emergency,
5236    #[serde(rename = "error")]
5237    Error,
5238    #[serde(rename = "info")]
5239    Info,
5240    #[serde(rename = "notice")]
5241    Notice,
5242    #[serde(rename = "warning")]
5243    Warning,
5244}
5245impl ::std::fmt::Display for LoggingLevel {
5246    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5247        match *self {
5248            Self::Alert => write!(f, "alert"),
5249            Self::Critical => write!(f, "critical"),
5250            Self::Debug => write!(f, "debug"),
5251            Self::Emergency => write!(f, "emergency"),
5252            Self::Error => write!(f, "error"),
5253            Self::Info => write!(f, "info"),
5254            Self::Notice => write!(f, "notice"),
5255            Self::Warning => write!(f, "warning"),
5256        }
5257    }
5258}
5259///JSONRPCNotification 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.
5260///
5261/// <details><summary>JSON schema</summary>
5262///
5263/// ```json
5264///{
5265///  "description": "JSONRPCNotification 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.",
5266///  "type": "object",
5267///  "required": [
5268///    "jsonrpc",
5269///    "method",
5270///    "params"
5271///  ],
5272///  "properties": {
5273///    "jsonrpc": {
5274///      "type": "string",
5275///      "const": "2.0"
5276///    },
5277///    "method": {
5278///      "type": "string",
5279///      "const": "notifications/message"
5280///    },
5281///    "params": {
5282///      "$ref": "#/$defs/LoggingMessageNotificationParams"
5283///    }
5284///  }
5285///}
5286/// ```
5287/// </details>
5288#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5289pub struct LoggingMessageNotification {
5290    #[serde(deserialize_with = "validate::logging_message_notification_jsonrpc")]
5291    jsonrpc: ::std::string::String,
5292    #[serde(deserialize_with = "validate::logging_message_notification_method")]
5293    method: ::std::string::String,
5294    pub params: LoggingMessageNotificationParams,
5295}
5296impl LoggingMessageNotification {
5297    pub fn new(params: LoggingMessageNotificationParams) -> Self {
5298        Self {
5299            jsonrpc: JSONRPC_VERSION.to_string(),
5300            method: "notifications/message".to_string(),
5301            params,
5302        }
5303    }
5304    pub fn jsonrpc(&self) -> &::std::string::String {
5305        &self.jsonrpc
5306    }
5307    pub fn method(&self) -> &::std::string::String {
5308        &self.method
5309    }
5310    /// returns "notifications/message"
5311    pub fn method_value() -> ::std::string::String {
5312        "notifications/message".to_string()
5313    }
5314    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
5315    pub fn method_name() -> ::std::string::String {
5316        "notifications/message".to_string()
5317    }
5318}
5319///Parameters for a notifications/message notification.
5320///
5321/// <details><summary>JSON schema</summary>
5322///
5323/// ```json
5324///{
5325///  "description": "Parameters for a notifications/message notification.",
5326///  "type": "object",
5327///  "required": [
5328///    "data",
5329///    "level"
5330///  ],
5331///  "properties": {
5332///    "_meta": {
5333///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
5334///      "type": "object",
5335///      "additionalProperties": {}
5336///    },
5337///    "data": {
5338///      "description": "The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here."
5339///    },
5340///    "level": {
5341///      "description": "The severity of this log message.",
5342///      "$ref": "#/$defs/LoggingLevel"
5343///    },
5344///    "logger": {
5345///      "description": "An optional name of the logger issuing this message.",
5346///      "type": "string"
5347///    }
5348///  }
5349///}
5350/// ```
5351/// </details>
5352#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5353pub struct LoggingMessageNotificationParams {
5354    ///The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
5355    pub data: ::serde_json::Value,
5356    ///The severity of this log message.
5357    pub level: LoggingLevel,
5358    ///An optional name of the logger issuing this message.
5359    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5360    pub logger: ::std::option::Option<::std::string::String>,
5361    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
5362    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
5363    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5364}
5365///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
5366///
5367/// <details><summary>JSON schema</summary>
5368///
5369/// ```json
5370///{
5371///  "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
5372///  "type": "object",
5373///  "properties": {
5374///    "progressToken": {
5375///      "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.",
5376///      "$ref": "#/$defs/ProgressToken"
5377///    }
5378///  },
5379///  "additionalProperties": {}
5380///}
5381/// ```
5382/// </details>
5383#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5384pub struct MessageMeta {
5385    ///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.
5386    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
5387    pub progress_token: ::std::option::Option<ProgressToken>,
5388    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
5389    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5390}
5391/**Hints to use for model selection.
5392Keys not declared here are currently left unspecified by the spec and are up
5393to the client to interpret.*/
5394///
5395/// <details><summary>JSON schema</summary>
5396///
5397/// ```json
5398///{
5399///  "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.",
5400///  "type": "object",
5401///  "properties": {
5402///    "name": {
5403///      "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",
5404///      "type": "string"
5405///    }
5406///  }
5407///}
5408/// ```
5409/// </details>
5410#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5411pub struct ModelHint {
5412    /**A hint for a model name.
5413    The client SHOULD treat this as a substring of a model name; for example:
5414     - claude-3-5-sonnet should match claude-3-5-sonnet-20241022
5415     - sonnet should match claude-3-5-sonnet-20241022, claude-3-sonnet-20240229, etc.
5416     - claude should match any Claude model
5417    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:
5418     - gemini-1.5-flash could match claude-3-haiku-20240307*/
5419    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5420    pub name: ::std::option::Option<::std::string::String>,
5421}
5422/**The server's preferences for model selection, requested of the client during sampling.
5423Because LLMs can vary along multiple dimensions, choosing the "best" model is
5424rarely straightforward.  Different models excel in different areas—some are
5425faster but less capable, others are more capable but more expensive, and so
5426on. This interface allows servers to express their priorities across multiple
5427dimensions to help clients make an appropriate selection for their use case.
5428These preferences are always advisory. The client MAY ignore them. It is also
5429up to the client to decide how to interpret these preferences and how to
5430balance them against other considerations.*/
5431///
5432/// <details><summary>JSON schema</summary>
5433///
5434/// ```json
5435///{
5436///  "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.",
5437///  "type": "object",
5438///  "properties": {
5439///    "costPriority": {
5440///      "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.",
5441///      "type": "number",
5442///      "maximum": 1.0,
5443///      "minimum": 0.0
5444///    },
5445///    "hints": {
5446///      "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.",
5447///      "type": "array",
5448///      "items": {
5449///        "$ref": "#/$defs/ModelHint"
5450///      }
5451///    },
5452///    "intelligencePriority": {
5453///      "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.",
5454///      "type": "number",
5455///      "maximum": 1.0,
5456///      "minimum": 0.0
5457///    },
5458///    "speedPriority": {
5459///      "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.",
5460///      "type": "number",
5461///      "maximum": 1.0,
5462///      "minimum": 0.0
5463///    }
5464///  }
5465///}
5466/// ```
5467/// </details>
5468#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5469pub struct ModelPreferences {
5470    #[serde(rename = "costPriority", default, skip_serializing_if = "::std::option::Option::is_none")]
5471    pub cost_priority: ::std::option::Option<f64>,
5472    /**Optional hints to use for model selection.
5473    If multiple hints are specified, the client MUST evaluate them in order
5474    (such that the first match is taken).
5475    The client SHOULD prioritize these hints over the numeric priorities, but
5476    MAY still use the priorities to select from ambiguous matches.*/
5477    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
5478    pub hints: ::std::vec::Vec<ModelHint>,
5479    #[serde(
5480        rename = "intelligencePriority",
5481        default,
5482        skip_serializing_if = "::std::option::Option::is_none"
5483    )]
5484    pub intelligence_priority: ::std::option::Option<f64>,
5485    #[serde(rename = "speedPriority", default, skip_serializing_if = "::std::option::Option::is_none")]
5486    pub speed_priority: ::std::option::Option<f64>,
5487}
5488///MultiSelectEnumSchema
5489///
5490/// <details><summary>JSON schema</summary>
5491///
5492/// ```json
5493///{
5494///  "anyOf": [
5495///    {
5496///      "$ref": "#/$defs/UntitledMultiSelectEnumSchema"
5497///    },
5498///    {
5499///      "$ref": "#/$defs/TitledMultiSelectEnumSchema"
5500///    }
5501///  ]
5502///}
5503/// ```
5504/// </details>
5505#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5506#[serde(untagged)]
5507pub enum MultiSelectEnumSchema {
5508    UntitledMultiSelectEnumSchema(UntitledMultiSelectEnumSchema),
5509    TitledMultiSelectEnumSchema(TitledMultiSelectEnumSchema),
5510}
5511impl ::std::convert::From<UntitledMultiSelectEnumSchema> for MultiSelectEnumSchema {
5512    fn from(value: UntitledMultiSelectEnumSchema) -> Self {
5513        Self::UntitledMultiSelectEnumSchema(value)
5514    }
5515}
5516impl ::std::convert::From<TitledMultiSelectEnumSchema> for MultiSelectEnumSchema {
5517    fn from(value: TitledMultiSelectEnumSchema) -> Self {
5518        Self::TitledMultiSelectEnumSchema(value)
5519    }
5520}
5521///Notification
5522///
5523/// <details><summary>JSON schema</summary>
5524///
5525/// ```json
5526///{
5527///  "type": "object",
5528///  "required": [
5529///    "method"
5530///  ],
5531///  "properties": {
5532///    "method": {
5533///      "type": "string"
5534///    },
5535///    "params": {
5536///      "type": "object",
5537///      "additionalProperties": {}
5538///    }
5539///  }
5540///}
5541/// ```
5542/// </details>
5543#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5544pub struct Notification {
5545    pub method: ::std::string::String,
5546    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5547    pub params: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5548}
5549///NotificationParams
5550///
5551/// <details><summary>JSON schema</summary>
5552///
5553/// ```json
5554///{
5555///  "type": "object",
5556///  "properties": {
5557///    "_meta": {
5558///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
5559///      "type": "object",
5560///      "additionalProperties": {}
5561///    }
5562///  }
5563///}
5564/// ```
5565/// </details>
5566#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5567pub struct NotificationParams {
5568    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
5569    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
5570    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5571}
5572///NumberSchema
5573///
5574/// <details><summary>JSON schema</summary>
5575///
5576/// ```json
5577///{
5578///  "type": "object",
5579///  "required": [
5580///    "type"
5581///  ],
5582///  "properties": {
5583///    "default": {
5584///      "type": "integer"
5585///    },
5586///    "description": {
5587///      "type": "string"
5588///    },
5589///    "maximum": {
5590///      "type": "integer"
5591///    },
5592///    "minimum": {
5593///      "type": "integer"
5594///    },
5595///    "title": {
5596///      "type": "string"
5597///    },
5598///    "type": {
5599///      "type": "string",
5600///      "enum": [
5601///        "integer",
5602///        "number"
5603///      ]
5604///    }
5605///  }
5606///}
5607/// ```
5608/// </details>
5609#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5610pub struct NumberSchema {
5611    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5612    pub default: ::std::option::Option<i64>,
5613    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5614    pub description: ::std::option::Option<::std::string::String>,
5615    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5616    pub maximum: ::std::option::Option<i64>,
5617    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5618    pub minimum: ::std::option::Option<i64>,
5619    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5620    pub title: ::std::option::Option<::std::string::String>,
5621    #[serde(rename = "type")]
5622    pub type_: NumberSchemaType,
5623}
5624///NumberSchemaType
5625///
5626/// <details><summary>JSON schema</summary>
5627///
5628/// ```json
5629///{
5630///  "type": "string",
5631///  "enum": [
5632///    "integer",
5633///    "number"
5634///  ]
5635///}
5636/// ```
5637/// </details>
5638#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
5639pub enum NumberSchemaType {
5640    #[serde(rename = "integer")]
5641    Integer,
5642    #[serde(rename = "number")]
5643    Number,
5644}
5645impl ::std::fmt::Display for NumberSchemaType {
5646    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5647        match *self {
5648            Self::Integer => write!(f, "integer"),
5649            Self::Number => write!(f, "number"),
5650        }
5651    }
5652}
5653///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
5654///
5655/// <details><summary>JSON schema</summary>
5656///
5657/// ```json
5658///{
5659///  "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
5660///  "type": "object",
5661///  "properties": {
5662///    "progressToken": {
5663///      "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.",
5664///      "$ref": "#/$defs/ProgressToken"
5665///    }
5666///  },
5667///  "additionalProperties": {}
5668///}
5669/// ```
5670/// </details>
5671#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5672pub struct PaginatedMeta {
5673    ///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.
5674    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
5675    pub progress_token: ::std::option::Option<ProgressToken>,
5676    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
5677    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5678}
5679///PaginatedRequest
5680///
5681/// <details><summary>JSON schema</summary>
5682///
5683/// ```json
5684///{
5685///  "type": "object",
5686///  "required": [
5687///    "id",
5688///    "jsonrpc",
5689///    "method"
5690///  ],
5691///  "properties": {
5692///    "id": {
5693///      "$ref": "#/$defs/RequestId"
5694///    },
5695///    "jsonrpc": {
5696///      "type": "string",
5697///      "const": "2.0"
5698///    },
5699///    "method": {
5700///      "type": "string"
5701///    },
5702///    "params": {
5703///      "$ref": "#/$defs/PaginatedRequestParams"
5704///    }
5705///  }
5706///}
5707/// ```
5708/// </details>
5709#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5710pub struct PaginatedRequest {
5711    pub id: RequestId,
5712    #[serde(deserialize_with = "validate::paginated_request_jsonrpc")]
5713    jsonrpc: ::std::string::String,
5714    pub method: ::std::string::String,
5715    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5716    pub params: ::std::option::Option<PaginatedRequestParams>,
5717}
5718impl PaginatedRequest {
5719    pub fn new(id: RequestId, method: ::std::string::String, params: ::std::option::Option<PaginatedRequestParams>) -> Self {
5720        Self {
5721            id,
5722            jsonrpc: JSONRPC_VERSION.to_string(),
5723            method,
5724            params,
5725        }
5726    }
5727    pub fn jsonrpc(&self) -> &::std::string::String {
5728        &self.jsonrpc
5729    }
5730}
5731///Common parameters for paginated requests.
5732///
5733/// <details><summary>JSON schema</summary>
5734///
5735/// ```json
5736///{
5737///  "description": "Common parameters for paginated requests.",
5738///  "type": "object",
5739///  "properties": {
5740///    "_meta": {
5741///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
5742///      "type": "object",
5743///      "properties": {
5744///        "progressToken": {
5745///          "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.",
5746///          "$ref": "#/$defs/ProgressToken"
5747///        }
5748///      },
5749///      "additionalProperties": {}
5750///    },
5751///    "cursor": {
5752///      "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.",
5753///      "type": "string"
5754///    }
5755///  }
5756///}
5757/// ```
5758/// </details>
5759#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5760pub struct PaginatedRequestParams {
5761    /**An opaque token representing the current pagination position.
5762    If provided, the server should return results starting after this cursor.*/
5763    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5764    pub cursor: ::std::option::Option<::std::string::String>,
5765    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
5766    pub meta: ::std::option::Option<PaginatedMeta>,
5767}
5768///PaginatedResult
5769///
5770/// <details><summary>JSON schema</summary>
5771///
5772/// ```json
5773///{
5774///  "type": "object",
5775///  "properties": {
5776///    "_meta": {
5777///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
5778///      "type": "object",
5779///      "additionalProperties": {}
5780///    },
5781///    "nextCursor": {
5782///      "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
5783///      "type": "string"
5784///    }
5785///  }
5786///}
5787/// ```
5788/// </details>
5789#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5790pub struct PaginatedResult {
5791    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
5792    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
5793    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5794    /**An opaque token representing the pagination position after the last returned result.
5795    If present, there may be more results available.*/
5796    #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
5797    pub next_cursor: ::std::option::Option<::std::string::String>,
5798}
5799///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.
5800///
5801/// <details><summary>JSON schema</summary>
5802///
5803/// ```json
5804///{
5805///  "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.",
5806///  "type": "object",
5807///  "required": [
5808///    "id",
5809///    "jsonrpc",
5810///    "method"
5811///  ],
5812///  "properties": {
5813///    "id": {
5814///      "$ref": "#/$defs/RequestId"
5815///    },
5816///    "jsonrpc": {
5817///      "type": "string",
5818///      "const": "2.0"
5819///    },
5820///    "method": {
5821///      "type": "string",
5822///      "const": "ping"
5823///    },
5824///    "params": {
5825///      "$ref": "#/$defs/RequestParams"
5826///    }
5827///  }
5828///}
5829/// ```
5830/// </details>
5831#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5832pub struct PingRequest {
5833    pub id: RequestId,
5834    #[serde(deserialize_with = "validate::ping_request_jsonrpc")]
5835    jsonrpc: ::std::string::String,
5836    #[serde(deserialize_with = "validate::ping_request_method")]
5837    method: ::std::string::String,
5838    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5839    pub params: ::std::option::Option<RequestParams>,
5840}
5841impl PingRequest {
5842    pub fn new(id: RequestId, params: ::std::option::Option<RequestParams>) -> Self {
5843        Self {
5844            id,
5845            jsonrpc: JSONRPC_VERSION.to_string(),
5846            method: "ping".to_string(),
5847            params,
5848        }
5849    }
5850    pub fn jsonrpc(&self) -> &::std::string::String {
5851        &self.jsonrpc
5852    }
5853    pub fn method(&self) -> &::std::string::String {
5854        &self.method
5855    }
5856    /// returns "ping"
5857    pub fn method_value() -> ::std::string::String {
5858        "ping".to_string()
5859    }
5860    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
5861    pub fn method_name() -> ::std::string::String {
5862        "ping".to_string()
5863    }
5864}
5865/**Restricted schema definitions that only allow primitive types
5866without nested objects or arrays.*/
5867///
5868/// <details><summary>JSON schema</summary>
5869///
5870/// ```json
5871///{
5872///  "description": "Restricted schema definitions that only allow primitive types\nwithout nested objects or arrays.",
5873///  "anyOf": [
5874///    {
5875///      "$ref": "#/$defs/StringSchema"
5876///    },
5877///    {
5878///      "$ref": "#/$defs/NumberSchema"
5879///    },
5880///    {
5881///      "$ref": "#/$defs/BooleanSchema"
5882///    },
5883///    {
5884///      "$ref": "#/$defs/UntitledSingleSelectEnumSchema"
5885///    },
5886///    {
5887///      "$ref": "#/$defs/TitledSingleSelectEnumSchema"
5888///    },
5889///    {
5890///      "$ref": "#/$defs/UntitledMultiSelectEnumSchema"
5891///    },
5892///    {
5893///      "$ref": "#/$defs/TitledMultiSelectEnumSchema"
5894///    },
5895///    {
5896///      "$ref": "#/$defs/LegacyTitledEnumSchema"
5897///    }
5898///  ]
5899///}
5900/// ```
5901/// </details>
5902#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5903#[serde(untagged)]
5904pub enum PrimitiveSchemaDefinition {
5905    StringSchema(StringSchema),
5906    NumberSchema(NumberSchema),
5907    BooleanSchema(BooleanSchema),
5908    UntitledSingleSelectEnumSchema(UntitledSingleSelectEnumSchema),
5909    TitledSingleSelectEnumSchema(TitledSingleSelectEnumSchema),
5910    UntitledMultiSelectEnumSchema(UntitledMultiSelectEnumSchema),
5911    TitledMultiSelectEnumSchema(TitledMultiSelectEnumSchema),
5912    LegacyTitledEnumSchema(LegacyTitledEnumSchema),
5913}
5914impl ::std::convert::From<StringSchema> for PrimitiveSchemaDefinition {
5915    fn from(value: StringSchema) -> Self {
5916        Self::StringSchema(value)
5917    }
5918}
5919impl ::std::convert::From<NumberSchema> for PrimitiveSchemaDefinition {
5920    fn from(value: NumberSchema) -> Self {
5921        Self::NumberSchema(value)
5922    }
5923}
5924impl ::std::convert::From<BooleanSchema> for PrimitiveSchemaDefinition {
5925    fn from(value: BooleanSchema) -> Self {
5926        Self::BooleanSchema(value)
5927    }
5928}
5929impl ::std::convert::From<UntitledSingleSelectEnumSchema> for PrimitiveSchemaDefinition {
5930    fn from(value: UntitledSingleSelectEnumSchema) -> Self {
5931        Self::UntitledSingleSelectEnumSchema(value)
5932    }
5933}
5934impl ::std::convert::From<TitledSingleSelectEnumSchema> for PrimitiveSchemaDefinition {
5935    fn from(value: TitledSingleSelectEnumSchema) -> Self {
5936        Self::TitledSingleSelectEnumSchema(value)
5937    }
5938}
5939impl ::std::convert::From<UntitledMultiSelectEnumSchema> for PrimitiveSchemaDefinition {
5940    fn from(value: UntitledMultiSelectEnumSchema) -> Self {
5941        Self::UntitledMultiSelectEnumSchema(value)
5942    }
5943}
5944impl ::std::convert::From<TitledMultiSelectEnumSchema> for PrimitiveSchemaDefinition {
5945    fn from(value: TitledMultiSelectEnumSchema) -> Self {
5946        Self::TitledMultiSelectEnumSchema(value)
5947    }
5948}
5949impl ::std::convert::From<LegacyTitledEnumSchema> for PrimitiveSchemaDefinition {
5950    fn from(value: LegacyTitledEnumSchema) -> Self {
5951        Self::LegacyTitledEnumSchema(value)
5952    }
5953}
5954///An out-of-band notification used to inform the receiver of a progress update for a long-running request.
5955///
5956/// <details><summary>JSON schema</summary>
5957///
5958/// ```json
5959///{
5960///  "description": "An out-of-band notification used to inform the receiver of a progress update for a long-running request.",
5961///  "type": "object",
5962///  "required": [
5963///    "jsonrpc",
5964///    "method",
5965///    "params"
5966///  ],
5967///  "properties": {
5968///    "jsonrpc": {
5969///      "type": "string",
5970///      "const": "2.0"
5971///    },
5972///    "method": {
5973///      "type": "string",
5974///      "const": "notifications/progress"
5975///    },
5976///    "params": {
5977///      "$ref": "#/$defs/ProgressNotificationParams"
5978///    }
5979///  }
5980///}
5981/// ```
5982/// </details>
5983#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5984pub struct ProgressNotification {
5985    #[serde(deserialize_with = "validate::progress_notification_jsonrpc")]
5986    jsonrpc: ::std::string::String,
5987    #[serde(deserialize_with = "validate::progress_notification_method")]
5988    method: ::std::string::String,
5989    pub params: ProgressNotificationParams,
5990}
5991impl ProgressNotification {
5992    pub fn new(params: ProgressNotificationParams) -> Self {
5993        Self {
5994            jsonrpc: JSONRPC_VERSION.to_string(),
5995            method: "notifications/progress".to_string(),
5996            params,
5997        }
5998    }
5999    pub fn jsonrpc(&self) -> &::std::string::String {
6000        &self.jsonrpc
6001    }
6002    pub fn method(&self) -> &::std::string::String {
6003        &self.method
6004    }
6005    /// returns "notifications/progress"
6006    pub fn method_value() -> ::std::string::String {
6007        "notifications/progress".to_string()
6008    }
6009    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
6010    pub fn method_name() -> ::std::string::String {
6011        "notifications/progress".to_string()
6012    }
6013}
6014///Parameters for a notifications/progress notification.
6015///
6016/// <details><summary>JSON schema</summary>
6017///
6018/// ```json
6019///{
6020///  "description": "Parameters for a notifications/progress notification.",
6021///  "type": "object",
6022///  "required": [
6023///    "progress",
6024///    "progressToken"
6025///  ],
6026///  "properties": {
6027///    "_meta": {
6028///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6029///      "type": "object",
6030///      "additionalProperties": {}
6031///    },
6032///    "message": {
6033///      "description": "An optional message describing the current progress.",
6034///      "type": "string"
6035///    },
6036///    "progress": {
6037///      "description": "The progress thus far. This should increase every time progress is made, even if the total is unknown.",
6038///      "type": "number"
6039///    },
6040///    "progressToken": {
6041///      "description": "The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.",
6042///      "$ref": "#/$defs/ProgressToken"
6043///    },
6044///    "total": {
6045///      "description": "Total number of items to process (or total progress required), if known.",
6046///      "type": "number"
6047///    }
6048///  }
6049///}
6050/// ```
6051/// </details>
6052#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6053pub struct ProgressNotificationParams {
6054    ///An optional message describing the current progress.
6055    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6056    pub message: ::std::option::Option<::std::string::String>,
6057    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
6058    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6059    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6060    pub progress: f64,
6061    ///The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
6062    #[serde(rename = "progressToken")]
6063    pub progress_token: ProgressToken,
6064    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6065    pub total: ::std::option::Option<f64>,
6066}
6067///A progress token, used to associate progress notifications with the original request.
6068///
6069/// <details><summary>JSON schema</summary>
6070///
6071/// ```json
6072///{
6073///  "description": "A progress token, used to associate progress notifications with the original request.",
6074///  "type": [
6075///    "string",
6076///    "integer"
6077///  ]
6078///}
6079/// ```
6080/// </details>
6081#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6082#[serde(untagged)]
6083pub enum ProgressToken {
6084    String(::std::string::String),
6085    Integer(i64),
6086}
6087impl ::std::convert::From<i64> for ProgressToken {
6088    fn from(value: i64) -> Self {
6089        Self::Integer(value)
6090    }
6091}
6092///A prompt or prompt template that the server offers.
6093///
6094/// <details><summary>JSON schema</summary>
6095///
6096/// ```json
6097///{
6098///  "description": "A prompt or prompt template that the server offers.",
6099///  "type": "object",
6100///  "required": [
6101///    "name"
6102///  ],
6103///  "properties": {
6104///    "_meta": {
6105///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6106///      "type": "object",
6107///      "additionalProperties": {}
6108///    },
6109///    "arguments": {
6110///      "description": "A list of arguments to use for templating the prompt.",
6111///      "type": "array",
6112///      "items": {
6113///        "$ref": "#/$defs/PromptArgument"
6114///      }
6115///    },
6116///    "description": {
6117///      "description": "An optional description of what this prompt provides",
6118///      "type": "string"
6119///    },
6120///    "icons": {
6121///      "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
6122///      "type": "array",
6123///      "items": {
6124///        "$ref": "#/$defs/Icon"
6125///      }
6126///    },
6127///    "name": {
6128///      "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
6129///      "type": "string"
6130///    },
6131///    "title": {
6132///      "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
6133///      "type": "string"
6134///    }
6135///  }
6136///}
6137/// ```
6138/// </details>
6139#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6140pub struct Prompt {
6141    ///A list of arguments to use for templating the prompt.
6142    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
6143    pub arguments: ::std::vec::Vec<PromptArgument>,
6144    ///An optional description of what this prompt provides
6145    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6146    pub description: ::std::option::Option<::std::string::String>,
6147    /**Optional set of sized icons that the client can display in a user interface.
6148    Clients that support rendering icons MUST support at least the following MIME types:
6149    - image/png - PNG images (safe, universal compatibility)
6150    - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
6151    Clients that support rendering icons SHOULD also support:
6152    - image/svg+xml - SVG images (scalable but requires security precautions)
6153    - image/webp - WebP images (modern, efficient format)*/
6154    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
6155    pub icons: ::std::vec::Vec<Icon>,
6156    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
6157    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6158    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6159    ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
6160    pub name: ::std::string::String,
6161    /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
6162    even by those unfamiliar with domain-specific terminology.
6163    If not provided, the name should be used for display (except for Tool,
6164    where annotations.title should be given precedence over using name,
6165    if present).*/
6166    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6167    pub title: ::std::option::Option<::std::string::String>,
6168}
6169///Describes an argument that a prompt can accept.
6170///
6171/// <details><summary>JSON schema</summary>
6172///
6173/// ```json
6174///{
6175///  "description": "Describes an argument that a prompt can accept.",
6176///  "type": "object",
6177///  "required": [
6178///    "name"
6179///  ],
6180///  "properties": {
6181///    "description": {
6182///      "description": "A human-readable description of the argument.",
6183///      "type": "string"
6184///    },
6185///    "name": {
6186///      "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
6187///      "type": "string"
6188///    },
6189///    "required": {
6190///      "description": "Whether this argument must be provided.",
6191///      "type": "boolean"
6192///    },
6193///    "title": {
6194///      "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
6195///      "type": "string"
6196///    }
6197///  }
6198///}
6199/// ```
6200/// </details>
6201#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6202pub struct PromptArgument {
6203    ///A human-readable description of the argument.
6204    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6205    pub description: ::std::option::Option<::std::string::String>,
6206    ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
6207    pub name: ::std::string::String,
6208    ///Whether this argument must be provided.
6209    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6210    pub required: ::std::option::Option<bool>,
6211    /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
6212    even by those unfamiliar with domain-specific terminology.
6213    If not provided, the name should be used for display (except for Tool,
6214    where annotations.title should be given precedence over using name,
6215    if present).*/
6216    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6217    pub title: ::std::option::Option<::std::string::String>,
6218}
6219///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.
6220///
6221/// <details><summary>JSON schema</summary>
6222///
6223/// ```json
6224///{
6225///  "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.",
6226///  "type": "object",
6227///  "required": [
6228///    "jsonrpc",
6229///    "method"
6230///  ],
6231///  "properties": {
6232///    "jsonrpc": {
6233///      "type": "string",
6234///      "const": "2.0"
6235///    },
6236///    "method": {
6237///      "type": "string",
6238///      "const": "notifications/prompts/list_changed"
6239///    },
6240///    "params": {
6241///      "$ref": "#/$defs/NotificationParams"
6242///    }
6243///  }
6244///}
6245/// ```
6246/// </details>
6247#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6248pub struct PromptListChangedNotification {
6249    #[serde(deserialize_with = "validate::prompt_list_changed_notification_jsonrpc")]
6250    jsonrpc: ::std::string::String,
6251    #[serde(deserialize_with = "validate::prompt_list_changed_notification_method")]
6252    method: ::std::string::String,
6253    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6254    pub params: ::std::option::Option<NotificationParams>,
6255}
6256impl PromptListChangedNotification {
6257    pub fn new(params: ::std::option::Option<NotificationParams>) -> Self {
6258        Self {
6259            jsonrpc: JSONRPC_VERSION.to_string(),
6260            method: "notifications/prompts/list_changed".to_string(),
6261            params,
6262        }
6263    }
6264    pub fn jsonrpc(&self) -> &::std::string::String {
6265        &self.jsonrpc
6266    }
6267    pub fn method(&self) -> &::std::string::String {
6268        &self.method
6269    }
6270    /// returns "notifications/prompts/list_changed"
6271    pub fn method_value() -> ::std::string::String {
6272        "notifications/prompts/list_changed".to_string()
6273    }
6274    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
6275    pub fn method_name() -> ::std::string::String {
6276        "notifications/prompts/list_changed".to_string()
6277    }
6278}
6279/**Describes a message returned as part of a prompt.
6280This is similar to SamplingMessage, but also supports the embedding of
6281resources from the MCP server.*/
6282///
6283/// <details><summary>JSON schema</summary>
6284///
6285/// ```json
6286///{
6287///  "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.",
6288///  "type": "object",
6289///  "required": [
6290///    "content",
6291///    "role"
6292///  ],
6293///  "properties": {
6294///    "content": {
6295///      "$ref": "#/$defs/ContentBlock"
6296///    },
6297///    "role": {
6298///      "$ref": "#/$defs/Role"
6299///    }
6300///  }
6301///}
6302/// ```
6303/// </details>
6304#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6305pub struct PromptMessage {
6306    pub content: ContentBlock,
6307    pub role: Role,
6308}
6309///Identifies a prompt.
6310///
6311/// <details><summary>JSON schema</summary>
6312///
6313/// ```json
6314///{
6315///  "description": "Identifies a prompt.",
6316///  "type": "object",
6317///  "required": [
6318///    "name",
6319///    "type"
6320///  ],
6321///  "properties": {
6322///    "name": {
6323///      "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
6324///      "type": "string"
6325///    },
6326///    "title": {
6327///      "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
6328///      "type": "string"
6329///    },
6330///    "type": {
6331///      "type": "string",
6332///      "const": "ref/prompt"
6333///    }
6334///  }
6335///}
6336/// ```
6337/// </details>
6338#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6339pub struct PromptReference {
6340    ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
6341    pub name: ::std::string::String,
6342    /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
6343    even by those unfamiliar with domain-specific terminology.
6344    If not provided, the name should be used for display (except for Tool,
6345    where annotations.title should be given precedence over using name,
6346    if present).*/
6347    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6348    pub title: ::std::option::Option<::std::string::String>,
6349    #[serde(rename = "type", deserialize_with = "validate::prompt_reference_type_")]
6350    type_: ::std::string::String,
6351}
6352impl PromptReference {
6353    pub fn new(name: ::std::string::String, title: ::std::option::Option<::std::string::String>) -> Self {
6354        Self {
6355            name,
6356            title,
6357            type_: "ref/prompt".to_string(),
6358        }
6359    }
6360    pub fn type_(&self) -> &::std::string::String {
6361        &self.type_
6362    }
6363    /// returns "ref/prompt"
6364    pub fn type_value() -> ::std::string::String {
6365        "ref/prompt".to_string()
6366    }
6367    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
6368    pub fn type_name() -> ::std::string::String {
6369        "ref/prompt".to_string()
6370    }
6371}
6372///ReadResourceContent
6373///
6374/// <details><summary>JSON schema</summary>
6375///
6376/// ```json
6377///{
6378///  "anyOf": [
6379///    {
6380///      "$ref": "#/$defs/TextResourceContents"
6381///    },
6382///    {
6383///      "$ref": "#/$defs/BlobResourceContents"
6384///    }
6385///  ]
6386///}
6387/// ```
6388/// </details>
6389#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6390#[serde(untagged)]
6391pub enum ReadResourceContent {
6392    TextResourceContents(TextResourceContents),
6393    BlobResourceContents(BlobResourceContents),
6394}
6395impl ::std::convert::From<TextResourceContents> for ReadResourceContent {
6396    fn from(value: TextResourceContents) -> Self {
6397        Self::TextResourceContents(value)
6398    }
6399}
6400impl ::std::convert::From<BlobResourceContents> for ReadResourceContent {
6401    fn from(value: BlobResourceContents) -> Self {
6402        Self::BlobResourceContents(value)
6403    }
6404}
6405///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
6406///
6407/// <details><summary>JSON schema</summary>
6408///
6409/// ```json
6410///{
6411///  "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6412///  "type": "object",
6413///  "properties": {
6414///    "progressToken": {
6415///      "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.",
6416///      "$ref": "#/$defs/ProgressToken"
6417///    }
6418///  },
6419///  "additionalProperties": {}
6420///}
6421/// ```
6422/// </details>
6423#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
6424pub struct ReadResourceMeta {
6425    ///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.
6426    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
6427    pub progress_token: ::std::option::Option<ProgressToken>,
6428    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
6429    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6430}
6431///Sent from the client to the server, to read a specific resource URI.
6432///
6433/// <details><summary>JSON schema</summary>
6434///
6435/// ```json
6436///{
6437///  "description": "Sent from the client to the server, to read a specific resource URI.",
6438///  "type": "object",
6439///  "required": [
6440///    "id",
6441///    "jsonrpc",
6442///    "method",
6443///    "params"
6444///  ],
6445///  "properties": {
6446///    "id": {
6447///      "$ref": "#/$defs/RequestId"
6448///    },
6449///    "jsonrpc": {
6450///      "type": "string",
6451///      "const": "2.0"
6452///    },
6453///    "method": {
6454///      "type": "string",
6455///      "const": "resources/read"
6456///    },
6457///    "params": {
6458///      "$ref": "#/$defs/ReadResourceRequestParams"
6459///    }
6460///  }
6461///}
6462/// ```
6463/// </details>
6464#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6465pub struct ReadResourceRequest {
6466    pub id: RequestId,
6467    #[serde(deserialize_with = "validate::read_resource_request_jsonrpc")]
6468    jsonrpc: ::std::string::String,
6469    #[serde(deserialize_with = "validate::read_resource_request_method")]
6470    method: ::std::string::String,
6471    pub params: ReadResourceRequestParams,
6472}
6473impl ReadResourceRequest {
6474    pub fn new(id: RequestId, params: ReadResourceRequestParams) -> Self {
6475        Self {
6476            id,
6477            jsonrpc: JSONRPC_VERSION.to_string(),
6478            method: "resources/read".to_string(),
6479            params,
6480        }
6481    }
6482    pub fn jsonrpc(&self) -> &::std::string::String {
6483        &self.jsonrpc
6484    }
6485    pub fn method(&self) -> &::std::string::String {
6486        &self.method
6487    }
6488    /// returns "resources/read"
6489    pub fn method_value() -> ::std::string::String {
6490        "resources/read".to_string()
6491    }
6492    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
6493    pub fn method_name() -> ::std::string::String {
6494        "resources/read".to_string()
6495    }
6496}
6497///Parameters for a resources/read request.
6498///
6499/// <details><summary>JSON schema</summary>
6500///
6501/// ```json
6502///{
6503///  "description": "Parameters for a resources/read request.",
6504///  "type": "object",
6505///  "required": [
6506///    "uri"
6507///  ],
6508///  "properties": {
6509///    "_meta": {
6510///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6511///      "type": "object",
6512///      "properties": {
6513///        "progressToken": {
6514///          "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.",
6515///          "$ref": "#/$defs/ProgressToken"
6516///        }
6517///      },
6518///      "additionalProperties": {}
6519///    },
6520///    "uri": {
6521///      "description": "The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.",
6522///      "type": "string",
6523///      "format": "uri"
6524///    }
6525///  }
6526///}
6527/// ```
6528/// </details>
6529#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6530pub struct ReadResourceRequestParams {
6531    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6532    pub meta: ::std::option::Option<ReadResourceMeta>,
6533    ///The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.
6534    pub uri: ::std::string::String,
6535}
6536///The server's response to a resources/read request from the client.
6537///
6538/// <details><summary>JSON schema</summary>
6539///
6540/// ```json
6541///{
6542///  "description": "The server's response to a resources/read request from the client.",
6543///  "type": "object",
6544///  "required": [
6545///    "contents"
6546///  ],
6547///  "properties": {
6548///    "_meta": {
6549///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6550///      "type": "object",
6551///      "additionalProperties": {}
6552///    },
6553///    "contents": {
6554///      "type": "array",
6555///      "items": {
6556///        "anyOf": [
6557///          {
6558///            "$ref": "#/$defs/TextResourceContents"
6559///          },
6560///          {
6561///            "$ref": "#/$defs/BlobResourceContents"
6562///          }
6563///        ]
6564///      }
6565///    }
6566///  }
6567///}
6568/// ```
6569/// </details>
6570#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6571pub struct ReadResourceResult {
6572    pub contents: ::std::vec::Vec<ReadResourceContent>,
6573    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
6574    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6575    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6576}
6577/**Metadata for associating messages with a task.
6578Include this in the _meta field under the key io.modelcontextprotocol/related-task.*/
6579///
6580/// <details><summary>JSON schema</summary>
6581///
6582/// ```json
6583///{
6584///  "description": "Metadata for associating messages with a task.\nInclude this in the _meta field under the key io.modelcontextprotocol/related-task.",
6585///  "type": "object",
6586///  "required": [
6587///    "taskId"
6588///  ],
6589///  "properties": {
6590///    "taskId": {
6591///      "description": "The task identifier this message is associated with.",
6592///      "type": "string"
6593///    }
6594///  }
6595///}
6596/// ```
6597/// </details>
6598#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6599pub struct RelatedTaskMetadata {
6600    ///The task identifier this message is associated with.
6601    #[serde(rename = "taskId")]
6602    pub task_id: ::std::string::String,
6603}
6604///Request
6605///
6606/// <details><summary>JSON schema</summary>
6607///
6608/// ```json
6609///{
6610///  "type": "object",
6611///  "required": [
6612///    "method"
6613///  ],
6614///  "properties": {
6615///    "method": {
6616///      "type": "string"
6617///    },
6618///    "params": {
6619///      "type": "object",
6620///      "additionalProperties": {}
6621///    }
6622///  }
6623///}
6624/// ```
6625/// </details>
6626#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6627pub struct Request {
6628    pub method: ::std::string::String,
6629    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6630    pub params: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6631}
6632///A uniquely identifying ID for a request in JSON-RPC.
6633///
6634/// <details><summary>JSON schema</summary>
6635///
6636/// ```json
6637///{
6638///  "description": "A uniquely identifying ID for a request in JSON-RPC.",
6639///  "type": [
6640///    "string",
6641///    "integer"
6642///  ]
6643///}
6644/// ```
6645/// </details>
6646#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6647#[serde(untagged)]
6648pub enum RequestId {
6649    String(::std::string::String),
6650    Integer(i64),
6651}
6652impl ::std::convert::From<i64> for RequestId {
6653    fn from(value: i64) -> Self {
6654        Self::Integer(value)
6655    }
6656}
6657///Common params for any request.
6658///
6659/// <details><summary>JSON schema</summary>
6660///
6661/// ```json
6662///{
6663///  "description": "Common params for any request.",
6664///  "type": "object",
6665///  "properties": {
6666///    "_meta": {
6667///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6668///      "type": "object",
6669///      "properties": {
6670///        "progressToken": {
6671///          "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.",
6672///          "$ref": "#/$defs/ProgressToken"
6673///        }
6674///      },
6675///      "additionalProperties": {}
6676///    }
6677///  }
6678///}
6679/// ```
6680/// </details>
6681#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
6682pub struct RequestParams {
6683    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6684    pub meta: ::std::option::Option<RequestParamsMeta>,
6685}
6686///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
6687///
6688/// <details><summary>JSON schema</summary>
6689///
6690/// ```json
6691///{
6692///  "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6693///  "type": "object",
6694///  "properties": {
6695///    "progressToken": {
6696///      "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.",
6697///      "$ref": "#/$defs/ProgressToken"
6698///    }
6699///  },
6700///  "additionalProperties": {}
6701///}
6702/// ```
6703/// </details>
6704#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
6705pub struct RequestParamsMeta {
6706    ///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.
6707    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
6708    pub progress_token: ::std::option::Option<ProgressToken>,
6709    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
6710    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6711}
6712///A known resource that the server is capable of reading.
6713///
6714/// <details><summary>JSON schema</summary>
6715///
6716/// ```json
6717///{
6718///  "description": "A known resource that the server is capable of reading.",
6719///  "type": "object",
6720///  "required": [
6721///    "name",
6722///    "uri"
6723///  ],
6724///  "properties": {
6725///    "_meta": {
6726///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6727///      "type": "object",
6728///      "additionalProperties": {}
6729///    },
6730///    "annotations": {
6731///      "description": "Optional annotations for the client.",
6732///      "$ref": "#/$defs/Annotations"
6733///    },
6734///    "description": {
6735///      "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.",
6736///      "type": "string"
6737///    },
6738///    "icons": {
6739///      "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
6740///      "type": "array",
6741///      "items": {
6742///        "$ref": "#/$defs/Icon"
6743///      }
6744///    },
6745///    "mimeType": {
6746///      "description": "The MIME type of this resource, if known.",
6747///      "type": "string"
6748///    },
6749///    "name": {
6750///      "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
6751///      "type": "string"
6752///    },
6753///    "size": {
6754///      "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.",
6755///      "type": "integer"
6756///    },
6757///    "title": {
6758///      "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
6759///      "type": "string"
6760///    },
6761///    "uri": {
6762///      "description": "The URI of this resource.",
6763///      "type": "string",
6764///      "format": "uri"
6765///    }
6766///  }
6767///}
6768/// ```
6769/// </details>
6770#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6771pub struct Resource {
6772    ///Optional annotations for the client.
6773    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6774    pub annotations: ::std::option::Option<Annotations>,
6775    /**A description of what this resource represents.
6776    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.*/
6777    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6778    pub description: ::std::option::Option<::std::string::String>,
6779    /**Optional set of sized icons that the client can display in a user interface.
6780    Clients that support rendering icons MUST support at least the following MIME types:
6781    - image/png - PNG images (safe, universal compatibility)
6782    - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
6783    Clients that support rendering icons SHOULD also support:
6784    - image/svg+xml - SVG images (scalable but requires security precautions)
6785    - image/webp - WebP images (modern, efficient format)*/
6786    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
6787    pub icons: ::std::vec::Vec<Icon>,
6788    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
6789    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6790    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6791    ///The MIME type of this resource, if known.
6792    #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
6793    pub mime_type: ::std::option::Option<::std::string::String>,
6794    ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
6795    pub name: ::std::string::String,
6796    /**The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
6797    This can be used by Hosts to display file sizes and estimate context window usage.*/
6798    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6799    pub size: ::std::option::Option<i64>,
6800    /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
6801    even by those unfamiliar with domain-specific terminology.
6802    If not provided, the name should be used for display (except for Tool,
6803    where annotations.title should be given precedence over using name,
6804    if present).*/
6805    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6806    pub title: ::std::option::Option<::std::string::String>,
6807    ///The URI of this resource.
6808    pub uri: ::std::string::String,
6809}
6810///The contents of a specific resource or sub-resource.
6811///
6812/// <details><summary>JSON schema</summary>
6813///
6814/// ```json
6815///{
6816///  "description": "The contents of a specific resource or sub-resource.",
6817///  "type": "object",
6818///  "required": [
6819///    "uri"
6820///  ],
6821///  "properties": {
6822///    "_meta": {
6823///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6824///      "type": "object",
6825///      "additionalProperties": {}
6826///    },
6827///    "mimeType": {
6828///      "description": "The MIME type of this resource, if known.",
6829///      "type": "string"
6830///    },
6831///    "uri": {
6832///      "description": "The URI of this resource.",
6833///      "type": "string",
6834///      "format": "uri"
6835///    }
6836///  }
6837///}
6838/// ```
6839/// </details>
6840#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6841pub struct ResourceContents {
6842    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
6843    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6844    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6845    ///The MIME type of this resource, if known.
6846    #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
6847    pub mime_type: ::std::option::Option<::std::string::String>,
6848    ///The URI of this resource.
6849    pub uri: ::std::string::String,
6850}
6851/**A resource that the server is capable of reading, included in a prompt or tool call result.
6852Note: resource links returned by tools are not guaranteed to appear in the results of resources/list requests.*/
6853///
6854/// <details><summary>JSON schema</summary>
6855///
6856/// ```json
6857///{
6858///  "description": "A resource that the server is capable of reading, included in a prompt or tool call result.\n\nNote: resource links returned by tools are not guaranteed to appear in the results of resources/list requests.",
6859///  "type": "object",
6860///  "required": [
6861///    "name",
6862///    "type",
6863///    "uri"
6864///  ],
6865///  "properties": {
6866///    "_meta": {
6867///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6868///      "type": "object",
6869///      "additionalProperties": {}
6870///    },
6871///    "annotations": {
6872///      "description": "Optional annotations for the client.",
6873///      "$ref": "#/$defs/Annotations"
6874///    },
6875///    "description": {
6876///      "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.",
6877///      "type": "string"
6878///    },
6879///    "icons": {
6880///      "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
6881///      "type": "array",
6882///      "items": {
6883///        "$ref": "#/$defs/Icon"
6884///      }
6885///    },
6886///    "mimeType": {
6887///      "description": "The MIME type of this resource, if known.",
6888///      "type": "string"
6889///    },
6890///    "name": {
6891///      "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
6892///      "type": "string"
6893///    },
6894///    "size": {
6895///      "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.",
6896///      "type": "integer"
6897///    },
6898///    "title": {
6899///      "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
6900///      "type": "string"
6901///    },
6902///    "type": {
6903///      "type": "string",
6904///      "const": "resource_link"
6905///    },
6906///    "uri": {
6907///      "description": "The URI of this resource.",
6908///      "type": "string",
6909///      "format": "uri"
6910///    }
6911///  }
6912///}
6913/// ```
6914/// </details>
6915#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6916pub struct ResourceLink {
6917    ///Optional annotations for the client.
6918    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6919    pub annotations: ::std::option::Option<Annotations>,
6920    /**A description of what this resource represents.
6921    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.*/
6922    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6923    pub description: ::std::option::Option<::std::string::String>,
6924    /**Optional set of sized icons that the client can display in a user interface.
6925    Clients that support rendering icons MUST support at least the following MIME types:
6926    - image/png - PNG images (safe, universal compatibility)
6927    - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
6928    Clients that support rendering icons SHOULD also support:
6929    - image/svg+xml - SVG images (scalable but requires security precautions)
6930    - image/webp - WebP images (modern, efficient format)*/
6931    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
6932    pub icons: ::std::vec::Vec<Icon>,
6933    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
6934    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6935    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6936    ///The MIME type of this resource, if known.
6937    #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
6938    pub mime_type: ::std::option::Option<::std::string::String>,
6939    ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
6940    pub name: ::std::string::String,
6941    /**The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
6942    This can be used by Hosts to display file sizes and estimate context window usage.*/
6943    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6944    pub size: ::std::option::Option<i64>,
6945    /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
6946    even by those unfamiliar with domain-specific terminology.
6947    If not provided, the name should be used for display (except for Tool,
6948    where annotations.title should be given precedence over using name,
6949    if present).*/
6950    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6951    pub title: ::std::option::Option<::std::string::String>,
6952    #[serde(rename = "type", deserialize_with = "validate::resource_link_type_")]
6953    type_: ::std::string::String,
6954    ///The URI of this resource.
6955    pub uri: ::std::string::String,
6956}
6957impl ResourceLink {
6958    #[allow(clippy::too_many_arguments)]
6959    pub fn new(
6960        icons: ::std::vec::Vec<Icon>,
6961        name: ::std::string::String,
6962        uri: ::std::string::String,
6963        annotations: ::std::option::Option<Annotations>,
6964        description: ::std::option::Option<::std::string::String>,
6965        meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6966        mime_type: ::std::option::Option<::std::string::String>,
6967        size: ::std::option::Option<i64>,
6968        title: ::std::option::Option<::std::string::String>,
6969    ) -> Self {
6970        Self {
6971            annotations,
6972            description,
6973            icons,
6974            meta,
6975            mime_type,
6976            name,
6977            size,
6978            title,
6979            type_: "resource_link".to_string(),
6980            uri,
6981        }
6982    }
6983    pub fn type_(&self) -> &::std::string::String {
6984        &self.type_
6985    }
6986    /// returns "resource_link"
6987    pub fn type_value() -> ::std::string::String {
6988        "resource_link".to_string()
6989    }
6990    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
6991    pub fn type_name() -> ::std::string::String {
6992        "resource_link".to_string()
6993    }
6994}
6995///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.
6996///
6997/// <details><summary>JSON schema</summary>
6998///
6999/// ```json
7000///{
7001///  "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.",
7002///  "type": "object",
7003///  "required": [
7004///    "jsonrpc",
7005///    "method"
7006///  ],
7007///  "properties": {
7008///    "jsonrpc": {
7009///      "type": "string",
7010///      "const": "2.0"
7011///    },
7012///    "method": {
7013///      "type": "string",
7014///      "const": "notifications/resources/list_changed"
7015///    },
7016///    "params": {
7017///      "$ref": "#/$defs/NotificationParams"
7018///    }
7019///  }
7020///}
7021/// ```
7022/// </details>
7023#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7024pub struct ResourceListChangedNotification {
7025    #[serde(deserialize_with = "validate::resource_list_changed_notification_jsonrpc")]
7026    jsonrpc: ::std::string::String,
7027    #[serde(deserialize_with = "validate::resource_list_changed_notification_method")]
7028    method: ::std::string::String,
7029    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7030    pub params: ::std::option::Option<NotificationParams>,
7031}
7032impl ResourceListChangedNotification {
7033    pub fn new(params: ::std::option::Option<NotificationParams>) -> Self {
7034        Self {
7035            jsonrpc: JSONRPC_VERSION.to_string(),
7036            method: "notifications/resources/list_changed".to_string(),
7037            params,
7038        }
7039    }
7040    pub fn jsonrpc(&self) -> &::std::string::String {
7041        &self.jsonrpc
7042    }
7043    pub fn method(&self) -> &::std::string::String {
7044        &self.method
7045    }
7046    /// returns "notifications/resources/list_changed"
7047    pub fn method_value() -> ::std::string::String {
7048        "notifications/resources/list_changed".to_string()
7049    }
7050    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
7051    pub fn method_name() -> ::std::string::String {
7052        "notifications/resources/list_changed".to_string()
7053    }
7054}
7055///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
7056///
7057/// <details><summary>JSON schema</summary>
7058///
7059/// ```json
7060///{
7061///  "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
7062///  "type": "object",
7063///  "properties": {
7064///    "progressToken": {
7065///      "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.",
7066///      "$ref": "#/$defs/ProgressToken"
7067///    }
7068///  },
7069///  "additionalProperties": {}
7070///}
7071/// ```
7072/// </details>
7073#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
7074pub struct ResourceMeta {
7075    ///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.
7076    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
7077    pub progress_token: ::std::option::Option<ProgressToken>,
7078    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
7079    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7080}
7081///Common parameters when working with resources.
7082///
7083/// <details><summary>JSON schema</summary>
7084///
7085/// ```json
7086///{
7087///  "description": "Common parameters when working with resources.",
7088///  "type": "object",
7089///  "required": [
7090///    "uri"
7091///  ],
7092///  "properties": {
7093///    "_meta": {
7094///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
7095///      "type": "object",
7096///      "properties": {
7097///        "progressToken": {
7098///          "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.",
7099///          "$ref": "#/$defs/ProgressToken"
7100///        }
7101///      },
7102///      "additionalProperties": {}
7103///    },
7104///    "uri": {
7105///      "description": "The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.",
7106///      "type": "string",
7107///      "format": "uri"
7108///    }
7109///  }
7110///}
7111/// ```
7112/// </details>
7113#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7114pub struct ResourceRequestParams {
7115    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
7116    pub meta: ::std::option::Option<ResourceMeta>,
7117    ///The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.
7118    pub uri: ::std::string::String,
7119}
7120///A template description for resources available on the server.
7121///
7122/// <details><summary>JSON schema</summary>
7123///
7124/// ```json
7125///{
7126///  "description": "A template description for resources available on the server.",
7127///  "type": "object",
7128///  "required": [
7129///    "name",
7130///    "uriTemplate"
7131///  ],
7132///  "properties": {
7133///    "_meta": {
7134///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
7135///      "type": "object",
7136///      "additionalProperties": {}
7137///    },
7138///    "annotations": {
7139///      "description": "Optional annotations for the client.",
7140///      "$ref": "#/$defs/Annotations"
7141///    },
7142///    "description": {
7143///      "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.",
7144///      "type": "string"
7145///    },
7146///    "icons": {
7147///      "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
7148///      "type": "array",
7149///      "items": {
7150///        "$ref": "#/$defs/Icon"
7151///      }
7152///    },
7153///    "mimeType": {
7154///      "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.",
7155///      "type": "string"
7156///    },
7157///    "name": {
7158///      "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
7159///      "type": "string"
7160///    },
7161///    "title": {
7162///      "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
7163///      "type": "string"
7164///    },
7165///    "uriTemplate": {
7166///      "description": "A URI template (according to RFC 6570) that can be used to construct resource URIs.",
7167///      "type": "string",
7168///      "format": "uri-template"
7169///    }
7170///  }
7171///}
7172/// ```
7173/// </details>
7174#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7175pub struct ResourceTemplate {
7176    ///Optional annotations for the client.
7177    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7178    pub annotations: ::std::option::Option<Annotations>,
7179    /**A description of what this template is for.
7180    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.*/
7181    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7182    pub description: ::std::option::Option<::std::string::String>,
7183    /**Optional set of sized icons that the client can display in a user interface.
7184    Clients that support rendering icons MUST support at least the following MIME types:
7185    - image/png - PNG images (safe, universal compatibility)
7186    - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
7187    Clients that support rendering icons SHOULD also support:
7188    - image/svg+xml - SVG images (scalable but requires security precautions)
7189    - image/webp - WebP images (modern, efficient format)*/
7190    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
7191    pub icons: ::std::vec::Vec<Icon>,
7192    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
7193    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
7194    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7195    ///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.
7196    #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
7197    pub mime_type: ::std::option::Option<::std::string::String>,
7198    ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
7199    pub name: ::std::string::String,
7200    /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
7201    even by those unfamiliar with domain-specific terminology.
7202    If not provided, the name should be used for display (except for Tool,
7203    where annotations.title should be given precedence over using name,
7204    if present).*/
7205    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7206    pub title: ::std::option::Option<::std::string::String>,
7207    ///A URI template (according to RFC 6570) that can be used to construct resource URIs.
7208    #[serde(rename = "uriTemplate")]
7209    pub uri_template: ::std::string::String,
7210}
7211///A reference to a resource or resource template definition.
7212///
7213/// <details><summary>JSON schema</summary>
7214///
7215/// ```json
7216///{
7217///  "description": "A reference to a resource or resource template definition.",
7218///  "type": "object",
7219///  "required": [
7220///    "type",
7221///    "uri"
7222///  ],
7223///  "properties": {
7224///    "type": {
7225///      "type": "string",
7226///      "const": "ref/resource"
7227///    },
7228///    "uri": {
7229///      "description": "The URI or URI template of the resource.",
7230///      "type": "string",
7231///      "format": "uri-template"
7232///    }
7233///  }
7234///}
7235/// ```
7236/// </details>
7237#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7238pub struct ResourceTemplateReference {
7239    #[serde(rename = "type", deserialize_with = "validate::resource_template_reference_type_")]
7240    type_: ::std::string::String,
7241    ///The URI or URI template of the resource.
7242    pub uri: ::std::string::String,
7243}
7244impl ResourceTemplateReference {
7245    pub fn new(uri: ::std::string::String) -> Self {
7246        Self {
7247            type_: "ref/resource".to_string(),
7248            uri,
7249        }
7250    }
7251    pub fn type_(&self) -> &::std::string::String {
7252        &self.type_
7253    }
7254    /// returns "ref/resource"
7255    pub fn type_value() -> ::std::string::String {
7256        "ref/resource".to_string()
7257    }
7258    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
7259    pub fn type_name() -> ::std::string::String {
7260        "ref/resource".to_string()
7261    }
7262}
7263///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.
7264///
7265/// <details><summary>JSON schema</summary>
7266///
7267/// ```json
7268///{
7269///  "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.",
7270///  "type": "object",
7271///  "required": [
7272///    "jsonrpc",
7273///    "method",
7274///    "params"
7275///  ],
7276///  "properties": {
7277///    "jsonrpc": {
7278///      "type": "string",
7279///      "const": "2.0"
7280///    },
7281///    "method": {
7282///      "type": "string",
7283///      "const": "notifications/resources/updated"
7284///    },
7285///    "params": {
7286///      "$ref": "#/$defs/ResourceUpdatedNotificationParams"
7287///    }
7288///  }
7289///}
7290/// ```
7291/// </details>
7292#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7293pub struct ResourceUpdatedNotification {
7294    #[serde(deserialize_with = "validate::resource_updated_notification_jsonrpc")]
7295    jsonrpc: ::std::string::String,
7296    #[serde(deserialize_with = "validate::resource_updated_notification_method")]
7297    method: ::std::string::String,
7298    pub params: ResourceUpdatedNotificationParams,
7299}
7300impl ResourceUpdatedNotification {
7301    pub fn new(params: ResourceUpdatedNotificationParams) -> Self {
7302        Self {
7303            jsonrpc: JSONRPC_VERSION.to_string(),
7304            method: "notifications/resources/updated".to_string(),
7305            params,
7306        }
7307    }
7308    pub fn jsonrpc(&self) -> &::std::string::String {
7309        &self.jsonrpc
7310    }
7311    pub fn method(&self) -> &::std::string::String {
7312        &self.method
7313    }
7314    /// returns "notifications/resources/updated"
7315    pub fn method_value() -> ::std::string::String {
7316        "notifications/resources/updated".to_string()
7317    }
7318    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
7319    pub fn method_name() -> ::std::string::String {
7320        "notifications/resources/updated".to_string()
7321    }
7322}
7323///Parameters for a notifications/resources/updated notification.
7324///
7325/// <details><summary>JSON schema</summary>
7326///
7327/// ```json
7328///{
7329///  "description": "Parameters for a notifications/resources/updated notification.",
7330///  "type": "object",
7331///  "required": [
7332///    "uri"
7333///  ],
7334///  "properties": {
7335///    "_meta": {
7336///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
7337///      "type": "object",
7338///      "additionalProperties": {}
7339///    },
7340///    "uri": {
7341///      "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.",
7342///      "type": "string",
7343///      "format": "uri"
7344///    }
7345///  }
7346///}
7347/// ```
7348/// </details>
7349#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7350pub struct ResourceUpdatedNotificationParams {
7351    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
7352    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
7353    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7354    ///The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
7355    pub uri: ::std::string::String,
7356}
7357///Result
7358///
7359/// <details><summary>JSON schema</summary>
7360///
7361/// ```json
7362///{
7363///  "type": "object",
7364///  "properties": {
7365///    "_meta": {
7366///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
7367///      "type": "object",
7368///      "additionalProperties": {}
7369///    }
7370///  },
7371///  "additionalProperties": {}
7372///}
7373/// ```
7374/// </details>
7375#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
7376pub struct Result {
7377    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
7378    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
7379    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7380    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
7381    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7382}
7383///The sender or recipient of messages and data in a conversation.
7384///
7385/// <details><summary>JSON schema</summary>
7386///
7387/// ```json
7388///{
7389///  "description": "The sender or recipient of messages and data in a conversation.",
7390///  "type": "string",
7391///  "enum": [
7392///    "assistant",
7393///    "user"
7394///  ]
7395///}
7396/// ```
7397/// </details>
7398#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
7399pub enum Role {
7400    #[serde(rename = "assistant")]
7401    Assistant,
7402    #[serde(rename = "user")]
7403    User,
7404}
7405impl ::std::fmt::Display for Role {
7406    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
7407        match *self {
7408            Self::Assistant => write!(f, "assistant"),
7409            Self::User => write!(f, "user"),
7410        }
7411    }
7412}
7413///Represents a root directory or file that the server can operate on.
7414///
7415/// <details><summary>JSON schema</summary>
7416///
7417/// ```json
7418///{
7419///  "description": "Represents a root directory or file that the server can operate on.",
7420///  "type": "object",
7421///  "required": [
7422///    "uri"
7423///  ],
7424///  "properties": {
7425///    "_meta": {
7426///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
7427///      "type": "object",
7428///      "additionalProperties": {}
7429///    },
7430///    "name": {
7431///      "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.",
7432///      "type": "string"
7433///    },
7434///    "uri": {
7435///      "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.",
7436///      "type": "string",
7437///      "format": "uri"
7438///    }
7439///  }
7440///}
7441/// ```
7442/// </details>
7443#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7444pub struct Root {
7445    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
7446    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
7447    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7448    /**An optional name for the root. This can be used to provide a human-readable
7449    identifier for the root, which may be useful for display purposes or for
7450    referencing the root in other parts of the application.*/
7451    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7452    pub name: ::std::option::Option<::std::string::String>,
7453    /**The URI identifying the root. This *must* start with file:// for now.
7454    This restriction may be relaxed in future versions of the protocol to allow
7455    other URI schemes.*/
7456    pub uri: ::std::string::String,
7457}
7458/**A notification from the client to the server, informing it that the list of roots has changed.
7459This notification should be sent whenever the client adds, removes, or modifies any root.
7460The server should then request an updated list of roots using the ListRootsRequest.*/
7461///
7462/// <details><summary>JSON schema</summary>
7463///
7464/// ```json
7465///{
7466///  "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.",
7467///  "type": "object",
7468///  "required": [
7469///    "jsonrpc",
7470///    "method"
7471///  ],
7472///  "properties": {
7473///    "jsonrpc": {
7474///      "type": "string",
7475///      "const": "2.0"
7476///    },
7477///    "method": {
7478///      "type": "string",
7479///      "const": "notifications/roots/list_changed"
7480///    },
7481///    "params": {
7482///      "$ref": "#/$defs/NotificationParams"
7483///    }
7484///  }
7485///}
7486/// ```
7487/// </details>
7488#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7489pub struct RootsListChangedNotification {
7490    #[serde(deserialize_with = "validate::roots_list_changed_notification_jsonrpc")]
7491    jsonrpc: ::std::string::String,
7492    #[serde(deserialize_with = "validate::roots_list_changed_notification_method")]
7493    method: ::std::string::String,
7494    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7495    pub params: ::std::option::Option<NotificationParams>,
7496}
7497impl RootsListChangedNotification {
7498    pub fn new(params: ::std::option::Option<NotificationParams>) -> Self {
7499        Self {
7500            jsonrpc: JSONRPC_VERSION.to_string(),
7501            method: "notifications/roots/list_changed".to_string(),
7502            params,
7503        }
7504    }
7505    pub fn jsonrpc(&self) -> &::std::string::String {
7506        &self.jsonrpc
7507    }
7508    pub fn method(&self) -> &::std::string::String {
7509        &self.method
7510    }
7511    /// returns "notifications/roots/list_changed"
7512    pub fn method_value() -> ::std::string::String {
7513        "notifications/roots/list_changed".to_string()
7514    }
7515    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
7516    pub fn method_name() -> ::std::string::String {
7517        "notifications/roots/list_changed".to_string()
7518    }
7519}
7520///RpcError
7521///
7522/// <details><summary>JSON schema</summary>
7523///
7524/// ```json
7525///{
7526///  "type": "object",
7527///  "required": [
7528///    "code",
7529///    "message"
7530///  ],
7531///  "properties": {
7532///    "code": {
7533///      "description": "The error type that occurred.",
7534///      "type": "integer"
7535///    },
7536///    "data": {
7537///      "description": "Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.)."
7538///    },
7539///    "message": {
7540///      "description": "A short description of the error. The message SHOULD be limited to a concise single sentence.",
7541///      "type": "string"
7542///    }
7543///  }
7544///}
7545/// ```
7546/// </details>
7547#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7548pub struct RpcError {
7549    ///The error type that occurred.
7550    pub code: i64,
7551    ///Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
7552    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7553    pub data: ::std::option::Option<::serde_json::Value>,
7554    ///A short description of the error. The message SHOULD be limited to a concise single sentence.
7555    pub message: ::std::string::String,
7556}
7557///Describes a message issued to or received from an LLM API.
7558///
7559/// <details><summary>JSON schema</summary>
7560///
7561/// ```json
7562///{
7563///  "description": "Describes a message issued to or received from an LLM API.",
7564///  "type": "object",
7565///  "required": [
7566///    "content",
7567///    "role"
7568///  ],
7569///  "properties": {
7570///    "_meta": {
7571///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
7572///      "type": "object",
7573///      "additionalProperties": {}
7574///    },
7575///    "content": {
7576///      "anyOf": [
7577///        {
7578///          "$ref": "#/$defs/TextContent"
7579///        },
7580///        {
7581///          "$ref": "#/$defs/ImageContent"
7582///        },
7583///        {
7584///          "$ref": "#/$defs/AudioContent"
7585///        },
7586///        {
7587///          "$ref": "#/$defs/ToolUseContent"
7588///        },
7589///        {
7590///          "$ref": "#/$defs/ToolResultContent"
7591///        },
7592///        {
7593///          "type": "array",
7594///          "items": {
7595///            "$ref": "#/$defs/SamplingMessageContentBlock"
7596///          }
7597///        }
7598///      ]
7599///    },
7600///    "role": {
7601///      "$ref": "#/$defs/Role"
7602///    }
7603///  }
7604///}
7605/// ```
7606/// </details>
7607#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7608pub struct SamplingMessage {
7609    pub content: SamplingMessageContent,
7610    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
7611    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
7612    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7613    pub role: Role,
7614}
7615///SamplingMessageContent
7616///
7617/// <details><summary>JSON schema</summary>
7618///
7619/// ```json
7620///{
7621///  "anyOf": [
7622///    {
7623///      "$ref": "#/$defs/TextContent"
7624///    },
7625///    {
7626///      "$ref": "#/$defs/ImageContent"
7627///    },
7628///    {
7629///      "$ref": "#/$defs/AudioContent"
7630///    },
7631///    {
7632///      "$ref": "#/$defs/ToolUseContent"
7633///    },
7634///    {
7635///      "$ref": "#/$defs/ToolResultContent"
7636///    },
7637///    {
7638///      "type": "array",
7639///      "items": {
7640///        "$ref": "#/$defs/SamplingMessageContentBlock"
7641///      }
7642///    }
7643///  ]
7644///}
7645/// ```
7646/// </details>
7647#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7648#[serde(untagged)]
7649pub enum SamplingMessageContent {
7650    TextContent(TextContent),
7651    ImageContent(ImageContent),
7652    AudioContent(AudioContent),
7653    ToolUseContent(ToolUseContent),
7654    ToolResultContent(ToolResultContent),
7655    SamplingMessageContentBlock(::std::vec::Vec<SamplingMessageContentBlock>),
7656}
7657impl ::std::convert::From<TextContent> for SamplingMessageContent {
7658    fn from(value: TextContent) -> Self {
7659        Self::TextContent(value)
7660    }
7661}
7662impl ::std::convert::From<ImageContent> for SamplingMessageContent {
7663    fn from(value: ImageContent) -> Self {
7664        Self::ImageContent(value)
7665    }
7666}
7667impl ::std::convert::From<AudioContent> for SamplingMessageContent {
7668    fn from(value: AudioContent) -> Self {
7669        Self::AudioContent(value)
7670    }
7671}
7672impl ::std::convert::From<ToolUseContent> for SamplingMessageContent {
7673    fn from(value: ToolUseContent) -> Self {
7674        Self::ToolUseContent(value)
7675    }
7676}
7677impl ::std::convert::From<ToolResultContent> for SamplingMessageContent {
7678    fn from(value: ToolResultContent) -> Self {
7679        Self::ToolResultContent(value)
7680    }
7681}
7682impl ::std::convert::From<::std::vec::Vec<SamplingMessageContentBlock>> for SamplingMessageContent {
7683    fn from(value: ::std::vec::Vec<SamplingMessageContentBlock>) -> Self {
7684        Self::SamplingMessageContentBlock(value)
7685    }
7686}
7687///SamplingMessageContentBlock
7688///
7689/// <details><summary>JSON schema</summary>
7690///
7691/// ```json
7692///{
7693///  "anyOf": [
7694///    {
7695///      "$ref": "#/$defs/TextContent"
7696///    },
7697///    {
7698///      "$ref": "#/$defs/ImageContent"
7699///    },
7700///    {
7701///      "$ref": "#/$defs/AudioContent"
7702///    },
7703///    {
7704///      "$ref": "#/$defs/ToolUseContent"
7705///    },
7706///    {
7707///      "$ref": "#/$defs/ToolResultContent"
7708///    }
7709///  ]
7710///}
7711/// ```
7712/// </details>
7713#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7714#[serde(untagged)]
7715pub enum SamplingMessageContentBlock {
7716    TextContent(TextContent),
7717    ImageContent(ImageContent),
7718    AudioContent(AudioContent),
7719    ToolUseContent(ToolUseContent),
7720    ToolResultContent(ToolResultContent),
7721}
7722impl ::std::convert::From<TextContent> for SamplingMessageContentBlock {
7723    fn from(value: TextContent) -> Self {
7724        Self::TextContent(value)
7725    }
7726}
7727impl ::std::convert::From<ImageContent> for SamplingMessageContentBlock {
7728    fn from(value: ImageContent) -> Self {
7729        Self::ImageContent(value)
7730    }
7731}
7732impl ::std::convert::From<AudioContent> for SamplingMessageContentBlock {
7733    fn from(value: AudioContent) -> Self {
7734        Self::AudioContent(value)
7735    }
7736}
7737impl ::std::convert::From<ToolUseContent> for SamplingMessageContentBlock {
7738    fn from(value: ToolUseContent) -> Self {
7739        Self::ToolUseContent(value)
7740    }
7741}
7742impl ::std::convert::From<ToolResultContent> for SamplingMessageContentBlock {
7743    fn from(value: ToolResultContent) -> Self {
7744        Self::ToolResultContent(value)
7745    }
7746}
7747///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.
7748///
7749/// <details><summary>JSON schema</summary>
7750///
7751/// ```json
7752///{
7753///  "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.",
7754///  "type": "object",
7755///  "properties": {
7756///    "completions": {
7757///      "description": "Present if the server supports argument autocompletion suggestions.",
7758///      "type": "object",
7759///      "additionalProperties": true
7760///    },
7761///    "experimental": {
7762///      "description": "Experimental, non-standard capabilities that the server supports.",
7763///      "type": "object",
7764///      "additionalProperties": {
7765///        "type": "object",
7766///        "additionalProperties": true
7767///      }
7768///    },
7769///    "logging": {
7770///      "description": "Present if the server supports sending log messages to the client.",
7771///      "type": "object",
7772///      "additionalProperties": true
7773///    },
7774///    "prompts": {
7775///      "description": "Present if the server offers any prompt templates.",
7776///      "type": "object",
7777///      "properties": {
7778///        "listChanged": {
7779///          "description": "Whether this server supports notifications for changes to the prompt list.",
7780///          "type": "boolean"
7781///        }
7782///      }
7783///    },
7784///    "resources": {
7785///      "description": "Present if the server offers any resources to read.",
7786///      "type": "object",
7787///      "properties": {
7788///        "listChanged": {
7789///          "description": "Whether this server supports notifications for changes to the resource list.",
7790///          "type": "boolean"
7791///        },
7792///        "subscribe": {
7793///          "description": "Whether this server supports subscribing to resource updates.",
7794///          "type": "boolean"
7795///        }
7796///      }
7797///    },
7798///    "tasks": {
7799///      "description": "Present if the server supports task-augmented requests.",
7800///      "type": "object",
7801///      "properties": {
7802///        "cancel": {
7803///          "description": "Whether this server supports tasks/cancel.",
7804///          "type": "object",
7805///          "additionalProperties": true
7806///        },
7807///        "list": {
7808///          "description": "Whether this server supports tasks/list.",
7809///          "type": "object",
7810///          "additionalProperties": true
7811///        },
7812///        "requests": {
7813///          "description": "Specifies which request types can be augmented with tasks.",
7814///          "type": "object",
7815///          "properties": {
7816///            "tools": {
7817///              "description": "Task support for tool-related requests.",
7818///              "type": "object",
7819///              "properties": {
7820///                "call": {
7821///                  "description": "Whether the server supports task-augmented tools/call requests.",
7822///                  "type": "object",
7823///                  "additionalProperties": true
7824///                }
7825///              }
7826///            }
7827///          }
7828///        }
7829///      }
7830///    },
7831///    "tools": {
7832///      "description": "Present if the server offers any tools to call.",
7833///      "type": "object",
7834///      "properties": {
7835///        "listChanged": {
7836///          "description": "Whether this server supports notifications for changes to the tool list.",
7837///          "type": "boolean"
7838///        }
7839///      }
7840///    }
7841///  }
7842///}
7843/// ```
7844/// </details>
7845#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
7846pub struct ServerCapabilities {
7847    ///Present if the server supports argument autocompletion suggestions.
7848    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7849    pub completions: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7850    ///Experimental, non-standard capabilities that the server supports.
7851    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7852    pub experimental: ::std::option::Option<
7853        ::std::collections::HashMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7854    >,
7855    ///Present if the server supports sending log messages to the client.
7856    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7857    pub logging: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7858    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7859    pub prompts: ::std::option::Option<ServerCapabilitiesPrompts>,
7860    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7861    pub resources: ::std::option::Option<ServerCapabilitiesResources>,
7862    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7863    pub tasks: ::std::option::Option<ServerTasks>,
7864    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7865    pub tools: ::std::option::Option<ServerCapabilitiesTools>,
7866}
7867///Present if the server offers any prompt templates.
7868///
7869/// <details><summary>JSON schema</summary>
7870///
7871/// ```json
7872///{
7873///  "description": "Present if the server offers any prompt templates.",
7874///  "type": "object",
7875///  "properties": {
7876///    "listChanged": {
7877///      "description": "Whether this server supports notifications for changes to the prompt list.",
7878///      "type": "boolean"
7879///    }
7880///  }
7881///}
7882/// ```
7883/// </details>
7884#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
7885pub struct ServerCapabilitiesPrompts {
7886    ///Whether this server supports notifications for changes to the prompt list.
7887    #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
7888    pub list_changed: ::std::option::Option<bool>,
7889}
7890///Present if the server offers any resources to read.
7891///
7892/// <details><summary>JSON schema</summary>
7893///
7894/// ```json
7895///{
7896///  "description": "Present if the server offers any resources to read.",
7897///  "type": "object",
7898///  "properties": {
7899///    "listChanged": {
7900///      "description": "Whether this server supports notifications for changes to the resource list.",
7901///      "type": "boolean"
7902///    },
7903///    "subscribe": {
7904///      "description": "Whether this server supports subscribing to resource updates.",
7905///      "type": "boolean"
7906///    }
7907///  }
7908///}
7909/// ```
7910/// </details>
7911#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
7912pub struct ServerCapabilitiesResources {
7913    ///Whether this server supports notifications for changes to the resource list.
7914    #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
7915    pub list_changed: ::std::option::Option<bool>,
7916    ///Whether this server supports subscribing to resource updates.
7917    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7918    pub subscribe: ::std::option::Option<bool>,
7919}
7920///Present if the server offers any tools to call.
7921///
7922/// <details><summary>JSON schema</summary>
7923///
7924/// ```json
7925///{
7926///  "description": "Present if the server offers any tools to call.",
7927///  "type": "object",
7928///  "properties": {
7929///    "listChanged": {
7930///      "description": "Whether this server supports notifications for changes to the tool list.",
7931///      "type": "boolean"
7932///    }
7933///  }
7934///}
7935/// ```
7936/// </details>
7937#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
7938pub struct ServerCapabilitiesTools {
7939    ///Whether this server supports notifications for changes to the tool list.
7940    #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
7941    pub list_changed: ::std::option::Option<bool>,
7942}
7943///ServerNotification
7944///
7945/// <details><summary>JSON schema</summary>
7946///
7947/// ```json
7948///{
7949///  "anyOf": [
7950///    {
7951///      "$ref": "#/$defs/CancelledNotification"
7952///    },
7953///    {
7954///      "$ref": "#/$defs/ProgressNotification"
7955///    },
7956///    {
7957///      "$ref": "#/$defs/ResourceListChangedNotification"
7958///    },
7959///    {
7960///      "$ref": "#/$defs/ResourceUpdatedNotification"
7961///    },
7962///    {
7963///      "$ref": "#/$defs/PromptListChangedNotification"
7964///    },
7965///    {
7966///      "$ref": "#/$defs/ToolListChangedNotification"
7967///    },
7968///    {
7969///      "$ref": "#/$defs/TaskStatusNotification"
7970///    },
7971///    {
7972///      "$ref": "#/$defs/LoggingMessageNotification"
7973///    },
7974///    {
7975///      "$ref": "#/$defs/ElicitationCompleteNotification"
7976///    }
7977///  ]
7978///}
7979/// ```
7980/// </details>
7981#[derive(::serde::Serialize, Clone, Debug)]
7982#[serde(untagged)]
7983pub enum ServerNotification {
7984    CancelledNotification(CancelledNotification),
7985    ProgressNotification(ProgressNotification),
7986    ResourceListChangedNotification(ResourceListChangedNotification),
7987    ResourceUpdatedNotification(ResourceUpdatedNotification),
7988    PromptListChangedNotification(PromptListChangedNotification),
7989    ToolListChangedNotification(ToolListChangedNotification),
7990    TaskStatusNotification(TaskStatusNotification),
7991    LoggingMessageNotification(LoggingMessageNotification),
7992    ElicitationCompleteNotification(ElicitationCompleteNotification),
7993}
7994impl ::std::convert::From<CancelledNotification> for ServerNotification {
7995    fn from(value: CancelledNotification) -> Self {
7996        Self::CancelledNotification(value)
7997    }
7998}
7999impl ::std::convert::From<ProgressNotification> for ServerNotification {
8000    fn from(value: ProgressNotification) -> Self {
8001        Self::ProgressNotification(value)
8002    }
8003}
8004impl ::std::convert::From<ResourceListChangedNotification> for ServerNotification {
8005    fn from(value: ResourceListChangedNotification) -> Self {
8006        Self::ResourceListChangedNotification(value)
8007    }
8008}
8009impl ::std::convert::From<ResourceUpdatedNotification> for ServerNotification {
8010    fn from(value: ResourceUpdatedNotification) -> Self {
8011        Self::ResourceUpdatedNotification(value)
8012    }
8013}
8014impl ::std::convert::From<PromptListChangedNotification> for ServerNotification {
8015    fn from(value: PromptListChangedNotification) -> Self {
8016        Self::PromptListChangedNotification(value)
8017    }
8018}
8019impl ::std::convert::From<ToolListChangedNotification> for ServerNotification {
8020    fn from(value: ToolListChangedNotification) -> Self {
8021        Self::ToolListChangedNotification(value)
8022    }
8023}
8024impl ::std::convert::From<TaskStatusNotification> for ServerNotification {
8025    fn from(value: TaskStatusNotification) -> Self {
8026        Self::TaskStatusNotification(value)
8027    }
8028}
8029impl ::std::convert::From<LoggingMessageNotification> for ServerNotification {
8030    fn from(value: LoggingMessageNotification) -> Self {
8031        Self::LoggingMessageNotification(value)
8032    }
8033}
8034impl ::std::convert::From<ElicitationCompleteNotification> for ServerNotification {
8035    fn from(value: ElicitationCompleteNotification) -> Self {
8036        Self::ElicitationCompleteNotification(value)
8037    }
8038}
8039///ServerRequest
8040///
8041/// <details><summary>JSON schema</summary>
8042///
8043/// ```json
8044///{
8045///  "anyOf": [
8046///    {
8047///      "$ref": "#/$defs/PingRequest"
8048///    },
8049///    {
8050///      "$ref": "#/$defs/GetTaskRequest"
8051///    },
8052///    {
8053///      "$ref": "#/$defs/GetTaskPayloadRequest"
8054///    },
8055///    {
8056///      "$ref": "#/$defs/CancelTaskRequest"
8057///    },
8058///    {
8059///      "$ref": "#/$defs/ListTasksRequest"
8060///    },
8061///    {
8062///      "$ref": "#/$defs/CreateMessageRequest"
8063///    },
8064///    {
8065///      "$ref": "#/$defs/ListRootsRequest"
8066///    },
8067///    {
8068///      "$ref": "#/$defs/ElicitRequest"
8069///    }
8070///  ]
8071///}
8072/// ```
8073/// </details>
8074#[derive(::serde::Serialize, Clone, Debug)]
8075#[serde(untagged)]
8076#[allow(clippy::large_enum_variant)]
8077pub enum ServerRequest {
8078    PingRequest(PingRequest),
8079    GetTaskRequest(GetTaskRequest),
8080    GetTaskPayloadRequest(GetTaskPayloadRequest),
8081    CancelTaskRequest(CancelTaskRequest),
8082    ListTasksRequest(ListTasksRequest),
8083    CreateMessageRequest(CreateMessageRequest),
8084    ListRootsRequest(ListRootsRequest),
8085    ElicitRequest(ElicitRequest),
8086}
8087impl ::std::convert::From<PingRequest> for ServerRequest {
8088    fn from(value: PingRequest) -> Self {
8089        Self::PingRequest(value)
8090    }
8091}
8092impl ::std::convert::From<GetTaskRequest> for ServerRequest {
8093    fn from(value: GetTaskRequest) -> Self {
8094        Self::GetTaskRequest(value)
8095    }
8096}
8097impl ::std::convert::From<GetTaskPayloadRequest> for ServerRequest {
8098    fn from(value: GetTaskPayloadRequest) -> Self {
8099        Self::GetTaskPayloadRequest(value)
8100    }
8101}
8102impl ::std::convert::From<CancelTaskRequest> for ServerRequest {
8103    fn from(value: CancelTaskRequest) -> Self {
8104        Self::CancelTaskRequest(value)
8105    }
8106}
8107impl ::std::convert::From<ListTasksRequest> for ServerRequest {
8108    fn from(value: ListTasksRequest) -> Self {
8109        Self::ListTasksRequest(value)
8110    }
8111}
8112impl ::std::convert::From<CreateMessageRequest> for ServerRequest {
8113    fn from(value: CreateMessageRequest) -> Self {
8114        Self::CreateMessageRequest(value)
8115    }
8116}
8117impl ::std::convert::From<ListRootsRequest> for ServerRequest {
8118    fn from(value: ListRootsRequest) -> Self {
8119        Self::ListRootsRequest(value)
8120    }
8121}
8122impl ::std::convert::From<ElicitRequest> for ServerRequest {
8123    fn from(value: ElicitRequest) -> Self {
8124        Self::ElicitRequest(value)
8125    }
8126}
8127///ServerResult
8128///
8129/// <details><summary>JSON schema</summary>
8130///
8131/// ```json
8132///{
8133///  "anyOf": [
8134///    {
8135///      "$ref": "#/$defs/Result"
8136///    },
8137///    {
8138///      "$ref": "#/$defs/InitializeResult"
8139///    },
8140///    {
8141///      "$ref": "#/$defs/ListResourcesResult"
8142///    },
8143///    {
8144///      "$ref": "#/$defs/ListResourceTemplatesResult"
8145///    },
8146///    {
8147///      "$ref": "#/$defs/ReadResourceResult"
8148///    },
8149///    {
8150///      "$ref": "#/$defs/ListPromptsResult"
8151///    },
8152///    {
8153///      "$ref": "#/$defs/GetPromptResult"
8154///    },
8155///    {
8156///      "$ref": "#/$defs/ListToolsResult"
8157///    },
8158///    {
8159///      "$ref": "#/$defs/CallToolResult"
8160///    },
8161///    {
8162///      "description": "The response to a tasks/get request.",
8163///      "$ref": "#/$defs/GetTaskResult"
8164///    },
8165///    {
8166///      "$ref": "#/$defs/GetTaskPayloadResult"
8167///    },
8168///    {
8169///      "description": "The response to a tasks/cancel request.",
8170///      "$ref": "#/$defs/CancelTaskResult"
8171///    },
8172///    {
8173///      "$ref": "#/$defs/ListTasksResult"
8174///    },
8175///    {
8176///      "$ref": "#/$defs/CompleteResult"
8177///    }
8178///  ]
8179///}
8180/// ```
8181/// </details>
8182#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8183#[serde(untagged)]
8184#[allow(clippy::large_enum_variant)]
8185pub enum ServerResult {
8186    InitializeResult(InitializeResult),
8187    ListResourcesResult(ListResourcesResult),
8188    ListResourceTemplatesResult(ListResourceTemplatesResult),
8189    ReadResourceResult(ReadResourceResult),
8190    ListPromptsResult(ListPromptsResult),
8191    GetPromptResult(GetPromptResult),
8192    ListToolsResult(ListToolsResult),
8193    CallToolResult(CallToolResult),
8194    GetTaskResult(GetTaskResult),
8195    GetTaskPayloadResult(GetTaskPayloadResult),
8196    CancelTaskResult(CancelTaskResult),
8197    ListTasksResult(ListTasksResult),
8198    CompleteResult(CompleteResult),
8199    Result(Result),
8200}
8201impl ::std::convert::From<InitializeResult> for ServerResult {
8202    fn from(value: InitializeResult) -> Self {
8203        Self::InitializeResult(value)
8204    }
8205}
8206impl ::std::convert::From<ListResourcesResult> for ServerResult {
8207    fn from(value: ListResourcesResult) -> Self {
8208        Self::ListResourcesResult(value)
8209    }
8210}
8211impl ::std::convert::From<ListResourceTemplatesResult> for ServerResult {
8212    fn from(value: ListResourceTemplatesResult) -> Self {
8213        Self::ListResourceTemplatesResult(value)
8214    }
8215}
8216impl ::std::convert::From<ReadResourceResult> for ServerResult {
8217    fn from(value: ReadResourceResult) -> Self {
8218        Self::ReadResourceResult(value)
8219    }
8220}
8221impl ::std::convert::From<ListPromptsResult> for ServerResult {
8222    fn from(value: ListPromptsResult) -> Self {
8223        Self::ListPromptsResult(value)
8224    }
8225}
8226impl ::std::convert::From<GetPromptResult> for ServerResult {
8227    fn from(value: GetPromptResult) -> Self {
8228        Self::GetPromptResult(value)
8229    }
8230}
8231impl ::std::convert::From<ListToolsResult> for ServerResult {
8232    fn from(value: ListToolsResult) -> Self {
8233        Self::ListToolsResult(value)
8234    }
8235}
8236impl ::std::convert::From<CallToolResult> for ServerResult {
8237    fn from(value: CallToolResult) -> Self {
8238        Self::CallToolResult(value)
8239    }
8240}
8241impl ::std::convert::From<GetTaskResult> for ServerResult {
8242    fn from(value: GetTaskResult) -> Self {
8243        Self::GetTaskResult(value)
8244    }
8245}
8246impl ::std::convert::From<GetTaskPayloadResult> for ServerResult {
8247    fn from(value: GetTaskPayloadResult) -> Self {
8248        Self::GetTaskPayloadResult(value)
8249    }
8250}
8251impl ::std::convert::From<CancelTaskResult> for ServerResult {
8252    fn from(value: CancelTaskResult) -> Self {
8253        Self::CancelTaskResult(value)
8254    }
8255}
8256impl ::std::convert::From<ListTasksResult> for ServerResult {
8257    fn from(value: ListTasksResult) -> Self {
8258        Self::ListTasksResult(value)
8259    }
8260}
8261impl ::std::convert::From<CompleteResult> for ServerResult {
8262    fn from(value: CompleteResult) -> Self {
8263        Self::CompleteResult(value)
8264    }
8265}
8266impl ::std::convert::From<Result> for ServerResult {
8267    fn from(value: Result) -> Self {
8268        Self::Result(value)
8269    }
8270}
8271///Specifies which request types can be augmented with tasks.
8272///
8273/// <details><summary>JSON schema</summary>
8274///
8275/// ```json
8276///{
8277///  "description": "Specifies which request types can be augmented with tasks.",
8278///  "type": "object",
8279///  "properties": {
8280///    "tools": {
8281///      "description": "Task support for tool-related requests.",
8282///      "type": "object",
8283///      "properties": {
8284///        "call": {
8285///          "description": "Whether the server supports task-augmented tools/call requests.",
8286///          "type": "object",
8287///          "additionalProperties": true
8288///        }
8289///      }
8290///    }
8291///  }
8292///}
8293/// ```
8294/// </details>
8295#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
8296pub struct ServerTaskRequest {
8297    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8298    pub tools: ::std::option::Option<ServerTaskTools>,
8299}
8300///Task support for tool-related requests.
8301///
8302/// <details><summary>JSON schema</summary>
8303///
8304/// ```json
8305///{
8306///  "description": "Task support for tool-related requests.",
8307///  "type": "object",
8308///  "properties": {
8309///    "call": {
8310///      "description": "Whether the server supports task-augmented tools/call requests.",
8311///      "type": "object",
8312///      "additionalProperties": true
8313///    }
8314///  }
8315///}
8316/// ```
8317/// </details>
8318#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
8319pub struct ServerTaskTools {
8320    ///Whether the server supports task-augmented tools/call requests.
8321    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8322    pub call: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
8323}
8324///Present if the server supports task-augmented requests.
8325///
8326/// <details><summary>JSON schema</summary>
8327///
8328/// ```json
8329///{
8330///  "description": "Present if the server supports task-augmented requests.",
8331///  "type": "object",
8332///  "properties": {
8333///    "cancel": {
8334///      "description": "Whether this server supports tasks/cancel.",
8335///      "type": "object",
8336///      "additionalProperties": true
8337///    },
8338///    "list": {
8339///      "description": "Whether this server supports tasks/list.",
8340///      "type": "object",
8341///      "additionalProperties": true
8342///    },
8343///    "requests": {
8344///      "description": "Specifies which request types can be augmented with tasks.",
8345///      "type": "object",
8346///      "properties": {
8347///        "tools": {
8348///          "description": "Task support for tool-related requests.",
8349///          "type": "object",
8350///          "properties": {
8351///            "call": {
8352///              "description": "Whether the server supports task-augmented tools/call requests.",
8353///              "type": "object",
8354///              "additionalProperties": true
8355///            }
8356///          }
8357///        }
8358///      }
8359///    }
8360///  }
8361///}
8362/// ```
8363/// </details>
8364#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
8365pub struct ServerTasks {
8366    ///Whether this server supports tasks/cancel.
8367    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8368    pub cancel: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
8369    ///Whether this server supports tasks/list.
8370    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8371    pub list: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
8372    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8373    pub requests: ::std::option::Option<ServerTaskRequest>,
8374}
8375///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
8376///
8377/// <details><summary>JSON schema</summary>
8378///
8379/// ```json
8380///{
8381///  "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
8382///  "type": "object",
8383///  "properties": {
8384///    "progressToken": {
8385///      "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.",
8386///      "$ref": "#/$defs/ProgressToken"
8387///    }
8388///  },
8389///  "additionalProperties": {}
8390///}
8391/// ```
8392/// </details>
8393#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
8394pub struct SetLevelMeta {
8395    ///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.
8396    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
8397    pub progress_token: ::std::option::Option<ProgressToken>,
8398    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
8399    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
8400}
8401///A request from the client to the server, to enable or adjust logging.
8402///
8403/// <details><summary>JSON schema</summary>
8404///
8405/// ```json
8406///{
8407///  "description": "A request from the client to the server, to enable or adjust logging.",
8408///  "type": "object",
8409///  "required": [
8410///    "id",
8411///    "jsonrpc",
8412///    "method",
8413///    "params"
8414///  ],
8415///  "properties": {
8416///    "id": {
8417///      "$ref": "#/$defs/RequestId"
8418///    },
8419///    "jsonrpc": {
8420///      "type": "string",
8421///      "const": "2.0"
8422///    },
8423///    "method": {
8424///      "type": "string",
8425///      "const": "logging/setLevel"
8426///    },
8427///    "params": {
8428///      "$ref": "#/$defs/SetLevelRequestParams"
8429///    }
8430///  }
8431///}
8432/// ```
8433/// </details>
8434#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8435pub struct SetLevelRequest {
8436    pub id: RequestId,
8437    #[serde(deserialize_with = "validate::set_level_request_jsonrpc")]
8438    jsonrpc: ::std::string::String,
8439    #[serde(deserialize_with = "validate::set_level_request_method")]
8440    method: ::std::string::String,
8441    pub params: SetLevelRequestParams,
8442}
8443impl SetLevelRequest {
8444    pub fn new(id: RequestId, params: SetLevelRequestParams) -> Self {
8445        Self {
8446            id,
8447            jsonrpc: JSONRPC_VERSION.to_string(),
8448            method: "logging/setLevel".to_string(),
8449            params,
8450        }
8451    }
8452    pub fn jsonrpc(&self) -> &::std::string::String {
8453        &self.jsonrpc
8454    }
8455    pub fn method(&self) -> &::std::string::String {
8456        &self.method
8457    }
8458    /// returns "logging/setLevel"
8459    pub fn method_value() -> ::std::string::String {
8460        "logging/setLevel".to_string()
8461    }
8462    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
8463    pub fn method_name() -> ::std::string::String {
8464        "logging/setLevel".to_string()
8465    }
8466}
8467///Parameters for a logging/setLevel request.
8468///
8469/// <details><summary>JSON schema</summary>
8470///
8471/// ```json
8472///{
8473///  "description": "Parameters for a logging/setLevel request.",
8474///  "type": "object",
8475///  "required": [
8476///    "level"
8477///  ],
8478///  "properties": {
8479///    "_meta": {
8480///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
8481///      "type": "object",
8482///      "properties": {
8483///        "progressToken": {
8484///          "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.",
8485///          "$ref": "#/$defs/ProgressToken"
8486///        }
8487///      },
8488///      "additionalProperties": {}
8489///    },
8490///    "level": {
8491///      "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.",
8492///      "$ref": "#/$defs/LoggingLevel"
8493///    }
8494///  }
8495///}
8496/// ```
8497/// </details>
8498#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8499pub struct SetLevelRequestParams {
8500    ///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.
8501    pub level: LoggingLevel,
8502    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
8503    pub meta: ::std::option::Option<SetLevelMeta>,
8504}
8505///SingleSelectEnumSchema
8506///
8507/// <details><summary>JSON schema</summary>
8508///
8509/// ```json
8510///{
8511///  "anyOf": [
8512///    {
8513///      "$ref": "#/$defs/UntitledSingleSelectEnumSchema"
8514///    },
8515///    {
8516///      "$ref": "#/$defs/TitledSingleSelectEnumSchema"
8517///    }
8518///  ]
8519///}
8520/// ```
8521/// </details>
8522#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8523#[serde(untagged)]
8524pub enum SingleSelectEnumSchema {
8525    UntitledSingleSelectEnumSchema(UntitledSingleSelectEnumSchema),
8526    TitledSingleSelectEnumSchema(TitledSingleSelectEnumSchema),
8527}
8528impl ::std::convert::From<UntitledSingleSelectEnumSchema> for SingleSelectEnumSchema {
8529    fn from(value: UntitledSingleSelectEnumSchema) -> Self {
8530        Self::UntitledSingleSelectEnumSchema(value)
8531    }
8532}
8533impl ::std::convert::From<TitledSingleSelectEnumSchema> for SingleSelectEnumSchema {
8534    fn from(value: TitledSingleSelectEnumSchema) -> Self {
8535        Self::TitledSingleSelectEnumSchema(value)
8536    }
8537}
8538///StringSchema
8539///
8540/// <details><summary>JSON schema</summary>
8541///
8542/// ```json
8543///{
8544///  "type": "object",
8545///  "required": [
8546///    "type"
8547///  ],
8548///  "properties": {
8549///    "default": {
8550///      "type": "string"
8551///    },
8552///    "description": {
8553///      "type": "string"
8554///    },
8555///    "format": {
8556///      "type": "string",
8557///      "enum": [
8558///        "date",
8559///        "date-time",
8560///        "email",
8561///        "uri"
8562///      ]
8563///    },
8564///    "maxLength": {
8565///      "type": "integer"
8566///    },
8567///    "minLength": {
8568///      "type": "integer"
8569///    },
8570///    "title": {
8571///      "type": "string"
8572///    },
8573///    "type": {
8574///      "type": "string",
8575///      "const": "string"
8576///    }
8577///  }
8578///}
8579/// ```
8580/// </details>
8581#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8582pub struct StringSchema {
8583    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8584    pub default: ::std::option::Option<::std::string::String>,
8585    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8586    pub description: ::std::option::Option<::std::string::String>,
8587    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8588    pub format: ::std::option::Option<StringSchemaFormat>,
8589    #[serde(rename = "maxLength", default, skip_serializing_if = "::std::option::Option::is_none")]
8590    pub max_length: ::std::option::Option<i64>,
8591    #[serde(rename = "minLength", default, skip_serializing_if = "::std::option::Option::is_none")]
8592    pub min_length: ::std::option::Option<i64>,
8593    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8594    pub title: ::std::option::Option<::std::string::String>,
8595    #[serde(rename = "type", deserialize_with = "validate::string_schema_type_")]
8596    type_: ::std::string::String,
8597}
8598impl StringSchema {
8599    pub fn new(
8600        default: ::std::option::Option<::std::string::String>,
8601        description: ::std::option::Option<::std::string::String>,
8602        format: ::std::option::Option<StringSchemaFormat>,
8603        max_length: ::std::option::Option<i64>,
8604        min_length: ::std::option::Option<i64>,
8605        title: ::std::option::Option<::std::string::String>,
8606    ) -> Self {
8607        Self {
8608            default,
8609            description,
8610            format,
8611            max_length,
8612            min_length,
8613            title,
8614            type_: "string".to_string(),
8615        }
8616    }
8617    pub fn type_(&self) -> &::std::string::String {
8618        &self.type_
8619    }
8620    /// returns "string"
8621    pub fn type_value() -> ::std::string::String {
8622        "string".to_string()
8623    }
8624    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
8625    pub fn type_name() -> ::std::string::String {
8626        "string".to_string()
8627    }
8628}
8629///StringSchemaFormat
8630///
8631/// <details><summary>JSON schema</summary>
8632///
8633/// ```json
8634///{
8635///  "type": "string",
8636///  "enum": [
8637///    "date",
8638///    "date-time",
8639///    "email",
8640///    "uri"
8641///  ]
8642///}
8643/// ```
8644/// </details>
8645#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
8646pub enum StringSchemaFormat {
8647    #[serde(rename = "date")]
8648    Date,
8649    #[serde(rename = "date-time")]
8650    DateTime,
8651    #[serde(rename = "email")]
8652    Email,
8653    #[serde(rename = "uri")]
8654    Uri,
8655}
8656impl ::std::fmt::Display for StringSchemaFormat {
8657    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
8658        match *self {
8659            Self::Date => write!(f, "date"),
8660            Self::DateTime => write!(f, "date-time"),
8661            Self::Email => write!(f, "email"),
8662            Self::Uri => write!(f, "uri"),
8663        }
8664    }
8665}
8666///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
8667///
8668/// <details><summary>JSON schema</summary>
8669///
8670/// ```json
8671///{
8672///  "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
8673///  "type": "object",
8674///  "properties": {
8675///    "progressToken": {
8676///      "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.",
8677///      "$ref": "#/$defs/ProgressToken"
8678///    }
8679///  },
8680///  "additionalProperties": {}
8681///}
8682/// ```
8683/// </details>
8684#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
8685pub struct SubscribeMeta {
8686    ///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.
8687    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
8688    pub progress_token: ::std::option::Option<ProgressToken>,
8689    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
8690    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
8691}
8692///Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
8693///
8694/// <details><summary>JSON schema</summary>
8695///
8696/// ```json
8697///{
8698///  "description": "Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.",
8699///  "type": "object",
8700///  "required": [
8701///    "id",
8702///    "jsonrpc",
8703///    "method",
8704///    "params"
8705///  ],
8706///  "properties": {
8707///    "id": {
8708///      "$ref": "#/$defs/RequestId"
8709///    },
8710///    "jsonrpc": {
8711///      "type": "string",
8712///      "const": "2.0"
8713///    },
8714///    "method": {
8715///      "type": "string",
8716///      "const": "resources/subscribe"
8717///    },
8718///    "params": {
8719///      "$ref": "#/$defs/SubscribeRequestParams"
8720///    }
8721///  }
8722///}
8723/// ```
8724/// </details>
8725#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8726pub struct SubscribeRequest {
8727    pub id: RequestId,
8728    #[serde(deserialize_with = "validate::subscribe_request_jsonrpc")]
8729    jsonrpc: ::std::string::String,
8730    #[serde(deserialize_with = "validate::subscribe_request_method")]
8731    method: ::std::string::String,
8732    pub params: SubscribeRequestParams,
8733}
8734impl SubscribeRequest {
8735    pub fn new(id: RequestId, params: SubscribeRequestParams) -> Self {
8736        Self {
8737            id,
8738            jsonrpc: JSONRPC_VERSION.to_string(),
8739            method: "resources/subscribe".to_string(),
8740            params,
8741        }
8742    }
8743    pub fn jsonrpc(&self) -> &::std::string::String {
8744        &self.jsonrpc
8745    }
8746    pub fn method(&self) -> &::std::string::String {
8747        &self.method
8748    }
8749    /// returns "resources/subscribe"
8750    pub fn method_value() -> ::std::string::String {
8751        "resources/subscribe".to_string()
8752    }
8753    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
8754    pub fn method_name() -> ::std::string::String {
8755        "resources/subscribe".to_string()
8756    }
8757}
8758///Parameters for a resources/subscribe request.
8759///
8760/// <details><summary>JSON schema</summary>
8761///
8762/// ```json
8763///{
8764///  "description": "Parameters for a resources/subscribe request.",
8765///  "type": "object",
8766///  "required": [
8767///    "uri"
8768///  ],
8769///  "properties": {
8770///    "_meta": {
8771///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
8772///      "type": "object",
8773///      "properties": {
8774///        "progressToken": {
8775///          "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.",
8776///          "$ref": "#/$defs/ProgressToken"
8777///        }
8778///      },
8779///      "additionalProperties": {}
8780///    },
8781///    "uri": {
8782///      "description": "The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.",
8783///      "type": "string",
8784///      "format": "uri"
8785///    }
8786///  }
8787///}
8788/// ```
8789/// </details>
8790#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8791pub struct SubscribeRequestParams {
8792    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
8793    pub meta: ::std::option::Option<SubscribeMeta>,
8794    ///The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.
8795    pub uri: ::std::string::String,
8796}
8797///Data associated with a task.
8798///
8799/// <details><summary>JSON schema</summary>
8800///
8801/// ```json
8802///{
8803///  "description": "Data associated with a task.",
8804///  "type": "object",
8805///  "required": [
8806///    "createdAt",
8807///    "lastUpdatedAt",
8808///    "status",
8809///    "taskId",
8810///    "ttl"
8811///  ],
8812///  "properties": {
8813///    "createdAt": {
8814///      "description": "ISO 8601 timestamp when the task was created.",
8815///      "type": "string"
8816///    },
8817///    "lastUpdatedAt": {
8818///      "description": "ISO 8601 timestamp when the task was last updated.",
8819///      "type": "string"
8820///    },
8821///    "pollInterval": {
8822///      "description": "Suggested polling interval in milliseconds.",
8823///      "type": "integer"
8824///    },
8825///    "status": {
8826///      "$ref": "#/$defs/TaskStatus"
8827///    },
8828///    "statusMessage": {
8829///      "description": "Optional human-readable message describing the current task state.\nThis can provide context for any status, including:\n- Reasons for \"cancelled\" status\n- Summaries for \"completed\" status\n- Diagnostic information for \"failed\" status (e.g., error details, what went wrong)",
8830///      "type": "string"
8831///    },
8832///    "taskId": {
8833///      "description": "The task identifier.",
8834///      "type": "string"
8835///    },
8836///    "ttl": {
8837///      "description": "Actual retention duration from creation in milliseconds, null for unlimited.",
8838///      "type": "integer"
8839///    }
8840///  }
8841///}
8842/// ```
8843/// </details>
8844#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8845pub struct Task {
8846    ///ISO 8601 timestamp when the task was created.
8847    #[serde(rename = "createdAt")]
8848    pub created_at: ::std::string::String,
8849    ///ISO 8601 timestamp when the task was last updated.
8850    #[serde(rename = "lastUpdatedAt")]
8851    pub last_updated_at: ::std::string::String,
8852    ///Suggested polling interval in milliseconds.
8853    #[serde(rename = "pollInterval", default, skip_serializing_if = "::std::option::Option::is_none")]
8854    pub poll_interval: ::std::option::Option<i64>,
8855    pub status: TaskStatus,
8856    /**Optional human-readable message describing the current task state.
8857    This can provide context for any status, including:
8858    - Reasons for "cancelled" status
8859    - Summaries for "completed" status
8860    - Diagnostic information for "failed" status (e.g., error details, what went wrong)*/
8861    #[serde(rename = "statusMessage", default, skip_serializing_if = "::std::option::Option::is_none")]
8862    pub status_message: ::std::option::Option<::std::string::String>,
8863    ///The task identifier.
8864    #[serde(rename = "taskId")]
8865    pub task_id: ::std::string::String,
8866    ///Actual retention duration from creation in milliseconds, null for unlimited.
8867    pub ttl: i64,
8868}
8869///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
8870///
8871/// <details><summary>JSON schema</summary>
8872///
8873/// ```json
8874///{
8875///  "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
8876///  "type": "object",
8877///  "properties": {
8878///    "progressToken": {
8879///      "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.",
8880///      "$ref": "#/$defs/ProgressToken"
8881///    }
8882///  },
8883///  "additionalProperties": {}
8884///}
8885/// ```
8886/// </details>
8887#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
8888pub struct TaskAugmentedMeta {
8889    ///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.
8890    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
8891    pub progress_token: ::std::option::Option<ProgressToken>,
8892    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
8893    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
8894}
8895///Common params for any task-augmented request.
8896///
8897/// <details><summary>JSON schema</summary>
8898///
8899/// ```json
8900///{
8901///  "description": "Common params for any task-augmented request.",
8902///  "type": "object",
8903///  "properties": {
8904///    "_meta": {
8905///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
8906///      "type": "object",
8907///      "properties": {
8908///        "progressToken": {
8909///          "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.",
8910///          "$ref": "#/$defs/ProgressToken"
8911///        }
8912///      },
8913///      "additionalProperties": {}
8914///    },
8915///    "task": {
8916///      "description": "If specified, the caller is requesting task-augmented execution for this request.\nThe request will return a CreateTaskResult immediately, and the actual result can be\nretrieved later via tasks/result.\n\nTask augmentation is subject to capability negotiation - receivers MUST declare support\nfor task augmentation of specific request types in their capabilities.",
8917///      "$ref": "#/$defs/TaskMetadata"
8918///    }
8919///  }
8920///}
8921/// ```
8922/// </details>
8923#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
8924pub struct TaskAugmentedRequestParams {
8925    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
8926    pub meta: ::std::option::Option<TaskAugmentedMeta>,
8927    /**If specified, the caller is requesting task-augmented execution for this request.
8928    The request will return a CreateTaskResult immediately, and the actual result can be
8929    retrieved later via tasks/result.
8930    Task augmentation is subject to capability negotiation - receivers MUST declare support
8931    for task augmentation of specific request types in their capabilities.*/
8932    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8933    pub task: ::std::option::Option<TaskMetadata>,
8934}
8935/**Metadata for augmenting a request with task execution.
8936Include this in the task field of the request parameters.*/
8937///
8938/// <details><summary>JSON schema</summary>
8939///
8940/// ```json
8941///{
8942///  "description": "Metadata for augmenting a request with task execution.\nInclude this in the task field of the request parameters.",
8943///  "type": "object",
8944///  "properties": {
8945///    "ttl": {
8946///      "description": "Requested duration in milliseconds to retain task from creation.",
8947///      "type": "integer"
8948///    }
8949///  }
8950///}
8951/// ```
8952/// </details>
8953#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
8954pub struct TaskMetadata {
8955    ///Requested duration in milliseconds to retain task from creation.
8956    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8957    pub ttl: ::std::option::Option<i64>,
8958}
8959///The status of a task.
8960///
8961/// <details><summary>JSON schema</summary>
8962///
8963/// ```json
8964///{
8965///  "description": "The status of a task.",
8966///  "type": "string",
8967///  "enum": [
8968///    "cancelled",
8969///    "completed",
8970///    "failed",
8971///    "input_required",
8972///    "working"
8973///  ]
8974///}
8975/// ```
8976/// </details>
8977#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
8978pub enum TaskStatus {
8979    #[serde(rename = "cancelled")]
8980    Cancelled,
8981    #[serde(rename = "completed")]
8982    Completed,
8983    #[serde(rename = "failed")]
8984    Failed,
8985    #[serde(rename = "input_required")]
8986    InputRequired,
8987    #[serde(rename = "working")]
8988    Working,
8989}
8990impl ::std::fmt::Display for TaskStatus {
8991    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
8992        match *self {
8993            Self::Cancelled => write!(f, "cancelled"),
8994            Self::Completed => write!(f, "completed"),
8995            Self::Failed => write!(f, "failed"),
8996            Self::InputRequired => write!(f, "input_required"),
8997            Self::Working => write!(f, "working"),
8998        }
8999    }
9000}
9001///An optional notification from the receiver to the requestor, informing them that a task's status has changed. Receivers are not required to send these notifications.
9002///
9003/// <details><summary>JSON schema</summary>
9004///
9005/// ```json
9006///{
9007///  "description": "An optional notification from the receiver to the requestor, informing them that a task's status has changed. Receivers are not required to send these notifications.",
9008///  "type": "object",
9009///  "required": [
9010///    "jsonrpc",
9011///    "method",
9012///    "params"
9013///  ],
9014///  "properties": {
9015///    "jsonrpc": {
9016///      "type": "string",
9017///      "const": "2.0"
9018///    },
9019///    "method": {
9020///      "type": "string",
9021///      "const": "notifications/tasks/status"
9022///    },
9023///    "params": {
9024///      "$ref": "#/$defs/TaskStatusNotificationParams"
9025///    }
9026///  }
9027///}
9028/// ```
9029/// </details>
9030#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9031pub struct TaskStatusNotification {
9032    #[serde(deserialize_with = "validate::task_status_notification_jsonrpc")]
9033    jsonrpc: ::std::string::String,
9034    #[serde(deserialize_with = "validate::task_status_notification_method")]
9035    method: ::std::string::String,
9036    pub params: TaskStatusNotificationParams,
9037}
9038impl TaskStatusNotification {
9039    pub fn new(params: TaskStatusNotificationParams) -> Self {
9040        Self {
9041            jsonrpc: JSONRPC_VERSION.to_string(),
9042            method: "notifications/tasks/status".to_string(),
9043            params,
9044        }
9045    }
9046    pub fn jsonrpc(&self) -> &::std::string::String {
9047        &self.jsonrpc
9048    }
9049    pub fn method(&self) -> &::std::string::String {
9050        &self.method
9051    }
9052    /// returns "notifications/tasks/status"
9053    pub fn method_value() -> ::std::string::String {
9054        "notifications/tasks/status".to_string()
9055    }
9056    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
9057    pub fn method_name() -> ::std::string::String {
9058        "notifications/tasks/status".to_string()
9059    }
9060}
9061///Parameters for a notifications/tasks/status notification.
9062///
9063/// <details><summary>JSON schema</summary>
9064///
9065/// ```json
9066///{
9067///  "description": "Parameters for a notifications/tasks/status notification.",
9068///  "allOf": [
9069///    {
9070///      "$ref": "#/$defs/NotificationParams"
9071///    },
9072///    {
9073///      "$ref": "#/$defs/Task"
9074///    }
9075///  ]
9076///}
9077/// ```
9078/// </details>
9079#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9080pub struct TaskStatusNotificationParams {
9081    ///ISO 8601 timestamp when the task was created.
9082    #[serde(rename = "createdAt")]
9083    pub created_at: ::std::string::String,
9084    ///ISO 8601 timestamp when the task was last updated.
9085    #[serde(rename = "lastUpdatedAt")]
9086    pub last_updated_at: ::std::string::String,
9087    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
9088    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
9089    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
9090    ///Suggested polling interval in milliseconds.
9091    #[serde(rename = "pollInterval", default, skip_serializing_if = "::std::option::Option::is_none")]
9092    pub poll_interval: ::std::option::Option<i64>,
9093    pub status: TaskStatus,
9094    /**Optional human-readable message describing the current task state.
9095    This can provide context for any status, including:
9096    - Reasons for "cancelled" status
9097    - Summaries for "completed" status
9098    - Diagnostic information for "failed" status (e.g., error details, what went wrong)*/
9099    #[serde(rename = "statusMessage", default, skip_serializing_if = "::std::option::Option::is_none")]
9100    pub status_message: ::std::option::Option<::std::string::String>,
9101    ///The task identifier.
9102    #[serde(rename = "taskId")]
9103    pub task_id: ::std::string::String,
9104    ///Actual retention duration from creation in milliseconds, null for unlimited.
9105    pub ttl: i64,
9106}
9107///Text provided to or from an LLM.
9108///
9109/// <details><summary>JSON schema</summary>
9110///
9111/// ```json
9112///{
9113///  "description": "Text provided to or from an LLM.",
9114///  "type": "object",
9115///  "required": [
9116///    "text",
9117///    "type"
9118///  ],
9119///  "properties": {
9120///    "_meta": {
9121///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
9122///      "type": "object",
9123///      "additionalProperties": {}
9124///    },
9125///    "annotations": {
9126///      "description": "Optional annotations for the client.",
9127///      "$ref": "#/$defs/Annotations"
9128///    },
9129///    "text": {
9130///      "description": "The text content of the message.",
9131///      "type": "string"
9132///    },
9133///    "type": {
9134///      "type": "string",
9135///      "const": "text"
9136///    }
9137///  }
9138///}
9139/// ```
9140/// </details>
9141#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9142pub struct TextContent {
9143    ///Optional annotations for the client.
9144    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9145    pub annotations: ::std::option::Option<Annotations>,
9146    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
9147    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
9148    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
9149    ///The text content of the message.
9150    pub text: ::std::string::String,
9151    #[serde(rename = "type", deserialize_with = "validate::text_content_type_")]
9152    type_: ::std::string::String,
9153}
9154impl TextContent {
9155    pub fn new(
9156        text: ::std::string::String,
9157        annotations: ::std::option::Option<Annotations>,
9158        meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
9159    ) -> Self {
9160        Self {
9161            annotations,
9162            meta,
9163            text,
9164            type_: "text".to_string(),
9165        }
9166    }
9167    pub fn type_(&self) -> &::std::string::String {
9168        &self.type_
9169    }
9170    /// returns "text"
9171    pub fn type_value() -> ::std::string::String {
9172        "text".to_string()
9173    }
9174    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
9175    pub fn type_name() -> ::std::string::String {
9176        "text".to_string()
9177    }
9178}
9179///TextResourceContents
9180///
9181/// <details><summary>JSON schema</summary>
9182///
9183/// ```json
9184///{
9185///  "type": "object",
9186///  "required": [
9187///    "text",
9188///    "uri"
9189///  ],
9190///  "properties": {
9191///    "_meta": {
9192///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
9193///      "type": "object",
9194///      "additionalProperties": {}
9195///    },
9196///    "mimeType": {
9197///      "description": "The MIME type of this resource, if known.",
9198///      "type": "string"
9199///    },
9200///    "text": {
9201///      "description": "The text of the item. This must only be set if the item can actually be represented as text (not binary data).",
9202///      "type": "string"
9203///    },
9204///    "uri": {
9205///      "description": "The URI of this resource.",
9206///      "type": "string",
9207///      "format": "uri"
9208///    }
9209///  }
9210///}
9211/// ```
9212/// </details>
9213#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9214pub struct TextResourceContents {
9215    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
9216    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
9217    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
9218    ///The MIME type of this resource, if known.
9219    #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
9220    pub mime_type: ::std::option::Option<::std::string::String>,
9221    ///The text of the item. This must only be set if the item can actually be represented as text (not binary data).
9222    pub text: ::std::string::String,
9223    ///The URI of this resource.
9224    pub uri: ::std::string::String,
9225}
9226///Schema for multiple-selection enumeration with display titles for each option.
9227///
9228/// <details><summary>JSON schema</summary>
9229///
9230/// ```json
9231///{
9232///  "description": "Schema for multiple-selection enumeration with display titles for each option.",
9233///  "type": "object",
9234///  "required": [
9235///    "items",
9236///    "type"
9237///  ],
9238///  "properties": {
9239///    "default": {
9240///      "description": "Optional default value.",
9241///      "type": "array",
9242///      "items": {
9243///        "type": "string"
9244///      }
9245///    },
9246///    "description": {
9247///      "description": "Optional description for the enum field.",
9248///      "type": "string"
9249///    },
9250///    "items": {
9251///      "description": "Schema for array items with enum options and display labels.",
9252///      "type": "object",
9253///      "required": [
9254///        "anyOf"
9255///      ],
9256///      "properties": {
9257///        "anyOf": {
9258///          "description": "Array of enum options with values and display labels.",
9259///          "type": "array",
9260///          "items": {
9261///            "type": "object",
9262///            "required": [
9263///              "const",
9264///              "title"
9265///            ],
9266///            "properties": {
9267///              "const": {
9268///                "description": "The constant enum value.",
9269///                "type": "string"
9270///              },
9271///              "title": {
9272///                "description": "Display title for this option.",
9273///                "type": "string"
9274///              }
9275///            }
9276///          }
9277///        }
9278///      }
9279///    },
9280///    "maxItems": {
9281///      "description": "Maximum number of items to select.",
9282///      "type": "integer"
9283///    },
9284///    "minItems": {
9285///      "description": "Minimum number of items to select.",
9286///      "type": "integer"
9287///    },
9288///    "title": {
9289///      "description": "Optional title for the enum field.",
9290///      "type": "string"
9291///    },
9292///    "type": {
9293///      "type": "string",
9294///      "const": "array"
9295///    }
9296///  }
9297///}
9298/// ```
9299/// </details>
9300#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9301pub struct TitledMultiSelectEnumSchema {
9302    ///Optional default value.
9303    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
9304    pub default: ::std::vec::Vec<::std::string::String>,
9305    ///Optional description for the enum field.
9306    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9307    pub description: ::std::option::Option<::std::string::String>,
9308    pub items: TitledMultiSelectEnumSchemaItems,
9309    ///Maximum number of items to select.
9310    #[serde(rename = "maxItems", default, skip_serializing_if = "::std::option::Option::is_none")]
9311    pub max_items: ::std::option::Option<i64>,
9312    ///Minimum number of items to select.
9313    #[serde(rename = "minItems", default, skip_serializing_if = "::std::option::Option::is_none")]
9314    pub min_items: ::std::option::Option<i64>,
9315    ///Optional title for the enum field.
9316    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9317    pub title: ::std::option::Option<::std::string::String>,
9318    #[serde(rename = "type", deserialize_with = "validate::titled_multi_select_enum_schema_type_")]
9319    type_: ::std::string::String,
9320}
9321impl TitledMultiSelectEnumSchema {
9322    pub fn new(
9323        default: ::std::vec::Vec<::std::string::String>,
9324        items: TitledMultiSelectEnumSchemaItems,
9325        description: ::std::option::Option<::std::string::String>,
9326        max_items: ::std::option::Option<i64>,
9327        min_items: ::std::option::Option<i64>,
9328        title: ::std::option::Option<::std::string::String>,
9329    ) -> Self {
9330        Self {
9331            default,
9332            description,
9333            items,
9334            max_items,
9335            min_items,
9336            title,
9337            type_: "array".to_string(),
9338        }
9339    }
9340    pub fn type_(&self) -> &::std::string::String {
9341        &self.type_
9342    }
9343    /// returns "array"
9344    pub fn type_value() -> ::std::string::String {
9345        "array".to_string()
9346    }
9347    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
9348    pub fn type_name() -> ::std::string::String {
9349        "array".to_string()
9350    }
9351}
9352///Schema for array items with enum options and display labels.
9353///
9354/// <details><summary>JSON schema</summary>
9355///
9356/// ```json
9357///{
9358///  "description": "Schema for array items with enum options and display labels.",
9359///  "type": "object",
9360///  "required": [
9361///    "anyOf"
9362///  ],
9363///  "properties": {
9364///    "anyOf": {
9365///      "description": "Array of enum options with values and display labels.",
9366///      "type": "array",
9367///      "items": {
9368///        "type": "object",
9369///        "required": [
9370///          "const",
9371///          "title"
9372///        ],
9373///        "properties": {
9374///          "const": {
9375///            "description": "The constant enum value.",
9376///            "type": "string"
9377///          },
9378///          "title": {
9379///            "description": "Display title for this option.",
9380///            "type": "string"
9381///          }
9382///        }
9383///      }
9384///    }
9385///  }
9386///}
9387/// ```
9388/// </details>
9389#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9390pub struct TitledMultiSelectEnumSchemaItems {
9391    ///Array of enum options with values and display labels.
9392    #[serde(rename = "anyOf")]
9393    pub any_of: ::std::vec::Vec<TitledMultiSelectEnumSchemaItemsAnyOfItem>,
9394}
9395///TitledMultiSelectEnumSchemaItemsAnyOfItem
9396///
9397/// <details><summary>JSON schema</summary>
9398///
9399/// ```json
9400///{
9401///  "type": "object",
9402///  "required": [
9403///    "const",
9404///    "title"
9405///  ],
9406///  "properties": {
9407///    "const": {
9408///      "description": "The constant enum value.",
9409///      "type": "string"
9410///    },
9411///    "title": {
9412///      "description": "Display title for this option.",
9413///      "type": "string"
9414///    }
9415///  }
9416///}
9417/// ```
9418/// </details>
9419#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9420pub struct TitledMultiSelectEnumSchemaItemsAnyOfItem {
9421    ///The constant enum value.
9422    #[serde(rename = "const")]
9423    pub const_: ::std::string::String,
9424    ///Display title for this option.
9425    pub title: ::std::string::String,
9426}
9427///Schema for single-selection enumeration with display titles for each option.
9428///
9429/// <details><summary>JSON schema</summary>
9430///
9431/// ```json
9432///{
9433///  "description": "Schema for single-selection enumeration with display titles for each option.",
9434///  "type": "object",
9435///  "required": [
9436///    "oneOf",
9437///    "type"
9438///  ],
9439///  "properties": {
9440///    "default": {
9441///      "description": "Optional default value.",
9442///      "type": "string"
9443///    },
9444///    "description": {
9445///      "description": "Optional description for the enum field.",
9446///      "type": "string"
9447///    },
9448///    "oneOf": {
9449///      "description": "Array of enum options with values and display labels.",
9450///      "type": "array",
9451///      "items": {
9452///        "type": "object",
9453///        "required": [
9454///          "const",
9455///          "title"
9456///        ],
9457///        "properties": {
9458///          "const": {
9459///            "description": "The enum value.",
9460///            "type": "string"
9461///          },
9462///          "title": {
9463///            "description": "Display label for this option.",
9464///            "type": "string"
9465///          }
9466///        }
9467///      }
9468///    },
9469///    "title": {
9470///      "description": "Optional title for the enum field.",
9471///      "type": "string"
9472///    },
9473///    "type": {
9474///      "type": "string",
9475///      "const": "string"
9476///    }
9477///  }
9478///}
9479/// ```
9480/// </details>
9481#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9482pub struct TitledSingleSelectEnumSchema {
9483    ///Optional default value.
9484    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9485    pub default: ::std::option::Option<::std::string::String>,
9486    ///Optional description for the enum field.
9487    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9488    pub description: ::std::option::Option<::std::string::String>,
9489    ///Array of enum options with values and display labels.
9490    #[serde(rename = "oneOf")]
9491    pub one_of: ::std::vec::Vec<TitledSingleSelectEnumSchemaOneOfItem>,
9492    ///Optional title for the enum field.
9493    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9494    pub title: ::std::option::Option<::std::string::String>,
9495    #[serde(rename = "type", deserialize_with = "validate::titled_single_select_enum_schema_type_")]
9496    type_: ::std::string::String,
9497}
9498impl TitledSingleSelectEnumSchema {
9499    pub fn new(
9500        one_of: ::std::vec::Vec<TitledSingleSelectEnumSchemaOneOfItem>,
9501        default: ::std::option::Option<::std::string::String>,
9502        description: ::std::option::Option<::std::string::String>,
9503        title: ::std::option::Option<::std::string::String>,
9504    ) -> Self {
9505        Self {
9506            default,
9507            description,
9508            one_of,
9509            title,
9510            type_: "string".to_string(),
9511        }
9512    }
9513    pub fn type_(&self) -> &::std::string::String {
9514        &self.type_
9515    }
9516    /// returns "string"
9517    pub fn type_value() -> ::std::string::String {
9518        "string".to_string()
9519    }
9520    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
9521    pub fn type_name() -> ::std::string::String {
9522        "string".to_string()
9523    }
9524}
9525///TitledSingleSelectEnumSchemaOneOfItem
9526///
9527/// <details><summary>JSON schema</summary>
9528///
9529/// ```json
9530///{
9531///  "type": "object",
9532///  "required": [
9533///    "const",
9534///    "title"
9535///  ],
9536///  "properties": {
9537///    "const": {
9538///      "description": "The enum value.",
9539///      "type": "string"
9540///    },
9541///    "title": {
9542///      "description": "Display label for this option.",
9543///      "type": "string"
9544///    }
9545///  }
9546///}
9547/// ```
9548/// </details>
9549#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9550pub struct TitledSingleSelectEnumSchemaOneOfItem {
9551    ///The enum value.
9552    #[serde(rename = "const")]
9553    pub const_: ::std::string::String,
9554    ///Display label for this option.
9555    pub title: ::std::string::String,
9556}
9557///Definition for a tool the client can call.
9558///
9559/// <details><summary>JSON schema</summary>
9560///
9561/// ```json
9562///{
9563///  "description": "Definition for a tool the client can call.",
9564///  "type": "object",
9565///  "required": [
9566///    "inputSchema",
9567///    "name"
9568///  ],
9569///  "properties": {
9570///    "_meta": {
9571///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
9572///      "type": "object",
9573///      "additionalProperties": {}
9574///    },
9575///    "annotations": {
9576///      "description": "Optional additional tool information.\n\nDisplay name precedence order is: title, annotations.title, then name.",
9577///      "$ref": "#/$defs/ToolAnnotations"
9578///    },
9579///    "description": {
9580///      "description": "A human-readable description of the tool.\n\nThis can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a \"hint\" to the model.",
9581///      "type": "string"
9582///    },
9583///    "execution": {
9584///      "description": "Execution-related properties for this tool.",
9585///      "$ref": "#/$defs/ToolExecution"
9586///    },
9587///    "icons": {
9588///      "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
9589///      "type": "array",
9590///      "items": {
9591///        "$ref": "#/$defs/Icon"
9592///      }
9593///    },
9594///    "inputSchema": {
9595///      "description": "A JSON Schema object defining the expected parameters for the tool.",
9596///      "type": "object",
9597///      "required": [
9598///        "type"
9599///      ],
9600///      "properties": {
9601///        "$schema": {
9602///          "type": "string"
9603///        },
9604///        "properties": {
9605///          "type": "object",
9606///          "additionalProperties": {
9607///            "type": "object",
9608///            "additionalProperties": true
9609///          }
9610///        },
9611///        "required": {
9612///          "type": "array",
9613///          "items": {
9614///            "type": "string"
9615///          }
9616///        },
9617///        "type": {
9618///          "type": "string",
9619///          "const": "object"
9620///        }
9621///      }
9622///    },
9623///    "name": {
9624///      "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
9625///      "type": "string"
9626///    },
9627///    "outputSchema": {
9628///      "description": "An optional JSON Schema object defining the structure of the tool's output returned in\nthe structuredContent field of a CallToolResult.\n\nDefaults to JSON Schema 2020-12 when no explicit $schema is provided.\nCurrently restricted to type: \"object\" at the root level.",
9629///      "type": "object",
9630///      "required": [
9631///        "type"
9632///      ],
9633///      "properties": {
9634///        "$schema": {
9635///          "type": "string"
9636///        },
9637///        "properties": {
9638///          "type": "object",
9639///          "additionalProperties": {
9640///            "type": "object",
9641///            "additionalProperties": true
9642///          }
9643///        },
9644///        "required": {
9645///          "type": "array",
9646///          "items": {
9647///            "type": "string"
9648///          }
9649///        },
9650///        "type": {
9651///          "type": "string",
9652///          "const": "object"
9653///        }
9654///      }
9655///    },
9656///    "title": {
9657///      "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
9658///      "type": "string"
9659///    }
9660///  }
9661///}
9662/// ```
9663/// </details>
9664#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9665pub struct Tool {
9666    /**Optional additional tool information.
9667    Display name precedence order is: title, annotations.title, then name.*/
9668    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9669    pub annotations: ::std::option::Option<ToolAnnotations>,
9670    /**A human-readable description of the tool.
9671    This can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a "hint" to the model.*/
9672    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9673    pub description: ::std::option::Option<::std::string::String>,
9674    ///Execution-related properties for this tool.
9675    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9676    pub execution: ::std::option::Option<ToolExecution>,
9677    /**Optional set of sized icons that the client can display in a user interface.
9678    Clients that support rendering icons MUST support at least the following MIME types:
9679    - image/png - PNG images (safe, universal compatibility)
9680    - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
9681    Clients that support rendering icons SHOULD also support:
9682    - image/svg+xml - SVG images (scalable but requires security precautions)
9683    - image/webp - WebP images (modern, efficient format)*/
9684    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
9685    pub icons: ::std::vec::Vec<Icon>,
9686    #[serde(rename = "inputSchema")]
9687    pub input_schema: ToolInputSchema,
9688    ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
9689    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
9690    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
9691    ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
9692    pub name: ::std::string::String,
9693    #[serde(rename = "outputSchema", default, skip_serializing_if = "::std::option::Option::is_none")]
9694    pub output_schema: ::std::option::Option<ToolOutputSchema>,
9695    /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
9696    even by those unfamiliar with domain-specific terminology.
9697    If not provided, the name should be used for display (except for Tool,
9698    where annotations.title should be given precedence over using name,
9699    if present).*/
9700    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9701    pub title: ::std::option::Option<::std::string::String>,
9702}
9703/**Additional properties describing a Tool to clients.
9704NOTE: all properties in ToolAnnotations are **hints**.
9705They are not guaranteed to provide a faithful description of
9706tool behavior (including descriptive properties like title).
9707Clients should never make tool use decisions based on ToolAnnotations
9708received from untrusted servers.*/
9709///
9710/// <details><summary>JSON schema</summary>
9711///
9712/// ```json
9713///{
9714///  "description": "Additional properties describing a Tool to clients.\n\nNOTE: all properties in ToolAnnotations are **hints**.\nThey are not guaranteed to provide a faithful description of\ntool behavior (including descriptive properties like title).\n\nClients should never make tool use decisions based on ToolAnnotations\nreceived from untrusted servers.",
9715///  "type": "object",
9716///  "properties": {
9717///    "destructiveHint": {
9718///      "description": "If true, the tool may perform destructive updates to its environment.\nIf false, the tool performs only additive updates.\n\n(This property is meaningful only when readOnlyHint == false)\n\nDefault: true",
9719///      "type": "boolean"
9720///    },
9721///    "idempotentHint": {
9722///      "description": "If true, calling the tool repeatedly with the same arguments\nwill have no additional effect on its environment.\n\n(This property is meaningful only when readOnlyHint == false)\n\nDefault: false",
9723///      "type": "boolean"
9724///    },
9725///    "openWorldHint": {
9726///      "description": "If true, this tool may interact with an \"open world\" of external\nentities. If false, the tool's domain of interaction is closed.\nFor example, the world of a web search tool is open, whereas that\nof a memory tool is not.\n\nDefault: true",
9727///      "type": "boolean"
9728///    },
9729///    "readOnlyHint": {
9730///      "description": "If true, the tool does not modify its environment.\n\nDefault: false",
9731///      "type": "boolean"
9732///    },
9733///    "title": {
9734///      "description": "A human-readable title for the tool.",
9735///      "type": "string"
9736///    }
9737///  }
9738///}
9739/// ```
9740/// </details>
9741#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
9742pub struct ToolAnnotations {
9743    /**If true, the tool may perform destructive updates to its environment.
9744    If false, the tool performs only additive updates.
9745    (This property is meaningful only when readOnlyHint == false)
9746    Default: true*/
9747    #[serde(rename = "destructiveHint", default, skip_serializing_if = "::std::option::Option::is_none")]
9748    pub destructive_hint: ::std::option::Option<bool>,
9749    /**If true, calling the tool repeatedly with the same arguments
9750    will have no additional effect on its environment.
9751    (This property is meaningful only when readOnlyHint == false)
9752    Default: false*/
9753    #[serde(rename = "idempotentHint", default, skip_serializing_if = "::std::option::Option::is_none")]
9754    pub idempotent_hint: ::std::option::Option<bool>,
9755    /**If true, this tool may interact with an "open world" of external
9756    entities. If false, the tool's domain of interaction is closed.
9757    For example, the world of a web search tool is open, whereas that
9758    of a memory tool is not.
9759    Default: true*/
9760    #[serde(rename = "openWorldHint", default, skip_serializing_if = "::std::option::Option::is_none")]
9761    pub open_world_hint: ::std::option::Option<bool>,
9762    /**If true, the tool does not modify its environment.
9763    Default: false*/
9764    #[serde(rename = "readOnlyHint", default, skip_serializing_if = "::std::option::Option::is_none")]
9765    pub read_only_hint: ::std::option::Option<bool>,
9766    ///A human-readable title for the tool.
9767    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9768    pub title: ::std::option::Option<::std::string::String>,
9769}
9770///Controls tool selection behavior for sampling requests.
9771///
9772/// <details><summary>JSON schema</summary>
9773///
9774/// ```json
9775///{
9776///  "description": "Controls tool selection behavior for sampling requests.",
9777///  "type": "object",
9778///  "properties": {
9779///    "mode": {
9780///      "description": "Controls the tool use ability of the model:\n- \"auto\": Model decides whether to use tools (default)\n- \"required\": Model MUST use at least one tool before completing\n- \"none\": Model MUST NOT use any tools",
9781///      "type": "string",
9782///      "enum": [
9783///        "auto",
9784///        "none",
9785///        "required"
9786///      ]
9787///    }
9788///  }
9789///}
9790/// ```
9791/// </details>
9792#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
9793pub struct ToolChoice {
9794    /**Controls the tool use ability of the model:
9795    - "auto": Model decides whether to use tools (default)
9796    - "required": Model MUST use at least one tool before completing
9797    - "none": Model MUST NOT use any tools*/
9798    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9799    pub mode: ::std::option::Option<ToolChoiceMode>,
9800}
9801/**Controls the tool use ability of the model:
9802- "auto": Model decides whether to use tools (default)
9803- "required": Model MUST use at least one tool before completing
9804- "none": Model MUST NOT use any tools*/
9805///
9806/// <details><summary>JSON schema</summary>
9807///
9808/// ```json
9809///{
9810///  "description": "Controls the tool use ability of the model:\n- \"auto\": Model decides whether to use tools (default)\n- \"required\": Model MUST use at least one tool before completing\n- \"none\": Model MUST NOT use any tools",
9811///  "type": "string",
9812///  "enum": [
9813///    "auto",
9814///    "none",
9815///    "required"
9816///  ]
9817///}
9818/// ```
9819/// </details>
9820#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
9821pub enum ToolChoiceMode {
9822    #[serde(rename = "auto")]
9823    Auto,
9824    #[serde(rename = "none")]
9825    None,
9826    #[serde(rename = "required")]
9827    Required,
9828}
9829impl ::std::fmt::Display for ToolChoiceMode {
9830    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
9831        match *self {
9832            Self::Auto => write!(f, "auto"),
9833            Self::None => write!(f, "none"),
9834            Self::Required => write!(f, "required"),
9835        }
9836    }
9837}
9838///Execution-related properties for a tool.
9839///
9840/// <details><summary>JSON schema</summary>
9841///
9842/// ```json
9843///{
9844///  "description": "Execution-related properties for a tool.",
9845///  "type": "object",
9846///  "properties": {
9847///    "taskSupport": {
9848///      "description": "Indicates whether this tool supports task-augmented execution.\nThis allows clients to handle long-running operations through polling\nthe task system.\n\n- \"forbidden\": Tool does not support task-augmented execution (default when absent)\n- \"optional\": Tool may support task-augmented execution\n- \"required\": Tool requires task-augmented execution\n\nDefault: \"forbidden\"",
9849///      "type": "string",
9850///      "enum": [
9851///        "forbidden",
9852///        "optional",
9853///        "required"
9854///      ]
9855///    }
9856///  }
9857///}
9858/// ```
9859/// </details>
9860#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
9861pub struct ToolExecution {
9862    /**Indicates whether this tool supports task-augmented execution.
9863    This allows clients to handle long-running operations through polling
9864    the task system.
9865    - "forbidden": Tool does not support task-augmented execution (default when absent)
9866    - "optional": Tool may support task-augmented execution
9867    - "required": Tool requires task-augmented execution
9868      "*/
9869    #[serde(rename = "taskSupport", default, skip_serializing_if = "::std::option::Option::is_none")]
9870    pub task_support: ::std::option::Option<ToolExecutionTaskSupport>,
9871}
9872/**Indicates whether this tool supports task-augmented execution.
9873This allows clients to handle long-running operations through polling
9874the task system.
9875- "forbidden": Tool does not support task-augmented execution (default when absent)
9876- "optional": Tool may support task-augmented execution
9877- "required": Tool requires task-augmented execution
9878  "*/
9879///
9880/// <details><summary>JSON schema</summary>
9881///
9882/// ```json
9883///{
9884///  "description": "Indicates whether this tool supports task-augmented execution.\nThis allows clients to handle long-running operations through polling\nthe task system.\n\n- \"forbidden\": Tool does not support task-augmented execution (default when absent)\n- \"optional\": Tool may support task-augmented execution\n- \"required\": Tool requires task-augmented execution\n\nDefault: \"forbidden\"",
9885///  "type": "string",
9886///  "enum": [
9887///    "forbidden",
9888///    "optional",
9889///    "required"
9890///  ]
9891///}
9892/// ```
9893/// </details>
9894#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
9895pub enum ToolExecutionTaskSupport {
9896    #[serde(rename = "forbidden")]
9897    Forbidden,
9898    #[serde(rename = "optional")]
9899    Optional,
9900    #[serde(rename = "required")]
9901    Required,
9902}
9903impl ::std::fmt::Display for ToolExecutionTaskSupport {
9904    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
9905        match *self {
9906            Self::Forbidden => write!(f, "forbidden"),
9907            Self::Optional => write!(f, "optional"),
9908            Self::Required => write!(f, "required"),
9909        }
9910    }
9911}
9912///A JSON Schema object defining the expected parameters for the tool.
9913///
9914/// <details><summary>JSON schema</summary>
9915///
9916/// ```json
9917///{
9918///  "description": "A JSON Schema object defining the expected parameters for the tool.",
9919///  "type": "object",
9920///  "required": [
9921///    "type"
9922///  ],
9923///  "properties": {
9924///    "$schema": {
9925///      "type": "string"
9926///    },
9927///    "properties": {
9928///      "type": "object",
9929///      "additionalProperties": {
9930///        "type": "object",
9931///        "additionalProperties": true
9932///      }
9933///    },
9934///    "required": {
9935///      "type": "array",
9936///      "items": {
9937///        "type": "string"
9938///      }
9939///    },
9940///    "type": {
9941///      "type": "string",
9942///      "const": "object"
9943///    }
9944///  }
9945///}
9946/// ```
9947/// </details>
9948#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9949pub struct ToolInputSchema {
9950    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9951    pub properties: ::std::option::Option<
9952        ::std::collections::HashMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
9953    >,
9954    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
9955    pub required: ::std::vec::Vec<::std::string::String>,
9956    #[serde(rename = "$schema", default, skip_serializing_if = "::std::option::Option::is_none")]
9957    pub schema: ::std::option::Option<::std::string::String>,
9958    #[serde(rename = "type", deserialize_with = "validate::tool_input_schema_type_")]
9959    type_: ::std::string::String,
9960}
9961impl ToolInputSchema {
9962    pub fn new(
9963        required: ::std::vec::Vec<::std::string::String>,
9964        properties: ::std::option::Option<
9965            ::std::collections::HashMap<
9966                ::std::string::String,
9967                ::serde_json::Map<::std::string::String, ::serde_json::Value>,
9968            >,
9969        >,
9970        schema: ::std::option::Option<::std::string::String>,
9971    ) -> Self {
9972        Self {
9973            properties,
9974            required,
9975            schema,
9976            type_: "object".to_string(),
9977        }
9978    }
9979    pub fn type_(&self) -> &::std::string::String {
9980        &self.type_
9981    }
9982    /// returns "object"
9983    pub fn type_value() -> ::std::string::String {
9984        "object".to_string()
9985    }
9986    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
9987    pub fn type_name() -> ::std::string::String {
9988        "object".to_string()
9989    }
9990}
9991///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.
9992///
9993/// <details><summary>JSON schema</summary>
9994///
9995/// ```json
9996///{
9997///  "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.",
9998///  "type": "object",
9999///  "required": [
10000///    "jsonrpc",
10001///    "method"
10002///  ],
10003///  "properties": {
10004///    "jsonrpc": {
10005///      "type": "string",
10006///      "const": "2.0"
10007///    },
10008///    "method": {
10009///      "type": "string",
10010///      "const": "notifications/tools/list_changed"
10011///    },
10012///    "params": {
10013///      "$ref": "#/$defs/NotificationParams"
10014///    }
10015///  }
10016///}
10017/// ```
10018/// </details>
10019#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10020pub struct ToolListChangedNotification {
10021    #[serde(deserialize_with = "validate::tool_list_changed_notification_jsonrpc")]
10022    jsonrpc: ::std::string::String,
10023    #[serde(deserialize_with = "validate::tool_list_changed_notification_method")]
10024    method: ::std::string::String,
10025    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
10026    pub params: ::std::option::Option<NotificationParams>,
10027}
10028impl ToolListChangedNotification {
10029    pub fn new(params: ::std::option::Option<NotificationParams>) -> Self {
10030        Self {
10031            jsonrpc: JSONRPC_VERSION.to_string(),
10032            method: "notifications/tools/list_changed".to_string(),
10033            params,
10034        }
10035    }
10036    pub fn jsonrpc(&self) -> &::std::string::String {
10037        &self.jsonrpc
10038    }
10039    pub fn method(&self) -> &::std::string::String {
10040        &self.method
10041    }
10042    /// returns "notifications/tools/list_changed"
10043    pub fn method_value() -> ::std::string::String {
10044        "notifications/tools/list_changed".to_string()
10045    }
10046    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
10047    pub fn method_name() -> ::std::string::String {
10048        "notifications/tools/list_changed".to_string()
10049    }
10050}
10051/**An optional JSON Schema object defining the structure of the tool's output returned in
10052the structuredContent field of a CallToolResult.
10053Defaults to JSON Schema 2020-12 when no explicit $schema is provided.
10054Currently restricted to type: "object" at the root level.*/
10055///
10056/// <details><summary>JSON schema</summary>
10057///
10058/// ```json
10059///{
10060///  "description": "An optional JSON Schema object defining the structure of the tool's output returned in\nthe structuredContent field of a CallToolResult.\n\nDefaults to JSON Schema 2020-12 when no explicit $schema is provided.\nCurrently restricted to type: \"object\" at the root level.",
10061///  "type": "object",
10062///  "required": [
10063///    "type"
10064///  ],
10065///  "properties": {
10066///    "$schema": {
10067///      "type": "string"
10068///    },
10069///    "properties": {
10070///      "type": "object",
10071///      "additionalProperties": {
10072///        "type": "object",
10073///        "additionalProperties": true
10074///      }
10075///    },
10076///    "required": {
10077///      "type": "array",
10078///      "items": {
10079///        "type": "string"
10080///      }
10081///    },
10082///    "type": {
10083///      "type": "string",
10084///      "const": "object"
10085///    }
10086///  }
10087///}
10088/// ```
10089/// </details>
10090#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10091pub struct ToolOutputSchema {
10092    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
10093    pub properties: ::std::option::Option<
10094        ::std::collections::HashMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
10095    >,
10096    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
10097    pub required: ::std::vec::Vec<::std::string::String>,
10098    #[serde(rename = "$schema", default, skip_serializing_if = "::std::option::Option::is_none")]
10099    pub schema: ::std::option::Option<::std::string::String>,
10100    #[serde(rename = "type", deserialize_with = "validate::tool_output_schema_type_")]
10101    type_: ::std::string::String,
10102}
10103impl ToolOutputSchema {
10104    pub fn new(
10105        required: ::std::vec::Vec<::std::string::String>,
10106        properties: ::std::option::Option<
10107            ::std::collections::HashMap<
10108                ::std::string::String,
10109                ::serde_json::Map<::std::string::String, ::serde_json::Value>,
10110            >,
10111        >,
10112        schema: ::std::option::Option<::std::string::String>,
10113    ) -> Self {
10114        Self {
10115            properties,
10116            required,
10117            schema,
10118            type_: "object".to_string(),
10119        }
10120    }
10121    pub fn type_(&self) -> &::std::string::String {
10122        &self.type_
10123    }
10124    /// returns "object"
10125    pub fn type_value() -> ::std::string::String {
10126        "object".to_string()
10127    }
10128    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
10129    pub fn type_name() -> ::std::string::String {
10130        "object".to_string()
10131    }
10132}
10133///The result of a tool use, provided by the user back to the assistant.
10134///
10135/// <details><summary>JSON schema</summary>
10136///
10137/// ```json
10138///{
10139///  "description": "The result of a tool use, provided by the user back to the assistant.",
10140///  "type": "object",
10141///  "required": [
10142///    "content",
10143///    "toolUseId",
10144///    "type"
10145///  ],
10146///  "properties": {
10147///    "_meta": {
10148///      "description": "Optional metadata about the tool result. Clients SHOULD preserve this field when\nincluding tool results in subsequent sampling requests to enable caching optimizations.\n\nSee [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
10149///      "type": "object",
10150///      "additionalProperties": {}
10151///    },
10152///    "content": {
10153///      "description": "The unstructured result content of the tool use.\n\nThis has the same format as CallToolResult.content and can include text, images,\naudio, resource links, and embedded resources.",
10154///      "type": "array",
10155///      "items": {
10156///        "$ref": "#/$defs/ContentBlock"
10157///      }
10158///    },
10159///    "isError": {
10160///      "description": "Whether the tool use resulted in an error.\n\nIf true, the content typically describes the error that occurred.\nDefault: false",
10161///      "type": "boolean"
10162///    },
10163///    "structuredContent": {
10164///      "description": "An optional structured result object.\n\nIf the tool defined an outputSchema, this SHOULD conform to that schema.",
10165///      "type": "object",
10166///      "additionalProperties": {}
10167///    },
10168///    "toolUseId": {
10169///      "description": "The ID of the tool use this result corresponds to.\n\nThis MUST match the ID from a previous ToolUseContent.",
10170///      "type": "string"
10171///    },
10172///    "type": {
10173///      "type": "string",
10174///      "const": "tool_result"
10175///    }
10176///  }
10177///}
10178/// ```
10179/// </details>
10180#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10181pub struct ToolResultContent {
10182    /**The unstructured result content of the tool use.
10183    This has the same format as CallToolResult.content and can include text, images,
10184    audio, resource links, and embedded resources.*/
10185    pub content: ::std::vec::Vec<ContentBlock>,
10186    /**Whether the tool use resulted in an error.
10187    If true, the content typically describes the error that occurred.
10188    Default: false*/
10189    #[serde(rename = "isError", default, skip_serializing_if = "::std::option::Option::is_none")]
10190    pub is_error: ::std::option::Option<bool>,
10191    /**Optional metadata about the tool result. Clients SHOULD preserve this field when
10192    including tool results in subsequent sampling requests to enable caching optimizations.
10193    See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.*/
10194    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
10195    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
10196    /**An optional structured result object.
10197    If the tool defined an outputSchema, this SHOULD conform to that schema.*/
10198    #[serde(
10199        rename = "structuredContent",
10200        default,
10201        skip_serializing_if = "::std::option::Option::is_none"
10202    )]
10203    pub structured_content: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
10204    /**The ID of the tool use this result corresponds to.
10205    This MUST match the ID from a previous ToolUseContent.*/
10206    #[serde(rename = "toolUseId")]
10207    pub tool_use_id: ::std::string::String,
10208    #[serde(rename = "type", deserialize_with = "validate::tool_result_content_type_")]
10209    type_: ::std::string::String,
10210}
10211impl ToolResultContent {
10212    pub fn new(
10213        content: ::std::vec::Vec<ContentBlock>,
10214        tool_use_id: ::std::string::String,
10215        is_error: ::std::option::Option<bool>,
10216        meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
10217        structured_content: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
10218    ) -> Self {
10219        Self {
10220            content,
10221            is_error,
10222            meta,
10223            structured_content,
10224            tool_use_id,
10225            type_: "tool_result".to_string(),
10226        }
10227    }
10228    pub fn type_(&self) -> &::std::string::String {
10229        &self.type_
10230    }
10231    /// returns "tool_result"
10232    pub fn type_value() -> ::std::string::String {
10233        "tool_result".to_string()
10234    }
10235    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
10236    pub fn type_name() -> ::std::string::String {
10237        "tool_result".to_string()
10238    }
10239}
10240///A request from the assistant to call a tool.
10241///
10242/// <details><summary>JSON schema</summary>
10243///
10244/// ```json
10245///{
10246///  "description": "A request from the assistant to call a tool.",
10247///  "type": "object",
10248///  "required": [
10249///    "id",
10250///    "input",
10251///    "name",
10252///    "type"
10253///  ],
10254///  "properties": {
10255///    "_meta": {
10256///      "description": "Optional metadata about the tool use. Clients SHOULD preserve this field when\nincluding tool uses in subsequent sampling requests to enable caching optimizations.\n\nSee [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
10257///      "type": "object",
10258///      "additionalProperties": {}
10259///    },
10260///    "id": {
10261///      "description": "A unique identifier for this tool use.\n\nThis ID is used to match tool results to their corresponding tool uses.",
10262///      "type": "string"
10263///    },
10264///    "input": {
10265///      "description": "The arguments to pass to the tool, conforming to the tool's input schema.",
10266///      "type": "object",
10267///      "additionalProperties": {}
10268///    },
10269///    "name": {
10270///      "description": "The name of the tool to call.",
10271///      "type": "string"
10272///    },
10273///    "type": {
10274///      "type": "string",
10275///      "const": "tool_use"
10276///    }
10277///  }
10278///}
10279/// ```
10280/// </details>
10281#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10282pub struct ToolUseContent {
10283    /**A unique identifier for this tool use.
10284    This ID is used to match tool results to their corresponding tool uses.*/
10285    pub id: ::std::string::String,
10286    ///The arguments to pass to the tool, conforming to the tool's input schema.
10287    pub input: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
10288    /**Optional metadata about the tool use. Clients SHOULD preserve this field when
10289    including tool uses in subsequent sampling requests to enable caching optimizations.
10290    See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.*/
10291    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
10292    pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
10293    ///The name of the tool to call.
10294    pub name: ::std::string::String,
10295    #[serde(rename = "type", deserialize_with = "validate::tool_use_content_type_")]
10296    type_: ::std::string::String,
10297}
10298impl ToolUseContent {
10299    pub fn new(
10300        id: ::std::string::String,
10301        input: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
10302        name: ::std::string::String,
10303        meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
10304    ) -> Self {
10305        Self {
10306            id,
10307            input,
10308            meta,
10309            name,
10310            type_: "tool_use".to_string(),
10311        }
10312    }
10313    pub fn type_(&self) -> &::std::string::String {
10314        &self.type_
10315    }
10316    /// returns "tool_use"
10317    pub fn type_value() -> ::std::string::String {
10318        "tool_use".to_string()
10319    }
10320    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
10321    pub fn type_name() -> ::std::string::String {
10322        "tool_use".to_string()
10323    }
10324}
10325///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
10326///
10327/// <details><summary>JSON schema</summary>
10328///
10329/// ```json
10330///{
10331///  "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
10332///  "type": "object",
10333///  "properties": {
10334///    "progressToken": {
10335///      "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.",
10336///      "$ref": "#/$defs/ProgressToken"
10337///    }
10338///  },
10339///  "additionalProperties": {}
10340///}
10341/// ```
10342/// </details>
10343#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
10344pub struct UnsubscribeMeta {
10345    ///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.
10346    #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
10347    pub progress_token: ::std::option::Option<ProgressToken>,
10348    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
10349    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
10350}
10351///Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
10352///
10353/// <details><summary>JSON schema</summary>
10354///
10355/// ```json
10356///{
10357///  "description": "Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.",
10358///  "type": "object",
10359///  "required": [
10360///    "id",
10361///    "jsonrpc",
10362///    "method",
10363///    "params"
10364///  ],
10365///  "properties": {
10366///    "id": {
10367///      "$ref": "#/$defs/RequestId"
10368///    },
10369///    "jsonrpc": {
10370///      "type": "string",
10371///      "const": "2.0"
10372///    },
10373///    "method": {
10374///      "type": "string",
10375///      "const": "resources/unsubscribe"
10376///    },
10377///    "params": {
10378///      "$ref": "#/$defs/UnsubscribeRequestParams"
10379///    }
10380///  }
10381///}
10382/// ```
10383/// </details>
10384#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10385pub struct UnsubscribeRequest {
10386    pub id: RequestId,
10387    #[serde(deserialize_with = "validate::unsubscribe_request_jsonrpc")]
10388    jsonrpc: ::std::string::String,
10389    #[serde(deserialize_with = "validate::unsubscribe_request_method")]
10390    method: ::std::string::String,
10391    pub params: UnsubscribeRequestParams,
10392}
10393impl UnsubscribeRequest {
10394    pub fn new(id: RequestId, params: UnsubscribeRequestParams) -> Self {
10395        Self {
10396            id,
10397            jsonrpc: JSONRPC_VERSION.to_string(),
10398            method: "resources/unsubscribe".to_string(),
10399            params,
10400        }
10401    }
10402    pub fn jsonrpc(&self) -> &::std::string::String {
10403        &self.jsonrpc
10404    }
10405    pub fn method(&self) -> &::std::string::String {
10406        &self.method
10407    }
10408    /// returns "resources/unsubscribe"
10409    pub fn method_value() -> ::std::string::String {
10410        "resources/unsubscribe".to_string()
10411    }
10412    #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
10413    pub fn method_name() -> ::std::string::String {
10414        "resources/unsubscribe".to_string()
10415    }
10416}
10417///Parameters for a resources/unsubscribe request.
10418///
10419/// <details><summary>JSON schema</summary>
10420///
10421/// ```json
10422///{
10423///  "description": "Parameters for a resources/unsubscribe request.",
10424///  "type": "object",
10425///  "required": [
10426///    "uri"
10427///  ],
10428///  "properties": {
10429///    "_meta": {
10430///      "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
10431///      "type": "object",
10432///      "properties": {
10433///        "progressToken": {
10434///          "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.",
10435///          "$ref": "#/$defs/ProgressToken"
10436///        }
10437///      },
10438///      "additionalProperties": {}
10439///    },
10440///    "uri": {
10441///      "description": "The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.",
10442///      "type": "string",
10443///      "format": "uri"
10444///    }
10445///  }
10446///}
10447/// ```
10448/// </details>
10449#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10450pub struct UnsubscribeRequestParams {
10451    #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
10452    pub meta: ::std::option::Option<UnsubscribeMeta>,
10453    ///The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.
10454    pub uri: ::std::string::String,
10455}
10456///Schema for multiple-selection enumeration without display titles for options.
10457///
10458/// <details><summary>JSON schema</summary>
10459///
10460/// ```json
10461///{
10462///  "description": "Schema for multiple-selection enumeration without display titles for options.",
10463///  "type": "object",
10464///  "required": [
10465///    "items",
10466///    "type"
10467///  ],
10468///  "properties": {
10469///    "default": {
10470///      "description": "Optional default value.",
10471///      "type": "array",
10472///      "items": {
10473///        "type": "string"
10474///      }
10475///    },
10476///    "description": {
10477///      "description": "Optional description for the enum field.",
10478///      "type": "string"
10479///    },
10480///    "items": {
10481///      "description": "Schema for the array items.",
10482///      "type": "object",
10483///      "required": [
10484///        "enum",
10485///        "type"
10486///      ],
10487///      "properties": {
10488///        "enum": {
10489///          "description": "Array of enum values to choose from.",
10490///          "type": "array",
10491///          "items": {
10492///            "type": "string"
10493///          }
10494///        },
10495///        "type": {
10496///          "type": "string",
10497///          "const": "string"
10498///        }
10499///      }
10500///    },
10501///    "maxItems": {
10502///      "description": "Maximum number of items to select.",
10503///      "type": "integer"
10504///    },
10505///    "minItems": {
10506///      "description": "Minimum number of items to select.",
10507///      "type": "integer"
10508///    },
10509///    "title": {
10510///      "description": "Optional title for the enum field.",
10511///      "type": "string"
10512///    },
10513///    "type": {
10514///      "type": "string",
10515///      "const": "array"
10516///    }
10517///  }
10518///}
10519/// ```
10520/// </details>
10521#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10522pub struct UntitledMultiSelectEnumSchema {
10523    ///Optional default value.
10524    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
10525    pub default: ::std::vec::Vec<::std::string::String>,
10526    ///Optional description for the enum field.
10527    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
10528    pub description: ::std::option::Option<::std::string::String>,
10529    pub items: UntitledMultiSelectEnumSchemaItems,
10530    ///Maximum number of items to select.
10531    #[serde(rename = "maxItems", default, skip_serializing_if = "::std::option::Option::is_none")]
10532    pub max_items: ::std::option::Option<i64>,
10533    ///Minimum number of items to select.
10534    #[serde(rename = "minItems", default, skip_serializing_if = "::std::option::Option::is_none")]
10535    pub min_items: ::std::option::Option<i64>,
10536    ///Optional title for the enum field.
10537    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
10538    pub title: ::std::option::Option<::std::string::String>,
10539    #[serde(rename = "type", deserialize_with = "validate::untitled_multi_select_enum_schema_type_")]
10540    type_: ::std::string::String,
10541}
10542impl UntitledMultiSelectEnumSchema {
10543    pub fn new(
10544        default: ::std::vec::Vec<::std::string::String>,
10545        items: UntitledMultiSelectEnumSchemaItems,
10546        description: ::std::option::Option<::std::string::String>,
10547        max_items: ::std::option::Option<i64>,
10548        min_items: ::std::option::Option<i64>,
10549        title: ::std::option::Option<::std::string::String>,
10550    ) -> Self {
10551        Self {
10552            default,
10553            description,
10554            items,
10555            max_items,
10556            min_items,
10557            title,
10558            type_: "array".to_string(),
10559        }
10560    }
10561    pub fn type_(&self) -> &::std::string::String {
10562        &self.type_
10563    }
10564    /// returns "array"
10565    pub fn type_value() -> ::std::string::String {
10566        "array".to_string()
10567    }
10568    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
10569    pub fn type_name() -> ::std::string::String {
10570        "array".to_string()
10571    }
10572}
10573///Schema for the array items.
10574///
10575/// <details><summary>JSON schema</summary>
10576///
10577/// ```json
10578///{
10579///  "description": "Schema for the array items.",
10580///  "type": "object",
10581///  "required": [
10582///    "enum",
10583///    "type"
10584///  ],
10585///  "properties": {
10586///    "enum": {
10587///      "description": "Array of enum values to choose from.",
10588///      "type": "array",
10589///      "items": {
10590///        "type": "string"
10591///      }
10592///    },
10593///    "type": {
10594///      "type": "string",
10595///      "const": "string"
10596///    }
10597///  }
10598///}
10599/// ```
10600/// </details>
10601#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10602pub struct UntitledMultiSelectEnumSchemaItems {
10603    ///Array of enum values to choose from.
10604    #[serde(rename = "enum")]
10605    pub enum_: ::std::vec::Vec<::std::string::String>,
10606    #[serde(
10607        rename = "type",
10608        deserialize_with = "validate::untitled_multi_select_enum_schema_items_type_"
10609    )]
10610    type_: ::std::string::String,
10611}
10612impl UntitledMultiSelectEnumSchemaItems {
10613    pub fn new(enum_: ::std::vec::Vec<::std::string::String>) -> Self {
10614        Self {
10615            enum_,
10616            type_: "string".to_string(),
10617        }
10618    }
10619    pub fn type_(&self) -> &::std::string::String {
10620        &self.type_
10621    }
10622    /// returns "string"
10623    pub fn type_value() -> ::std::string::String {
10624        "string".to_string()
10625    }
10626    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
10627    pub fn type_name() -> ::std::string::String {
10628        "string".to_string()
10629    }
10630}
10631///Schema for single-selection enumeration without display titles for options.
10632///
10633/// <details><summary>JSON schema</summary>
10634///
10635/// ```json
10636///{
10637///  "description": "Schema for single-selection enumeration without display titles for options.",
10638///  "type": "object",
10639///  "required": [
10640///    "enum",
10641///    "type"
10642///  ],
10643///  "properties": {
10644///    "default": {
10645///      "description": "Optional default value.",
10646///      "type": "string"
10647///    },
10648///    "description": {
10649///      "description": "Optional description for the enum field.",
10650///      "type": "string"
10651///    },
10652///    "enum": {
10653///      "description": "Array of enum values to choose from.",
10654///      "type": "array",
10655///      "items": {
10656///        "type": "string"
10657///      }
10658///    },
10659///    "title": {
10660///      "description": "Optional title for the enum field.",
10661///      "type": "string"
10662///    },
10663///    "type": {
10664///      "type": "string",
10665///      "const": "string"
10666///    }
10667///  }
10668///}
10669/// ```
10670/// </details>
10671#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10672pub struct UntitledSingleSelectEnumSchema {
10673    ///Optional default value.
10674    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
10675    pub default: ::std::option::Option<::std::string::String>,
10676    ///Optional description for the enum field.
10677    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
10678    pub description: ::std::option::Option<::std::string::String>,
10679    ///Array of enum values to choose from.
10680    #[serde(rename = "enum")]
10681    pub enum_: ::std::vec::Vec<::std::string::String>,
10682    ///Optional title for the enum field.
10683    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
10684    pub title: ::std::option::Option<::std::string::String>,
10685    #[serde(rename = "type", deserialize_with = "validate::untitled_single_select_enum_schema_type_")]
10686    type_: ::std::string::String,
10687}
10688impl UntitledSingleSelectEnumSchema {
10689    pub fn new(
10690        enum_: ::std::vec::Vec<::std::string::String>,
10691        default: ::std::option::Option<::std::string::String>,
10692        description: ::std::option::Option<::std::string::String>,
10693        title: ::std::option::Option<::std::string::String>,
10694    ) -> Self {
10695        Self {
10696            default,
10697            description,
10698            enum_,
10699            title,
10700            type_: "string".to_string(),
10701        }
10702    }
10703    pub fn type_(&self) -> &::std::string::String {
10704        &self.type_
10705    }
10706    /// returns "string"
10707    pub fn type_value() -> ::std::string::String {
10708        "string".to_string()
10709    }
10710    #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
10711    pub fn type_name() -> ::std::string::String {
10712        "string".to_string()
10713    }
10714}
10715///UrlElicitError
10716///
10717/// <details><summary>JSON schema</summary>
10718///
10719/// ```json
10720///{
10721///  "allOf": [
10722///    {
10723///      "$ref": "#/$defs/Error"
10724///    },
10725///    {
10726///      "type": "object",
10727///      "required": [
10728///        "code",
10729///        "data"
10730///      ],
10731///      "properties": {
10732///        "code": {
10733///          "type": "integer"
10734///        },
10735///        "data": {
10736///          "type": "object",
10737///          "required": [
10738///            "elicitations"
10739///          ],
10740///          "properties": {
10741///            "elicitations": {
10742///              "type": "array",
10743///              "items": {
10744///                "$ref": "#/$defs/ElicitRequestURLParams"
10745///              }
10746///            }
10747///          },
10748///          "additionalProperties": {}
10749///        }
10750///      }
10751///    }
10752///  ]
10753///}
10754/// ```
10755/// </details>
10756#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10757pub struct UrlElicitError {
10758    #[serde(deserialize_with = "validate::url_elicit_error_code")]
10759    code: i64,
10760    pub data: UrlElicitErrorData,
10761    ///A short description of the error. The message SHOULD be limited to a concise single sentence.
10762    pub message: ::std::string::String,
10763}
10764impl UrlElicitError {
10765    pub fn new(data: UrlElicitErrorData, message: ::std::string::String) -> Self {
10766        Self {
10767            code: -32042i64,
10768            data,
10769            message,
10770        }
10771    }
10772    pub fn code(&self) -> &i64 {
10773        &self.code
10774    }
10775    /// returns -32042i64
10776    pub fn code_value() -> i64 {
10777        -32042i64
10778    }
10779    #[deprecated(since = "0.8.0", note = "Use `code_value()` instead.")]
10780    pub fn code_name() -> i64 {
10781        -32042i64
10782    }
10783}
10784///UrlElicitErrorData
10785///
10786/// <details><summary>JSON schema</summary>
10787///
10788/// ```json
10789///{
10790///  "type": "object",
10791///  "required": [
10792///    "elicitations"
10793///  ],
10794///  "properties": {
10795///    "elicitations": {
10796///      "type": "array",
10797///      "items": {
10798///        "$ref": "#/$defs/ElicitRequestURLParams"
10799///      }
10800///    }
10801///  },
10802///  "additionalProperties": {}
10803///}
10804/// ```
10805/// </details>
10806#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10807pub struct UrlElicitErrorData {
10808    pub elicitations: ::std::vec::Vec<ElicitRequestUrlParams>,
10809    #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
10810    pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
10811}
10812///An error response that indicates that the server requires the client to provide additional information via an elicitation request.
10813///
10814/// <details><summary>JSON schema</summary>
10815///
10816/// ```json
10817///{
10818///  "description": "An error response that indicates that the server requires the client to provide additional information via an elicitation request.",
10819///  "type": "object",
10820///  "required": [
10821///    "error",
10822///    "jsonrpc"
10823///  ],
10824///  "properties": {
10825///    "error": {
10826///      "allOf": [
10827///        {
10828///          "$ref": "#/$defs/Error"
10829///        },
10830///        {
10831///          "type": "object",
10832///          "required": [
10833///            "code",
10834///            "data"
10835///          ],
10836///          "properties": {
10837///            "code": {
10838///              "type": "integer"
10839///            },
10840///            "data": {
10841///              "type": "object",
10842///              "required": [
10843///                "elicitations"
10844///              ],
10845///              "properties": {
10846///                "elicitations": {
10847///                  "type": "array",
10848///                  "items": {
10849///                    "$ref": "#/$defs/ElicitRequestURLParams"
10850///                  }
10851///                }
10852///              },
10853///              "additionalProperties": {}
10854///            }
10855///          }
10856///        }
10857///      ]
10858///    },
10859///    "id": {
10860///      "$ref": "#/$defs/RequestId"
10861///    },
10862///    "jsonrpc": {
10863///      "type": "string",
10864///      "const": "2.0"
10865///    }
10866///  }
10867///}
10868/// ```
10869/// </details>
10870#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10871pub struct UrlElicitationRequiredError {
10872    pub error: UrlElicitError,
10873    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
10874    pub id: ::std::option::Option<RequestId>,
10875    #[serde(deserialize_with = "validate::url_elicitation_required_error_jsonrpc")]
10876    jsonrpc: ::std::string::String,
10877}
10878impl UrlElicitationRequiredError {
10879    pub fn new(error: UrlElicitError, id: ::std::option::Option<RequestId>) -> Self {
10880        Self {
10881            error,
10882            id,
10883            jsonrpc: JSONRPC_VERSION.to_string(),
10884        }
10885    }
10886    pub fn jsonrpc(&self) -> &::std::string::String {
10887        &self.jsonrpc
10888    }
10889}
10890/// Implementing the Deserialize trait
10891/// This allows enum to be deserialized into correct type based on the value of the "method"
10892impl<'de> serde::Deserialize<'de> for ClientRequest {
10893    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10894    where
10895        D: serde::Deserializer<'de>,
10896    {
10897        let value: serde_json::Value = serde::Deserialize::deserialize(deserializer)?;
10898        let method_option = value.get("method").and_then(|v| v.as_str());
10899        if let Some(method) = method_option {
10900            match method {
10901                "initialize" => {
10902                    let req = serde_json::from_value::<InitializeRequest>(value).map_err(serde::de::Error::custom)?;
10903                    Ok(ClientRequest::InitializeRequest(req))
10904                }
10905                "ping" => {
10906                    let req = serde_json::from_value::<PingRequest>(value).map_err(serde::de::Error::custom)?;
10907                    Ok(ClientRequest::PingRequest(req))
10908                }
10909                "resources/list" => {
10910                    let req = serde_json::from_value::<ListResourcesRequest>(value).map_err(serde::de::Error::custom)?;
10911                    Ok(ClientRequest::ListResourcesRequest(req))
10912                }
10913                "resources/templates/list" => {
10914                    let req =
10915                        serde_json::from_value::<ListResourceTemplatesRequest>(value).map_err(serde::de::Error::custom)?;
10916                    Ok(ClientRequest::ListResourceTemplatesRequest(req))
10917                }
10918                "resources/read" => {
10919                    let req = serde_json::from_value::<ReadResourceRequest>(value).map_err(serde::de::Error::custom)?;
10920                    Ok(ClientRequest::ReadResourceRequest(req))
10921                }
10922                "resources/subscribe" => {
10923                    let req = serde_json::from_value::<SubscribeRequest>(value).map_err(serde::de::Error::custom)?;
10924                    Ok(ClientRequest::SubscribeRequest(req))
10925                }
10926                "resources/unsubscribe" => {
10927                    let req = serde_json::from_value::<UnsubscribeRequest>(value).map_err(serde::de::Error::custom)?;
10928                    Ok(ClientRequest::UnsubscribeRequest(req))
10929                }
10930                "prompts/list" => {
10931                    let req = serde_json::from_value::<ListPromptsRequest>(value).map_err(serde::de::Error::custom)?;
10932                    Ok(ClientRequest::ListPromptsRequest(req))
10933                }
10934                "prompts/get" => {
10935                    let req = serde_json::from_value::<GetPromptRequest>(value).map_err(serde::de::Error::custom)?;
10936                    Ok(ClientRequest::GetPromptRequest(req))
10937                }
10938                "tools/list" => {
10939                    let req = serde_json::from_value::<ListToolsRequest>(value).map_err(serde::de::Error::custom)?;
10940                    Ok(ClientRequest::ListToolsRequest(req))
10941                }
10942                "tools/call" => {
10943                    let req = serde_json::from_value::<CallToolRequest>(value).map_err(serde::de::Error::custom)?;
10944                    Ok(ClientRequest::CallToolRequest(req))
10945                }
10946                "tasks/get" => {
10947                    let req = serde_json::from_value::<GetTaskRequest>(value).map_err(serde::de::Error::custom)?;
10948                    Ok(ClientRequest::GetTaskRequest(req))
10949                }
10950                "tasks/result" => {
10951                    let req = serde_json::from_value::<GetTaskPayloadRequest>(value).map_err(serde::de::Error::custom)?;
10952                    Ok(ClientRequest::GetTaskPayloadRequest(req))
10953                }
10954                "tasks/cancel" => {
10955                    let req = serde_json::from_value::<CancelTaskRequest>(value).map_err(serde::de::Error::custom)?;
10956                    Ok(ClientRequest::CancelTaskRequest(req))
10957                }
10958                "tasks/list" => {
10959                    let req = serde_json::from_value::<ListTasksRequest>(value).map_err(serde::de::Error::custom)?;
10960                    Ok(ClientRequest::ListTasksRequest(req))
10961                }
10962                "logging/setLevel" => {
10963                    let req = serde_json::from_value::<SetLevelRequest>(value).map_err(serde::de::Error::custom)?;
10964                    Ok(ClientRequest::SetLevelRequest(req))
10965                }
10966                "completion/complete" => {
10967                    let req = serde_json::from_value::<CompleteRequest>(value).map_err(serde::de::Error::custom)?;
10968                    Ok(ClientRequest::CompleteRequest(req))
10969                }
10970                _ => Err(serde::de::Error::unknown_variant("method", &[""])),
10971            }
10972        } else {
10973            Err(serde::de::Error::missing_field("method"))
10974        }
10975    }
10976}
10977impl ClientRequest {
10978    pub fn method(&self) -> &str {
10979        match self {
10980            ClientRequest::InitializeRequest(request) => request.method(),
10981            ClientRequest::PingRequest(request) => request.method(),
10982            ClientRequest::ListResourcesRequest(request) => request.method(),
10983            ClientRequest::ListResourceTemplatesRequest(request) => request.method(),
10984            ClientRequest::ReadResourceRequest(request) => request.method(),
10985            ClientRequest::SubscribeRequest(request) => request.method(),
10986            ClientRequest::UnsubscribeRequest(request) => request.method(),
10987            ClientRequest::ListPromptsRequest(request) => request.method(),
10988            ClientRequest::GetPromptRequest(request) => request.method(),
10989            ClientRequest::ListToolsRequest(request) => request.method(),
10990            ClientRequest::CallToolRequest(request) => request.method(),
10991            ClientRequest::GetTaskRequest(request) => request.method(),
10992            ClientRequest::GetTaskPayloadRequest(request) => request.method(),
10993            ClientRequest::CancelTaskRequest(request) => request.method(),
10994            ClientRequest::ListTasksRequest(request) => request.method(),
10995            ClientRequest::SetLevelRequest(request) => request.method(),
10996            ClientRequest::CompleteRequest(request) => request.method(),
10997        }
10998    }
10999}
11000/// Implementing the Deserialize trait
11001/// This allows enum to be deserialized into correct type based on the value of the "method"
11002impl<'de> serde::Deserialize<'de> for ClientNotification {
11003    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11004    where
11005        D: serde::Deserializer<'de>,
11006    {
11007        let value: serde_json::Value = serde::Deserialize::deserialize(deserializer)?;
11008        let method_option = value.get("method").and_then(|v| v.as_str());
11009        if let Some(method) = method_option {
11010            match method {
11011                "notifications/cancelled" => {
11012                    let req = serde_json::from_value::<CancelledNotification>(value).map_err(serde::de::Error::custom)?;
11013                    Ok(ClientNotification::CancelledNotification(req))
11014                }
11015                "notifications/initialized" => {
11016                    let req = serde_json::from_value::<InitializedNotification>(value).map_err(serde::de::Error::custom)?;
11017                    Ok(ClientNotification::InitializedNotification(req))
11018                }
11019                "notifications/progress" => {
11020                    let req = serde_json::from_value::<ProgressNotification>(value).map_err(serde::de::Error::custom)?;
11021                    Ok(ClientNotification::ProgressNotification(req))
11022                }
11023                "notifications/tasks/status" => {
11024                    let req = serde_json::from_value::<TaskStatusNotification>(value).map_err(serde::de::Error::custom)?;
11025                    Ok(ClientNotification::TaskStatusNotification(req))
11026                }
11027                "notifications/roots/list_changed" => {
11028                    let req =
11029                        serde_json::from_value::<RootsListChangedNotification>(value).map_err(serde::de::Error::custom)?;
11030                    Ok(ClientNotification::RootsListChangedNotification(req))
11031                }
11032                _ => Err(serde::de::Error::unknown_variant("method", &[""])),
11033            }
11034        } else {
11035            Err(serde::de::Error::missing_field("method"))
11036        }
11037    }
11038}
11039impl ClientNotification {
11040    pub fn method(&self) -> &str {
11041        match self {
11042            ClientNotification::CancelledNotification(request) => request.method(),
11043            ClientNotification::InitializedNotification(request) => request.method(),
11044            ClientNotification::ProgressNotification(request) => request.method(),
11045            ClientNotification::TaskStatusNotification(request) => request.method(),
11046            ClientNotification::RootsListChangedNotification(request) => request.method(),
11047        }
11048    }
11049}
11050/// Implementing the Deserialize trait
11051/// This allows enum to be deserialized into correct type based on the value of the "method"
11052impl<'de> serde::Deserialize<'de> for ServerRequest {
11053    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11054    where
11055        D: serde::Deserializer<'de>,
11056    {
11057        let value: serde_json::Value = serde::Deserialize::deserialize(deserializer)?;
11058        let method_option = value.get("method").and_then(|v| v.as_str());
11059        if let Some(method) = method_option {
11060            match method {
11061                "ping" => {
11062                    let req = serde_json::from_value::<PingRequest>(value).map_err(serde::de::Error::custom)?;
11063                    Ok(ServerRequest::PingRequest(req))
11064                }
11065                "tasks/get" => {
11066                    let req = serde_json::from_value::<GetTaskRequest>(value).map_err(serde::de::Error::custom)?;
11067                    Ok(ServerRequest::GetTaskRequest(req))
11068                }
11069                "tasks/result" => {
11070                    let req = serde_json::from_value::<GetTaskPayloadRequest>(value).map_err(serde::de::Error::custom)?;
11071                    Ok(ServerRequest::GetTaskPayloadRequest(req))
11072                }
11073                "tasks/cancel" => {
11074                    let req = serde_json::from_value::<CancelTaskRequest>(value).map_err(serde::de::Error::custom)?;
11075                    Ok(ServerRequest::CancelTaskRequest(req))
11076                }
11077                "tasks/list" => {
11078                    let req = serde_json::from_value::<ListTasksRequest>(value).map_err(serde::de::Error::custom)?;
11079                    Ok(ServerRequest::ListTasksRequest(req))
11080                }
11081                "sampling/createMessage" => {
11082                    let req = serde_json::from_value::<CreateMessageRequest>(value).map_err(serde::de::Error::custom)?;
11083                    Ok(ServerRequest::CreateMessageRequest(req))
11084                }
11085                "roots/list" => {
11086                    let req = serde_json::from_value::<ListRootsRequest>(value).map_err(serde::de::Error::custom)?;
11087                    Ok(ServerRequest::ListRootsRequest(req))
11088                }
11089                "elicitation/create" => {
11090                    let req = serde_json::from_value::<ElicitRequest>(value).map_err(serde::de::Error::custom)?;
11091                    Ok(ServerRequest::ElicitRequest(req))
11092                }
11093                _ => Err(serde::de::Error::unknown_variant("method", &[""])),
11094            }
11095        } else {
11096            Err(serde::de::Error::missing_field("method"))
11097        }
11098    }
11099}
11100impl ServerRequest {
11101    pub fn method(&self) -> &str {
11102        match self {
11103            ServerRequest::PingRequest(request) => request.method(),
11104            ServerRequest::GetTaskRequest(request) => request.method(),
11105            ServerRequest::GetTaskPayloadRequest(request) => request.method(),
11106            ServerRequest::CancelTaskRequest(request) => request.method(),
11107            ServerRequest::ListTasksRequest(request) => request.method(),
11108            ServerRequest::CreateMessageRequest(request) => request.method(),
11109            ServerRequest::ListRootsRequest(request) => request.method(),
11110            ServerRequest::ElicitRequest(request) => request.method(),
11111        }
11112    }
11113}
11114/// Implementing the Deserialize trait
11115/// This allows enum to be deserialized into correct type based on the value of the "method"
11116impl<'de> serde::Deserialize<'de> for ServerNotification {
11117    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11118    where
11119        D: serde::Deserializer<'de>,
11120    {
11121        let value: serde_json::Value = serde::Deserialize::deserialize(deserializer)?;
11122        let method_option = value.get("method").and_then(|v| v.as_str());
11123        if let Some(method) = method_option {
11124            match method {
11125                "notifications/cancelled" => {
11126                    let req = serde_json::from_value::<CancelledNotification>(value).map_err(serde::de::Error::custom)?;
11127                    Ok(ServerNotification::CancelledNotification(req))
11128                }
11129                "notifications/progress" => {
11130                    let req = serde_json::from_value::<ProgressNotification>(value).map_err(serde::de::Error::custom)?;
11131                    Ok(ServerNotification::ProgressNotification(req))
11132                }
11133                "notifications/resources/list_changed" => {
11134                    let req = serde_json::from_value::<ResourceListChangedNotification>(value)
11135                        .map_err(serde::de::Error::custom)?;
11136                    Ok(ServerNotification::ResourceListChangedNotification(req))
11137                }
11138                "notifications/resources/updated" => {
11139                    let req =
11140                        serde_json::from_value::<ResourceUpdatedNotification>(value).map_err(serde::de::Error::custom)?;
11141                    Ok(ServerNotification::ResourceUpdatedNotification(req))
11142                }
11143                "notifications/prompts/list_changed" => {
11144                    let req =
11145                        serde_json::from_value::<PromptListChangedNotification>(value).map_err(serde::de::Error::custom)?;
11146                    Ok(ServerNotification::PromptListChangedNotification(req))
11147                }
11148                "notifications/tools/list_changed" => {
11149                    let req =
11150                        serde_json::from_value::<ToolListChangedNotification>(value).map_err(serde::de::Error::custom)?;
11151                    Ok(ServerNotification::ToolListChangedNotification(req))
11152                }
11153                "notifications/tasks/status" => {
11154                    let req = serde_json::from_value::<TaskStatusNotification>(value).map_err(serde::de::Error::custom)?;
11155                    Ok(ServerNotification::TaskStatusNotification(req))
11156                }
11157                "notifications/message" => {
11158                    let req =
11159                        serde_json::from_value::<LoggingMessageNotification>(value).map_err(serde::de::Error::custom)?;
11160                    Ok(ServerNotification::LoggingMessageNotification(req))
11161                }
11162                "notifications/elicitation/complete" => {
11163                    let req = serde_json::from_value::<ElicitationCompleteNotification>(value)
11164                        .map_err(serde::de::Error::custom)?;
11165                    Ok(ServerNotification::ElicitationCompleteNotification(req))
11166                }
11167                _ => Err(serde::de::Error::unknown_variant("method", &[""])),
11168            }
11169        } else {
11170            Err(serde::de::Error::missing_field("method"))
11171        }
11172    }
11173}
11174impl ServerNotification {
11175    pub fn method(&self) -> &str {
11176        match self {
11177            ServerNotification::CancelledNotification(request) => request.method(),
11178            ServerNotification::ProgressNotification(request) => request.method(),
11179            ServerNotification::ResourceListChangedNotification(request) => request.method(),
11180            ServerNotification::ResourceUpdatedNotification(request) => request.method(),
11181            ServerNotification::PromptListChangedNotification(request) => request.method(),
11182            ServerNotification::ToolListChangedNotification(request) => request.method(),
11183            ServerNotification::TaskStatusNotification(request) => request.method(),
11184            ServerNotification::LoggingMessageNotification(request) => request.method(),
11185            ServerNotification::ElicitationCompleteNotification(request) => request.method(),
11186        }
11187    }
11188}
11189/// Deprecating the old auto-generated verbose names.
11190/// These were renamed to clearer, shorter names in v0.8.0.
11191/// The old names are deprecated but kept for backward-compatibility for a smooth migration period.
11192///
11193#[deprecated(since = "0.8.0", note = "Use `IncludeContext` instead.")]
11194pub type CreateMessageRequestParamsIncludeContext = IncludeContext;
11195#[deprecated(since = "0.8.0", note = "Use `CompleteRequestContext` instead.")]
11196pub type CompleteRequestParamsContext = CompleteRequestContext;
11197#[deprecated(since = "0.8.0", note = "Use `CompleteRequestArgument` instead.")]
11198pub type CompleteRequestParamsArgument = CompleteRequestArgument;
11199#[deprecated(since = "0.8.0", note = "Use `CompleteRequestRef` instead.")]
11200pub type CompleteRequestParamsRef = CompleteRequestRef;
11201#[deprecated(since = "0.8.0", note = "Use `CreateMessageContent` instead.")]
11202pub type CreateMessageResultContent = CreateMessageContent;
11203#[deprecated(since = "0.8.0", note = "Use `ElicitResultContent` instead.")]
11204pub type ElicitResultContentValue = ElicitResultContent;
11205#[deprecated(since = "0.8.0", note = "Use `ClientRoots` instead.")]
11206pub type ClientCapabilitiesRoots = ClientRoots;
11207#[deprecated(since = "0.8.0", note = "Use `ReadResourceContent` instead.")]
11208pub type ReadResourceResultContentsItem = ReadResourceContent;