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