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