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