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