rust_mcp_schema/generated_schema/2025_11_25/mcp_schema.rs
1/// Copyright (c) 2025 Ali Hashemi (rust-mcp-stack)
2/// Licensed under the MIT License. See LICENSE in the project root.
3/// ----------------------------------------------------------------------------
4/// This file is auto-generated by mcp-schema-gen v0.5.2.
5/// WARNING:
6/// It is not recommended to modify this file directly. You are free to
7/// modify or extend the implementations as needed, but please do so at your own risk.
8///
9/// Generated from : <https://github.com/modelcontextprotocol/specification.git>
10/// Hash : 9e7768c802b606e2d3dc4ebdaeaf07c40f943054
11/// Generated at : 2026-03-12 21:06:20
12/// ----------------------------------------------------------------------------
13///
14use super::validators as validate;
15/// MCP Protocol Version
16pub const LATEST_PROTOCOL_VERSION: &str = "2025-11-25";
17/// JSON-RPC Version
18pub const JSONRPC_VERSION: &str = "2.0";
19/// Parse error. Invalid JSON was received. An error occurred while parsing the JSON text.
20pub const PARSE_ERROR: i64 = -32700i64;
21/// Invalid Request. The JSON sent is not a valid Request object.
22pub const INVALID_REQUEST: i64 = -32600i64;
23/// Method not found. The method does not exist / is not available.
24pub const METHOD_NOT_FOUND: i64 = -32601i64;
25/// Invalid param. Invalid method parameter(s).
26pub const INVALID_PARAMS: i64 = -32602i64;
27/// Internal error. Internal JSON-RPC error.
28pub const INTERNAL_ERROR: i64 = -32603i64;
29/// The server cannot proceed without additional client input.
30pub const URL_ELICITATION_REQUIRED: i64 = -32042i64;
31///Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
32///
33/// <details><summary>JSON schema</summary>
34///
35/// ```json
36///{
37/// "description": "Optional annotations for the client. The client can use annotations to inform how objects are used or displayed",
38/// "type": "object",
39/// "properties": {
40/// "audience": {
41/// "description": "Describes who the intended audience of this object or data is.\n\nIt can include multiple entries to indicate content useful for multiple audiences (e.g., [\"user\", \"assistant\"]).",
42/// "type": "array",
43/// "items": {
44/// "$ref": "#/$defs/Role"
45/// }
46/// },
47/// "lastModified": {
48/// "description": "The moment the resource was last modified, as an ISO 8601 formatted string.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").\n\nExamples: last activity timestamp in an open file, timestamp when the resource\nwas attached, etc.",
49/// "type": "string"
50/// },
51/// "priority": {
52/// "description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
53/// "type": "number",
54/// "maximum": 1.0,
55/// "minimum": 0.0
56/// }
57/// }
58///}
59/// ```
60/// </details>
61#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
62pub struct Annotations {
63 /**Describes who the intended audience of this object or data is.
64 It can include multiple entries to indicate content useful for multiple audiences (e.g., ["user", "assistant"]).*/
65 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
66 pub audience: ::std::vec::Vec<Role>,
67 /**The moment the resource was last modified, as an ISO 8601 formatted string.
68 Should be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z").
69 Examples: last activity timestamp in an open file, timestamp when the resource
70 was attached, etc.*/
71 #[serde(rename = "lastModified", default, skip_serializing_if = "::std::option::Option::is_none")]
72 pub last_modified: ::std::option::Option<::std::string::String>,
73 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
74 pub priority: ::std::option::Option<f64>,
75}
76///Audio provided to or from an LLM.
77///
78/// <details><summary>JSON schema</summary>
79///
80/// ```json
81///{
82/// "description": "Audio provided to or from an LLM.",
83/// "type": "object",
84/// "required": [
85/// "data",
86/// "mimeType",
87/// "type"
88/// ],
89/// "properties": {
90/// "_meta": {
91/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
92/// "type": "object",
93/// "additionalProperties": {}
94/// },
95/// "annotations": {
96/// "description": "Optional annotations for the client.",
97/// "$ref": "#/$defs/Annotations"
98/// },
99/// "data": {
100/// "description": "The base64-encoded audio data.",
101/// "type": "string",
102/// "format": "byte"
103/// },
104/// "mimeType": {
105/// "description": "The MIME type of the audio. Different providers may support different audio types.",
106/// "type": "string"
107/// },
108/// "type": {
109/// "type": "string",
110/// "const": "audio"
111/// }
112/// }
113///}
114/// ```
115/// </details>
116#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
117pub struct AudioContent {
118 ///Optional annotations for the client.
119 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
120 pub annotations: ::std::option::Option<Annotations>,
121 ///The base64-encoded audio data.
122 pub data: ::std::string::String,
123 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
124 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
125 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
126 ///The MIME type of the audio. Different providers may support different audio types.
127 #[serde(rename = "mimeType")]
128 pub mime_type: ::std::string::String,
129 #[serde(rename = "type", deserialize_with = "validate::audio_content_type_")]
130 type_: ::std::string::String,
131}
132impl AudioContent {
133 pub fn new(
134 data: ::std::string::String,
135 mime_type: ::std::string::String,
136 annotations: ::std::option::Option<Annotations>,
137 meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
138 ) -> Self {
139 Self {
140 annotations,
141 data,
142 meta,
143 mime_type,
144 type_: "audio".to_string(),
145 }
146 }
147 pub fn type_(&self) -> &::std::string::String {
148 &self.type_
149 }
150 /// returns "audio"
151 pub fn type_value() -> &'static str {
152 "audio"
153 }
154}
155///Base interface for metadata with name (identifier) and title (display name) properties.
156///
157/// <details><summary>JSON schema</summary>
158///
159/// ```json
160///{
161/// "description": "Base interface for metadata with name (identifier) and title (display name) properties.",
162/// "type": "object",
163/// "required": [
164/// "name"
165/// ],
166/// "properties": {
167/// "name": {
168/// "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
169/// "type": "string"
170/// },
171/// "title": {
172/// "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
173/// "type": "string"
174/// }
175/// }
176///}
177/// ```
178/// </details>
179#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
180pub struct BaseMetadata {
181 ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
182 pub name: ::std::string::String,
183 /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
184 even by those unfamiliar with domain-specific terminology.
185 If not provided, the name should be used for display (except for Tool,
186 where annotations.title should be given precedence over using name,
187 if present).*/
188 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
189 pub title: ::std::option::Option<::std::string::String>,
190}
191///BlobResourceContents
192///
193/// <details><summary>JSON schema</summary>
194///
195/// ```json
196///{
197/// "type": "object",
198/// "required": [
199/// "blob",
200/// "uri"
201/// ],
202/// "properties": {
203/// "_meta": {
204/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
205/// "type": "object",
206/// "additionalProperties": {}
207/// },
208/// "blob": {
209/// "description": "A base64-encoded string representing the binary data of the item.",
210/// "type": "string",
211/// "format": "byte"
212/// },
213/// "mimeType": {
214/// "description": "The MIME type of this resource, if known.",
215/// "type": "string"
216/// },
217/// "uri": {
218/// "description": "The URI of this resource.",
219/// "type": "string",
220/// "format": "uri"
221/// }
222/// }
223///}
224/// ```
225/// </details>
226#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
227pub struct BlobResourceContents {
228 ///A base64-encoded string representing the binary data of the item.
229 pub blob: ::std::string::String,
230 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
231 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
232 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
233 ///The MIME type of this resource, if known.
234 #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
235 pub mime_type: ::std::option::Option<::std::string::String>,
236 ///The URI of this resource.
237 pub uri: ::std::string::String,
238}
239///BooleanSchema
240///
241/// <details><summary>JSON schema</summary>
242///
243/// ```json
244///{
245/// "type": "object",
246/// "required": [
247/// "type"
248/// ],
249/// "properties": {
250/// "default": {
251/// "type": "boolean"
252/// },
253/// "description": {
254/// "type": "string"
255/// },
256/// "title": {
257/// "type": "string"
258/// },
259/// "type": {
260/// "type": "string",
261/// "const": "boolean"
262/// }
263/// }
264///}
265/// ```
266/// </details>
267#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
268pub struct BooleanSchema {
269 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
270 pub default: ::std::option::Option<bool>,
271 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
272 pub description: ::std::option::Option<::std::string::String>,
273 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
274 pub title: ::std::option::Option<::std::string::String>,
275 #[serde(rename = "type", deserialize_with = "validate::boolean_schema_type_")]
276 type_: ::std::string::String,
277}
278impl BooleanSchema {
279 pub fn new(
280 default: ::std::option::Option<bool>,
281 description: ::std::option::Option<::std::string::String>,
282 title: ::std::option::Option<::std::string::String>,
283 ) -> Self {
284 Self {
285 default,
286 description,
287 title,
288 type_: "boolean".to_string(),
289 }
290 }
291 pub fn type_(&self) -> &::std::string::String {
292 &self.type_
293 }
294 /// returns "boolean"
295 pub fn type_value() -> &'static str {
296 "boolean"
297 }
298}
299///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
300///
301/// <details><summary>JSON schema</summary>
302///
303/// ```json
304///{
305/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
306/// "type": "object",
307/// "properties": {
308/// "progressToken": {
309/// "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.",
310/// "$ref": "#/$defs/ProgressToken"
311/// }
312/// },
313/// "additionalProperties": {}
314///}
315/// ```
316/// </details>
317#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
318pub struct CallToolMeta {
319 ///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.
320 #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
321 pub progress_token: ::std::option::Option<ProgressToken>,
322 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
323 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
324}
325///Used by the client to invoke a tool provided by the server.
326///
327/// <details><summary>JSON schema</summary>
328///
329/// ```json
330///{
331/// "description": "Used by the client to invoke a tool provided by the server.",
332/// "type": "object",
333/// "required": [
334/// "id",
335/// "jsonrpc",
336/// "method",
337/// "params"
338/// ],
339/// "properties": {
340/// "id": {
341/// "$ref": "#/$defs/RequestId"
342/// },
343/// "jsonrpc": {
344/// "type": "string",
345/// "const": "2.0"
346/// },
347/// "method": {
348/// "type": "string",
349/// "const": "tools/call"
350/// },
351/// "params": {
352/// "$ref": "#/$defs/CallToolRequestParams"
353/// }
354/// }
355///}
356/// ```
357/// </details>
358#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
359pub struct CallToolRequest {
360 pub id: RequestId,
361 #[serde(deserialize_with = "validate::call_tool_request_jsonrpc")]
362 jsonrpc: ::std::string::String,
363 #[serde(deserialize_with = "validate::call_tool_request_method")]
364 method: ::std::string::String,
365 pub params: CallToolRequestParams,
366}
367impl CallToolRequest {
368 pub fn new(id: RequestId, params: CallToolRequestParams) -> Self {
369 Self {
370 id,
371 jsonrpc: JSONRPC_VERSION.to_string(),
372 method: "tools/call".to_string(),
373 params,
374 }
375 }
376 pub fn jsonrpc(&self) -> &::std::string::String {
377 &self.jsonrpc
378 }
379 pub fn method(&self) -> &::std::string::String {
380 &self.method
381 }
382 /// returns "tools/call"
383 pub fn method_value() -> &'static str {
384 "tools/call"
385 }
386}
387///Parameters for a tools/call request.
388///
389/// <details><summary>JSON schema</summary>
390///
391/// ```json
392///{
393/// "description": "Parameters for a tools/call request.",
394/// "type": "object",
395/// "required": [
396/// "name"
397/// ],
398/// "properties": {
399/// "_meta": {
400/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
401/// "type": "object",
402/// "properties": {
403/// "progressToken": {
404/// "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.",
405/// "$ref": "#/$defs/ProgressToken"
406/// }
407/// },
408/// "additionalProperties": {}
409/// },
410/// "arguments": {
411/// "description": "Arguments to use for the tool call.",
412/// "type": "object",
413/// "additionalProperties": {}
414/// },
415/// "name": {
416/// "description": "The name of the tool.",
417/// "type": "string"
418/// },
419/// "task": {
420/// "description": "If specified, the caller is requesting task-augmented execution for this request.\nThe request will return a CreateTaskResult immediately, and the actual result can be\nretrieved later via tasks/result.\n\nTask augmentation is subject to capability negotiation - receivers MUST declare support\nfor task augmentation of specific request types in their capabilities.",
421/// "$ref": "#/$defs/TaskMetadata"
422/// }
423/// }
424///}
425/// ```
426/// </details>
427#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
428pub struct CallToolRequestParams {
429 ///Arguments to use for the tool call.
430 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
431 pub arguments: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
432 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
433 pub meta: ::std::option::Option<CallToolMeta>,
434 ///The name of the tool.
435 pub name: ::std::string::String,
436 /**If specified, the caller is requesting task-augmented execution for this request.
437 The request will return a CreateTaskResult immediately, and the actual result can be
438 retrieved later via tasks/result.
439 Task augmentation is subject to capability negotiation - receivers MUST declare support
440 for task augmentation of specific request types in their capabilities.*/
441 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
442 pub task: ::std::option::Option<TaskMetadata>,
443}
444///The server's response to a tool call.
445///
446/// <details><summary>JSON schema</summary>
447///
448/// ```json
449///{
450/// "description": "The server's response to a tool call.",
451/// "type": "object",
452/// "required": [
453/// "content"
454/// ],
455/// "properties": {
456/// "_meta": {
457/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
458/// "type": "object",
459/// "additionalProperties": {}
460/// },
461/// "content": {
462/// "description": "A list of content objects that represent the unstructured result of the tool call.",
463/// "type": "array",
464/// "items": {
465/// "$ref": "#/$defs/ContentBlock"
466/// }
467/// },
468/// "isError": {
469/// "description": "Whether the tool call ended in an error.\n\nIf not set, this is assumed to be false (the call was successful).\n\nAny errors that originate from the tool SHOULD be reported inside the result\nobject, with isError set to true, _not_ as an MCP protocol-level error\nresponse. Otherwise, the LLM would not be able to see that an error occurred\nand self-correct.\n\nHowever, any errors in _finding_ the tool, an error indicating that the\nserver does not support tool calls, or any other exceptional conditions,\nshould be reported as an MCP error response.",
470/// "type": "boolean"
471/// },
472/// "structuredContent": {
473/// "description": "An optional JSON object that represents the structured result of the tool call.",
474/// "type": "object",
475/// "additionalProperties": {}
476/// }
477/// }
478///}
479/// ```
480/// </details>
481#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
482pub struct CallToolResult {
483 ///A list of content objects that represent the unstructured result of the tool call.
484 pub content: ::std::vec::Vec<ContentBlock>,
485 /**Whether the tool call ended in an error.
486 If not set, this is assumed to be false (the call was successful).
487 Any errors that originate from the tool SHOULD be reported inside the result
488 object, with isError set to true, _not_ as an MCP protocol-level error
489 response. Otherwise, the LLM would not be able to see that an error occurred
490 and self-correct.
491 However, any errors in _finding_ the tool, an error indicating that the
492 server does not support tool calls, or any other exceptional conditions,
493 should be reported as an MCP error response.*/
494 #[serde(rename = "isError", default, skip_serializing_if = "::std::option::Option::is_none")]
495 pub is_error: ::std::option::Option<bool>,
496 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
497 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
498 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
499 ///An optional JSON object that represents the structured result of the tool call.
500 #[serde(
501 rename = "structuredContent",
502 default,
503 skip_serializing_if = "::std::option::Option::is_none"
504 )]
505 pub structured_content: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
506}
507///CancelTaskParams
508///
509/// <details><summary>JSON schema</summary>
510///
511/// ```json
512///{
513/// "type": "object",
514/// "required": [
515/// "taskId"
516/// ],
517/// "properties": {
518/// "taskId": {
519/// "description": "The task identifier to cancel.",
520/// "type": "string"
521/// }
522/// }
523///}
524/// ```
525/// </details>
526#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
527pub struct CancelTaskParams {
528 ///The task identifier to cancel.
529 #[serde(rename = "taskId")]
530 pub task_id: ::std::string::String,
531}
532///A request to cancel a task.
533///
534/// <details><summary>JSON schema</summary>
535///
536/// ```json
537///{
538/// "description": "A request to cancel a task.",
539/// "type": "object",
540/// "required": [
541/// "id",
542/// "jsonrpc",
543/// "method",
544/// "params"
545/// ],
546/// "properties": {
547/// "id": {
548/// "$ref": "#/$defs/RequestId"
549/// },
550/// "jsonrpc": {
551/// "type": "string",
552/// "const": "2.0"
553/// },
554/// "method": {
555/// "type": "string",
556/// "const": "tasks/cancel"
557/// },
558/// "params": {
559/// "type": "object",
560/// "required": [
561/// "taskId"
562/// ],
563/// "properties": {
564/// "taskId": {
565/// "description": "The task identifier to cancel.",
566/// "type": "string"
567/// }
568/// }
569/// }
570/// }
571///}
572/// ```
573/// </details>
574#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
575pub struct CancelTaskRequest {
576 pub id: RequestId,
577 #[serde(deserialize_with = "validate::cancel_task_request_jsonrpc")]
578 jsonrpc: ::std::string::String,
579 #[serde(deserialize_with = "validate::cancel_task_request_method")]
580 method: ::std::string::String,
581 pub params: CancelTaskParams,
582}
583impl CancelTaskRequest {
584 pub fn new(id: RequestId, params: CancelTaskParams) -> Self {
585 Self {
586 id,
587 jsonrpc: JSONRPC_VERSION.to_string(),
588 method: "tasks/cancel".to_string(),
589 params,
590 }
591 }
592 pub fn jsonrpc(&self) -> &::std::string::String {
593 &self.jsonrpc
594 }
595 pub fn method(&self) -> &::std::string::String {
596 &self.method
597 }
598 /// returns "tasks/cancel"
599 pub fn method_value() -> &'static str {
600 "tasks/cancel"
601 }
602}
603///The response to a tasks/cancel request.
604///
605/// <details><summary>JSON schema</summary>
606///
607/// ```json
608///{
609/// "description": "The response to a tasks/cancel request.",
610/// "allOf": [
611/// {
612/// "$ref": "#/$defs/Result"
613/// },
614/// {
615/// "$ref": "#/$defs/Task"
616/// }
617/// ]
618///}
619/// ```
620/// </details>
621#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
622pub struct CancelTaskResult {
623 #[serde(rename = "createdAt")]
624 pub created_at: ::std::string::String,
625 #[serde(rename = "lastUpdatedAt")]
626 pub last_updated_at: ::std::string::String,
627 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
628 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
629 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
630 #[serde(rename = "pollInterval", default, skip_serializing_if = "::std::option::Option::is_none")]
631 pub poll_interval: ::std::option::Option<i64>,
632 pub status: TaskStatus,
633 #[serde(rename = "statusMessage", default, skip_serializing_if = "::std::option::Option::is_none")]
634 pub status_message: ::std::option::Option<::std::string::String>,
635 #[serde(rename = "taskId")]
636 pub task_id: ::std::string::String,
637 pub ttl: i64,
638 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
639 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
640}
641/**This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
642The 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.
643This notification indicates that the result will be unused, so any associated processing SHOULD cease.
644A client MUST NOT attempt to cancel its initialize request.
645For task cancellation, use the tasks/cancel request instead of this notification.*/
646///
647/// <details><summary>JSON schema</summary>
648///
649/// ```json
650///{
651/// "description": "This notification can be sent by either side to indicate that it is cancelling a previously-issued request.\n\nThe request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.\n\nThis notification indicates that the result will be unused, so any associated processing SHOULD cease.\n\nA client MUST NOT attempt to cancel its initialize request.\n\nFor task cancellation, use the tasks/cancel request instead of this notification.",
652/// "type": "object",
653/// "required": [
654/// "jsonrpc",
655/// "method",
656/// "params"
657/// ],
658/// "properties": {
659/// "jsonrpc": {
660/// "type": "string",
661/// "const": "2.0"
662/// },
663/// "method": {
664/// "type": "string",
665/// "const": "notifications/cancelled"
666/// },
667/// "params": {
668/// "$ref": "#/$defs/CancelledNotificationParams"
669/// }
670/// }
671///}
672/// ```
673/// </details>
674#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
675pub struct CancelledNotification {
676 #[serde(deserialize_with = "validate::cancelled_notification_jsonrpc")]
677 jsonrpc: ::std::string::String,
678 #[serde(deserialize_with = "validate::cancelled_notification_method")]
679 method: ::std::string::String,
680 pub params: CancelledNotificationParams,
681}
682impl CancelledNotification {
683 pub fn new(params: CancelledNotificationParams) -> Self {
684 Self {
685 jsonrpc: JSONRPC_VERSION.to_string(),
686 method: "notifications/cancelled".to_string(),
687 params,
688 }
689 }
690 pub fn jsonrpc(&self) -> &::std::string::String {
691 &self.jsonrpc
692 }
693 pub fn method(&self) -> &::std::string::String {
694 &self.method
695 }
696 /// returns "notifications/cancelled"
697 pub fn method_value() -> &'static str {
698 "notifications/cancelled"
699 }
700}
701///Parameters for a notifications/cancelled notification.
702///
703/// <details><summary>JSON schema</summary>
704///
705/// ```json
706///{
707/// "description": "Parameters for a notifications/cancelled notification.",
708/// "type": "object",
709/// "properties": {
710/// "_meta": {
711/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
712/// "type": "object",
713/// "additionalProperties": {}
714/// },
715/// "reason": {
716/// "description": "An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.",
717/// "type": "string"
718/// },
719/// "requestId": {
720/// "description": "The ID of the request to cancel.\n\nThis MUST correspond to the ID of a request previously issued in the same direction.\nThis MUST be provided for cancelling non-task requests.\nThis MUST NOT be used for cancelling tasks (use the tasks/cancel request instead).",
721/// "$ref": "#/$defs/RequestId"
722/// }
723/// }
724///}
725/// ```
726/// </details>
727#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
728pub struct CancelledNotificationParams {
729 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
730 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
731 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
732 ///An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
733 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
734 pub reason: ::std::option::Option<::std::string::String>,
735 /**The ID of the request to cancel.
736 This MUST correspond to the ID of a request previously issued in the same direction.
737 This MUST be provided for cancelling non-task requests.
738 This MUST NOT be used for cancelling tasks (use the tasks/cancel request instead).*/
739 #[serde(rename = "requestId", default, skip_serializing_if = "::std::option::Option::is_none")]
740 pub request_id: ::std::option::Option<RequestId>,
741}
742///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.
743///
744/// <details><summary>JSON schema</summary>
745///
746/// ```json
747///{
748/// "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.",
749/// "type": "object",
750/// "properties": {
751/// "elicitation": {
752/// "description": "Present if the client supports elicitation from the server.",
753/// "type": "object",
754/// "properties": {
755/// "form": {
756/// "type": "object",
757/// "additionalProperties": true
758/// },
759/// "url": {
760/// "type": "object",
761/// "additionalProperties": true
762/// }
763/// }
764/// },
765/// "experimental": {
766/// "description": "Experimental, non-standard capabilities that the client supports.",
767/// "type": "object",
768/// "additionalProperties": {
769/// "type": "object",
770/// "additionalProperties": true
771/// }
772/// },
773/// "roots": {
774/// "description": "Present if the client supports listing roots.",
775/// "type": "object",
776/// "properties": {
777/// "listChanged": {
778/// "description": "Whether the client supports notifications for changes to the roots list.",
779/// "type": "boolean"
780/// }
781/// }
782/// },
783/// "sampling": {
784/// "description": "Present if the client supports sampling from an LLM.",
785/// "type": "object",
786/// "properties": {
787/// "context": {
788/// "description": "Whether the client supports context inclusion via includeContext parameter.\nIf not declared, servers SHOULD only use includeContext: \"none\" (or omit it).",
789/// "type": "object",
790/// "additionalProperties": true
791/// },
792/// "tools": {
793/// "description": "Whether the client supports tool use via tools and toolChoice parameters.",
794/// "type": "object",
795/// "additionalProperties": true
796/// }
797/// }
798/// },
799/// "tasks": {
800/// "description": "Present if the client supports task-augmented requests.",
801/// "type": "object",
802/// "properties": {
803/// "cancel": {
804/// "description": "Whether this client supports tasks/cancel.",
805/// "type": "object",
806/// "additionalProperties": true
807/// },
808/// "list": {
809/// "description": "Whether this client supports tasks/list.",
810/// "type": "object",
811/// "additionalProperties": true
812/// },
813/// "requests": {
814/// "description": "Specifies which request types can be augmented with tasks.",
815/// "type": "object",
816/// "properties": {
817/// "elicitation": {
818/// "description": "Task support for elicitation-related requests.",
819/// "type": "object",
820/// "properties": {
821/// "create": {
822/// "description": "Whether the client supports task-augmented elicitation/create requests.",
823/// "type": "object",
824/// "additionalProperties": true
825/// }
826/// }
827/// },
828/// "sampling": {
829/// "description": "Task support for sampling-related requests.",
830/// "type": "object",
831/// "properties": {
832/// "createMessage": {
833/// "description": "Whether the client supports task-augmented sampling/createMessage requests.",
834/// "type": "object",
835/// "additionalProperties": true
836/// }
837/// }
838/// }
839/// }
840/// }
841/// }
842/// }
843/// }
844///}
845/// ```
846/// </details>
847#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
848pub struct ClientCapabilities {
849 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
850 pub elicitation: ::std::option::Option<ClientElicitation>,
851 ///Experimental, non-standard capabilities that the client supports.
852 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
853 pub experimental: ::std::option::Option<
854 std::collections::BTreeMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
855 >,
856 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
857 pub roots: ::std::option::Option<ClientRoots>,
858 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
859 pub sampling: ::std::option::Option<ClientSampling>,
860 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
861 pub tasks: ::std::option::Option<ClientTasks>,
862}
863///Present if the client supports elicitation from the server.
864///
865/// <details><summary>JSON schema</summary>
866///
867/// ```json
868///{
869/// "description": "Present if the client supports elicitation from the server.",
870/// "type": "object",
871/// "properties": {
872/// "form": {
873/// "type": "object",
874/// "additionalProperties": true
875/// },
876/// "url": {
877/// "type": "object",
878/// "additionalProperties": true
879/// }
880/// }
881///}
882/// ```
883/// </details>
884#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
885pub struct ClientElicitation {
886 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
887 pub form: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
888 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
889 pub url: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
890}
891///ClientNotification
892///
893/// <details><summary>JSON schema</summary>
894///
895/// ```json
896///{
897/// "anyOf": [
898/// {
899/// "$ref": "#/$defs/CancelledNotification"
900/// },
901/// {
902/// "$ref": "#/$defs/InitializedNotification"
903/// },
904/// {
905/// "$ref": "#/$defs/ProgressNotification"
906/// },
907/// {
908/// "$ref": "#/$defs/TaskStatusNotification"
909/// },
910/// {
911/// "$ref": "#/$defs/RootsListChangedNotification"
912/// }
913/// ]
914///}
915/// ```
916/// </details>
917#[derive(::serde::Serialize, Clone, Debug)]
918#[serde(untagged)]
919pub enum ClientNotification {
920 CancelledNotification(CancelledNotification),
921 InitializedNotification(InitializedNotification),
922 ProgressNotification(ProgressNotification),
923 TaskStatusNotification(TaskStatusNotification),
924 RootsListChangedNotification(RootsListChangedNotification),
925}
926impl ::std::convert::From<CancelledNotification> for ClientNotification {
927 fn from(value: CancelledNotification) -> Self {
928 Self::CancelledNotification(value)
929 }
930}
931impl ::std::convert::From<InitializedNotification> for ClientNotification {
932 fn from(value: InitializedNotification) -> Self {
933 Self::InitializedNotification(value)
934 }
935}
936impl ::std::convert::From<ProgressNotification> for ClientNotification {
937 fn from(value: ProgressNotification) -> Self {
938 Self::ProgressNotification(value)
939 }
940}
941impl ::std::convert::From<TaskStatusNotification> for ClientNotification {
942 fn from(value: TaskStatusNotification) -> Self {
943 Self::TaskStatusNotification(value)
944 }
945}
946impl ::std::convert::From<RootsListChangedNotification> for ClientNotification {
947 fn from(value: RootsListChangedNotification) -> Self {
948 Self::RootsListChangedNotification(value)
949 }
950}
951///ClientRequest
952///
953/// <details><summary>JSON schema</summary>
954///
955/// ```json
956///{
957/// "anyOf": [
958/// {
959/// "$ref": "#/$defs/InitializeRequest"
960/// },
961/// {
962/// "$ref": "#/$defs/PingRequest"
963/// },
964/// {
965/// "$ref": "#/$defs/ListResourcesRequest"
966/// },
967/// {
968/// "$ref": "#/$defs/ListResourceTemplatesRequest"
969/// },
970/// {
971/// "$ref": "#/$defs/ReadResourceRequest"
972/// },
973/// {
974/// "$ref": "#/$defs/SubscribeRequest"
975/// },
976/// {
977/// "$ref": "#/$defs/UnsubscribeRequest"
978/// },
979/// {
980/// "$ref": "#/$defs/ListPromptsRequest"
981/// },
982/// {
983/// "$ref": "#/$defs/GetPromptRequest"
984/// },
985/// {
986/// "$ref": "#/$defs/ListToolsRequest"
987/// },
988/// {
989/// "$ref": "#/$defs/CallToolRequest"
990/// },
991/// {
992/// "$ref": "#/$defs/GetTaskRequest"
993/// },
994/// {
995/// "$ref": "#/$defs/GetTaskPayloadRequest"
996/// },
997/// {
998/// "$ref": "#/$defs/CancelTaskRequest"
999/// },
1000/// {
1001/// "$ref": "#/$defs/ListTasksRequest"
1002/// },
1003/// {
1004/// "$ref": "#/$defs/SetLevelRequest"
1005/// },
1006/// {
1007/// "$ref": "#/$defs/CompleteRequest"
1008/// }
1009/// ]
1010///}
1011/// ```
1012/// </details>
1013#[derive(::serde::Serialize, Clone, Debug)]
1014#[serde(untagged)]
1015pub enum ClientRequest {
1016 InitializeRequest(InitializeRequest),
1017 PingRequest(PingRequest),
1018 ListResourcesRequest(ListResourcesRequest),
1019 ListResourceTemplatesRequest(ListResourceTemplatesRequest),
1020 ReadResourceRequest(ReadResourceRequest),
1021 SubscribeRequest(SubscribeRequest),
1022 UnsubscribeRequest(UnsubscribeRequest),
1023 ListPromptsRequest(ListPromptsRequest),
1024 GetPromptRequest(GetPromptRequest),
1025 ListToolsRequest(ListToolsRequest),
1026 CallToolRequest(CallToolRequest),
1027 GetTaskRequest(GetTaskRequest),
1028 GetTaskPayloadRequest(GetTaskPayloadRequest),
1029 CancelTaskRequest(CancelTaskRequest),
1030 ListTasksRequest(ListTasksRequest),
1031 SetLevelRequest(SetLevelRequest),
1032 CompleteRequest(CompleteRequest),
1033}
1034impl ::std::convert::From<InitializeRequest> for ClientRequest {
1035 fn from(value: InitializeRequest) -> Self {
1036 Self::InitializeRequest(value)
1037 }
1038}
1039impl ::std::convert::From<PingRequest> for ClientRequest {
1040 fn from(value: PingRequest) -> Self {
1041 Self::PingRequest(value)
1042 }
1043}
1044impl ::std::convert::From<ListResourcesRequest> for ClientRequest {
1045 fn from(value: ListResourcesRequest) -> Self {
1046 Self::ListResourcesRequest(value)
1047 }
1048}
1049impl ::std::convert::From<ListResourceTemplatesRequest> for ClientRequest {
1050 fn from(value: ListResourceTemplatesRequest) -> Self {
1051 Self::ListResourceTemplatesRequest(value)
1052 }
1053}
1054impl ::std::convert::From<ReadResourceRequest> for ClientRequest {
1055 fn from(value: ReadResourceRequest) -> Self {
1056 Self::ReadResourceRequest(value)
1057 }
1058}
1059impl ::std::convert::From<SubscribeRequest> for ClientRequest {
1060 fn from(value: SubscribeRequest) -> Self {
1061 Self::SubscribeRequest(value)
1062 }
1063}
1064impl ::std::convert::From<UnsubscribeRequest> for ClientRequest {
1065 fn from(value: UnsubscribeRequest) -> Self {
1066 Self::UnsubscribeRequest(value)
1067 }
1068}
1069impl ::std::convert::From<ListPromptsRequest> for ClientRequest {
1070 fn from(value: ListPromptsRequest) -> Self {
1071 Self::ListPromptsRequest(value)
1072 }
1073}
1074impl ::std::convert::From<GetPromptRequest> for ClientRequest {
1075 fn from(value: GetPromptRequest) -> Self {
1076 Self::GetPromptRequest(value)
1077 }
1078}
1079impl ::std::convert::From<ListToolsRequest> for ClientRequest {
1080 fn from(value: ListToolsRequest) -> Self {
1081 Self::ListToolsRequest(value)
1082 }
1083}
1084impl ::std::convert::From<CallToolRequest> for ClientRequest {
1085 fn from(value: CallToolRequest) -> Self {
1086 Self::CallToolRequest(value)
1087 }
1088}
1089impl ::std::convert::From<GetTaskRequest> for ClientRequest {
1090 fn from(value: GetTaskRequest) -> Self {
1091 Self::GetTaskRequest(value)
1092 }
1093}
1094impl ::std::convert::From<GetTaskPayloadRequest> for ClientRequest {
1095 fn from(value: GetTaskPayloadRequest) -> Self {
1096 Self::GetTaskPayloadRequest(value)
1097 }
1098}
1099impl ::std::convert::From<CancelTaskRequest> for ClientRequest {
1100 fn from(value: CancelTaskRequest) -> Self {
1101 Self::CancelTaskRequest(value)
1102 }
1103}
1104impl ::std::convert::From<ListTasksRequest> for ClientRequest {
1105 fn from(value: ListTasksRequest) -> Self {
1106 Self::ListTasksRequest(value)
1107 }
1108}
1109impl ::std::convert::From<SetLevelRequest> for ClientRequest {
1110 fn from(value: SetLevelRequest) -> Self {
1111 Self::SetLevelRequest(value)
1112 }
1113}
1114impl ::std::convert::From<CompleteRequest> for ClientRequest {
1115 fn from(value: CompleteRequest) -> Self {
1116 Self::CompleteRequest(value)
1117 }
1118}
1119///ClientResult
1120///
1121/// <details><summary>JSON schema</summary>
1122///
1123/// ```json
1124///{
1125/// "anyOf": [
1126/// {
1127/// "$ref": "#/$defs/Result"
1128/// },
1129/// {
1130/// "description": "The response to a tasks/get request.",
1131/// "$ref": "#/$defs/GetTaskResult"
1132/// },
1133/// {
1134/// "$ref": "#/$defs/GetTaskPayloadResult"
1135/// },
1136/// {
1137/// "description": "The response to a tasks/cancel request.",
1138/// "$ref": "#/$defs/CancelTaskResult"
1139/// },
1140/// {
1141/// "$ref": "#/$defs/ListTasksResult"
1142/// },
1143/// {
1144/// "$ref": "#/$defs/CreateMessageResult"
1145/// },
1146/// {
1147/// "$ref": "#/$defs/ListRootsResult"
1148/// },
1149/// {
1150/// "$ref": "#/$defs/ElicitResult"
1151/// }
1152/// ]
1153///}
1154/// ```
1155/// </details>
1156#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1157#[serde(untagged)]
1158pub enum ClientResult {
1159 GetTaskResult(GetTaskResult),
1160 CancelTaskResult(CancelTaskResult),
1161 ListTasksResult(ListTasksResult),
1162 CreateMessageResult(CreateMessageResult),
1163 ListRootsResult(ListRootsResult),
1164 ElicitResult(ElicitResult),
1165 Result(Result),
1166 GetTaskPayloadResult(GetTaskPayloadResult),
1167}
1168impl ::std::convert::From<GetTaskResult> for ClientResult {
1169 fn from(value: GetTaskResult) -> Self {
1170 Self::GetTaskResult(value)
1171 }
1172}
1173impl ::std::convert::From<CancelTaskResult> for ClientResult {
1174 fn from(value: CancelTaskResult) -> Self {
1175 Self::CancelTaskResult(value)
1176 }
1177}
1178impl ::std::convert::From<ListTasksResult> for ClientResult {
1179 fn from(value: ListTasksResult) -> Self {
1180 Self::ListTasksResult(value)
1181 }
1182}
1183impl ::std::convert::From<CreateMessageResult> for ClientResult {
1184 fn from(value: CreateMessageResult) -> Self {
1185 Self::CreateMessageResult(value)
1186 }
1187}
1188impl ::std::convert::From<ListRootsResult> for ClientResult {
1189 fn from(value: ListRootsResult) -> Self {
1190 Self::ListRootsResult(value)
1191 }
1192}
1193impl ::std::convert::From<ElicitResult> for ClientResult {
1194 fn from(value: ElicitResult) -> Self {
1195 Self::ElicitResult(value)
1196 }
1197}
1198impl ::std::convert::From<Result> for ClientResult {
1199 fn from(value: Result) -> Self {
1200 Self::Result(value)
1201 }
1202}
1203impl ::std::convert::From<GetTaskPayloadResult> for ClientResult {
1204 fn from(value: GetTaskPayloadResult) -> Self {
1205 Self::GetTaskPayloadResult(value)
1206 }
1207}
1208///Present if the client supports listing roots.
1209///
1210/// <details><summary>JSON schema</summary>
1211///
1212/// ```json
1213///{
1214/// "description": "Present if the client supports listing roots.",
1215/// "type": "object",
1216/// "properties": {
1217/// "listChanged": {
1218/// "description": "Whether the client supports notifications for changes to the roots list.",
1219/// "type": "boolean"
1220/// }
1221/// }
1222///}
1223/// ```
1224/// </details>
1225#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
1226pub struct ClientRoots {
1227 ///Whether the client supports notifications for changes to the roots list.
1228 #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
1229 pub list_changed: ::std::option::Option<bool>,
1230}
1231///Present if the client supports sampling from an LLM.
1232///
1233/// <details><summary>JSON schema</summary>
1234///
1235/// ```json
1236///{
1237/// "description": "Present if the client supports sampling from an LLM.",
1238/// "type": "object",
1239/// "properties": {
1240/// "context": {
1241/// "description": "Whether the client supports context inclusion via includeContext parameter.\nIf not declared, servers SHOULD only use includeContext: \"none\" (or omit it).",
1242/// "type": "object",
1243/// "additionalProperties": true
1244/// },
1245/// "tools": {
1246/// "description": "Whether the client supports tool use via tools and toolChoice parameters.",
1247/// "type": "object",
1248/// "additionalProperties": true
1249/// }
1250/// }
1251///}
1252/// ```
1253/// </details>
1254#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
1255pub struct ClientSampling {
1256 /**Whether the client supports context inclusion via includeContext parameter.
1257 If not declared, servers SHOULD only use includeContext: "none" (or omit it).*/
1258 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1259 pub context: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1260 ///Whether the client supports tool use via tools and toolChoice parameters.
1261 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1262 pub tools: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1263}
1264///Task support for elicitation-related requests.
1265///
1266/// <details><summary>JSON schema</summary>
1267///
1268/// ```json
1269///{
1270/// "description": "Task support for elicitation-related requests.",
1271/// "type": "object",
1272/// "properties": {
1273/// "create": {
1274/// "description": "Whether the client supports task-augmented elicitation/create requests.",
1275/// "type": "object",
1276/// "additionalProperties": true
1277/// }
1278/// }
1279///}
1280/// ```
1281/// </details>
1282#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
1283pub struct ClientTaskElicitation {
1284 ///Whether the client supports task-augmented elicitation/create requests.
1285 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1286 pub create: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1287}
1288///Specifies which request types can be augmented with tasks.
1289///
1290/// <details><summary>JSON schema</summary>
1291///
1292/// ```json
1293///{
1294/// "description": "Specifies which request types can be augmented with tasks.",
1295/// "type": "object",
1296/// "properties": {
1297/// "elicitation": {
1298/// "description": "Task support for elicitation-related requests.",
1299/// "type": "object",
1300/// "properties": {
1301/// "create": {
1302/// "description": "Whether the client supports task-augmented elicitation/create requests.",
1303/// "type": "object",
1304/// "additionalProperties": true
1305/// }
1306/// }
1307/// },
1308/// "sampling": {
1309/// "description": "Task support for sampling-related requests.",
1310/// "type": "object",
1311/// "properties": {
1312/// "createMessage": {
1313/// "description": "Whether the client supports task-augmented sampling/createMessage requests.",
1314/// "type": "object",
1315/// "additionalProperties": true
1316/// }
1317/// }
1318/// }
1319/// }
1320///}
1321/// ```
1322/// </details>
1323#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
1324pub struct ClientTaskRequest {
1325 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1326 pub elicitation: ::std::option::Option<ClientTaskElicitation>,
1327 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1328 pub sampling: ::std::option::Option<ClientTaskSampling>,
1329}
1330///Task support for sampling-related requests.
1331///
1332/// <details><summary>JSON schema</summary>
1333///
1334/// ```json
1335///{
1336/// "description": "Task support for sampling-related requests.",
1337/// "type": "object",
1338/// "properties": {
1339/// "createMessage": {
1340/// "description": "Whether the client supports task-augmented sampling/createMessage requests.",
1341/// "type": "object",
1342/// "additionalProperties": true
1343/// }
1344/// }
1345///}
1346/// ```
1347/// </details>
1348#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
1349pub struct ClientTaskSampling {
1350 ///Whether the client supports task-augmented sampling/createMessage requests.
1351 #[serde(rename = "createMessage", default, skip_serializing_if = "::std::option::Option::is_none")]
1352 pub create_message: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1353}
1354///Present if the client supports task-augmented requests.
1355///
1356/// <details><summary>JSON schema</summary>
1357///
1358/// ```json
1359///{
1360/// "description": "Present if the client supports task-augmented requests.",
1361/// "type": "object",
1362/// "properties": {
1363/// "cancel": {
1364/// "description": "Whether this client supports tasks/cancel.",
1365/// "type": "object",
1366/// "additionalProperties": true
1367/// },
1368/// "list": {
1369/// "description": "Whether this client supports tasks/list.",
1370/// "type": "object",
1371/// "additionalProperties": true
1372/// },
1373/// "requests": {
1374/// "description": "Specifies which request types can be augmented with tasks.",
1375/// "type": "object",
1376/// "properties": {
1377/// "elicitation": {
1378/// "description": "Task support for elicitation-related requests.",
1379/// "type": "object",
1380/// "properties": {
1381/// "create": {
1382/// "description": "Whether the client supports task-augmented elicitation/create requests.",
1383/// "type": "object",
1384/// "additionalProperties": true
1385/// }
1386/// }
1387/// },
1388/// "sampling": {
1389/// "description": "Task support for sampling-related requests.",
1390/// "type": "object",
1391/// "properties": {
1392/// "createMessage": {
1393/// "description": "Whether the client supports task-augmented sampling/createMessage requests.",
1394/// "type": "object",
1395/// "additionalProperties": true
1396/// }
1397/// }
1398/// }
1399/// }
1400/// }
1401/// }
1402///}
1403/// ```
1404/// </details>
1405#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
1406pub struct ClientTasks {
1407 ///Whether this client supports tasks/cancel.
1408 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1409 pub cancel: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1410 ///Whether this client supports tasks/list.
1411 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1412 pub list: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1413 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1414 pub requests: ::std::option::Option<ClientTaskRequest>,
1415}
1416///A request from the client to the server, to ask for completion options.
1417///
1418/// <details><summary>JSON schema</summary>
1419///
1420/// ```json
1421///{
1422/// "description": "A request from the client to the server, to ask for completion options.",
1423/// "type": "object",
1424/// "required": [
1425/// "id",
1426/// "jsonrpc",
1427/// "method",
1428/// "params"
1429/// ],
1430/// "properties": {
1431/// "id": {
1432/// "$ref": "#/$defs/RequestId"
1433/// },
1434/// "jsonrpc": {
1435/// "type": "string",
1436/// "const": "2.0"
1437/// },
1438/// "method": {
1439/// "type": "string",
1440/// "const": "completion/complete"
1441/// },
1442/// "params": {
1443/// "$ref": "#/$defs/CompleteRequestParams"
1444/// }
1445/// }
1446///}
1447/// ```
1448/// </details>
1449#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1450pub struct CompleteRequest {
1451 pub id: RequestId,
1452 #[serde(deserialize_with = "validate::complete_request_jsonrpc")]
1453 jsonrpc: ::std::string::String,
1454 #[serde(deserialize_with = "validate::complete_request_method")]
1455 method: ::std::string::String,
1456 pub params: CompleteRequestParams,
1457}
1458impl CompleteRequest {
1459 pub fn new(id: RequestId, params: CompleteRequestParams) -> Self {
1460 Self {
1461 id,
1462 jsonrpc: JSONRPC_VERSION.to_string(),
1463 method: "completion/complete".to_string(),
1464 params,
1465 }
1466 }
1467 pub fn jsonrpc(&self) -> &::std::string::String {
1468 &self.jsonrpc
1469 }
1470 pub fn method(&self) -> &::std::string::String {
1471 &self.method
1472 }
1473 /// returns "completion/complete"
1474 pub fn method_value() -> &'static str {
1475 "completion/complete"
1476 }
1477}
1478///The argument's information
1479///
1480/// <details><summary>JSON schema</summary>
1481///
1482/// ```json
1483///{
1484/// "description": "The argument's information",
1485/// "type": "object",
1486/// "required": [
1487/// "name",
1488/// "value"
1489/// ],
1490/// "properties": {
1491/// "name": {
1492/// "description": "The name of the argument",
1493/// "type": "string"
1494/// },
1495/// "value": {
1496/// "description": "The value of the argument to use for completion matching.",
1497/// "type": "string"
1498/// }
1499/// }
1500///}
1501/// ```
1502/// </details>
1503#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1504pub struct CompleteRequestArgument {
1505 ///The name of the argument
1506 pub name: ::std::string::String,
1507 ///The value of the argument to use for completion matching.
1508 pub value: ::std::string::String,
1509}
1510///Additional, optional context for completions
1511///
1512/// <details><summary>JSON schema</summary>
1513///
1514/// ```json
1515///{
1516/// "description": "Additional, optional context for completions",
1517/// "type": "object",
1518/// "properties": {
1519/// "arguments": {
1520/// "description": "Previously-resolved variables in a URI template or prompt.",
1521/// "type": "object",
1522/// "additionalProperties": {
1523/// "type": "string"
1524/// }
1525/// }
1526/// }
1527///}
1528/// ```
1529/// </details>
1530#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
1531pub struct CompleteRequestContext {
1532 ///Previously-resolved variables in a URI template or prompt.
1533 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1534 pub arguments: ::std::option::Option<std::collections::BTreeMap<::std::string::String, ::std::string::String>>,
1535}
1536///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
1537///
1538/// <details><summary>JSON schema</summary>
1539///
1540/// ```json
1541///{
1542/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
1543/// "type": "object",
1544/// "properties": {
1545/// "progressToken": {
1546/// "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.",
1547/// "$ref": "#/$defs/ProgressToken"
1548/// }
1549/// },
1550/// "additionalProperties": {}
1551///}
1552/// ```
1553/// </details>
1554#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
1555pub struct CompleteRequestMeta {
1556 ///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.
1557 #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
1558 pub progress_token: ::std::option::Option<ProgressToken>,
1559 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
1560 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1561}
1562///Parameters for a completion/complete request.
1563///
1564/// <details><summary>JSON schema</summary>
1565///
1566/// ```json
1567///{
1568/// "description": "Parameters for a completion/complete request.",
1569/// "type": "object",
1570/// "required": [
1571/// "argument",
1572/// "ref"
1573/// ],
1574/// "properties": {
1575/// "_meta": {
1576/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
1577/// "type": "object",
1578/// "properties": {
1579/// "progressToken": {
1580/// "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.",
1581/// "$ref": "#/$defs/ProgressToken"
1582/// }
1583/// },
1584/// "additionalProperties": {}
1585/// },
1586/// "argument": {
1587/// "description": "The argument's information",
1588/// "type": "object",
1589/// "required": [
1590/// "name",
1591/// "value"
1592/// ],
1593/// "properties": {
1594/// "name": {
1595/// "description": "The name of the argument",
1596/// "type": "string"
1597/// },
1598/// "value": {
1599/// "description": "The value of the argument to use for completion matching.",
1600/// "type": "string"
1601/// }
1602/// }
1603/// },
1604/// "context": {
1605/// "description": "Additional, optional context for completions",
1606/// "type": "object",
1607/// "properties": {
1608/// "arguments": {
1609/// "description": "Previously-resolved variables in a URI template or prompt.",
1610/// "type": "object",
1611/// "additionalProperties": {
1612/// "type": "string"
1613/// }
1614/// }
1615/// }
1616/// },
1617/// "ref": {
1618/// "anyOf": [
1619/// {
1620/// "$ref": "#/$defs/PromptReference"
1621/// },
1622/// {
1623/// "$ref": "#/$defs/ResourceTemplateReference"
1624/// }
1625/// ]
1626/// }
1627/// }
1628///}
1629/// ```
1630/// </details>
1631#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1632pub struct CompleteRequestParams {
1633 pub argument: CompleteRequestArgument,
1634 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1635 pub context: ::std::option::Option<CompleteRequestContext>,
1636 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
1637 pub meta: ::std::option::Option<CompleteRequestMeta>,
1638 #[serde(rename = "ref")]
1639 pub ref_: CompleteRequestRef,
1640}
1641///CompleteRequestRef
1642///
1643/// <details><summary>JSON schema</summary>
1644///
1645/// ```json
1646///{
1647/// "anyOf": [
1648/// {
1649/// "$ref": "#/$defs/PromptReference"
1650/// },
1651/// {
1652/// "$ref": "#/$defs/ResourceTemplateReference"
1653/// }
1654/// ]
1655///}
1656/// ```
1657/// </details>
1658#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1659#[serde(untagged)]
1660pub enum CompleteRequestRef {
1661 PromptReference(PromptReference),
1662 ResourceTemplateReference(ResourceTemplateReference),
1663}
1664impl ::std::convert::From<PromptReference> for CompleteRequestRef {
1665 fn from(value: PromptReference) -> Self {
1666 Self::PromptReference(value)
1667 }
1668}
1669impl ::std::convert::From<ResourceTemplateReference> for CompleteRequestRef {
1670 fn from(value: ResourceTemplateReference) -> Self {
1671 Self::ResourceTemplateReference(value)
1672 }
1673}
1674///The server's response to a completion/complete request
1675///
1676/// <details><summary>JSON schema</summary>
1677///
1678/// ```json
1679///{
1680/// "description": "The server's response to a completion/complete request",
1681/// "type": "object",
1682/// "required": [
1683/// "completion"
1684/// ],
1685/// "properties": {
1686/// "_meta": {
1687/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
1688/// "type": "object",
1689/// "additionalProperties": {}
1690/// },
1691/// "completion": {
1692/// "type": "object",
1693/// "required": [
1694/// "values"
1695/// ],
1696/// "properties": {
1697/// "hasMore": {
1698/// "description": "Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.",
1699/// "type": "boolean"
1700/// },
1701/// "total": {
1702/// "description": "The total number of completion options available. This can exceed the number of values actually sent in the response.",
1703/// "type": "integer"
1704/// },
1705/// "values": {
1706/// "description": "An array of completion values. Must not exceed 100 items.",
1707/// "type": "array",
1708/// "items": {
1709/// "type": "string"
1710/// }
1711/// }
1712/// }
1713/// }
1714/// }
1715///}
1716/// ```
1717/// </details>
1718#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1719pub struct CompleteResult {
1720 pub completion: CompleteResultCompletion,
1721 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
1722 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
1723 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1724}
1725///CompleteResultCompletion
1726///
1727/// <details><summary>JSON schema</summary>
1728///
1729/// ```json
1730///{
1731/// "type": "object",
1732/// "required": [
1733/// "values"
1734/// ],
1735/// "properties": {
1736/// "hasMore": {
1737/// "description": "Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.",
1738/// "type": "boolean"
1739/// },
1740/// "total": {
1741/// "description": "The total number of completion options available. This can exceed the number of values actually sent in the response.",
1742/// "type": "integer"
1743/// },
1744/// "values": {
1745/// "description": "An array of completion values. Must not exceed 100 items.",
1746/// "type": "array",
1747/// "items": {
1748/// "type": "string"
1749/// }
1750/// }
1751/// }
1752///}
1753/// ```
1754/// </details>
1755#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1756pub struct CompleteResultCompletion {
1757 ///Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
1758 #[serde(rename = "hasMore", default, skip_serializing_if = "::std::option::Option::is_none")]
1759 pub has_more: ::std::option::Option<bool>,
1760 ///The total number of completion options available. This can exceed the number of values actually sent in the response.
1761 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1762 pub total: ::std::option::Option<i64>,
1763 ///An array of completion values. Must not exceed 100 items.
1764 pub values: ::std::vec::Vec<::std::string::String>,
1765}
1766///ContentBlock
1767///
1768/// <details><summary>JSON schema</summary>
1769///
1770/// ```json
1771///{
1772/// "anyOf": [
1773/// {
1774/// "$ref": "#/$defs/TextContent"
1775/// },
1776/// {
1777/// "$ref": "#/$defs/ImageContent"
1778/// },
1779/// {
1780/// "$ref": "#/$defs/AudioContent"
1781/// },
1782/// {
1783/// "$ref": "#/$defs/ResourceLink"
1784/// },
1785/// {
1786/// "$ref": "#/$defs/EmbeddedResource"
1787/// }
1788/// ]
1789///}
1790/// ```
1791/// </details>
1792#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1793#[serde(untagged)]
1794pub enum ContentBlock {
1795 TextContent(TextContent),
1796 ImageContent(ImageContent),
1797 AudioContent(AudioContent),
1798 ResourceLink(ResourceLink),
1799 EmbeddedResource(EmbeddedResource),
1800}
1801impl ::std::convert::From<TextContent> for ContentBlock {
1802 fn from(value: TextContent) -> Self {
1803 Self::TextContent(value)
1804 }
1805}
1806impl ::std::convert::From<ImageContent> for ContentBlock {
1807 fn from(value: ImageContent) -> Self {
1808 Self::ImageContent(value)
1809 }
1810}
1811impl ::std::convert::From<AudioContent> for ContentBlock {
1812 fn from(value: AudioContent) -> Self {
1813 Self::AudioContent(value)
1814 }
1815}
1816impl ::std::convert::From<ResourceLink> for ContentBlock {
1817 fn from(value: ResourceLink) -> Self {
1818 Self::ResourceLink(value)
1819 }
1820}
1821impl ::std::convert::From<EmbeddedResource> for ContentBlock {
1822 fn from(value: EmbeddedResource) -> Self {
1823 Self::EmbeddedResource(value)
1824 }
1825}
1826///CreateMessageContent
1827///
1828/// <details><summary>JSON schema</summary>
1829///
1830/// ```json
1831///{
1832/// "anyOf": [
1833/// {
1834/// "$ref": "#/$defs/TextContent"
1835/// },
1836/// {
1837/// "$ref": "#/$defs/ImageContent"
1838/// },
1839/// {
1840/// "$ref": "#/$defs/AudioContent"
1841/// },
1842/// {
1843/// "$ref": "#/$defs/ToolUseContent"
1844/// },
1845/// {
1846/// "$ref": "#/$defs/ToolResultContent"
1847/// },
1848/// {
1849/// "type": "array",
1850/// "items": {
1851/// "$ref": "#/$defs/SamplingMessageContentBlock"
1852/// }
1853/// }
1854/// ]
1855///}
1856/// ```
1857/// </details>
1858#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1859#[serde(untagged)]
1860pub enum CreateMessageContent {
1861 TextContent(TextContent),
1862 ImageContent(ImageContent),
1863 AudioContent(AudioContent),
1864 ToolUseContent(ToolUseContent),
1865 ToolResultContent(ToolResultContent),
1866 SamplingMessageContentBlock(::std::vec::Vec<SamplingMessageContentBlock>),
1867}
1868impl ::std::convert::From<TextContent> for CreateMessageContent {
1869 fn from(value: TextContent) -> Self {
1870 Self::TextContent(value)
1871 }
1872}
1873impl ::std::convert::From<ImageContent> for CreateMessageContent {
1874 fn from(value: ImageContent) -> Self {
1875 Self::ImageContent(value)
1876 }
1877}
1878impl ::std::convert::From<AudioContent> for CreateMessageContent {
1879 fn from(value: AudioContent) -> Self {
1880 Self::AudioContent(value)
1881 }
1882}
1883impl ::std::convert::From<ToolUseContent> for CreateMessageContent {
1884 fn from(value: ToolUseContent) -> Self {
1885 Self::ToolUseContent(value)
1886 }
1887}
1888impl ::std::convert::From<ToolResultContent> for CreateMessageContent {
1889 fn from(value: ToolResultContent) -> Self {
1890 Self::ToolResultContent(value)
1891 }
1892}
1893impl ::std::convert::From<::std::vec::Vec<SamplingMessageContentBlock>> for CreateMessageContent {
1894 fn from(value: ::std::vec::Vec<SamplingMessageContentBlock>) -> Self {
1895 Self::SamplingMessageContentBlock(value)
1896 }
1897}
1898///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.
1899///
1900/// <details><summary>JSON schema</summary>
1901///
1902/// ```json
1903///{
1904/// "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.",
1905/// "type": "object",
1906/// "required": [
1907/// "id",
1908/// "jsonrpc",
1909/// "method",
1910/// "params"
1911/// ],
1912/// "properties": {
1913/// "id": {
1914/// "$ref": "#/$defs/RequestId"
1915/// },
1916/// "jsonrpc": {
1917/// "type": "string",
1918/// "const": "2.0"
1919/// },
1920/// "method": {
1921/// "type": "string",
1922/// "const": "sampling/createMessage"
1923/// },
1924/// "params": {
1925/// "$ref": "#/$defs/CreateMessageRequestParams"
1926/// }
1927/// }
1928///}
1929/// ```
1930/// </details>
1931#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1932pub struct CreateMessageRequest {
1933 pub id: RequestId,
1934 #[serde(deserialize_with = "validate::create_message_request_jsonrpc")]
1935 jsonrpc: ::std::string::String,
1936 #[serde(deserialize_with = "validate::create_message_request_method")]
1937 method: ::std::string::String,
1938 pub params: CreateMessageRequestParams,
1939}
1940impl CreateMessageRequest {
1941 pub fn new(id: RequestId, params: CreateMessageRequestParams) -> Self {
1942 Self {
1943 id,
1944 jsonrpc: JSONRPC_VERSION.to_string(),
1945 method: "sampling/createMessage".to_string(),
1946 params,
1947 }
1948 }
1949 pub fn jsonrpc(&self) -> &::std::string::String {
1950 &self.jsonrpc
1951 }
1952 pub fn method(&self) -> &::std::string::String {
1953 &self.method
1954 }
1955 /// returns "sampling/createMessage"
1956 pub fn method_value() -> &'static str {
1957 "sampling/createMessage"
1958 }
1959}
1960///Parameters for a sampling/createMessage request.
1961///
1962/// <details><summary>JSON schema</summary>
1963///
1964/// ```json
1965///{
1966/// "description": "Parameters for a sampling/createMessage request.",
1967/// "type": "object",
1968/// "required": [
1969/// "maxTokens",
1970/// "messages"
1971/// ],
1972/// "properties": {
1973/// "_meta": {
1974/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
1975/// "type": "object",
1976/// "properties": {
1977/// "progressToken": {
1978/// "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.",
1979/// "$ref": "#/$defs/ProgressToken"
1980/// }
1981/// },
1982/// "additionalProperties": {}
1983/// },
1984/// "includeContext": {
1985/// "description": "A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.\nThe client MAY ignore this request.\n\nDefault is \"none\". Values \"thisServer\" and \"allServers\" are soft-deprecated. Servers SHOULD only use these values if the client\ndeclares ClientCapabilities.sampling.context. These values may be removed in future spec releases.",
1986/// "type": "string",
1987/// "enum": [
1988/// "allServers",
1989/// "none",
1990/// "thisServer"
1991/// ]
1992/// },
1993/// "maxTokens": {
1994/// "description": "The requested maximum number of tokens to sample (to prevent runaway completions).\n\nThe client MAY choose to sample fewer tokens than the requested maximum.",
1995/// "type": "integer"
1996/// },
1997/// "messages": {
1998/// "type": "array",
1999/// "items": {
2000/// "$ref": "#/$defs/SamplingMessage"
2001/// }
2002/// },
2003/// "metadata": {
2004/// "description": "Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.",
2005/// "type": "object",
2006/// "additionalProperties": true
2007/// },
2008/// "modelPreferences": {
2009/// "description": "The server's preferences for which model to select. The client MAY ignore these preferences.",
2010/// "$ref": "#/$defs/ModelPreferences"
2011/// },
2012/// "stopSequences": {
2013/// "type": "array",
2014/// "items": {
2015/// "type": "string"
2016/// }
2017/// },
2018/// "systemPrompt": {
2019/// "description": "An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.",
2020/// "type": "string"
2021/// },
2022/// "task": {
2023/// "description": "If specified, the caller is requesting task-augmented execution for this request.\nThe request will return a CreateTaskResult immediately, and the actual result can be\nretrieved later via tasks/result.\n\nTask augmentation is subject to capability negotiation - receivers MUST declare support\nfor task augmentation of specific request types in their capabilities.",
2024/// "$ref": "#/$defs/TaskMetadata"
2025/// },
2026/// "temperature": {
2027/// "type": "number"
2028/// },
2029/// "toolChoice": {
2030/// "description": "Controls how the model uses tools.\nThe client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.\nDefault is { mode: \"auto\" }.",
2031/// "$ref": "#/$defs/ToolChoice"
2032/// },
2033/// "tools": {
2034/// "description": "Tools that the model may use during generation.\nThe client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.",
2035/// "type": "array",
2036/// "items": {
2037/// "$ref": "#/$defs/Tool"
2038/// }
2039/// }
2040/// }
2041///}
2042/// ```
2043/// </details>
2044#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2045pub struct CreateMessageRequestParams {
2046 /**A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
2047 The client MAY ignore this request.
2048 Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
2049 declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.*/
2050 #[serde(rename = "includeContext", default, skip_serializing_if = "::std::option::Option::is_none")]
2051 pub include_context: ::std::option::Option<IncludeContext>,
2052 /**The requested maximum number of tokens to sample (to prevent runaway completions).
2053 The client MAY choose to sample fewer tokens than the requested maximum.*/
2054 #[serde(rename = "maxTokens")]
2055 pub max_tokens: i64,
2056 pub messages: ::std::vec::Vec<SamplingMessage>,
2057 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2058 pub meta: ::std::option::Option<MessageMeta>,
2059 ///Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
2060 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2061 pub metadata: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2062 ///The server's preferences for which model to select. The client MAY ignore these preferences.
2063 #[serde(
2064 rename = "modelPreferences",
2065 default,
2066 skip_serializing_if = "::std::option::Option::is_none"
2067 )]
2068 pub model_preferences: ::std::option::Option<ModelPreferences>,
2069 #[serde(rename = "stopSequences", default, skip_serializing_if = "::std::vec::Vec::is_empty")]
2070 pub stop_sequences: ::std::vec::Vec<::std::string::String>,
2071 ///An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
2072 #[serde(rename = "systemPrompt", default, skip_serializing_if = "::std::option::Option::is_none")]
2073 pub system_prompt: ::std::option::Option<::std::string::String>,
2074 /**If specified, the caller is requesting task-augmented execution for this request.
2075 The request will return a CreateTaskResult immediately, and the actual result can be
2076 retrieved later via tasks/result.
2077 Task augmentation is subject to capability negotiation - receivers MUST declare support
2078 for task augmentation of specific request types in their capabilities.*/
2079 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2080 pub task: ::std::option::Option<TaskMetadata>,
2081 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2082 pub temperature: ::std::option::Option<f64>,
2083 /**Controls how the model uses tools.
2084 The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
2085 Default is { mode: "auto" }.*/
2086 #[serde(rename = "toolChoice", default, skip_serializing_if = "::std::option::Option::is_none")]
2087 pub tool_choice: ::std::option::Option<ToolChoice>,
2088 /**Tools that the model may use during generation.
2089 The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.*/
2090 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
2091 pub tools: ::std::vec::Vec<Tool>,
2092}
2093/**The client's response to a sampling/createMessage request from the server.
2094The client should inform the user before returning the sampled message, to allow them
2095to inspect the response (human in the loop) and decide whether to allow the server to see it.*/
2096///
2097/// <details><summary>JSON schema</summary>
2098///
2099/// ```json
2100///{
2101/// "description": "The client's response to a sampling/createMessage request from the server.\nThe client should inform the user before returning the sampled message, to allow them\nto inspect the response (human in the loop) and decide whether to allow the server to see it.",
2102/// "type": "object",
2103/// "required": [
2104/// "content",
2105/// "model",
2106/// "role"
2107/// ],
2108/// "properties": {
2109/// "_meta": {
2110/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
2111/// "type": "object",
2112/// "additionalProperties": {}
2113/// },
2114/// "content": {
2115/// "anyOf": [
2116/// {
2117/// "$ref": "#/$defs/TextContent"
2118/// },
2119/// {
2120/// "$ref": "#/$defs/ImageContent"
2121/// },
2122/// {
2123/// "$ref": "#/$defs/AudioContent"
2124/// },
2125/// {
2126/// "$ref": "#/$defs/ToolUseContent"
2127/// },
2128/// {
2129/// "$ref": "#/$defs/ToolResultContent"
2130/// },
2131/// {
2132/// "type": "array",
2133/// "items": {
2134/// "$ref": "#/$defs/SamplingMessageContentBlock"
2135/// }
2136/// }
2137/// ]
2138/// },
2139/// "model": {
2140/// "description": "The name of the model that generated the message.",
2141/// "type": "string"
2142/// },
2143/// "role": {
2144/// "$ref": "#/$defs/Role"
2145/// },
2146/// "stopReason": {
2147/// "description": "The reason why sampling stopped, if known.\n\nStandard values:\n- \"endTurn\": Natural end of the assistant's turn\n- \"stopSequence\": A stop sequence was encountered\n- \"maxTokens\": Maximum token limit was reached\n- \"toolUse\": The model wants to use one or more tools\n\nThis field is an open string to allow for provider-specific stop reasons.",
2148/// "type": "string"
2149/// }
2150/// }
2151///}
2152/// ```
2153/// </details>
2154#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2155pub struct CreateMessageResult {
2156 pub content: CreateMessageContent,
2157 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
2158 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2159 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2160 ///The name of the model that generated the message.
2161 pub model: ::std::string::String,
2162 pub role: Role,
2163 /**The reason why sampling stopped, if known.
2164 Standard values:
2165 - "endTurn": Natural end of the assistant's turn
2166 - "stopSequence": A stop sequence was encountered
2167 - "maxTokens": Maximum token limit was reached
2168 - "toolUse": The model wants to use one or more tools
2169 This field is an open string to allow for provider-specific stop reasons.*/
2170 #[serde(rename = "stopReason", default, skip_serializing_if = "::std::option::Option::is_none")]
2171 pub stop_reason: ::std::option::Option<::std::string::String>,
2172}
2173///A response to a task-augmented request.
2174///
2175/// <details><summary>JSON schema</summary>
2176///
2177/// ```json
2178///{
2179/// "description": "A response to a task-augmented request.",
2180/// "type": "object",
2181/// "required": [
2182/// "task"
2183/// ],
2184/// "properties": {
2185/// "_meta": {
2186/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
2187/// "type": "object",
2188/// "additionalProperties": {}
2189/// },
2190/// "task": {
2191/// "$ref": "#/$defs/Task"
2192/// }
2193/// }
2194///}
2195/// ```
2196/// </details>
2197#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2198pub struct CreateTaskResult {
2199 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
2200 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2201 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2202 pub task: Task,
2203}
2204///An opaque token used to represent a cursor for pagination.
2205///
2206/// <details><summary>JSON schema</summary>
2207///
2208/// ```json
2209///{
2210/// "description": "An opaque token used to represent a cursor for pagination.",
2211/// "type": "string"
2212///}
2213/// ```
2214/// </details>
2215#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2216#[serde(transparent)]
2217pub struct Cursor(pub ::std::string::String);
2218///ElicitCompleteParams
2219///
2220/// <details><summary>JSON schema</summary>
2221///
2222/// ```json
2223///{
2224/// "type": "object",
2225/// "required": [
2226/// "elicitationId"
2227/// ],
2228/// "properties": {
2229/// "elicitationId": {
2230/// "description": "The ID of the elicitation that completed.",
2231/// "type": "string"
2232/// }
2233/// }
2234///}
2235/// ```
2236/// </details>
2237#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2238pub struct ElicitCompleteParams {
2239 ///The ID of the elicitation that completed.
2240 #[serde(rename = "elicitationId")]
2241 pub elicitation_id: ::std::string::String,
2242}
2243///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
2244///
2245/// <details><summary>JSON schema</summary>
2246///
2247/// ```json
2248///{
2249/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
2250/// "type": "object",
2251/// "properties": {
2252/// "progressToken": {
2253/// "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.",
2254/// "$ref": "#/$defs/ProgressToken"
2255/// }
2256/// },
2257/// "additionalProperties": {}
2258///}
2259/// ```
2260/// </details>
2261#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
2262pub struct ElicitFormMeta {
2263 ///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.
2264 #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
2265 pub progress_token: ::std::option::Option<ProgressToken>,
2266 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
2267 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2268}
2269/**A restricted subset of JSON Schema.
2270Only top-level properties are allowed, without nesting.*/
2271///
2272/// <details><summary>JSON schema</summary>
2273///
2274/// ```json
2275///{
2276/// "description": "A restricted subset of JSON Schema.\nOnly top-level properties are allowed, without nesting.",
2277/// "type": "object",
2278/// "required": [
2279/// "properties",
2280/// "type"
2281/// ],
2282/// "properties": {
2283/// "$schema": {
2284/// "type": "string"
2285/// },
2286/// "properties": {
2287/// "type": "object",
2288/// "additionalProperties": {
2289/// "$ref": "#/$defs/PrimitiveSchemaDefinition"
2290/// }
2291/// },
2292/// "required": {
2293/// "type": "array",
2294/// "items": {
2295/// "type": "string"
2296/// }
2297/// },
2298/// "type": {
2299/// "type": "string",
2300/// "const": "object"
2301/// }
2302/// }
2303///}
2304/// ```
2305/// </details>
2306#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2307pub struct ElicitFormSchema {
2308 pub properties: std::collections::BTreeMap<::std::string::String, PrimitiveSchemaDefinition>,
2309 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
2310 pub required: ::std::vec::Vec<::std::string::String>,
2311 #[serde(rename = "$schema", default, skip_serializing_if = "::std::option::Option::is_none")]
2312 pub schema: ::std::option::Option<::std::string::String>,
2313 #[serde(rename = "type", deserialize_with = "validate::elicit_form_schema_type_")]
2314 type_: ::std::string::String,
2315}
2316impl ElicitFormSchema {
2317 pub fn new(
2318 properties: std::collections::BTreeMap<::std::string::String, PrimitiveSchemaDefinition>,
2319 required: ::std::vec::Vec<::std::string::String>,
2320 schema: ::std::option::Option<::std::string::String>,
2321 ) -> Self {
2322 Self {
2323 properties,
2324 required,
2325 schema,
2326 type_: "object".to_string(),
2327 }
2328 }
2329 pub fn type_(&self) -> &::std::string::String {
2330 &self.type_
2331 }
2332 /// returns "object"
2333 pub fn type_value() -> &'static str {
2334 "object"
2335 }
2336}
2337///A request from the server to elicit additional information from the user via the client.
2338///
2339/// <details><summary>JSON schema</summary>
2340///
2341/// ```json
2342///{
2343/// "description": "A request from the server to elicit additional information from the user via the client.",
2344/// "type": "object",
2345/// "required": [
2346/// "id",
2347/// "jsonrpc",
2348/// "method",
2349/// "params"
2350/// ],
2351/// "properties": {
2352/// "id": {
2353/// "$ref": "#/$defs/RequestId"
2354/// },
2355/// "jsonrpc": {
2356/// "type": "string",
2357/// "const": "2.0"
2358/// },
2359/// "method": {
2360/// "type": "string",
2361/// "const": "elicitation/create"
2362/// },
2363/// "params": {
2364/// "$ref": "#/$defs/ElicitRequestParams"
2365/// }
2366/// }
2367///}
2368/// ```
2369/// </details>
2370#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2371pub struct ElicitRequest {
2372 pub id: RequestId,
2373 #[serde(deserialize_with = "validate::elicit_request_jsonrpc")]
2374 jsonrpc: ::std::string::String,
2375 #[serde(deserialize_with = "validate::elicit_request_method")]
2376 method: ::std::string::String,
2377 pub params: ElicitRequestParams,
2378}
2379impl ElicitRequest {
2380 pub fn new(id: RequestId, params: ElicitRequestParams) -> Self {
2381 Self {
2382 id,
2383 jsonrpc: JSONRPC_VERSION.to_string(),
2384 method: "elicitation/create".to_string(),
2385 params,
2386 }
2387 }
2388 pub fn jsonrpc(&self) -> &::std::string::String {
2389 &self.jsonrpc
2390 }
2391 pub fn method(&self) -> &::std::string::String {
2392 &self.method
2393 }
2394 /// returns "elicitation/create"
2395 pub fn method_value() -> &'static str {
2396 "elicitation/create"
2397 }
2398}
2399///The parameters for a request to elicit non-sensitive information from the user via a form in the client.
2400///
2401/// <details><summary>JSON schema</summary>
2402///
2403/// ```json
2404///{
2405/// "description": "The parameters for a request to elicit non-sensitive information from the user via a form in the client.",
2406/// "type": "object",
2407/// "required": [
2408/// "message",
2409/// "requestedSchema"
2410/// ],
2411/// "properties": {
2412/// "_meta": {
2413/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
2414/// "type": "object",
2415/// "properties": {
2416/// "progressToken": {
2417/// "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.",
2418/// "$ref": "#/$defs/ProgressToken"
2419/// }
2420/// },
2421/// "additionalProperties": {}
2422/// },
2423/// "message": {
2424/// "description": "The message to present to the user describing what information is being requested.",
2425/// "type": "string"
2426/// },
2427/// "mode": {
2428/// "description": "The elicitation mode.",
2429/// "type": "string",
2430/// "const": "form"
2431/// },
2432/// "requestedSchema": {
2433/// "description": "A restricted subset of JSON Schema.\nOnly top-level properties are allowed, without nesting.",
2434/// "type": "object",
2435/// "required": [
2436/// "properties",
2437/// "type"
2438/// ],
2439/// "properties": {
2440/// "$schema": {
2441/// "type": "string"
2442/// },
2443/// "properties": {
2444/// "type": "object",
2445/// "additionalProperties": {
2446/// "$ref": "#/$defs/PrimitiveSchemaDefinition"
2447/// }
2448/// },
2449/// "required": {
2450/// "type": "array",
2451/// "items": {
2452/// "type": "string"
2453/// }
2454/// },
2455/// "type": {
2456/// "type": "string",
2457/// "const": "object"
2458/// }
2459/// }
2460/// },
2461/// "task": {
2462/// "description": "If specified, the caller is requesting task-augmented execution for this request.\nThe request will return a CreateTaskResult immediately, and the actual result can be\nretrieved later via tasks/result.\n\nTask augmentation is subject to capability negotiation - receivers MUST declare support\nfor task augmentation of specific request types in their capabilities.",
2463/// "$ref": "#/$defs/TaskMetadata"
2464/// }
2465/// }
2466///}
2467/// ```
2468/// </details>
2469#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2470pub struct ElicitRequestFormParams {
2471 ///The message to present to the user describing what information is being requested.
2472 pub message: ::std::string::String,
2473 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2474 pub meta: ::std::option::Option<ElicitFormMeta>,
2475 ///The elicitation mode.
2476 #[serde(
2477 default,
2478 skip_serializing_if = "::std::option::Option::is_none",
2479 deserialize_with = "validate::elicit_request_form_params_mode"
2480 )]
2481 mode: ::std::option::Option<::std::string::String>,
2482 #[serde(rename = "requestedSchema")]
2483 pub requested_schema: ElicitFormSchema,
2484 /**If specified, the caller is requesting task-augmented execution for this request.
2485 The request will return a CreateTaskResult immediately, and the actual result can be
2486 retrieved later via tasks/result.
2487 Task augmentation is subject to capability negotiation - receivers MUST declare support
2488 for task augmentation of specific request types in their capabilities.*/
2489 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2490 pub task: ::std::option::Option<TaskMetadata>,
2491}
2492impl ElicitRequestFormParams {
2493 pub fn new(
2494 message: ::std::string::String,
2495 requested_schema: ElicitFormSchema,
2496 meta: ::std::option::Option<ElicitFormMeta>,
2497 task: ::std::option::Option<TaskMetadata>,
2498 ) -> Self {
2499 Self {
2500 message,
2501 meta,
2502 mode: Some("form".to_string()),
2503 requested_schema,
2504 task,
2505 }
2506 }
2507 pub fn mode(&self) -> &::std::option::Option<::std::string::String> {
2508 &self.mode
2509 }
2510 /// returns "form"
2511 pub fn mode_value() -> &'static str {
2512 "form"
2513 }
2514}
2515///The parameters for a request to elicit additional information from the user via the client.
2516///
2517/// <details><summary>JSON schema</summary>
2518///
2519/// ```json
2520///{
2521/// "description": "The parameters for a request to elicit additional information from the user via the client.",
2522/// "anyOf": [
2523/// {
2524/// "$ref": "#/$defs/ElicitRequestURLParams"
2525/// },
2526/// {
2527/// "$ref": "#/$defs/ElicitRequestFormParams"
2528/// }
2529/// ]
2530///}
2531/// ```
2532/// </details>
2533#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2534#[serde(untagged)]
2535pub enum ElicitRequestParams {
2536 UrlParams(ElicitRequestUrlParams),
2537 FormParams(ElicitRequestFormParams),
2538}
2539impl ::std::convert::From<ElicitRequestUrlParams> for ElicitRequestParams {
2540 fn from(value: ElicitRequestUrlParams) -> Self {
2541 Self::UrlParams(value)
2542 }
2543}
2544impl ::std::convert::From<ElicitRequestFormParams> for ElicitRequestParams {
2545 fn from(value: ElicitRequestFormParams) -> Self {
2546 Self::FormParams(value)
2547 }
2548}
2549///The parameters for a request to elicit information from the user via a URL in the client.
2550///
2551/// <details><summary>JSON schema</summary>
2552///
2553/// ```json
2554///{
2555/// "description": "The parameters for a request to elicit information from the user via a URL in the client.",
2556/// "type": "object",
2557/// "required": [
2558/// "elicitationId",
2559/// "message",
2560/// "mode",
2561/// "url"
2562/// ],
2563/// "properties": {
2564/// "_meta": {
2565/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
2566/// "type": "object",
2567/// "properties": {
2568/// "progressToken": {
2569/// "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.",
2570/// "$ref": "#/$defs/ProgressToken"
2571/// }
2572/// },
2573/// "additionalProperties": {}
2574/// },
2575/// "elicitationId": {
2576/// "description": "The ID of the elicitation, which must be unique within the context of the server.\nThe client MUST treat this ID as an opaque value.",
2577/// "type": "string"
2578/// },
2579/// "message": {
2580/// "description": "The message to present to the user explaining why the interaction is needed.",
2581/// "type": "string"
2582/// },
2583/// "mode": {
2584/// "description": "The elicitation mode.",
2585/// "type": "string",
2586/// "const": "url"
2587/// },
2588/// "task": {
2589/// "description": "If specified, the caller is requesting task-augmented execution for this request.\nThe request will return a CreateTaskResult immediately, and the actual result can be\nretrieved later via tasks/result.\n\nTask augmentation is subject to capability negotiation - receivers MUST declare support\nfor task augmentation of specific request types in their capabilities.",
2590/// "$ref": "#/$defs/TaskMetadata"
2591/// },
2592/// "url": {
2593/// "description": "The URL that the user should navigate to.",
2594/// "type": "string",
2595/// "format": "uri"
2596/// }
2597/// }
2598///}
2599/// ```
2600/// </details>
2601#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2602pub struct ElicitRequestUrlParams {
2603 /**The ID of the elicitation, which must be unique within the context of the server.
2604 The client MUST treat this ID as an opaque value.*/
2605 #[serde(rename = "elicitationId")]
2606 pub elicitation_id: ::std::string::String,
2607 ///The message to present to the user explaining why the interaction is needed.
2608 pub message: ::std::string::String,
2609 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2610 pub meta: ::std::option::Option<ElicitUrlMeta>,
2611 ///The elicitation mode.
2612 #[serde(deserialize_with = "validate::elicit_request_url_params_mode")]
2613 mode: ::std::string::String,
2614 /**If specified, the caller is requesting task-augmented execution for this request.
2615 The request will return a CreateTaskResult immediately, and the actual result can be
2616 retrieved later via tasks/result.
2617 Task augmentation is subject to capability negotiation - receivers MUST declare support
2618 for task augmentation of specific request types in their capabilities.*/
2619 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2620 pub task: ::std::option::Option<TaskMetadata>,
2621 ///The URL that the user should navigate to.
2622 pub url: ::std::string::String,
2623}
2624impl ElicitRequestUrlParams {
2625 pub fn new(
2626 elicitation_id: ::std::string::String,
2627 message: ::std::string::String,
2628 url: ::std::string::String,
2629 meta: ::std::option::Option<ElicitUrlMeta>,
2630 task: ::std::option::Option<TaskMetadata>,
2631 ) -> Self {
2632 Self {
2633 elicitation_id,
2634 message,
2635 meta,
2636 mode: "url".to_string(),
2637 task,
2638 url,
2639 }
2640 }
2641 pub fn mode(&self) -> &::std::string::String {
2642 &self.mode
2643 }
2644 /// returns "url"
2645 pub fn mode_value() -> &'static str {
2646 "url"
2647 }
2648}
2649///The client's response to an elicitation request.
2650///
2651/// <details><summary>JSON schema</summary>
2652///
2653/// ```json
2654///{
2655/// "description": "The client's response to an elicitation request.",
2656/// "type": "object",
2657/// "required": [
2658/// "action"
2659/// ],
2660/// "properties": {
2661/// "_meta": {
2662/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
2663/// "type": "object",
2664/// "additionalProperties": {}
2665/// },
2666/// "action": {
2667/// "description": "The user action in response to the elicitation.\n- \"accept\": User submitted the form/confirmed the action\n- \"decline\": User explicitly decline the action\n- \"cancel\": User dismissed without making an explicit choice",
2668/// "type": "string",
2669/// "enum": [
2670/// "accept",
2671/// "cancel",
2672/// "decline"
2673/// ]
2674/// },
2675/// "content": {
2676/// "description": "The submitted form data, only present when action is \"accept\" and mode was \"form\".\nContains values matching the requested schema.\nOmitted for out-of-band mode responses.",
2677/// "type": "object",
2678/// "additionalProperties": {
2679/// "anyOf": [
2680/// {
2681/// "type": "array",
2682/// "items": {
2683/// "type": "string"
2684/// }
2685/// },
2686/// {
2687/// "type": [
2688/// "string",
2689/// "integer",
2690/// "boolean"
2691/// ]
2692/// }
2693/// ]
2694/// }
2695/// }
2696/// }
2697///}
2698/// ```
2699/// </details>
2700#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2701pub struct ElicitResult {
2702 /**The user action in response to the elicitation.
2703 - "accept": User submitted the form/confirmed the action
2704 - "decline": User explicitly decline the action
2705 - "cancel": User dismissed without making an explicit choice*/
2706 pub action: ElicitResultAction,
2707 /**The submitted form data, only present when action is "accept" and mode was "form".
2708 Contains values matching the requested schema.
2709 Omitted for out-of-band mode responses.*/
2710 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2711 pub content: ::std::option::Option<std::collections::BTreeMap<::std::string::String, ElicitResultContent>>,
2712 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
2713 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2714 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2715}
2716/**The user action in response to the elicitation.
2717- "accept": User submitted the form/confirmed the action
2718- "decline": User explicitly decline the action
2719- "cancel": User dismissed without making an explicit choice*/
2720///
2721/// <details><summary>JSON schema</summary>
2722///
2723/// ```json
2724///{
2725/// "description": "The user action in response to the elicitation.\n- \"accept\": User submitted the form/confirmed the action\n- \"decline\": User explicitly decline the action\n- \"cancel\": User dismissed without making an explicit choice",
2726/// "type": "string",
2727/// "enum": [
2728/// "accept",
2729/// "cancel",
2730/// "decline"
2731/// ]
2732///}
2733/// ```
2734/// </details>
2735#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2736pub enum ElicitResultAction {
2737 #[serde(rename = "accept")]
2738 Accept,
2739 #[serde(rename = "cancel")]
2740 Cancel,
2741 #[serde(rename = "decline")]
2742 Decline,
2743}
2744impl ::std::fmt::Display for ElicitResultAction {
2745 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2746 match *self {
2747 Self::Accept => write!(f, "accept"),
2748 Self::Cancel => write!(f, "cancel"),
2749 Self::Decline => write!(f, "decline"),
2750 }
2751 }
2752}
2753///ElicitResultContent
2754///
2755/// <details><summary>JSON schema</summary>
2756///
2757/// ```json
2758///{
2759/// "anyOf": [
2760/// {
2761/// "type": "array",
2762/// "items": {
2763/// "type": "string"
2764/// }
2765/// },
2766/// {
2767/// "type": [
2768/// "string",
2769/// "integer",
2770/// "boolean"
2771/// ]
2772/// }
2773/// ]
2774///}
2775/// ```
2776/// </details>
2777#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2778#[serde(untagged)]
2779pub enum ElicitResultContent {
2780 StringArray(::std::vec::Vec<::std::string::String>),
2781 Primitive(ElicitResultContentPrimitive),
2782}
2783impl ::std::convert::From<::std::vec::Vec<::std::string::String>> for ElicitResultContent {
2784 fn from(value: ::std::vec::Vec<::std::string::String>) -> Self {
2785 Self::StringArray(value)
2786 }
2787}
2788impl ::std::convert::From<ElicitResultContentPrimitive> for ElicitResultContent {
2789 fn from(value: ElicitResultContentPrimitive) -> Self {
2790 Self::Primitive(value)
2791 }
2792}
2793///ElicitResultContentPrimitive
2794///
2795/// <details><summary>JSON schema</summary>
2796///
2797/// ```json
2798///{
2799/// "type": [
2800/// "string",
2801/// "integer",
2802/// "boolean"
2803/// ]
2804///}
2805/// ```
2806/// </details>
2807#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2808#[serde(untagged)]
2809pub enum ElicitResultContentPrimitive {
2810 Boolean(bool),
2811 String(::std::string::String),
2812 Integer(i64),
2813}
2814impl ::std::convert::From<bool> for ElicitResultContentPrimitive {
2815 fn from(value: bool) -> Self {
2816 Self::Boolean(value)
2817 }
2818}
2819impl ::std::convert::From<i64> for ElicitResultContentPrimitive {
2820 fn from(value: i64) -> Self {
2821 Self::Integer(value)
2822 }
2823}
2824///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
2825///
2826/// <details><summary>JSON schema</summary>
2827///
2828/// ```json
2829///{
2830/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
2831/// "type": "object",
2832/// "properties": {
2833/// "progressToken": {
2834/// "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.",
2835/// "$ref": "#/$defs/ProgressToken"
2836/// }
2837/// },
2838/// "additionalProperties": {}
2839///}
2840/// ```
2841/// </details>
2842#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
2843pub struct ElicitUrlMeta {
2844 ///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.
2845 #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
2846 pub progress_token: ::std::option::Option<ProgressToken>,
2847 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
2848 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2849}
2850///An optional notification from the server to the client, informing it of a completion of a out-of-band elicitation request.
2851///
2852/// <details><summary>JSON schema</summary>
2853///
2854/// ```json
2855///{
2856/// "description": "An optional notification from the server to the client, informing it of a completion of a out-of-band elicitation request.",
2857/// "type": "object",
2858/// "required": [
2859/// "jsonrpc",
2860/// "method",
2861/// "params"
2862/// ],
2863/// "properties": {
2864/// "jsonrpc": {
2865/// "type": "string",
2866/// "const": "2.0"
2867/// },
2868/// "method": {
2869/// "type": "string",
2870/// "const": "notifications/elicitation/complete"
2871/// },
2872/// "params": {
2873/// "type": "object",
2874/// "required": [
2875/// "elicitationId"
2876/// ],
2877/// "properties": {
2878/// "elicitationId": {
2879/// "description": "The ID of the elicitation that completed.",
2880/// "type": "string"
2881/// }
2882/// }
2883/// }
2884/// }
2885///}
2886/// ```
2887/// </details>
2888#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2889pub struct ElicitationCompleteNotification {
2890 #[serde(deserialize_with = "validate::elicitation_complete_notification_jsonrpc")]
2891 jsonrpc: ::std::string::String,
2892 #[serde(deserialize_with = "validate::elicitation_complete_notification_method")]
2893 method: ::std::string::String,
2894 pub params: ElicitCompleteParams,
2895}
2896impl ElicitationCompleteNotification {
2897 pub fn new(params: ElicitCompleteParams) -> Self {
2898 Self {
2899 jsonrpc: JSONRPC_VERSION.to_string(),
2900 method: "notifications/elicitation/complete".to_string(),
2901 params,
2902 }
2903 }
2904 pub fn jsonrpc(&self) -> &::std::string::String {
2905 &self.jsonrpc
2906 }
2907 pub fn method(&self) -> &::std::string::String {
2908 &self.method
2909 }
2910 /// returns "notifications/elicitation/complete"
2911 pub fn method_value() -> &'static str {
2912 "notifications/elicitation/complete"
2913 }
2914}
2915/**The contents of a resource, embedded into a prompt or tool call result.
2916It is up to the client how best to render embedded resources for the benefit
2917of the LLM and/or the user.*/
2918///
2919/// <details><summary>JSON schema</summary>
2920///
2921/// ```json
2922///{
2923/// "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.",
2924/// "type": "object",
2925/// "required": [
2926/// "resource",
2927/// "type"
2928/// ],
2929/// "properties": {
2930/// "_meta": {
2931/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
2932/// "type": "object",
2933/// "additionalProperties": {}
2934/// },
2935/// "annotations": {
2936/// "description": "Optional annotations for the client.",
2937/// "$ref": "#/$defs/Annotations"
2938/// },
2939/// "resource": {
2940/// "anyOf": [
2941/// {
2942/// "$ref": "#/$defs/TextResourceContents"
2943/// },
2944/// {
2945/// "$ref": "#/$defs/BlobResourceContents"
2946/// }
2947/// ]
2948/// },
2949/// "type": {
2950/// "type": "string",
2951/// "const": "resource"
2952/// }
2953/// }
2954///}
2955/// ```
2956/// </details>
2957#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2958pub struct EmbeddedResource {
2959 ///Optional annotations for the client.
2960 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2961 pub annotations: ::std::option::Option<Annotations>,
2962 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
2963 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
2964 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2965 pub resource: EmbeddedResourceResource,
2966 #[serde(rename = "type", deserialize_with = "validate::embedded_resource_type_")]
2967 type_: ::std::string::String,
2968}
2969impl EmbeddedResource {
2970 pub fn new(
2971 resource: EmbeddedResourceResource,
2972 annotations: ::std::option::Option<Annotations>,
2973 meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2974 ) -> Self {
2975 Self {
2976 annotations,
2977 meta,
2978 resource,
2979 type_: "resource".to_string(),
2980 }
2981 }
2982 pub fn type_(&self) -> &::std::string::String {
2983 &self.type_
2984 }
2985 /// returns "resource"
2986 pub fn type_value() -> &'static str {
2987 "resource"
2988 }
2989}
2990///EmbeddedResourceResource
2991///
2992/// <details><summary>JSON schema</summary>
2993///
2994/// ```json
2995///{
2996/// "anyOf": [
2997/// {
2998/// "$ref": "#/$defs/TextResourceContents"
2999/// },
3000/// {
3001/// "$ref": "#/$defs/BlobResourceContents"
3002/// }
3003/// ]
3004///}
3005/// ```
3006/// </details>
3007#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3008#[serde(untagged)]
3009pub enum EmbeddedResourceResource {
3010 TextResourceContents(TextResourceContents),
3011 BlobResourceContents(BlobResourceContents),
3012}
3013impl ::std::convert::From<TextResourceContents> for EmbeddedResourceResource {
3014 fn from(value: TextResourceContents) -> Self {
3015 Self::TextResourceContents(value)
3016 }
3017}
3018impl ::std::convert::From<BlobResourceContents> for EmbeddedResourceResource {
3019 fn from(value: BlobResourceContents) -> Self {
3020 Self::BlobResourceContents(value)
3021 }
3022}
3023///EmptyResult
3024///
3025/// <details><summary>JSON schema</summary>
3026///
3027/// ```json
3028///{
3029/// "$ref": "#/$defs/Result"
3030///}
3031/// ```
3032/// </details>
3033#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3034#[serde(transparent)]
3035pub struct EmptyResult(pub Result);
3036///EnumSchema
3037///
3038/// <details><summary>JSON schema</summary>
3039///
3040/// ```json
3041///{
3042/// "anyOf": [
3043/// {
3044/// "$ref": "#/$defs/UntitledSingleSelectEnumSchema"
3045/// },
3046/// {
3047/// "$ref": "#/$defs/TitledSingleSelectEnumSchema"
3048/// },
3049/// {
3050/// "$ref": "#/$defs/UntitledMultiSelectEnumSchema"
3051/// },
3052/// {
3053/// "$ref": "#/$defs/TitledMultiSelectEnumSchema"
3054/// },
3055/// {
3056/// "$ref": "#/$defs/LegacyTitledEnumSchema"
3057/// }
3058/// ]
3059///}
3060/// ```
3061/// </details>
3062#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3063#[serde(untagged)]
3064pub enum EnumSchema {
3065 UntitledSingleSelectEnumSchema(UntitledSingleSelectEnumSchema),
3066 TitledSingleSelectEnumSchema(TitledSingleSelectEnumSchema),
3067 UntitledMultiSelectEnumSchema(UntitledMultiSelectEnumSchema),
3068 TitledMultiSelectEnumSchema(TitledMultiSelectEnumSchema),
3069 LegacyTitledEnumSchema(LegacyTitledEnumSchema),
3070}
3071impl ::std::convert::From<UntitledSingleSelectEnumSchema> for EnumSchema {
3072 fn from(value: UntitledSingleSelectEnumSchema) -> Self {
3073 Self::UntitledSingleSelectEnumSchema(value)
3074 }
3075}
3076impl ::std::convert::From<TitledSingleSelectEnumSchema> for EnumSchema {
3077 fn from(value: TitledSingleSelectEnumSchema) -> Self {
3078 Self::TitledSingleSelectEnumSchema(value)
3079 }
3080}
3081impl ::std::convert::From<UntitledMultiSelectEnumSchema> for EnumSchema {
3082 fn from(value: UntitledMultiSelectEnumSchema) -> Self {
3083 Self::UntitledMultiSelectEnumSchema(value)
3084 }
3085}
3086impl ::std::convert::From<TitledMultiSelectEnumSchema> for EnumSchema {
3087 fn from(value: TitledMultiSelectEnumSchema) -> Self {
3088 Self::TitledMultiSelectEnumSchema(value)
3089 }
3090}
3091impl ::std::convert::From<LegacyTitledEnumSchema> for EnumSchema {
3092 fn from(value: LegacyTitledEnumSchema) -> Self {
3093 Self::LegacyTitledEnumSchema(value)
3094 }
3095}
3096///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
3097///
3098/// <details><summary>JSON schema</summary>
3099///
3100/// ```json
3101///{
3102/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
3103/// "type": "object",
3104/// "properties": {
3105/// "progressToken": {
3106/// "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.",
3107/// "$ref": "#/$defs/ProgressToken"
3108/// }
3109/// },
3110/// "additionalProperties": {}
3111///}
3112/// ```
3113/// </details>
3114#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
3115pub struct GetPromptMeta {
3116 ///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.
3117 #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
3118 pub progress_token: ::std::option::Option<ProgressToken>,
3119 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
3120 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3121}
3122///Used by the client to get a prompt provided by the server.
3123///
3124/// <details><summary>JSON schema</summary>
3125///
3126/// ```json
3127///{
3128/// "description": "Used by the client to get a prompt provided by the server.",
3129/// "type": "object",
3130/// "required": [
3131/// "id",
3132/// "jsonrpc",
3133/// "method",
3134/// "params"
3135/// ],
3136/// "properties": {
3137/// "id": {
3138/// "$ref": "#/$defs/RequestId"
3139/// },
3140/// "jsonrpc": {
3141/// "type": "string",
3142/// "const": "2.0"
3143/// },
3144/// "method": {
3145/// "type": "string",
3146/// "const": "prompts/get"
3147/// },
3148/// "params": {
3149/// "$ref": "#/$defs/GetPromptRequestParams"
3150/// }
3151/// }
3152///}
3153/// ```
3154/// </details>
3155#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3156pub struct GetPromptRequest {
3157 pub id: RequestId,
3158 #[serde(deserialize_with = "validate::get_prompt_request_jsonrpc")]
3159 jsonrpc: ::std::string::String,
3160 #[serde(deserialize_with = "validate::get_prompt_request_method")]
3161 method: ::std::string::String,
3162 pub params: GetPromptRequestParams,
3163}
3164impl GetPromptRequest {
3165 pub fn new(id: RequestId, params: GetPromptRequestParams) -> Self {
3166 Self {
3167 id,
3168 jsonrpc: JSONRPC_VERSION.to_string(),
3169 method: "prompts/get".to_string(),
3170 params,
3171 }
3172 }
3173 pub fn jsonrpc(&self) -> &::std::string::String {
3174 &self.jsonrpc
3175 }
3176 pub fn method(&self) -> &::std::string::String {
3177 &self.method
3178 }
3179 /// returns "prompts/get"
3180 pub fn method_value() -> &'static str {
3181 "prompts/get"
3182 }
3183}
3184///Parameters for a prompts/get request.
3185///
3186/// <details><summary>JSON schema</summary>
3187///
3188/// ```json
3189///{
3190/// "description": "Parameters for a prompts/get request.",
3191/// "type": "object",
3192/// "required": [
3193/// "name"
3194/// ],
3195/// "properties": {
3196/// "_meta": {
3197/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
3198/// "type": "object",
3199/// "properties": {
3200/// "progressToken": {
3201/// "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.",
3202/// "$ref": "#/$defs/ProgressToken"
3203/// }
3204/// },
3205/// "additionalProperties": {}
3206/// },
3207/// "arguments": {
3208/// "description": "Arguments to use for templating the prompt.",
3209/// "type": "object",
3210/// "additionalProperties": {
3211/// "type": "string"
3212/// }
3213/// },
3214/// "name": {
3215/// "description": "The name of the prompt or prompt template.",
3216/// "type": "string"
3217/// }
3218/// }
3219///}
3220/// ```
3221/// </details>
3222#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3223pub struct GetPromptRequestParams {
3224 ///Arguments to use for templating the prompt.
3225 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3226 pub arguments: ::std::option::Option<std::collections::BTreeMap<::std::string::String, ::std::string::String>>,
3227 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3228 pub meta: ::std::option::Option<GetPromptMeta>,
3229 ///The name of the prompt or prompt template.
3230 pub name: ::std::string::String,
3231}
3232///The server's response to a prompts/get request from the client.
3233///
3234/// <details><summary>JSON schema</summary>
3235///
3236/// ```json
3237///{
3238/// "description": "The server's response to a prompts/get request from the client.",
3239/// "type": "object",
3240/// "required": [
3241/// "messages"
3242/// ],
3243/// "properties": {
3244/// "_meta": {
3245/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
3246/// "type": "object",
3247/// "additionalProperties": {}
3248/// },
3249/// "description": {
3250/// "description": "An optional description for the prompt.",
3251/// "type": "string"
3252/// },
3253/// "messages": {
3254/// "type": "array",
3255/// "items": {
3256/// "$ref": "#/$defs/PromptMessage"
3257/// }
3258/// }
3259/// }
3260///}
3261/// ```
3262/// </details>
3263#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3264pub struct GetPromptResult {
3265 ///An optional description for the prompt.
3266 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3267 pub description: ::std::option::Option<::std::string::String>,
3268 pub messages: ::std::vec::Vec<PromptMessage>,
3269 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
3270 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3271 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3272}
3273///GetTaskParams
3274///
3275/// <details><summary>JSON schema</summary>
3276///
3277/// ```json
3278///{
3279/// "type": "object",
3280/// "required": [
3281/// "taskId"
3282/// ],
3283/// "properties": {
3284/// "taskId": {
3285/// "description": "The task identifier to query.",
3286/// "type": "string"
3287/// }
3288/// }
3289///}
3290/// ```
3291/// </details>
3292#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3293pub struct GetTaskParams {
3294 ///The task identifier to query.
3295 #[serde(rename = "taskId")]
3296 pub task_id: ::std::string::String,
3297}
3298///GetTaskPayloadParams
3299///
3300/// <details><summary>JSON schema</summary>
3301///
3302/// ```json
3303///{
3304/// "type": "object",
3305/// "required": [
3306/// "taskId"
3307/// ],
3308/// "properties": {
3309/// "taskId": {
3310/// "description": "The task identifier to retrieve results for.",
3311/// "type": "string"
3312/// }
3313/// }
3314///}
3315/// ```
3316/// </details>
3317#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3318pub struct GetTaskPayloadParams {
3319 ///The task identifier to retrieve results for.
3320 #[serde(rename = "taskId")]
3321 pub task_id: ::std::string::String,
3322}
3323///A request to retrieve the result of a completed task.
3324///
3325/// <details><summary>JSON schema</summary>
3326///
3327/// ```json
3328///{
3329/// "description": "A request to retrieve the result of a completed task.",
3330/// "type": "object",
3331/// "required": [
3332/// "id",
3333/// "jsonrpc",
3334/// "method",
3335/// "params"
3336/// ],
3337/// "properties": {
3338/// "id": {
3339/// "$ref": "#/$defs/RequestId"
3340/// },
3341/// "jsonrpc": {
3342/// "type": "string",
3343/// "const": "2.0"
3344/// },
3345/// "method": {
3346/// "type": "string",
3347/// "const": "tasks/result"
3348/// },
3349/// "params": {
3350/// "type": "object",
3351/// "required": [
3352/// "taskId"
3353/// ],
3354/// "properties": {
3355/// "taskId": {
3356/// "description": "The task identifier to retrieve results for.",
3357/// "type": "string"
3358/// }
3359/// }
3360/// }
3361/// }
3362///}
3363/// ```
3364/// </details>
3365#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3366pub struct GetTaskPayloadRequest {
3367 pub id: RequestId,
3368 #[serde(deserialize_with = "validate::get_task_payload_request_jsonrpc")]
3369 jsonrpc: ::std::string::String,
3370 #[serde(deserialize_with = "validate::get_task_payload_request_method")]
3371 method: ::std::string::String,
3372 pub params: GetTaskPayloadParams,
3373}
3374impl GetTaskPayloadRequest {
3375 pub fn new(id: RequestId, params: GetTaskPayloadParams) -> Self {
3376 Self {
3377 id,
3378 jsonrpc: JSONRPC_VERSION.to_string(),
3379 method: "tasks/result".to_string(),
3380 params,
3381 }
3382 }
3383 pub fn jsonrpc(&self) -> &::std::string::String {
3384 &self.jsonrpc
3385 }
3386 pub fn method(&self) -> &::std::string::String {
3387 &self.method
3388 }
3389 /// returns "tasks/result"
3390 pub fn method_value() -> &'static str {
3391 "tasks/result"
3392 }
3393}
3394/**The response to a tasks/result request.
3395The structure matches the result type of the original request.
3396For example, a tools/call task would return the CallToolResult structure.*/
3397///
3398/// <details><summary>JSON schema</summary>
3399///
3400/// ```json
3401///{
3402/// "description": "The response to a tasks/result request.\nThe structure matches the result type of the original request.\nFor example, a tools/call task would return the CallToolResult structure.",
3403/// "type": "object",
3404/// "properties": {
3405/// "_meta": {
3406/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
3407/// "type": "object",
3408/// "additionalProperties": {}
3409/// }
3410/// },
3411/// "additionalProperties": {}
3412///}
3413/// ```
3414/// </details>
3415#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
3416pub struct GetTaskPayloadResult {
3417 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
3418 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3419 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3420 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
3421 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3422}
3423///A request to retrieve the state of a task.
3424///
3425/// <details><summary>JSON schema</summary>
3426///
3427/// ```json
3428///{
3429/// "description": "A request to retrieve the state of a task.",
3430/// "type": "object",
3431/// "required": [
3432/// "id",
3433/// "jsonrpc",
3434/// "method",
3435/// "params"
3436/// ],
3437/// "properties": {
3438/// "id": {
3439/// "$ref": "#/$defs/RequestId"
3440/// },
3441/// "jsonrpc": {
3442/// "type": "string",
3443/// "const": "2.0"
3444/// },
3445/// "method": {
3446/// "type": "string",
3447/// "const": "tasks/get"
3448/// },
3449/// "params": {
3450/// "type": "object",
3451/// "required": [
3452/// "taskId"
3453/// ],
3454/// "properties": {
3455/// "taskId": {
3456/// "description": "The task identifier to query.",
3457/// "type": "string"
3458/// }
3459/// }
3460/// }
3461/// }
3462///}
3463/// ```
3464/// </details>
3465#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3466pub struct GetTaskRequest {
3467 pub id: RequestId,
3468 #[serde(deserialize_with = "validate::get_task_request_jsonrpc")]
3469 jsonrpc: ::std::string::String,
3470 #[serde(deserialize_with = "validate::get_task_request_method")]
3471 method: ::std::string::String,
3472 pub params: GetTaskParams,
3473}
3474impl GetTaskRequest {
3475 pub fn new(id: RequestId, params: GetTaskParams) -> Self {
3476 Self {
3477 id,
3478 jsonrpc: JSONRPC_VERSION.to_string(),
3479 method: "tasks/get".to_string(),
3480 params,
3481 }
3482 }
3483 pub fn jsonrpc(&self) -> &::std::string::String {
3484 &self.jsonrpc
3485 }
3486 pub fn method(&self) -> &::std::string::String {
3487 &self.method
3488 }
3489 /// returns "tasks/get"
3490 pub fn method_value() -> &'static str {
3491 "tasks/get"
3492 }
3493}
3494///The response to a tasks/get request.
3495///
3496/// <details><summary>JSON schema</summary>
3497///
3498/// ```json
3499///{
3500/// "description": "The response to a tasks/get request.",
3501/// "allOf": [
3502/// {
3503/// "$ref": "#/$defs/Result"
3504/// },
3505/// {
3506/// "$ref": "#/$defs/Task"
3507/// }
3508/// ]
3509///}
3510/// ```
3511/// </details>
3512#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3513pub struct GetTaskResult {
3514 #[serde(rename = "createdAt")]
3515 pub created_at: ::std::string::String,
3516 #[serde(rename = "lastUpdatedAt")]
3517 pub last_updated_at: ::std::string::String,
3518 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
3519 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3520 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3521 #[serde(rename = "pollInterval", default, skip_serializing_if = "::std::option::Option::is_none")]
3522 pub poll_interval: ::std::option::Option<i64>,
3523 pub status: TaskStatus,
3524 #[serde(rename = "statusMessage", default, skip_serializing_if = "::std::option::Option::is_none")]
3525 pub status_message: ::std::option::Option<::std::string::String>,
3526 #[serde(rename = "taskId")]
3527 pub task_id: ::std::string::String,
3528 pub ttl: i64,
3529 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
3530 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3531}
3532///An optionally-sized icon that can be displayed in a user interface.
3533///
3534/// <details><summary>JSON schema</summary>
3535///
3536/// ```json
3537///{
3538/// "description": "An optionally-sized icon that can be displayed in a user interface.",
3539/// "type": "object",
3540/// "required": [
3541/// "src"
3542/// ],
3543/// "properties": {
3544/// "mimeType": {
3545/// "description": "Optional MIME type override if the source MIME type is missing or generic.\nFor example: \"image/png\", \"image/jpeg\", or \"image/svg+xml\".",
3546/// "type": "string"
3547/// },
3548/// "sizes": {
3549/// "description": "Optional array of strings that specify sizes at which the icon can be used.\nEach string should be in WxH format (e.g., \"48x48\", \"96x96\") or \"any\" for scalable formats like SVG.\n\nIf not provided, the client should assume that the icon can be used at any size.",
3550/// "type": "array",
3551/// "items": {
3552/// "type": "string"
3553/// }
3554/// },
3555/// "src": {
3556/// "description": "A standard URI pointing to an icon resource. May be an HTTP/HTTPS URL or a\ndata: URI with Base64-encoded image data.\n\nConsumers SHOULD takes steps to ensure URLs serving icons are from the\nsame domain as the client/server or a trusted domain.\n\nConsumers SHOULD take appropriate precautions when consuming SVGs as they can contain\nexecutable JavaScript.",
3557/// "type": "string",
3558/// "format": "uri"
3559/// },
3560/// "theme": {
3561/// "description": "Optional specifier for the theme this icon is designed for. light indicates\nthe icon is designed to be used with a light background, and dark indicates\nthe icon is designed to be used with a dark background.\n\nIf not provided, the client should assume the icon can be used with any theme.",
3562/// "type": "string",
3563/// "enum": [
3564/// "dark",
3565/// "light"
3566/// ]
3567/// }
3568/// }
3569///}
3570/// ```
3571/// </details>
3572#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3573pub struct Icon {
3574 /**Optional MIME type override if the source MIME type is missing or generic.
3575 For example: "image/png", "image/jpeg", or "image/svg+xml".*/
3576 #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
3577 pub mime_type: ::std::option::Option<::std::string::String>,
3578 /**Optional array of strings that specify sizes at which the icon can be used.
3579 Each string should be in WxH format (e.g., "48x48", "96x96") or "any" for scalable formats like SVG.
3580 If not provided, the client should assume that the icon can be used at any size.*/
3581 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
3582 pub sizes: ::std::vec::Vec<::std::string::String>,
3583 /**A standard URI pointing to an icon resource. May be an HTTP/HTTPS URL or a
3584 data: URI with Base64-encoded image data.
3585 Consumers SHOULD takes steps to ensure URLs serving icons are from the
3586 same domain as the client/server or a trusted domain.
3587 Consumers SHOULD take appropriate precautions when consuming SVGs as they can contain
3588 executable JavaScript.*/
3589 pub src: ::std::string::String,
3590 /**Optional specifier for the theme this icon is designed for. light indicates
3591 the icon is designed to be used with a light background, and dark indicates
3592 the icon is designed to be used with a dark background.
3593 If not provided, the client should assume the icon can be used with any theme.*/
3594 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3595 pub theme: ::std::option::Option<IconTheme>,
3596}
3597/**Optional specifier for the theme this icon is designed for. light indicates
3598the icon is designed to be used with a light background, and dark indicates
3599the icon is designed to be used with a dark background.
3600If not provided, the client should assume the icon can be used with any theme.*/
3601///
3602/// <details><summary>JSON schema</summary>
3603///
3604/// ```json
3605///{
3606/// "description": "Optional specifier for the theme this icon is designed for. light indicates\nthe icon is designed to be used with a light background, and dark indicates\nthe icon is designed to be used with a dark background.\n\nIf not provided, the client should assume the icon can be used with any theme.",
3607/// "type": "string",
3608/// "enum": [
3609/// "dark",
3610/// "light"
3611/// ]
3612///}
3613/// ```
3614/// </details>
3615#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3616pub enum IconTheme {
3617 #[serde(rename = "dark")]
3618 Dark,
3619 #[serde(rename = "light")]
3620 Light,
3621}
3622impl ::std::fmt::Display for IconTheme {
3623 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3624 match *self {
3625 Self::Dark => write!(f, "dark"),
3626 Self::Light => write!(f, "light"),
3627 }
3628 }
3629}
3630///Base interface to add icons property.
3631///
3632/// <details><summary>JSON schema</summary>
3633///
3634/// ```json
3635///{
3636/// "description": "Base interface to add icons property.",
3637/// "type": "object",
3638/// "properties": {
3639/// "icons": {
3640/// "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
3641/// "type": "array",
3642/// "items": {
3643/// "$ref": "#/$defs/Icon"
3644/// }
3645/// }
3646/// }
3647///}
3648/// ```
3649/// </details>
3650#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
3651pub struct Icons {
3652 /**Optional set of sized icons that the client can display in a user interface.
3653 Clients that support rendering icons MUST support at least the following MIME types:
3654 - image/png - PNG images (safe, universal compatibility)
3655 - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
3656 Clients that support rendering icons SHOULD also support:
3657 - image/svg+xml - SVG images (scalable but requires security precautions)
3658 - image/webp - WebP images (modern, efficient format)*/
3659 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
3660 pub icons: ::std::vec::Vec<Icon>,
3661}
3662///An image provided to or from an LLM.
3663///
3664/// <details><summary>JSON schema</summary>
3665///
3666/// ```json
3667///{
3668/// "description": "An image provided to or from an LLM.",
3669/// "type": "object",
3670/// "required": [
3671/// "data",
3672/// "mimeType",
3673/// "type"
3674/// ],
3675/// "properties": {
3676/// "_meta": {
3677/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
3678/// "type": "object",
3679/// "additionalProperties": {}
3680/// },
3681/// "annotations": {
3682/// "description": "Optional annotations for the client.",
3683/// "$ref": "#/$defs/Annotations"
3684/// },
3685/// "data": {
3686/// "description": "The base64-encoded image data.",
3687/// "type": "string",
3688/// "format": "byte"
3689/// },
3690/// "mimeType": {
3691/// "description": "The MIME type of the image. Different providers may support different image types.",
3692/// "type": "string"
3693/// },
3694/// "type": {
3695/// "type": "string",
3696/// "const": "image"
3697/// }
3698/// }
3699///}
3700/// ```
3701/// </details>
3702#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3703pub struct ImageContent {
3704 ///Optional annotations for the client.
3705 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3706 pub annotations: ::std::option::Option<Annotations>,
3707 ///The base64-encoded image data.
3708 pub data: ::std::string::String,
3709 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
3710 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3711 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3712 ///The MIME type of the image. Different providers may support different image types.
3713 #[serde(rename = "mimeType")]
3714 pub mime_type: ::std::string::String,
3715 #[serde(rename = "type", deserialize_with = "validate::image_content_type_")]
3716 type_: ::std::string::String,
3717}
3718impl ImageContent {
3719 pub fn new(
3720 data: ::std::string::String,
3721 mime_type: ::std::string::String,
3722 annotations: ::std::option::Option<Annotations>,
3723 meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3724 ) -> Self {
3725 Self {
3726 annotations,
3727 data,
3728 meta,
3729 mime_type,
3730 type_: "image".to_string(),
3731 }
3732 }
3733 pub fn type_(&self) -> &::std::string::String {
3734 &self.type_
3735 }
3736 /// returns "image"
3737 pub fn type_value() -> &'static str {
3738 "image"
3739 }
3740}
3741///Describes the MCP implementation.
3742///
3743/// <details><summary>JSON schema</summary>
3744///
3745/// ```json
3746///{
3747/// "description": "Describes the MCP implementation.",
3748/// "type": "object",
3749/// "required": [
3750/// "name",
3751/// "version"
3752/// ],
3753/// "properties": {
3754/// "description": {
3755/// "description": "An optional human-readable description of what this implementation does.\n\nThis can be used by clients or servers to provide context about their purpose\nand capabilities. For example, a server might describe the types of resources\nor tools it provides, while a client might describe its intended use case.",
3756/// "type": "string"
3757/// },
3758/// "icons": {
3759/// "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
3760/// "type": "array",
3761/// "items": {
3762/// "$ref": "#/$defs/Icon"
3763/// }
3764/// },
3765/// "name": {
3766/// "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
3767/// "type": "string"
3768/// },
3769/// "title": {
3770/// "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
3771/// "type": "string"
3772/// },
3773/// "version": {
3774/// "type": "string"
3775/// },
3776/// "websiteUrl": {
3777/// "description": "An optional URL of the website for this implementation.",
3778/// "type": "string",
3779/// "format": "uri"
3780/// }
3781/// }
3782///}
3783/// ```
3784/// </details>
3785#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3786pub struct Implementation {
3787 /**An optional human-readable description of what this implementation does.
3788 This can be used by clients or servers to provide context about their purpose
3789 and capabilities. For example, a server might describe the types of resources
3790 or tools it provides, while a client might describe its intended use case.*/
3791 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3792 pub description: ::std::option::Option<::std::string::String>,
3793 /**Optional set of sized icons that the client can display in a user interface.
3794 Clients that support rendering icons MUST support at least the following MIME types:
3795 - image/png - PNG images (safe, universal compatibility)
3796 - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
3797 Clients that support rendering icons SHOULD also support:
3798 - image/svg+xml - SVG images (scalable but requires security precautions)
3799 - image/webp - WebP images (modern, efficient format)*/
3800 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
3801 pub icons: ::std::vec::Vec<Icon>,
3802 ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
3803 pub name: ::std::string::String,
3804 /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
3805 even by those unfamiliar with domain-specific terminology.
3806 If not provided, the name should be used for display (except for Tool,
3807 where annotations.title should be given precedence over using name,
3808 if present).*/
3809 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3810 pub title: ::std::option::Option<::std::string::String>,
3811 pub version: ::std::string::String,
3812 ///An optional URL of the website for this implementation.
3813 #[serde(rename = "websiteUrl", default, skip_serializing_if = "::std::option::Option::is_none")]
3814 pub website_url: ::std::option::Option<::std::string::String>,
3815}
3816/**A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
3817The client MAY ignore this request.
3818Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
3819declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.*/
3820///
3821/// <details><summary>JSON schema</summary>
3822///
3823/// ```json
3824///{
3825/// "description": "A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.\nThe client MAY ignore this request.\n\nDefault is \"none\". Values \"thisServer\" and \"allServers\" are soft-deprecated. Servers SHOULD only use these values if the client\ndeclares ClientCapabilities.sampling.context. These values may be removed in future spec releases.",
3826/// "type": "string",
3827/// "enum": [
3828/// "allServers",
3829/// "none",
3830/// "thisServer"
3831/// ]
3832///}
3833/// ```
3834/// </details>
3835#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3836pub enum IncludeContext {
3837 #[serde(rename = "allServers")]
3838 AllServers,
3839 #[serde(rename = "none")]
3840 None,
3841 #[serde(rename = "thisServer")]
3842 ThisServer,
3843}
3844impl ::std::fmt::Display for IncludeContext {
3845 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3846 match *self {
3847 Self::AllServers => write!(f, "allServers"),
3848 Self::None => write!(f, "none"),
3849 Self::ThisServer => write!(f, "thisServer"),
3850 }
3851 }
3852}
3853///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
3854///
3855/// <details><summary>JSON schema</summary>
3856///
3857/// ```json
3858///{
3859/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
3860/// "type": "object",
3861/// "properties": {
3862/// "progressToken": {
3863/// "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.",
3864/// "$ref": "#/$defs/ProgressToken"
3865/// }
3866/// },
3867/// "additionalProperties": {}
3868///}
3869/// ```
3870/// </details>
3871#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
3872pub struct InitializeMeta {
3873 ///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.
3874 #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
3875 pub progress_token: ::std::option::Option<ProgressToken>,
3876 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
3877 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
3878}
3879///This request is sent from the client to the server when it first connects, asking it to begin initialization.
3880///
3881/// <details><summary>JSON schema</summary>
3882///
3883/// ```json
3884///{
3885/// "description": "This request is sent from the client to the server when it first connects, asking it to begin initialization.",
3886/// "type": "object",
3887/// "required": [
3888/// "id",
3889/// "jsonrpc",
3890/// "method",
3891/// "params"
3892/// ],
3893/// "properties": {
3894/// "id": {
3895/// "$ref": "#/$defs/RequestId"
3896/// },
3897/// "jsonrpc": {
3898/// "type": "string",
3899/// "const": "2.0"
3900/// },
3901/// "method": {
3902/// "type": "string",
3903/// "const": "initialize"
3904/// },
3905/// "params": {
3906/// "$ref": "#/$defs/InitializeRequestParams"
3907/// }
3908/// }
3909///}
3910/// ```
3911/// </details>
3912#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3913pub struct InitializeRequest {
3914 pub id: RequestId,
3915 #[serde(deserialize_with = "validate::initialize_request_jsonrpc")]
3916 jsonrpc: ::std::string::String,
3917 #[serde(deserialize_with = "validate::initialize_request_method")]
3918 method: ::std::string::String,
3919 pub params: InitializeRequestParams,
3920}
3921impl InitializeRequest {
3922 pub fn new(id: RequestId, params: InitializeRequestParams) -> Self {
3923 Self {
3924 id,
3925 jsonrpc: JSONRPC_VERSION.to_string(),
3926 method: "initialize".to_string(),
3927 params,
3928 }
3929 }
3930 pub fn jsonrpc(&self) -> &::std::string::String {
3931 &self.jsonrpc
3932 }
3933 pub fn method(&self) -> &::std::string::String {
3934 &self.method
3935 }
3936 /// returns "initialize"
3937 pub fn method_value() -> &'static str {
3938 "initialize"
3939 }
3940}
3941///Parameters for an initialize request.
3942///
3943/// <details><summary>JSON schema</summary>
3944///
3945/// ```json
3946///{
3947/// "description": "Parameters for an initialize request.",
3948/// "type": "object",
3949/// "required": [
3950/// "capabilities",
3951/// "clientInfo",
3952/// "protocolVersion"
3953/// ],
3954/// "properties": {
3955/// "_meta": {
3956/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
3957/// "type": "object",
3958/// "properties": {
3959/// "progressToken": {
3960/// "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.",
3961/// "$ref": "#/$defs/ProgressToken"
3962/// }
3963/// },
3964/// "additionalProperties": {}
3965/// },
3966/// "capabilities": {
3967/// "$ref": "#/$defs/ClientCapabilities"
3968/// },
3969/// "clientInfo": {
3970/// "$ref": "#/$defs/Implementation"
3971/// },
3972/// "protocolVersion": {
3973/// "description": "The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.",
3974/// "type": "string"
3975/// }
3976/// }
3977///}
3978/// ```
3979/// </details>
3980#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3981pub struct InitializeRequestParams {
3982 pub capabilities: ClientCapabilities,
3983 #[serde(rename = "clientInfo")]
3984 pub client_info: Implementation,
3985 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
3986 pub meta: ::std::option::Option<InitializeMeta>,
3987 ///The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
3988 #[serde(rename = "protocolVersion")]
3989 pub protocol_version: ::std::string::String,
3990}
3991///After receiving an initialize request from the client, the server sends this response.
3992///
3993/// <details><summary>JSON schema</summary>
3994///
3995/// ```json
3996///{
3997/// "description": "After receiving an initialize request from the client, the server sends this response.",
3998/// "type": "object",
3999/// "required": [
4000/// "capabilities",
4001/// "protocolVersion",
4002/// "serverInfo"
4003/// ],
4004/// "properties": {
4005/// "_meta": {
4006/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
4007/// "type": "object",
4008/// "additionalProperties": {}
4009/// },
4010/// "capabilities": {
4011/// "$ref": "#/$defs/ServerCapabilities"
4012/// },
4013/// "instructions": {
4014/// "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.",
4015/// "type": "string"
4016/// },
4017/// "protocolVersion": {
4018/// "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.",
4019/// "type": "string"
4020/// },
4021/// "serverInfo": {
4022/// "$ref": "#/$defs/Implementation"
4023/// }
4024/// }
4025///}
4026/// ```
4027/// </details>
4028#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4029pub struct InitializeResult {
4030 pub capabilities: ServerCapabilities,
4031 /**Instructions describing how to use the server and its features.
4032 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.*/
4033 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4034 pub instructions: ::std::option::Option<::std::string::String>,
4035 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
4036 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4037 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4038 ///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.
4039 #[serde(rename = "protocolVersion")]
4040 pub protocol_version: ::std::string::String,
4041 #[serde(rename = "serverInfo")]
4042 pub server_info: Implementation,
4043}
4044///This notification is sent from the client to the server after initialization has finished.
4045///
4046/// <details><summary>JSON schema</summary>
4047///
4048/// ```json
4049///{
4050/// "description": "This notification is sent from the client to the server after initialization has finished.",
4051/// "type": "object",
4052/// "required": [
4053/// "jsonrpc",
4054/// "method"
4055/// ],
4056/// "properties": {
4057/// "jsonrpc": {
4058/// "type": "string",
4059/// "const": "2.0"
4060/// },
4061/// "method": {
4062/// "type": "string",
4063/// "const": "notifications/initialized"
4064/// },
4065/// "params": {
4066/// "$ref": "#/$defs/NotificationParams"
4067/// }
4068/// }
4069///}
4070/// ```
4071/// </details>
4072#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4073pub struct InitializedNotification {
4074 #[serde(deserialize_with = "validate::initialized_notification_jsonrpc")]
4075 jsonrpc: ::std::string::String,
4076 #[serde(deserialize_with = "validate::initialized_notification_method")]
4077 method: ::std::string::String,
4078 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4079 pub params: ::std::option::Option<NotificationParams>,
4080}
4081impl InitializedNotification {
4082 pub fn new(params: ::std::option::Option<NotificationParams>) -> Self {
4083 Self {
4084 jsonrpc: JSONRPC_VERSION.to_string(),
4085 method: "notifications/initialized".to_string(),
4086 params,
4087 }
4088 }
4089 pub fn jsonrpc(&self) -> &::std::string::String {
4090 &self.jsonrpc
4091 }
4092 pub fn method(&self) -> &::std::string::String {
4093 &self.method
4094 }
4095 /// returns "notifications/initialized"
4096 pub fn method_value() -> &'static str {
4097 "notifications/initialized"
4098 }
4099}
4100///A response to a request that indicates an error occurred.
4101///
4102/// <details><summary>JSON schema</summary>
4103///
4104/// ```json
4105///{
4106/// "description": "A response to a request that indicates an error occurred.",
4107/// "type": "object",
4108/// "required": [
4109/// "error",
4110/// "jsonrpc"
4111/// ],
4112/// "properties": {
4113/// "error": {
4114/// "$ref": "#/$defs/Error"
4115/// },
4116/// "id": {
4117/// "$ref": "#/$defs/RequestId"
4118/// },
4119/// "jsonrpc": {
4120/// "type": "string",
4121/// "const": "2.0"
4122/// }
4123/// }
4124///}
4125/// ```
4126/// </details>
4127#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4128pub struct JsonrpcErrorResponse {
4129 pub error: RpcError,
4130 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4131 pub id: ::std::option::Option<RequestId>,
4132 #[serde(deserialize_with = "validate::jsonrpc_error_response_jsonrpc")]
4133 jsonrpc: ::std::string::String,
4134}
4135impl JsonrpcErrorResponse {
4136 pub fn new(error: RpcError, id: ::std::option::Option<RequestId>) -> Self {
4137 Self {
4138 error,
4139 id,
4140 jsonrpc: JSONRPC_VERSION.to_string(),
4141 }
4142 }
4143 pub fn jsonrpc(&self) -> &::std::string::String {
4144 &self.jsonrpc
4145 }
4146}
4147///Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.
4148///
4149/// <details><summary>JSON schema</summary>
4150///
4151/// ```json
4152///{
4153/// "description": "Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.",
4154/// "anyOf": [
4155/// {
4156/// "$ref": "#/$defs/JSONRPCRequest"
4157/// },
4158/// {
4159/// "$ref": "#/$defs/JSONRPCNotification"
4160/// },
4161/// {
4162/// "$ref": "#/$defs/JSONRPCResultResponse"
4163/// },
4164/// {
4165/// "$ref": "#/$defs/JSONRPCErrorResponse"
4166/// }
4167/// ]
4168///}
4169/// ```
4170/// </details>
4171#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4172#[serde(untagged)]
4173pub enum JsonrpcMessage {
4174 Request(JsonrpcRequest),
4175 Notification(JsonrpcNotification),
4176 ResultResponse(JsonrpcResultResponse),
4177 ErrorResponse(JsonrpcErrorResponse),
4178}
4179impl ::std::convert::From<JsonrpcRequest> for JsonrpcMessage {
4180 fn from(value: JsonrpcRequest) -> Self {
4181 Self::Request(value)
4182 }
4183}
4184impl ::std::convert::From<JsonrpcNotification> for JsonrpcMessage {
4185 fn from(value: JsonrpcNotification) -> Self {
4186 Self::Notification(value)
4187 }
4188}
4189impl ::std::convert::From<JsonrpcResultResponse> for JsonrpcMessage {
4190 fn from(value: JsonrpcResultResponse) -> Self {
4191 Self::ResultResponse(value)
4192 }
4193}
4194impl ::std::convert::From<JsonrpcErrorResponse> for JsonrpcMessage {
4195 fn from(value: JsonrpcErrorResponse) -> Self {
4196 Self::ErrorResponse(value)
4197 }
4198}
4199///A notification which does not expect a response.
4200///
4201/// <details><summary>JSON schema</summary>
4202///
4203/// ```json
4204///{
4205/// "description": "A notification which does not expect a response.",
4206/// "type": "object",
4207/// "required": [
4208/// "jsonrpc",
4209/// "method"
4210/// ],
4211/// "properties": {
4212/// "jsonrpc": {
4213/// "type": "string",
4214/// "const": "2.0"
4215/// },
4216/// "method": {
4217/// "type": "string"
4218/// },
4219/// "params": {
4220/// "type": "object",
4221/// "additionalProperties": {}
4222/// }
4223/// }
4224///}
4225/// ```
4226/// </details>
4227#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4228pub struct JsonrpcNotification {
4229 #[serde(deserialize_with = "validate::jsonrpc_notification_jsonrpc")]
4230 jsonrpc: ::std::string::String,
4231 pub method: ::std::string::String,
4232 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4233 pub params: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4234}
4235impl JsonrpcNotification {
4236 pub fn new(
4237 method: ::std::string::String,
4238 params: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4239 ) -> Self {
4240 Self {
4241 jsonrpc: JSONRPC_VERSION.to_string(),
4242 method,
4243 params,
4244 }
4245 }
4246 pub fn jsonrpc(&self) -> &::std::string::String {
4247 &self.jsonrpc
4248 }
4249}
4250///A request that expects a response.
4251///
4252/// <details><summary>JSON schema</summary>
4253///
4254/// ```json
4255///{
4256/// "description": "A request that expects a response.",
4257/// "type": "object",
4258/// "required": [
4259/// "id",
4260/// "jsonrpc",
4261/// "method"
4262/// ],
4263/// "properties": {
4264/// "id": {
4265/// "$ref": "#/$defs/RequestId"
4266/// },
4267/// "jsonrpc": {
4268/// "type": "string",
4269/// "const": "2.0"
4270/// },
4271/// "method": {
4272/// "type": "string"
4273/// },
4274/// "params": {
4275/// "type": "object",
4276/// "additionalProperties": {}
4277/// }
4278/// }
4279///}
4280/// ```
4281/// </details>
4282#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4283pub struct JsonrpcRequest {
4284 pub id: RequestId,
4285 #[serde(deserialize_with = "validate::jsonrpc_request_jsonrpc")]
4286 jsonrpc: ::std::string::String,
4287 pub method: ::std::string::String,
4288 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4289 pub params: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4290}
4291impl JsonrpcRequest {
4292 pub fn new(
4293 id: RequestId,
4294 method: ::std::string::String,
4295 params: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4296 ) -> Self {
4297 Self {
4298 id,
4299 jsonrpc: JSONRPC_VERSION.to_string(),
4300 method,
4301 params,
4302 }
4303 }
4304 pub fn jsonrpc(&self) -> &::std::string::String {
4305 &self.jsonrpc
4306 }
4307}
4308///A response to a request, containing either the result or error.
4309///
4310/// <details><summary>JSON schema</summary>
4311///
4312/// ```json
4313///{
4314/// "description": "A response to a request, containing either the result or error.",
4315/// "anyOf": [
4316/// {
4317/// "$ref": "#/$defs/JSONRPCResultResponse"
4318/// },
4319/// {
4320/// "$ref": "#/$defs/JSONRPCErrorResponse"
4321/// }
4322/// ]
4323///}
4324/// ```
4325/// </details>
4326#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4327#[serde(untagged)]
4328pub enum JsonrpcResponse {
4329 ResultResponse(JsonrpcResultResponse),
4330 ErrorResponse(JsonrpcErrorResponse),
4331}
4332impl ::std::convert::From<JsonrpcResultResponse> for JsonrpcResponse {
4333 fn from(value: JsonrpcResultResponse) -> Self {
4334 Self::ResultResponse(value)
4335 }
4336}
4337impl ::std::convert::From<JsonrpcErrorResponse> for JsonrpcResponse {
4338 fn from(value: JsonrpcErrorResponse) -> Self {
4339 Self::ErrorResponse(value)
4340 }
4341}
4342///A successful (non-error) response to a request.
4343///
4344/// <details><summary>JSON schema</summary>
4345///
4346/// ```json
4347///{
4348/// "description": "A successful (non-error) response to a request.",
4349/// "type": "object",
4350/// "required": [
4351/// "id",
4352/// "jsonrpc",
4353/// "result"
4354/// ],
4355/// "properties": {
4356/// "id": {
4357/// "$ref": "#/$defs/RequestId"
4358/// },
4359/// "jsonrpc": {
4360/// "type": "string",
4361/// "const": "2.0"
4362/// },
4363/// "result": {
4364/// "$ref": "#/$defs/Result"
4365/// }
4366/// }
4367///}
4368/// ```
4369/// </details>
4370#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4371pub struct JsonrpcResultResponse {
4372 pub id: RequestId,
4373 #[serde(deserialize_with = "validate::jsonrpc_result_response_jsonrpc")]
4374 jsonrpc: ::std::string::String,
4375 pub result: Result,
4376}
4377impl JsonrpcResultResponse {
4378 pub fn new(id: RequestId, result: Result) -> Self {
4379 Self {
4380 id,
4381 jsonrpc: JSONRPC_VERSION.to_string(),
4382 result,
4383 }
4384 }
4385 pub fn jsonrpc(&self) -> &::std::string::String {
4386 &self.jsonrpc
4387 }
4388}
4389/**Use TitledSingleSelectEnumSchema instead.
4390This interface will be removed in a future version.*/
4391///
4392/// <details><summary>JSON schema</summary>
4393///
4394/// ```json
4395///{
4396/// "description": "Use TitledSingleSelectEnumSchema instead.\nThis interface will be removed in a future version.",
4397/// "type": "object",
4398/// "required": [
4399/// "enum",
4400/// "type"
4401/// ],
4402/// "properties": {
4403/// "default": {
4404/// "type": "string"
4405/// },
4406/// "description": {
4407/// "type": "string"
4408/// },
4409/// "enum": {
4410/// "type": "array",
4411/// "items": {
4412/// "type": "string"
4413/// }
4414/// },
4415/// "enumNames": {
4416/// "description": "(Legacy) Display names for enum values.\nNon-standard according to JSON schema 2020-12.",
4417/// "type": "array",
4418/// "items": {
4419/// "type": "string"
4420/// }
4421/// },
4422/// "title": {
4423/// "type": "string"
4424/// },
4425/// "type": {
4426/// "type": "string",
4427/// "const": "string"
4428/// }
4429/// }
4430///}
4431/// ```
4432/// </details>
4433#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4434pub struct LegacyTitledEnumSchema {
4435 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4436 pub default: ::std::option::Option<::std::string::String>,
4437 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4438 pub description: ::std::option::Option<::std::string::String>,
4439 #[serde(rename = "enum")]
4440 pub enum_: ::std::vec::Vec<::std::string::String>,
4441 /**(Legacy) Display names for enum values.
4442 Non-standard according to JSON schema 2020-12.*/
4443 #[serde(rename = "enumNames", default, skip_serializing_if = "::std::vec::Vec::is_empty")]
4444 pub enum_names: ::std::vec::Vec<::std::string::String>,
4445 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4446 pub title: ::std::option::Option<::std::string::String>,
4447 #[serde(rename = "type", deserialize_with = "validate::legacy_titled_enum_schema_type_")]
4448 type_: ::std::string::String,
4449}
4450impl LegacyTitledEnumSchema {
4451 pub fn new(
4452 enum_: ::std::vec::Vec<::std::string::String>,
4453 enum_names: ::std::vec::Vec<::std::string::String>,
4454 default: ::std::option::Option<::std::string::String>,
4455 description: ::std::option::Option<::std::string::String>,
4456 title: ::std::option::Option<::std::string::String>,
4457 ) -> Self {
4458 Self {
4459 default,
4460 description,
4461 enum_,
4462 enum_names,
4463 title,
4464 type_: "string".to_string(),
4465 }
4466 }
4467 pub fn type_(&self) -> &::std::string::String {
4468 &self.type_
4469 }
4470 /// returns "string"
4471 pub fn type_value() -> &'static str {
4472 "string"
4473 }
4474}
4475///Sent from the client to request a list of prompts and prompt templates the server has.
4476///
4477/// <details><summary>JSON schema</summary>
4478///
4479/// ```json
4480///{
4481/// "description": "Sent from the client to request a list of prompts and prompt templates the server has.",
4482/// "type": "object",
4483/// "required": [
4484/// "id",
4485/// "jsonrpc",
4486/// "method"
4487/// ],
4488/// "properties": {
4489/// "id": {
4490/// "$ref": "#/$defs/RequestId"
4491/// },
4492/// "jsonrpc": {
4493/// "type": "string",
4494/// "const": "2.0"
4495/// },
4496/// "method": {
4497/// "type": "string",
4498/// "const": "prompts/list"
4499/// },
4500/// "params": {
4501/// "$ref": "#/$defs/PaginatedRequestParams"
4502/// }
4503/// }
4504///}
4505/// ```
4506/// </details>
4507#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4508pub struct ListPromptsRequest {
4509 pub id: RequestId,
4510 #[serde(deserialize_with = "validate::list_prompts_request_jsonrpc")]
4511 jsonrpc: ::std::string::String,
4512 #[serde(deserialize_with = "validate::list_prompts_request_method")]
4513 method: ::std::string::String,
4514 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4515 pub params: ::std::option::Option<PaginatedRequestParams>,
4516}
4517impl ListPromptsRequest {
4518 pub fn new(id: RequestId, params: ::std::option::Option<PaginatedRequestParams>) -> Self {
4519 Self {
4520 id,
4521 jsonrpc: JSONRPC_VERSION.to_string(),
4522 method: "prompts/list".to_string(),
4523 params,
4524 }
4525 }
4526 pub fn jsonrpc(&self) -> &::std::string::String {
4527 &self.jsonrpc
4528 }
4529 pub fn method(&self) -> &::std::string::String {
4530 &self.method
4531 }
4532 /// returns "prompts/list"
4533 pub fn method_value() -> &'static str {
4534 "prompts/list"
4535 }
4536}
4537///The server's response to a prompts/list request from the client.
4538///
4539/// <details><summary>JSON schema</summary>
4540///
4541/// ```json
4542///{
4543/// "description": "The server's response to a prompts/list request from the client.",
4544/// "type": "object",
4545/// "required": [
4546/// "prompts"
4547/// ],
4548/// "properties": {
4549/// "_meta": {
4550/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
4551/// "type": "object",
4552/// "additionalProperties": {}
4553/// },
4554/// "nextCursor": {
4555/// "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
4556/// "type": "string"
4557/// },
4558/// "prompts": {
4559/// "type": "array",
4560/// "items": {
4561/// "$ref": "#/$defs/Prompt"
4562/// }
4563/// }
4564/// }
4565///}
4566/// ```
4567/// </details>
4568#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4569pub struct ListPromptsResult {
4570 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
4571 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4572 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4573 /**An opaque token representing the pagination position after the last returned result.
4574 If present, there may be more results available.*/
4575 #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
4576 pub next_cursor: ::std::option::Option<::std::string::String>,
4577 pub prompts: ::std::vec::Vec<Prompt>,
4578}
4579///Sent from the client to request a list of resource templates the server has.
4580///
4581/// <details><summary>JSON schema</summary>
4582///
4583/// ```json
4584///{
4585/// "description": "Sent from the client to request a list of resource templates the server has.",
4586/// "type": "object",
4587/// "required": [
4588/// "id",
4589/// "jsonrpc",
4590/// "method"
4591/// ],
4592/// "properties": {
4593/// "id": {
4594/// "$ref": "#/$defs/RequestId"
4595/// },
4596/// "jsonrpc": {
4597/// "type": "string",
4598/// "const": "2.0"
4599/// },
4600/// "method": {
4601/// "type": "string",
4602/// "const": "resources/templates/list"
4603/// },
4604/// "params": {
4605/// "$ref": "#/$defs/PaginatedRequestParams"
4606/// }
4607/// }
4608///}
4609/// ```
4610/// </details>
4611#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4612pub struct ListResourceTemplatesRequest {
4613 pub id: RequestId,
4614 #[serde(deserialize_with = "validate::list_resource_templates_request_jsonrpc")]
4615 jsonrpc: ::std::string::String,
4616 #[serde(deserialize_with = "validate::list_resource_templates_request_method")]
4617 method: ::std::string::String,
4618 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4619 pub params: ::std::option::Option<PaginatedRequestParams>,
4620}
4621impl ListResourceTemplatesRequest {
4622 pub fn new(id: RequestId, params: ::std::option::Option<PaginatedRequestParams>) -> Self {
4623 Self {
4624 id,
4625 jsonrpc: JSONRPC_VERSION.to_string(),
4626 method: "resources/templates/list".to_string(),
4627 params,
4628 }
4629 }
4630 pub fn jsonrpc(&self) -> &::std::string::String {
4631 &self.jsonrpc
4632 }
4633 pub fn method(&self) -> &::std::string::String {
4634 &self.method
4635 }
4636 /// returns "resources/templates/list"
4637 pub fn method_value() -> &'static str {
4638 "resources/templates/list"
4639 }
4640}
4641///The server's response to a resources/templates/list request from the client.
4642///
4643/// <details><summary>JSON schema</summary>
4644///
4645/// ```json
4646///{
4647/// "description": "The server's response to a resources/templates/list request from the client.",
4648/// "type": "object",
4649/// "required": [
4650/// "resourceTemplates"
4651/// ],
4652/// "properties": {
4653/// "_meta": {
4654/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
4655/// "type": "object",
4656/// "additionalProperties": {}
4657/// },
4658/// "nextCursor": {
4659/// "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
4660/// "type": "string"
4661/// },
4662/// "resourceTemplates": {
4663/// "type": "array",
4664/// "items": {
4665/// "$ref": "#/$defs/ResourceTemplate"
4666/// }
4667/// }
4668/// }
4669///}
4670/// ```
4671/// </details>
4672#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4673pub struct ListResourceTemplatesResult {
4674 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
4675 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4676 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4677 /**An opaque token representing the pagination position after the last returned result.
4678 If present, there may be more results available.*/
4679 #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
4680 pub next_cursor: ::std::option::Option<::std::string::String>,
4681 #[serde(rename = "resourceTemplates")]
4682 pub resource_templates: ::std::vec::Vec<ResourceTemplate>,
4683}
4684///Sent from the client to request a list of resources the server has.
4685///
4686/// <details><summary>JSON schema</summary>
4687///
4688/// ```json
4689///{
4690/// "description": "Sent from the client to request a list of resources the server has.",
4691/// "type": "object",
4692/// "required": [
4693/// "id",
4694/// "jsonrpc",
4695/// "method"
4696/// ],
4697/// "properties": {
4698/// "id": {
4699/// "$ref": "#/$defs/RequestId"
4700/// },
4701/// "jsonrpc": {
4702/// "type": "string",
4703/// "const": "2.0"
4704/// },
4705/// "method": {
4706/// "type": "string",
4707/// "const": "resources/list"
4708/// },
4709/// "params": {
4710/// "$ref": "#/$defs/PaginatedRequestParams"
4711/// }
4712/// }
4713///}
4714/// ```
4715/// </details>
4716#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4717pub struct ListResourcesRequest {
4718 pub id: RequestId,
4719 #[serde(deserialize_with = "validate::list_resources_request_jsonrpc")]
4720 jsonrpc: ::std::string::String,
4721 #[serde(deserialize_with = "validate::list_resources_request_method")]
4722 method: ::std::string::String,
4723 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4724 pub params: ::std::option::Option<PaginatedRequestParams>,
4725}
4726impl ListResourcesRequest {
4727 pub fn new(id: RequestId, params: ::std::option::Option<PaginatedRequestParams>) -> Self {
4728 Self {
4729 id,
4730 jsonrpc: JSONRPC_VERSION.to_string(),
4731 method: "resources/list".to_string(),
4732 params,
4733 }
4734 }
4735 pub fn jsonrpc(&self) -> &::std::string::String {
4736 &self.jsonrpc
4737 }
4738 pub fn method(&self) -> &::std::string::String {
4739 &self.method
4740 }
4741 /// returns "resources/list"
4742 pub fn method_value() -> &'static str {
4743 "resources/list"
4744 }
4745}
4746///The server's response to a resources/list request from the client.
4747///
4748/// <details><summary>JSON schema</summary>
4749///
4750/// ```json
4751///{
4752/// "description": "The server's response to a resources/list request from the client.",
4753/// "type": "object",
4754/// "required": [
4755/// "resources"
4756/// ],
4757/// "properties": {
4758/// "_meta": {
4759/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
4760/// "type": "object",
4761/// "additionalProperties": {}
4762/// },
4763/// "nextCursor": {
4764/// "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
4765/// "type": "string"
4766/// },
4767/// "resources": {
4768/// "type": "array",
4769/// "items": {
4770/// "$ref": "#/$defs/Resource"
4771/// }
4772/// }
4773/// }
4774///}
4775/// ```
4776/// </details>
4777#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4778pub struct ListResourcesResult {
4779 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
4780 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4781 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4782 /**An opaque token representing the pagination position after the last returned result.
4783 If present, there may be more results available.*/
4784 #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
4785 pub next_cursor: ::std::option::Option<::std::string::String>,
4786 pub resources: ::std::vec::Vec<Resource>,
4787}
4788/**Sent from the server to request a list of root URIs from the client. Roots allow
4789servers to ask for specific directories or files to operate on. A common example
4790for roots is providing a set of repositories or directories a server should operate
4791on.
4792This request is typically used when the server needs to understand the file system
4793structure or access specific locations that the client has permission to read from.*/
4794///
4795/// <details><summary>JSON schema</summary>
4796///
4797/// ```json
4798///{
4799/// "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.",
4800/// "type": "object",
4801/// "required": [
4802/// "id",
4803/// "jsonrpc",
4804/// "method"
4805/// ],
4806/// "properties": {
4807/// "id": {
4808/// "$ref": "#/$defs/RequestId"
4809/// },
4810/// "jsonrpc": {
4811/// "type": "string",
4812/// "const": "2.0"
4813/// },
4814/// "method": {
4815/// "type": "string",
4816/// "const": "roots/list"
4817/// },
4818/// "params": {
4819/// "$ref": "#/$defs/RequestParams"
4820/// }
4821/// }
4822///}
4823/// ```
4824/// </details>
4825#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4826pub struct ListRootsRequest {
4827 pub id: RequestId,
4828 #[serde(deserialize_with = "validate::list_roots_request_jsonrpc")]
4829 jsonrpc: ::std::string::String,
4830 #[serde(deserialize_with = "validate::list_roots_request_method")]
4831 method: ::std::string::String,
4832 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4833 pub params: ::std::option::Option<RequestParams>,
4834}
4835impl ListRootsRequest {
4836 pub fn new(id: RequestId, params: ::std::option::Option<RequestParams>) -> Self {
4837 Self {
4838 id,
4839 jsonrpc: JSONRPC_VERSION.to_string(),
4840 method: "roots/list".to_string(),
4841 params,
4842 }
4843 }
4844 pub fn jsonrpc(&self) -> &::std::string::String {
4845 &self.jsonrpc
4846 }
4847 pub fn method(&self) -> &::std::string::String {
4848 &self.method
4849 }
4850 /// returns "roots/list"
4851 pub fn method_value() -> &'static str {
4852 "roots/list"
4853 }
4854}
4855/**The client's response to a roots/list request from the server.
4856This result contains an array of Root objects, each representing a root directory
4857or file that the server can operate on.*/
4858///
4859/// <details><summary>JSON schema</summary>
4860///
4861/// ```json
4862///{
4863/// "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.",
4864/// "type": "object",
4865/// "required": [
4866/// "roots"
4867/// ],
4868/// "properties": {
4869/// "_meta": {
4870/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
4871/// "type": "object",
4872/// "additionalProperties": {}
4873/// },
4874/// "roots": {
4875/// "type": "array",
4876/// "items": {
4877/// "$ref": "#/$defs/Root"
4878/// }
4879/// }
4880/// }
4881///}
4882/// ```
4883/// </details>
4884#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4885pub struct ListRootsResult {
4886 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
4887 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4888 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4889 pub roots: ::std::vec::Vec<Root>,
4890}
4891///A request to retrieve a list of tasks.
4892///
4893/// <details><summary>JSON schema</summary>
4894///
4895/// ```json
4896///{
4897/// "description": "A request to retrieve a list of tasks.",
4898/// "type": "object",
4899/// "required": [
4900/// "id",
4901/// "jsonrpc",
4902/// "method"
4903/// ],
4904/// "properties": {
4905/// "id": {
4906/// "$ref": "#/$defs/RequestId"
4907/// },
4908/// "jsonrpc": {
4909/// "type": "string",
4910/// "const": "2.0"
4911/// },
4912/// "method": {
4913/// "type": "string",
4914/// "const": "tasks/list"
4915/// },
4916/// "params": {
4917/// "$ref": "#/$defs/PaginatedRequestParams"
4918/// }
4919/// }
4920///}
4921/// ```
4922/// </details>
4923#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4924pub struct ListTasksRequest {
4925 pub id: RequestId,
4926 #[serde(deserialize_with = "validate::list_tasks_request_jsonrpc")]
4927 jsonrpc: ::std::string::String,
4928 #[serde(deserialize_with = "validate::list_tasks_request_method")]
4929 method: ::std::string::String,
4930 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4931 pub params: ::std::option::Option<PaginatedRequestParams>,
4932}
4933impl ListTasksRequest {
4934 pub fn new(id: RequestId, params: ::std::option::Option<PaginatedRequestParams>) -> Self {
4935 Self {
4936 id,
4937 jsonrpc: JSONRPC_VERSION.to_string(),
4938 method: "tasks/list".to_string(),
4939 params,
4940 }
4941 }
4942 pub fn jsonrpc(&self) -> &::std::string::String {
4943 &self.jsonrpc
4944 }
4945 pub fn method(&self) -> &::std::string::String {
4946 &self.method
4947 }
4948 /// returns "tasks/list"
4949 pub fn method_value() -> &'static str {
4950 "tasks/list"
4951 }
4952}
4953///The response to a tasks/list request.
4954///
4955/// <details><summary>JSON schema</summary>
4956///
4957/// ```json
4958///{
4959/// "description": "The response to a tasks/list request.",
4960/// "type": "object",
4961/// "required": [
4962/// "tasks"
4963/// ],
4964/// "properties": {
4965/// "_meta": {
4966/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
4967/// "type": "object",
4968/// "additionalProperties": {}
4969/// },
4970/// "nextCursor": {
4971/// "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
4972/// "type": "string"
4973/// },
4974/// "tasks": {
4975/// "type": "array",
4976/// "items": {
4977/// "$ref": "#/$defs/Task"
4978/// }
4979/// }
4980/// }
4981///}
4982/// ```
4983/// </details>
4984#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4985pub struct ListTasksResult {
4986 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
4987 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
4988 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
4989 /**An opaque token representing the pagination position after the last returned result.
4990 If present, there may be more results available.*/
4991 #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
4992 pub next_cursor: ::std::option::Option<::std::string::String>,
4993 pub tasks: ::std::vec::Vec<Task>,
4994}
4995///Sent from the client to request a list of tools the server has.
4996///
4997/// <details><summary>JSON schema</summary>
4998///
4999/// ```json
5000///{
5001/// "description": "Sent from the client to request a list of tools the server has.",
5002/// "type": "object",
5003/// "required": [
5004/// "id",
5005/// "jsonrpc",
5006/// "method"
5007/// ],
5008/// "properties": {
5009/// "id": {
5010/// "$ref": "#/$defs/RequestId"
5011/// },
5012/// "jsonrpc": {
5013/// "type": "string",
5014/// "const": "2.0"
5015/// },
5016/// "method": {
5017/// "type": "string",
5018/// "const": "tools/list"
5019/// },
5020/// "params": {
5021/// "$ref": "#/$defs/PaginatedRequestParams"
5022/// }
5023/// }
5024///}
5025/// ```
5026/// </details>
5027#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5028pub struct ListToolsRequest {
5029 pub id: RequestId,
5030 #[serde(deserialize_with = "validate::list_tools_request_jsonrpc")]
5031 jsonrpc: ::std::string::String,
5032 #[serde(deserialize_with = "validate::list_tools_request_method")]
5033 method: ::std::string::String,
5034 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5035 pub params: ::std::option::Option<PaginatedRequestParams>,
5036}
5037impl ListToolsRequest {
5038 pub fn new(id: RequestId, params: ::std::option::Option<PaginatedRequestParams>) -> Self {
5039 Self {
5040 id,
5041 jsonrpc: JSONRPC_VERSION.to_string(),
5042 method: "tools/list".to_string(),
5043 params,
5044 }
5045 }
5046 pub fn jsonrpc(&self) -> &::std::string::String {
5047 &self.jsonrpc
5048 }
5049 pub fn method(&self) -> &::std::string::String {
5050 &self.method
5051 }
5052 /// returns "tools/list"
5053 pub fn method_value() -> &'static str {
5054 "tools/list"
5055 }
5056}
5057///The server's response to a tools/list request from the client.
5058///
5059/// <details><summary>JSON schema</summary>
5060///
5061/// ```json
5062///{
5063/// "description": "The server's response to a tools/list request from the client.",
5064/// "type": "object",
5065/// "required": [
5066/// "tools"
5067/// ],
5068/// "properties": {
5069/// "_meta": {
5070/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
5071/// "type": "object",
5072/// "additionalProperties": {}
5073/// },
5074/// "nextCursor": {
5075/// "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
5076/// "type": "string"
5077/// },
5078/// "tools": {
5079/// "type": "array",
5080/// "items": {
5081/// "$ref": "#/$defs/Tool"
5082/// }
5083/// }
5084/// }
5085///}
5086/// ```
5087/// </details>
5088#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5089pub struct ListToolsResult {
5090 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
5091 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
5092 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5093 /**An opaque token representing the pagination position after the last returned result.
5094 If present, there may be more results available.*/
5095 #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
5096 pub next_cursor: ::std::option::Option<::std::string::String>,
5097 pub tools: ::std::vec::Vec<Tool>,
5098}
5099/**The severity of a log message.
5100These map to syslog message severities, as specified in RFC-5424:
5101<https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1>*/
5102///
5103/// <details><summary>JSON schema</summary>
5104///
5105/// ```json
5106///{
5107/// "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>",
5108/// "type": "string",
5109/// "enum": [
5110/// "alert",
5111/// "critical",
5112/// "debug",
5113/// "emergency",
5114/// "error",
5115/// "info",
5116/// "notice",
5117/// "warning"
5118/// ]
5119///}
5120/// ```
5121/// </details>
5122#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
5123pub enum LoggingLevel {
5124 #[serde(rename = "alert")]
5125 Alert,
5126 #[serde(rename = "critical")]
5127 Critical,
5128 #[serde(rename = "debug")]
5129 Debug,
5130 #[serde(rename = "emergency")]
5131 Emergency,
5132 #[serde(rename = "error")]
5133 Error,
5134 #[serde(rename = "info")]
5135 Info,
5136 #[serde(rename = "notice")]
5137 Notice,
5138 #[serde(rename = "warning")]
5139 Warning,
5140}
5141impl ::std::fmt::Display for LoggingLevel {
5142 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5143 match *self {
5144 Self::Alert => write!(f, "alert"),
5145 Self::Critical => write!(f, "critical"),
5146 Self::Debug => write!(f, "debug"),
5147 Self::Emergency => write!(f, "emergency"),
5148 Self::Error => write!(f, "error"),
5149 Self::Info => write!(f, "info"),
5150 Self::Notice => write!(f, "notice"),
5151 Self::Warning => write!(f, "warning"),
5152 }
5153 }
5154}
5155///JSONRPCNotification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.
5156///
5157/// <details><summary>JSON schema</summary>
5158///
5159/// ```json
5160///{
5161/// "description": "JSONRPCNotification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.",
5162/// "type": "object",
5163/// "required": [
5164/// "jsonrpc",
5165/// "method",
5166/// "params"
5167/// ],
5168/// "properties": {
5169/// "jsonrpc": {
5170/// "type": "string",
5171/// "const": "2.0"
5172/// },
5173/// "method": {
5174/// "type": "string",
5175/// "const": "notifications/message"
5176/// },
5177/// "params": {
5178/// "$ref": "#/$defs/LoggingMessageNotificationParams"
5179/// }
5180/// }
5181///}
5182/// ```
5183/// </details>
5184#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5185pub struct LoggingMessageNotification {
5186 #[serde(deserialize_with = "validate::logging_message_notification_jsonrpc")]
5187 jsonrpc: ::std::string::String,
5188 #[serde(deserialize_with = "validate::logging_message_notification_method")]
5189 method: ::std::string::String,
5190 pub params: LoggingMessageNotificationParams,
5191}
5192impl LoggingMessageNotification {
5193 pub fn new(params: LoggingMessageNotificationParams) -> Self {
5194 Self {
5195 jsonrpc: JSONRPC_VERSION.to_string(),
5196 method: "notifications/message".to_string(),
5197 params,
5198 }
5199 }
5200 pub fn jsonrpc(&self) -> &::std::string::String {
5201 &self.jsonrpc
5202 }
5203 pub fn method(&self) -> &::std::string::String {
5204 &self.method
5205 }
5206 /// returns "notifications/message"
5207 pub fn method_value() -> &'static str {
5208 "notifications/message"
5209 }
5210}
5211///Parameters for a notifications/message notification.
5212///
5213/// <details><summary>JSON schema</summary>
5214///
5215/// ```json
5216///{
5217/// "description": "Parameters for a notifications/message notification.",
5218/// "type": "object",
5219/// "required": [
5220/// "data",
5221/// "level"
5222/// ],
5223/// "properties": {
5224/// "_meta": {
5225/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
5226/// "type": "object",
5227/// "additionalProperties": {}
5228/// },
5229/// "data": {
5230/// "description": "The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here."
5231/// },
5232/// "level": {
5233/// "description": "The severity of this log message.",
5234/// "$ref": "#/$defs/LoggingLevel"
5235/// },
5236/// "logger": {
5237/// "description": "An optional name of the logger issuing this message.",
5238/// "type": "string"
5239/// }
5240/// }
5241///}
5242/// ```
5243/// </details>
5244#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5245pub struct LoggingMessageNotificationParams {
5246 ///The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
5247 pub data: ::serde_json::Value,
5248 ///The severity of this log message.
5249 pub level: LoggingLevel,
5250 ///An optional name of the logger issuing this message.
5251 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5252 pub logger: ::std::option::Option<::std::string::String>,
5253 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
5254 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
5255 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5256}
5257///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
5258///
5259/// <details><summary>JSON schema</summary>
5260///
5261/// ```json
5262///{
5263/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
5264/// "type": "object",
5265/// "properties": {
5266/// "progressToken": {
5267/// "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.",
5268/// "$ref": "#/$defs/ProgressToken"
5269/// }
5270/// },
5271/// "additionalProperties": {}
5272///}
5273/// ```
5274/// </details>
5275#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5276pub struct MessageMeta {
5277 ///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.
5278 #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
5279 pub progress_token: ::std::option::Option<ProgressToken>,
5280 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
5281 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5282}
5283/**Hints to use for model selection.
5284Keys not declared here are currently left unspecified by the spec and are up
5285to the client to interpret.*/
5286///
5287/// <details><summary>JSON schema</summary>
5288///
5289/// ```json
5290///{
5291/// "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.",
5292/// "type": "object",
5293/// "properties": {
5294/// "name": {
5295/// "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",
5296/// "type": "string"
5297/// }
5298/// }
5299///}
5300/// ```
5301/// </details>
5302#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5303pub struct ModelHint {
5304 /**A hint for a model name.
5305 The client SHOULD treat this as a substring of a model name; for example:
5306 - claude-3-5-sonnet should match claude-3-5-sonnet-20241022
5307 - sonnet should match claude-3-5-sonnet-20241022, claude-3-sonnet-20240229, etc.
5308 - claude should match any Claude model
5309 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:
5310 - gemini-1.5-flash could match claude-3-haiku-20240307*/
5311 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5312 pub name: ::std::option::Option<::std::string::String>,
5313}
5314/**The server's preferences for model selection, requested of the client during sampling.
5315Because LLMs can vary along multiple dimensions, choosing the "best" model is
5316rarely straightforward. Different models excel in different areas—some are
5317faster but less capable, others are more capable but more expensive, and so
5318on. This interface allows servers to express their priorities across multiple
5319dimensions to help clients make an appropriate selection for their use case.
5320These preferences are always advisory. The client MAY ignore them. It is also
5321up to the client to decide how to interpret these preferences and how to
5322balance them against other considerations.*/
5323///
5324/// <details><summary>JSON schema</summary>
5325///
5326/// ```json
5327///{
5328/// "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.",
5329/// "type": "object",
5330/// "properties": {
5331/// "costPriority": {
5332/// "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.",
5333/// "type": "number",
5334/// "maximum": 1.0,
5335/// "minimum": 0.0
5336/// },
5337/// "hints": {
5338/// "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.",
5339/// "type": "array",
5340/// "items": {
5341/// "$ref": "#/$defs/ModelHint"
5342/// }
5343/// },
5344/// "intelligencePriority": {
5345/// "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.",
5346/// "type": "number",
5347/// "maximum": 1.0,
5348/// "minimum": 0.0
5349/// },
5350/// "speedPriority": {
5351/// "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.",
5352/// "type": "number",
5353/// "maximum": 1.0,
5354/// "minimum": 0.0
5355/// }
5356/// }
5357///}
5358/// ```
5359/// </details>
5360#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5361pub struct ModelPreferences {
5362 #[serde(rename = "costPriority", default, skip_serializing_if = "::std::option::Option::is_none")]
5363 pub cost_priority: ::std::option::Option<f64>,
5364 /**Optional hints to use for model selection.
5365 If multiple hints are specified, the client MUST evaluate them in order
5366 (such that the first match is taken).
5367 The client SHOULD prioritize these hints over the numeric priorities, but
5368 MAY still use the priorities to select from ambiguous matches.*/
5369 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
5370 pub hints: ::std::vec::Vec<ModelHint>,
5371 #[serde(
5372 rename = "intelligencePriority",
5373 default,
5374 skip_serializing_if = "::std::option::Option::is_none"
5375 )]
5376 pub intelligence_priority: ::std::option::Option<f64>,
5377 #[serde(rename = "speedPriority", default, skip_serializing_if = "::std::option::Option::is_none")]
5378 pub speed_priority: ::std::option::Option<f64>,
5379}
5380///MultiSelectEnumSchema
5381///
5382/// <details><summary>JSON schema</summary>
5383///
5384/// ```json
5385///{
5386/// "anyOf": [
5387/// {
5388/// "$ref": "#/$defs/UntitledMultiSelectEnumSchema"
5389/// },
5390/// {
5391/// "$ref": "#/$defs/TitledMultiSelectEnumSchema"
5392/// }
5393/// ]
5394///}
5395/// ```
5396/// </details>
5397#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5398#[serde(untagged)]
5399pub enum MultiSelectEnumSchema {
5400 UntitledMultiSelectEnumSchema(UntitledMultiSelectEnumSchema),
5401 TitledMultiSelectEnumSchema(TitledMultiSelectEnumSchema),
5402}
5403impl ::std::convert::From<UntitledMultiSelectEnumSchema> for MultiSelectEnumSchema {
5404 fn from(value: UntitledMultiSelectEnumSchema) -> Self {
5405 Self::UntitledMultiSelectEnumSchema(value)
5406 }
5407}
5408impl ::std::convert::From<TitledMultiSelectEnumSchema> for MultiSelectEnumSchema {
5409 fn from(value: TitledMultiSelectEnumSchema) -> Self {
5410 Self::TitledMultiSelectEnumSchema(value)
5411 }
5412}
5413///Notification
5414///
5415/// <details><summary>JSON schema</summary>
5416///
5417/// ```json
5418///{
5419/// "type": "object",
5420/// "required": [
5421/// "method"
5422/// ],
5423/// "properties": {
5424/// "method": {
5425/// "type": "string"
5426/// },
5427/// "params": {
5428/// "type": "object",
5429/// "additionalProperties": {}
5430/// }
5431/// }
5432///}
5433/// ```
5434/// </details>
5435#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5436pub struct Notification {
5437 pub method: ::std::string::String,
5438 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5439 pub params: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5440}
5441///NotificationParams
5442///
5443/// <details><summary>JSON schema</summary>
5444///
5445/// ```json
5446///{
5447/// "type": "object",
5448/// "properties": {
5449/// "_meta": {
5450/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
5451/// "type": "object",
5452/// "additionalProperties": {}
5453/// }
5454/// }
5455///}
5456/// ```
5457/// </details>
5458#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5459pub struct NotificationParams {
5460 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
5461 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
5462 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5463}
5464///NumberSchema
5465///
5466/// <details><summary>JSON schema</summary>
5467///
5468/// ```json
5469///{
5470/// "type": "object",
5471/// "required": [
5472/// "type"
5473/// ],
5474/// "properties": {
5475/// "default": {
5476/// "type": "integer"
5477/// },
5478/// "description": {
5479/// "type": "string"
5480/// },
5481/// "maximum": {
5482/// "type": "integer"
5483/// },
5484/// "minimum": {
5485/// "type": "integer"
5486/// },
5487/// "title": {
5488/// "type": "string"
5489/// },
5490/// "type": {
5491/// "type": "string",
5492/// "enum": [
5493/// "integer",
5494/// "number"
5495/// ]
5496/// }
5497/// }
5498///}
5499/// ```
5500/// </details>
5501#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5502pub struct NumberSchema {
5503 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5504 pub default: ::std::option::Option<f64>,
5505 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5506 pub description: ::std::option::Option<::std::string::String>,
5507 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5508 pub maximum: ::std::option::Option<f64>,
5509 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5510 pub minimum: ::std::option::Option<f64>,
5511 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5512 pub title: ::std::option::Option<::std::string::String>,
5513 #[serde(rename = "type")]
5514 pub type_: NumberSchemaType,
5515}
5516///NumberSchemaType
5517///
5518/// <details><summary>JSON schema</summary>
5519///
5520/// ```json
5521///{
5522/// "type": "string",
5523/// "enum": [
5524/// "integer",
5525/// "number"
5526/// ]
5527///}
5528/// ```
5529/// </details>
5530#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
5531pub enum NumberSchemaType {
5532 #[serde(rename = "integer")]
5533 Integer,
5534 #[serde(rename = "number")]
5535 Number,
5536}
5537impl ::std::fmt::Display for NumberSchemaType {
5538 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5539 match *self {
5540 Self::Integer => write!(f, "integer"),
5541 Self::Number => write!(f, "number"),
5542 }
5543 }
5544}
5545///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
5546///
5547/// <details><summary>JSON schema</summary>
5548///
5549/// ```json
5550///{
5551/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
5552/// "type": "object",
5553/// "properties": {
5554/// "progressToken": {
5555/// "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.",
5556/// "$ref": "#/$defs/ProgressToken"
5557/// }
5558/// },
5559/// "additionalProperties": {}
5560///}
5561/// ```
5562/// </details>
5563#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5564pub struct PaginatedMeta {
5565 ///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.
5566 #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
5567 pub progress_token: ::std::option::Option<ProgressToken>,
5568 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
5569 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5570}
5571///PaginatedRequest
5572///
5573/// <details><summary>JSON schema</summary>
5574///
5575/// ```json
5576///{
5577/// "type": "object",
5578/// "required": [
5579/// "id",
5580/// "jsonrpc",
5581/// "method"
5582/// ],
5583/// "properties": {
5584/// "id": {
5585/// "$ref": "#/$defs/RequestId"
5586/// },
5587/// "jsonrpc": {
5588/// "type": "string",
5589/// "const": "2.0"
5590/// },
5591/// "method": {
5592/// "type": "string"
5593/// },
5594/// "params": {
5595/// "$ref": "#/$defs/PaginatedRequestParams"
5596/// }
5597/// }
5598///}
5599/// ```
5600/// </details>
5601#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5602pub struct PaginatedRequest {
5603 pub id: RequestId,
5604 #[serde(deserialize_with = "validate::paginated_request_jsonrpc")]
5605 jsonrpc: ::std::string::String,
5606 pub method: ::std::string::String,
5607 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5608 pub params: ::std::option::Option<PaginatedRequestParams>,
5609}
5610impl PaginatedRequest {
5611 pub fn new(id: RequestId, method: ::std::string::String, params: ::std::option::Option<PaginatedRequestParams>) -> Self {
5612 Self {
5613 id,
5614 jsonrpc: JSONRPC_VERSION.to_string(),
5615 method,
5616 params,
5617 }
5618 }
5619 pub fn jsonrpc(&self) -> &::std::string::String {
5620 &self.jsonrpc
5621 }
5622}
5623///Common parameters for paginated requests.
5624///
5625/// <details><summary>JSON schema</summary>
5626///
5627/// ```json
5628///{
5629/// "description": "Common parameters for paginated requests.",
5630/// "type": "object",
5631/// "properties": {
5632/// "_meta": {
5633/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
5634/// "type": "object",
5635/// "properties": {
5636/// "progressToken": {
5637/// "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.",
5638/// "$ref": "#/$defs/ProgressToken"
5639/// }
5640/// },
5641/// "additionalProperties": {}
5642/// },
5643/// "cursor": {
5644/// "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.",
5645/// "type": "string"
5646/// }
5647/// }
5648///}
5649/// ```
5650/// </details>
5651#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5652pub struct PaginatedRequestParams {
5653 /**An opaque token representing the current pagination position.
5654 If provided, the server should return results starting after this cursor.*/
5655 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5656 pub cursor: ::std::option::Option<::std::string::String>,
5657 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
5658 pub meta: ::std::option::Option<PaginatedMeta>,
5659}
5660///PaginatedResult
5661///
5662/// <details><summary>JSON schema</summary>
5663///
5664/// ```json
5665///{
5666/// "type": "object",
5667/// "properties": {
5668/// "_meta": {
5669/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
5670/// "type": "object",
5671/// "additionalProperties": {}
5672/// },
5673/// "nextCursor": {
5674/// "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
5675/// "type": "string"
5676/// }
5677/// }
5678///}
5679/// ```
5680/// </details>
5681#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
5682pub struct PaginatedResult {
5683 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
5684 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
5685 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5686 /**An opaque token representing the pagination position after the last returned result.
5687 If present, there may be more results available.*/
5688 #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
5689 pub next_cursor: ::std::option::Option<::std::string::String>,
5690}
5691///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.
5692///
5693/// <details><summary>JSON schema</summary>
5694///
5695/// ```json
5696///{
5697/// "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.",
5698/// "type": "object",
5699/// "required": [
5700/// "id",
5701/// "jsonrpc",
5702/// "method"
5703/// ],
5704/// "properties": {
5705/// "id": {
5706/// "$ref": "#/$defs/RequestId"
5707/// },
5708/// "jsonrpc": {
5709/// "type": "string",
5710/// "const": "2.0"
5711/// },
5712/// "method": {
5713/// "type": "string",
5714/// "const": "ping"
5715/// },
5716/// "params": {
5717/// "$ref": "#/$defs/RequestParams"
5718/// }
5719/// }
5720///}
5721/// ```
5722/// </details>
5723#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5724pub struct PingRequest {
5725 pub id: RequestId,
5726 #[serde(deserialize_with = "validate::ping_request_jsonrpc")]
5727 jsonrpc: ::std::string::String,
5728 #[serde(deserialize_with = "validate::ping_request_method")]
5729 method: ::std::string::String,
5730 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5731 pub params: ::std::option::Option<RequestParams>,
5732}
5733impl PingRequest {
5734 pub fn new(id: RequestId, params: ::std::option::Option<RequestParams>) -> Self {
5735 Self {
5736 id,
5737 jsonrpc: JSONRPC_VERSION.to_string(),
5738 method: "ping".to_string(),
5739 params,
5740 }
5741 }
5742 pub fn jsonrpc(&self) -> &::std::string::String {
5743 &self.jsonrpc
5744 }
5745 pub fn method(&self) -> &::std::string::String {
5746 &self.method
5747 }
5748 /// returns "ping"
5749 pub fn method_value() -> &'static str {
5750 "ping"
5751 }
5752}
5753/**Restricted schema definitions that only allow primitive types
5754without nested objects or arrays.*/
5755///
5756/// <details><summary>JSON schema</summary>
5757///
5758/// ```json
5759///{
5760/// "description": "Restricted schema definitions that only allow primitive types\nwithout nested objects or arrays.",
5761/// "anyOf": [
5762/// {
5763/// "$ref": "#/$defs/StringSchema"
5764/// },
5765/// {
5766/// "$ref": "#/$defs/NumberSchema"
5767/// },
5768/// {
5769/// "$ref": "#/$defs/BooleanSchema"
5770/// },
5771/// {
5772/// "$ref": "#/$defs/UntitledSingleSelectEnumSchema"
5773/// },
5774/// {
5775/// "$ref": "#/$defs/TitledSingleSelectEnumSchema"
5776/// },
5777/// {
5778/// "$ref": "#/$defs/UntitledMultiSelectEnumSchema"
5779/// },
5780/// {
5781/// "$ref": "#/$defs/TitledMultiSelectEnumSchema"
5782/// },
5783/// {
5784/// "$ref": "#/$defs/LegacyTitledEnumSchema"
5785/// }
5786/// ]
5787///}
5788/// ```
5789/// </details>
5790#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5791#[serde(untagged)]
5792pub enum PrimitiveSchemaDefinition {
5793 StringSchema(StringSchema),
5794 NumberSchema(NumberSchema),
5795 BooleanSchema(BooleanSchema),
5796 UntitledSingleSelectEnumSchema(UntitledSingleSelectEnumSchema),
5797 TitledSingleSelectEnumSchema(TitledSingleSelectEnumSchema),
5798 UntitledMultiSelectEnumSchema(UntitledMultiSelectEnumSchema),
5799 TitledMultiSelectEnumSchema(TitledMultiSelectEnumSchema),
5800 LegacyTitledEnumSchema(LegacyTitledEnumSchema),
5801}
5802impl ::std::convert::From<StringSchema> for PrimitiveSchemaDefinition {
5803 fn from(value: StringSchema) -> Self {
5804 Self::StringSchema(value)
5805 }
5806}
5807impl ::std::convert::From<NumberSchema> for PrimitiveSchemaDefinition {
5808 fn from(value: NumberSchema) -> Self {
5809 Self::NumberSchema(value)
5810 }
5811}
5812impl ::std::convert::From<BooleanSchema> for PrimitiveSchemaDefinition {
5813 fn from(value: BooleanSchema) -> Self {
5814 Self::BooleanSchema(value)
5815 }
5816}
5817impl ::std::convert::From<UntitledSingleSelectEnumSchema> for PrimitiveSchemaDefinition {
5818 fn from(value: UntitledSingleSelectEnumSchema) -> Self {
5819 Self::UntitledSingleSelectEnumSchema(value)
5820 }
5821}
5822impl ::std::convert::From<TitledSingleSelectEnumSchema> for PrimitiveSchemaDefinition {
5823 fn from(value: TitledSingleSelectEnumSchema) -> Self {
5824 Self::TitledSingleSelectEnumSchema(value)
5825 }
5826}
5827impl ::std::convert::From<UntitledMultiSelectEnumSchema> for PrimitiveSchemaDefinition {
5828 fn from(value: UntitledMultiSelectEnumSchema) -> Self {
5829 Self::UntitledMultiSelectEnumSchema(value)
5830 }
5831}
5832impl ::std::convert::From<TitledMultiSelectEnumSchema> for PrimitiveSchemaDefinition {
5833 fn from(value: TitledMultiSelectEnumSchema) -> Self {
5834 Self::TitledMultiSelectEnumSchema(value)
5835 }
5836}
5837impl ::std::convert::From<LegacyTitledEnumSchema> for PrimitiveSchemaDefinition {
5838 fn from(value: LegacyTitledEnumSchema) -> Self {
5839 Self::LegacyTitledEnumSchema(value)
5840 }
5841}
5842///An out-of-band notification used to inform the receiver of a progress update for a long-running request.
5843///
5844/// <details><summary>JSON schema</summary>
5845///
5846/// ```json
5847///{
5848/// "description": "An out-of-band notification used to inform the receiver of a progress update for a long-running request.",
5849/// "type": "object",
5850/// "required": [
5851/// "jsonrpc",
5852/// "method",
5853/// "params"
5854/// ],
5855/// "properties": {
5856/// "jsonrpc": {
5857/// "type": "string",
5858/// "const": "2.0"
5859/// },
5860/// "method": {
5861/// "type": "string",
5862/// "const": "notifications/progress"
5863/// },
5864/// "params": {
5865/// "$ref": "#/$defs/ProgressNotificationParams"
5866/// }
5867/// }
5868///}
5869/// ```
5870/// </details>
5871#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5872pub struct ProgressNotification {
5873 #[serde(deserialize_with = "validate::progress_notification_jsonrpc")]
5874 jsonrpc: ::std::string::String,
5875 #[serde(deserialize_with = "validate::progress_notification_method")]
5876 method: ::std::string::String,
5877 pub params: ProgressNotificationParams,
5878}
5879impl ProgressNotification {
5880 pub fn new(params: ProgressNotificationParams) -> Self {
5881 Self {
5882 jsonrpc: JSONRPC_VERSION.to_string(),
5883 method: "notifications/progress".to_string(),
5884 params,
5885 }
5886 }
5887 pub fn jsonrpc(&self) -> &::std::string::String {
5888 &self.jsonrpc
5889 }
5890 pub fn method(&self) -> &::std::string::String {
5891 &self.method
5892 }
5893 /// returns "notifications/progress"
5894 pub fn method_value() -> &'static str {
5895 "notifications/progress"
5896 }
5897}
5898///Parameters for a notifications/progress notification.
5899///
5900/// <details><summary>JSON schema</summary>
5901///
5902/// ```json
5903///{
5904/// "description": "Parameters for a notifications/progress notification.",
5905/// "type": "object",
5906/// "required": [
5907/// "progress",
5908/// "progressToken"
5909/// ],
5910/// "properties": {
5911/// "_meta": {
5912/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
5913/// "type": "object",
5914/// "additionalProperties": {}
5915/// },
5916/// "message": {
5917/// "description": "An optional message describing the current progress.",
5918/// "type": "string"
5919/// },
5920/// "progress": {
5921/// "description": "The progress thus far. This should increase every time progress is made, even if the total is unknown.",
5922/// "type": "number"
5923/// },
5924/// "progressToken": {
5925/// "description": "The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.",
5926/// "$ref": "#/$defs/ProgressToken"
5927/// },
5928/// "total": {
5929/// "description": "Total number of items to process (or total progress required), if known.",
5930/// "type": "number"
5931/// }
5932/// }
5933///}
5934/// ```
5935/// </details>
5936#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5937pub struct ProgressNotificationParams {
5938 ///An optional message describing the current progress.
5939 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5940 pub message: ::std::option::Option<::std::string::String>,
5941 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
5942 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
5943 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5944 pub progress: f64,
5945 ///The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
5946 #[serde(rename = "progressToken")]
5947 pub progress_token: ProgressToken,
5948 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5949 pub total: ::std::option::Option<f64>,
5950}
5951///A progress token, used to associate progress notifications with the original request.
5952///
5953/// <details><summary>JSON schema</summary>
5954///
5955/// ```json
5956///{
5957/// "description": "A progress token, used to associate progress notifications with the original request.",
5958/// "type": [
5959/// "string",
5960/// "integer"
5961/// ]
5962///}
5963/// ```
5964/// </details>
5965#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5966#[serde(untagged)]
5967pub enum ProgressToken {
5968 String(::std::string::String),
5969 Integer(i64),
5970}
5971impl ::std::convert::From<i64> for ProgressToken {
5972 fn from(value: i64) -> Self {
5973 Self::Integer(value)
5974 }
5975}
5976///A prompt or prompt template that the server offers.
5977///
5978/// <details><summary>JSON schema</summary>
5979///
5980/// ```json
5981///{
5982/// "description": "A prompt or prompt template that the server offers.",
5983/// "type": "object",
5984/// "required": [
5985/// "name"
5986/// ],
5987/// "properties": {
5988/// "_meta": {
5989/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
5990/// "type": "object",
5991/// "additionalProperties": {}
5992/// },
5993/// "arguments": {
5994/// "description": "A list of arguments to use for templating the prompt.",
5995/// "type": "array",
5996/// "items": {
5997/// "$ref": "#/$defs/PromptArgument"
5998/// }
5999/// },
6000/// "description": {
6001/// "description": "An optional description of what this prompt provides",
6002/// "type": "string"
6003/// },
6004/// "icons": {
6005/// "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
6006/// "type": "array",
6007/// "items": {
6008/// "$ref": "#/$defs/Icon"
6009/// }
6010/// },
6011/// "name": {
6012/// "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
6013/// "type": "string"
6014/// },
6015/// "title": {
6016/// "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
6017/// "type": "string"
6018/// }
6019/// }
6020///}
6021/// ```
6022/// </details>
6023#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6024pub struct Prompt {
6025 ///A list of arguments to use for templating the prompt.
6026 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
6027 pub arguments: ::std::vec::Vec<PromptArgument>,
6028 ///An optional description of what this prompt provides
6029 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6030 pub description: ::std::option::Option<::std::string::String>,
6031 /**Optional set of sized icons that the client can display in a user interface.
6032 Clients that support rendering icons MUST support at least the following MIME types:
6033 - image/png - PNG images (safe, universal compatibility)
6034 - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
6035 Clients that support rendering icons SHOULD also support:
6036 - image/svg+xml - SVG images (scalable but requires security precautions)
6037 - image/webp - WebP images (modern, efficient format)*/
6038 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
6039 pub icons: ::std::vec::Vec<Icon>,
6040 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
6041 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6042 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6043 ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
6044 pub name: ::std::string::String,
6045 /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
6046 even by those unfamiliar with domain-specific terminology.
6047 If not provided, the name should be used for display (except for Tool,
6048 where annotations.title should be given precedence over using name,
6049 if present).*/
6050 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6051 pub title: ::std::option::Option<::std::string::String>,
6052}
6053///Describes an argument that a prompt can accept.
6054///
6055/// <details><summary>JSON schema</summary>
6056///
6057/// ```json
6058///{
6059/// "description": "Describes an argument that a prompt can accept.",
6060/// "type": "object",
6061/// "required": [
6062/// "name"
6063/// ],
6064/// "properties": {
6065/// "description": {
6066/// "description": "A human-readable description of the argument.",
6067/// "type": "string"
6068/// },
6069/// "name": {
6070/// "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
6071/// "type": "string"
6072/// },
6073/// "required": {
6074/// "description": "Whether this argument must be provided.",
6075/// "type": "boolean"
6076/// },
6077/// "title": {
6078/// "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
6079/// "type": "string"
6080/// }
6081/// }
6082///}
6083/// ```
6084/// </details>
6085#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6086pub struct PromptArgument {
6087 ///A human-readable description of the argument.
6088 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6089 pub description: ::std::option::Option<::std::string::String>,
6090 ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
6091 pub name: ::std::string::String,
6092 ///Whether this argument must be provided.
6093 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6094 pub required: ::std::option::Option<bool>,
6095 /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
6096 even by those unfamiliar with domain-specific terminology.
6097 If not provided, the name should be used for display (except for Tool,
6098 where annotations.title should be given precedence over using name,
6099 if present).*/
6100 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6101 pub title: ::std::option::Option<::std::string::String>,
6102}
6103///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.
6104///
6105/// <details><summary>JSON schema</summary>
6106///
6107/// ```json
6108///{
6109/// "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.",
6110/// "type": "object",
6111/// "required": [
6112/// "jsonrpc",
6113/// "method"
6114/// ],
6115/// "properties": {
6116/// "jsonrpc": {
6117/// "type": "string",
6118/// "const": "2.0"
6119/// },
6120/// "method": {
6121/// "type": "string",
6122/// "const": "notifications/prompts/list_changed"
6123/// },
6124/// "params": {
6125/// "$ref": "#/$defs/NotificationParams"
6126/// }
6127/// }
6128///}
6129/// ```
6130/// </details>
6131#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6132pub struct PromptListChangedNotification {
6133 #[serde(deserialize_with = "validate::prompt_list_changed_notification_jsonrpc")]
6134 jsonrpc: ::std::string::String,
6135 #[serde(deserialize_with = "validate::prompt_list_changed_notification_method")]
6136 method: ::std::string::String,
6137 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6138 pub params: ::std::option::Option<NotificationParams>,
6139}
6140impl PromptListChangedNotification {
6141 pub fn new(params: ::std::option::Option<NotificationParams>) -> Self {
6142 Self {
6143 jsonrpc: JSONRPC_VERSION.to_string(),
6144 method: "notifications/prompts/list_changed".to_string(),
6145 params,
6146 }
6147 }
6148 pub fn jsonrpc(&self) -> &::std::string::String {
6149 &self.jsonrpc
6150 }
6151 pub fn method(&self) -> &::std::string::String {
6152 &self.method
6153 }
6154 /// returns "notifications/prompts/list_changed"
6155 pub fn method_value() -> &'static str {
6156 "notifications/prompts/list_changed"
6157 }
6158}
6159/**Describes a message returned as part of a prompt.
6160This is similar to SamplingMessage, but also supports the embedding of
6161resources from the MCP server.*/
6162///
6163/// <details><summary>JSON schema</summary>
6164///
6165/// ```json
6166///{
6167/// "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.",
6168/// "type": "object",
6169/// "required": [
6170/// "content",
6171/// "role"
6172/// ],
6173/// "properties": {
6174/// "content": {
6175/// "$ref": "#/$defs/ContentBlock"
6176/// },
6177/// "role": {
6178/// "$ref": "#/$defs/Role"
6179/// }
6180/// }
6181///}
6182/// ```
6183/// </details>
6184#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6185pub struct PromptMessage {
6186 pub content: ContentBlock,
6187 pub role: Role,
6188}
6189///Identifies a prompt.
6190///
6191/// <details><summary>JSON schema</summary>
6192///
6193/// ```json
6194///{
6195/// "description": "Identifies a prompt.",
6196/// "type": "object",
6197/// "required": [
6198/// "name",
6199/// "type"
6200/// ],
6201/// "properties": {
6202/// "name": {
6203/// "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
6204/// "type": "string"
6205/// },
6206/// "title": {
6207/// "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
6208/// "type": "string"
6209/// },
6210/// "type": {
6211/// "type": "string",
6212/// "const": "ref/prompt"
6213/// }
6214/// }
6215///}
6216/// ```
6217/// </details>
6218#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6219pub struct PromptReference {
6220 ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
6221 pub name: ::std::string::String,
6222 /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
6223 even by those unfamiliar with domain-specific terminology.
6224 If not provided, the name should be used for display (except for Tool,
6225 where annotations.title should be given precedence over using name,
6226 if present).*/
6227 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6228 pub title: ::std::option::Option<::std::string::String>,
6229 #[serde(rename = "type", deserialize_with = "validate::prompt_reference_type_")]
6230 type_: ::std::string::String,
6231}
6232impl PromptReference {
6233 pub fn new(name: ::std::string::String, title: ::std::option::Option<::std::string::String>) -> Self {
6234 Self {
6235 name,
6236 title,
6237 type_: "ref/prompt".to_string(),
6238 }
6239 }
6240 pub fn type_(&self) -> &::std::string::String {
6241 &self.type_
6242 }
6243 /// returns "ref/prompt"
6244 pub fn type_value() -> &'static str {
6245 "ref/prompt"
6246 }
6247}
6248///ReadResourceContent
6249///
6250/// <details><summary>JSON schema</summary>
6251///
6252/// ```json
6253///{
6254/// "anyOf": [
6255/// {
6256/// "$ref": "#/$defs/TextResourceContents"
6257/// },
6258/// {
6259/// "$ref": "#/$defs/BlobResourceContents"
6260/// }
6261/// ]
6262///}
6263/// ```
6264/// </details>
6265#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6266#[serde(untagged)]
6267pub enum ReadResourceContent {
6268 TextResourceContents(TextResourceContents),
6269 BlobResourceContents(BlobResourceContents),
6270}
6271impl ::std::convert::From<TextResourceContents> for ReadResourceContent {
6272 fn from(value: TextResourceContents) -> Self {
6273 Self::TextResourceContents(value)
6274 }
6275}
6276impl ::std::convert::From<BlobResourceContents> for ReadResourceContent {
6277 fn from(value: BlobResourceContents) -> Self {
6278 Self::BlobResourceContents(value)
6279 }
6280}
6281///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
6282///
6283/// <details><summary>JSON schema</summary>
6284///
6285/// ```json
6286///{
6287/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6288/// "type": "object",
6289/// "properties": {
6290/// "progressToken": {
6291/// "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.",
6292/// "$ref": "#/$defs/ProgressToken"
6293/// }
6294/// },
6295/// "additionalProperties": {}
6296///}
6297/// ```
6298/// </details>
6299#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
6300pub struct ReadResourceMeta {
6301 ///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.
6302 #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
6303 pub progress_token: ::std::option::Option<ProgressToken>,
6304 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
6305 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6306}
6307///Sent from the client to the server, to read a specific resource URI.
6308///
6309/// <details><summary>JSON schema</summary>
6310///
6311/// ```json
6312///{
6313/// "description": "Sent from the client to the server, to read a specific resource URI.",
6314/// "type": "object",
6315/// "required": [
6316/// "id",
6317/// "jsonrpc",
6318/// "method",
6319/// "params"
6320/// ],
6321/// "properties": {
6322/// "id": {
6323/// "$ref": "#/$defs/RequestId"
6324/// },
6325/// "jsonrpc": {
6326/// "type": "string",
6327/// "const": "2.0"
6328/// },
6329/// "method": {
6330/// "type": "string",
6331/// "const": "resources/read"
6332/// },
6333/// "params": {
6334/// "$ref": "#/$defs/ReadResourceRequestParams"
6335/// }
6336/// }
6337///}
6338/// ```
6339/// </details>
6340#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6341pub struct ReadResourceRequest {
6342 pub id: RequestId,
6343 #[serde(deserialize_with = "validate::read_resource_request_jsonrpc")]
6344 jsonrpc: ::std::string::String,
6345 #[serde(deserialize_with = "validate::read_resource_request_method")]
6346 method: ::std::string::String,
6347 pub params: ReadResourceRequestParams,
6348}
6349impl ReadResourceRequest {
6350 pub fn new(id: RequestId, params: ReadResourceRequestParams) -> Self {
6351 Self {
6352 id,
6353 jsonrpc: JSONRPC_VERSION.to_string(),
6354 method: "resources/read".to_string(),
6355 params,
6356 }
6357 }
6358 pub fn jsonrpc(&self) -> &::std::string::String {
6359 &self.jsonrpc
6360 }
6361 pub fn method(&self) -> &::std::string::String {
6362 &self.method
6363 }
6364 /// returns "resources/read"
6365 pub fn method_value() -> &'static str {
6366 "resources/read"
6367 }
6368}
6369///Parameters for a resources/read request.
6370///
6371/// <details><summary>JSON schema</summary>
6372///
6373/// ```json
6374///{
6375/// "description": "Parameters for a resources/read request.",
6376/// "type": "object",
6377/// "required": [
6378/// "uri"
6379/// ],
6380/// "properties": {
6381/// "_meta": {
6382/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6383/// "type": "object",
6384/// "properties": {
6385/// "progressToken": {
6386/// "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.",
6387/// "$ref": "#/$defs/ProgressToken"
6388/// }
6389/// },
6390/// "additionalProperties": {}
6391/// },
6392/// "uri": {
6393/// "description": "The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.",
6394/// "type": "string",
6395/// "format": "uri"
6396/// }
6397/// }
6398///}
6399/// ```
6400/// </details>
6401#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6402pub struct ReadResourceRequestParams {
6403 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6404 pub meta: ::std::option::Option<ReadResourceMeta>,
6405 ///The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.
6406 pub uri: ::std::string::String,
6407}
6408///The server's response to a resources/read request from the client.
6409///
6410/// <details><summary>JSON schema</summary>
6411///
6412/// ```json
6413///{
6414/// "description": "The server's response to a resources/read request from the client.",
6415/// "type": "object",
6416/// "required": [
6417/// "contents"
6418/// ],
6419/// "properties": {
6420/// "_meta": {
6421/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6422/// "type": "object",
6423/// "additionalProperties": {}
6424/// },
6425/// "contents": {
6426/// "type": "array",
6427/// "items": {
6428/// "anyOf": [
6429/// {
6430/// "$ref": "#/$defs/TextResourceContents"
6431/// },
6432/// {
6433/// "$ref": "#/$defs/BlobResourceContents"
6434/// }
6435/// ]
6436/// }
6437/// }
6438/// }
6439///}
6440/// ```
6441/// </details>
6442#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6443pub struct ReadResourceResult {
6444 pub contents: ::std::vec::Vec<ReadResourceContent>,
6445 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
6446 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6447 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6448}
6449/**Metadata for associating messages with a task.
6450Include this in the _meta field under the key io.modelcontextprotocol/related-task.*/
6451///
6452/// <details><summary>JSON schema</summary>
6453///
6454/// ```json
6455///{
6456/// "description": "Metadata for associating messages with a task.\nInclude this in the _meta field under the key io.modelcontextprotocol/related-task.",
6457/// "type": "object",
6458/// "required": [
6459/// "taskId"
6460/// ],
6461/// "properties": {
6462/// "taskId": {
6463/// "description": "The task identifier this message is associated with.",
6464/// "type": "string"
6465/// }
6466/// }
6467///}
6468/// ```
6469/// </details>
6470#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6471pub struct RelatedTaskMetadata {
6472 ///The task identifier this message is associated with.
6473 #[serde(rename = "taskId")]
6474 pub task_id: ::std::string::String,
6475}
6476///Request
6477///
6478/// <details><summary>JSON schema</summary>
6479///
6480/// ```json
6481///{
6482/// "type": "object",
6483/// "required": [
6484/// "method"
6485/// ],
6486/// "properties": {
6487/// "method": {
6488/// "type": "string"
6489/// },
6490/// "params": {
6491/// "type": "object",
6492/// "additionalProperties": {}
6493/// }
6494/// }
6495///}
6496/// ```
6497/// </details>
6498#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6499pub struct Request {
6500 pub method: ::std::string::String,
6501 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6502 pub params: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6503}
6504///A uniquely identifying ID for a request in JSON-RPC.
6505///
6506/// <details><summary>JSON schema</summary>
6507///
6508/// ```json
6509///{
6510/// "description": "A uniquely identifying ID for a request in JSON-RPC.",
6511/// "type": [
6512/// "string",
6513/// "integer"
6514/// ]
6515///}
6516/// ```
6517/// </details>
6518#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6519#[serde(untagged)]
6520pub enum RequestId {
6521 String(::std::string::String),
6522 Integer(i64),
6523}
6524impl ::std::convert::From<i64> for RequestId {
6525 fn from(value: i64) -> Self {
6526 Self::Integer(value)
6527 }
6528}
6529///Common params for any request.
6530///
6531/// <details><summary>JSON schema</summary>
6532///
6533/// ```json
6534///{
6535/// "description": "Common params for any request.",
6536/// "type": "object",
6537/// "properties": {
6538/// "_meta": {
6539/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6540/// "type": "object",
6541/// "properties": {
6542/// "progressToken": {
6543/// "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.",
6544/// "$ref": "#/$defs/ProgressToken"
6545/// }
6546/// },
6547/// "additionalProperties": {}
6548/// }
6549/// }
6550///}
6551/// ```
6552/// </details>
6553#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
6554pub struct RequestParams {
6555 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6556 pub meta: ::std::option::Option<RequestParamsMeta>,
6557}
6558///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
6559///
6560/// <details><summary>JSON schema</summary>
6561///
6562/// ```json
6563///{
6564/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6565/// "type": "object",
6566/// "properties": {
6567/// "progressToken": {
6568/// "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.",
6569/// "$ref": "#/$defs/ProgressToken"
6570/// }
6571/// },
6572/// "additionalProperties": {}
6573///}
6574/// ```
6575/// </details>
6576#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
6577pub struct RequestParamsMeta {
6578 ///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.
6579 #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
6580 pub progress_token: ::std::option::Option<ProgressToken>,
6581 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
6582 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6583}
6584///A known resource that the server is capable of reading.
6585///
6586/// <details><summary>JSON schema</summary>
6587///
6588/// ```json
6589///{
6590/// "description": "A known resource that the server is capable of reading.",
6591/// "type": "object",
6592/// "required": [
6593/// "name",
6594/// "uri"
6595/// ],
6596/// "properties": {
6597/// "_meta": {
6598/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6599/// "type": "object",
6600/// "additionalProperties": {}
6601/// },
6602/// "annotations": {
6603/// "description": "Optional annotations for the client.",
6604/// "$ref": "#/$defs/Annotations"
6605/// },
6606/// "description": {
6607/// "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.",
6608/// "type": "string"
6609/// },
6610/// "icons": {
6611/// "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
6612/// "type": "array",
6613/// "items": {
6614/// "$ref": "#/$defs/Icon"
6615/// }
6616/// },
6617/// "mimeType": {
6618/// "description": "The MIME type of this resource, if known.",
6619/// "type": "string"
6620/// },
6621/// "name": {
6622/// "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
6623/// "type": "string"
6624/// },
6625/// "size": {
6626/// "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.",
6627/// "type": "integer"
6628/// },
6629/// "title": {
6630/// "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
6631/// "type": "string"
6632/// },
6633/// "uri": {
6634/// "description": "The URI of this resource.",
6635/// "type": "string",
6636/// "format": "uri"
6637/// }
6638/// }
6639///}
6640/// ```
6641/// </details>
6642#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6643pub struct Resource {
6644 ///Optional annotations for the client.
6645 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6646 pub annotations: ::std::option::Option<Annotations>,
6647 /**A description of what this resource represents.
6648 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.*/
6649 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6650 pub description: ::std::option::Option<::std::string::String>,
6651 /**Optional set of sized icons that the client can display in a user interface.
6652 Clients that support rendering icons MUST support at least the following MIME types:
6653 - image/png - PNG images (safe, universal compatibility)
6654 - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
6655 Clients that support rendering icons SHOULD also support:
6656 - image/svg+xml - SVG images (scalable but requires security precautions)
6657 - image/webp - WebP images (modern, efficient format)*/
6658 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
6659 pub icons: ::std::vec::Vec<Icon>,
6660 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
6661 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6662 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6663 ///The MIME type of this resource, if known.
6664 #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
6665 pub mime_type: ::std::option::Option<::std::string::String>,
6666 ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
6667 pub name: ::std::string::String,
6668 /**The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
6669 This can be used by Hosts to display file sizes and estimate context window usage.*/
6670 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6671 pub size: ::std::option::Option<i64>,
6672 /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
6673 even by those unfamiliar with domain-specific terminology.
6674 If not provided, the name should be used for display (except for Tool,
6675 where annotations.title should be given precedence over using name,
6676 if present).*/
6677 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6678 pub title: ::std::option::Option<::std::string::String>,
6679 ///The URI of this resource.
6680 pub uri: ::std::string::String,
6681}
6682///The contents of a specific resource or sub-resource.
6683///
6684/// <details><summary>JSON schema</summary>
6685///
6686/// ```json
6687///{
6688/// "description": "The contents of a specific resource or sub-resource.",
6689/// "type": "object",
6690/// "required": [
6691/// "uri"
6692/// ],
6693/// "properties": {
6694/// "_meta": {
6695/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6696/// "type": "object",
6697/// "additionalProperties": {}
6698/// },
6699/// "mimeType": {
6700/// "description": "The MIME type of this resource, if known.",
6701/// "type": "string"
6702/// },
6703/// "uri": {
6704/// "description": "The URI of this resource.",
6705/// "type": "string",
6706/// "format": "uri"
6707/// }
6708/// }
6709///}
6710/// ```
6711/// </details>
6712#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6713pub struct ResourceContents {
6714 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
6715 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6716 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6717 ///The MIME type of this resource, if known.
6718 #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
6719 pub mime_type: ::std::option::Option<::std::string::String>,
6720 ///The URI of this resource.
6721 pub uri: ::std::string::String,
6722}
6723/**A resource that the server is capable of reading, included in a prompt or tool call result.
6724Note: resource links returned by tools are not guaranteed to appear in the results of resources/list requests.*/
6725///
6726/// <details><summary>JSON schema</summary>
6727///
6728/// ```json
6729///{
6730/// "description": "A resource that the server is capable of reading, included in a prompt or tool call result.\n\nNote: resource links returned by tools are not guaranteed to appear in the results of resources/list requests.",
6731/// "type": "object",
6732/// "required": [
6733/// "name",
6734/// "type",
6735/// "uri"
6736/// ],
6737/// "properties": {
6738/// "_meta": {
6739/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6740/// "type": "object",
6741/// "additionalProperties": {}
6742/// },
6743/// "annotations": {
6744/// "description": "Optional annotations for the client.",
6745/// "$ref": "#/$defs/Annotations"
6746/// },
6747/// "description": {
6748/// "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.",
6749/// "type": "string"
6750/// },
6751/// "icons": {
6752/// "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
6753/// "type": "array",
6754/// "items": {
6755/// "$ref": "#/$defs/Icon"
6756/// }
6757/// },
6758/// "mimeType": {
6759/// "description": "The MIME type of this resource, if known.",
6760/// "type": "string"
6761/// },
6762/// "name": {
6763/// "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
6764/// "type": "string"
6765/// },
6766/// "size": {
6767/// "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.",
6768/// "type": "integer"
6769/// },
6770/// "title": {
6771/// "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
6772/// "type": "string"
6773/// },
6774/// "type": {
6775/// "type": "string",
6776/// "const": "resource_link"
6777/// },
6778/// "uri": {
6779/// "description": "The URI of this resource.",
6780/// "type": "string",
6781/// "format": "uri"
6782/// }
6783/// }
6784///}
6785/// ```
6786/// </details>
6787#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6788pub struct ResourceLink {
6789 ///Optional annotations for the client.
6790 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6791 pub annotations: ::std::option::Option<Annotations>,
6792 /**A description of what this resource represents.
6793 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.*/
6794 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6795 pub description: ::std::option::Option<::std::string::String>,
6796 /**Optional set of sized icons that the client can display in a user interface.
6797 Clients that support rendering icons MUST support at least the following MIME types:
6798 - image/png - PNG images (safe, universal compatibility)
6799 - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
6800 Clients that support rendering icons SHOULD also support:
6801 - image/svg+xml - SVG images (scalable but requires security precautions)
6802 - image/webp - WebP images (modern, efficient format)*/
6803 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
6804 pub icons: ::std::vec::Vec<Icon>,
6805 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
6806 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6807 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6808 ///The MIME type of this resource, if known.
6809 #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
6810 pub mime_type: ::std::option::Option<::std::string::String>,
6811 ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
6812 pub name: ::std::string::String,
6813 /**The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
6814 This can be used by Hosts to display file sizes and estimate context window usage.*/
6815 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6816 pub size: ::std::option::Option<i64>,
6817 /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
6818 even by those unfamiliar with domain-specific terminology.
6819 If not provided, the name should be used for display (except for Tool,
6820 where annotations.title should be given precedence over using name,
6821 if present).*/
6822 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6823 pub title: ::std::option::Option<::std::string::String>,
6824 #[serde(rename = "type", deserialize_with = "validate::resource_link_type_")]
6825 type_: ::std::string::String,
6826 ///The URI of this resource.
6827 pub uri: ::std::string::String,
6828}
6829impl ResourceLink {
6830 #[allow(clippy::too_many_arguments)]
6831 pub fn new(
6832 icons: ::std::vec::Vec<Icon>,
6833 name: ::std::string::String,
6834 uri: ::std::string::String,
6835 annotations: ::std::option::Option<Annotations>,
6836 description: ::std::option::Option<::std::string::String>,
6837 meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6838 mime_type: ::std::option::Option<::std::string::String>,
6839 size: ::std::option::Option<i64>,
6840 title: ::std::option::Option<::std::string::String>,
6841 ) -> Self {
6842 Self {
6843 annotations,
6844 description,
6845 icons,
6846 meta,
6847 mime_type,
6848 name,
6849 size,
6850 title,
6851 type_: "resource_link".to_string(),
6852 uri,
6853 }
6854 }
6855 pub fn type_(&self) -> &::std::string::String {
6856 &self.type_
6857 }
6858 /// returns "resource_link"
6859 pub fn type_value() -> &'static str {
6860 "resource_link"
6861 }
6862}
6863///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.
6864///
6865/// <details><summary>JSON schema</summary>
6866///
6867/// ```json
6868///{
6869/// "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.",
6870/// "type": "object",
6871/// "required": [
6872/// "jsonrpc",
6873/// "method"
6874/// ],
6875/// "properties": {
6876/// "jsonrpc": {
6877/// "type": "string",
6878/// "const": "2.0"
6879/// },
6880/// "method": {
6881/// "type": "string",
6882/// "const": "notifications/resources/list_changed"
6883/// },
6884/// "params": {
6885/// "$ref": "#/$defs/NotificationParams"
6886/// }
6887/// }
6888///}
6889/// ```
6890/// </details>
6891#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6892pub struct ResourceListChangedNotification {
6893 #[serde(deserialize_with = "validate::resource_list_changed_notification_jsonrpc")]
6894 jsonrpc: ::std::string::String,
6895 #[serde(deserialize_with = "validate::resource_list_changed_notification_method")]
6896 method: ::std::string::String,
6897 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6898 pub params: ::std::option::Option<NotificationParams>,
6899}
6900impl ResourceListChangedNotification {
6901 pub fn new(params: ::std::option::Option<NotificationParams>) -> Self {
6902 Self {
6903 jsonrpc: JSONRPC_VERSION.to_string(),
6904 method: "notifications/resources/list_changed".to_string(),
6905 params,
6906 }
6907 }
6908 pub fn jsonrpc(&self) -> &::std::string::String {
6909 &self.jsonrpc
6910 }
6911 pub fn method(&self) -> &::std::string::String {
6912 &self.method
6913 }
6914 /// returns "notifications/resources/list_changed"
6915 pub fn method_value() -> &'static str {
6916 "notifications/resources/list_changed"
6917 }
6918}
6919///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
6920///
6921/// <details><summary>JSON schema</summary>
6922///
6923/// ```json
6924///{
6925/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6926/// "type": "object",
6927/// "properties": {
6928/// "progressToken": {
6929/// "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.",
6930/// "$ref": "#/$defs/ProgressToken"
6931/// }
6932/// },
6933/// "additionalProperties": {}
6934///}
6935/// ```
6936/// </details>
6937#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
6938pub struct ResourceMeta {
6939 ///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.
6940 #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
6941 pub progress_token: ::std::option::Option<ProgressToken>,
6942 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
6943 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
6944}
6945///Common parameters when working with resources.
6946///
6947/// <details><summary>JSON schema</summary>
6948///
6949/// ```json
6950///{
6951/// "description": "Common parameters when working with resources.",
6952/// "type": "object",
6953/// "required": [
6954/// "uri"
6955/// ],
6956/// "properties": {
6957/// "_meta": {
6958/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6959/// "type": "object",
6960/// "properties": {
6961/// "progressToken": {
6962/// "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.",
6963/// "$ref": "#/$defs/ProgressToken"
6964/// }
6965/// },
6966/// "additionalProperties": {}
6967/// },
6968/// "uri": {
6969/// "description": "The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.",
6970/// "type": "string",
6971/// "format": "uri"
6972/// }
6973/// }
6974///}
6975/// ```
6976/// </details>
6977#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6978pub struct ResourceRequestParams {
6979 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
6980 pub meta: ::std::option::Option<ResourceMeta>,
6981 ///The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.
6982 pub uri: ::std::string::String,
6983}
6984///A template description for resources available on the server.
6985///
6986/// <details><summary>JSON schema</summary>
6987///
6988/// ```json
6989///{
6990/// "description": "A template description for resources available on the server.",
6991/// "type": "object",
6992/// "required": [
6993/// "name",
6994/// "uriTemplate"
6995/// ],
6996/// "properties": {
6997/// "_meta": {
6998/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
6999/// "type": "object",
7000/// "additionalProperties": {}
7001/// },
7002/// "annotations": {
7003/// "description": "Optional annotations for the client.",
7004/// "$ref": "#/$defs/Annotations"
7005/// },
7006/// "description": {
7007/// "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.",
7008/// "type": "string"
7009/// },
7010/// "icons": {
7011/// "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
7012/// "type": "array",
7013/// "items": {
7014/// "$ref": "#/$defs/Icon"
7015/// }
7016/// },
7017/// "mimeType": {
7018/// "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.",
7019/// "type": "string"
7020/// },
7021/// "name": {
7022/// "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
7023/// "type": "string"
7024/// },
7025/// "title": {
7026/// "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
7027/// "type": "string"
7028/// },
7029/// "uriTemplate": {
7030/// "description": "A URI template (according to RFC 6570) that can be used to construct resource URIs.",
7031/// "type": "string",
7032/// "format": "uri-template"
7033/// }
7034/// }
7035///}
7036/// ```
7037/// </details>
7038#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7039pub struct ResourceTemplate {
7040 ///Optional annotations for the client.
7041 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7042 pub annotations: ::std::option::Option<Annotations>,
7043 /**A description of what this template is for.
7044 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.*/
7045 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7046 pub description: ::std::option::Option<::std::string::String>,
7047 /**Optional set of sized icons that the client can display in a user interface.
7048 Clients that support rendering icons MUST support at least the following MIME types:
7049 - image/png - PNG images (safe, universal compatibility)
7050 - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
7051 Clients that support rendering icons SHOULD also support:
7052 - image/svg+xml - SVG images (scalable but requires security precautions)
7053 - image/webp - WebP images (modern, efficient format)*/
7054 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
7055 pub icons: ::std::vec::Vec<Icon>,
7056 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
7057 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
7058 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7059 ///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.
7060 #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
7061 pub mime_type: ::std::option::Option<::std::string::String>,
7062 ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
7063 pub name: ::std::string::String,
7064 /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
7065 even by those unfamiliar with domain-specific terminology.
7066 If not provided, the name should be used for display (except for Tool,
7067 where annotations.title should be given precedence over using name,
7068 if present).*/
7069 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7070 pub title: ::std::option::Option<::std::string::String>,
7071 ///A URI template (according to RFC 6570) that can be used to construct resource URIs.
7072 #[serde(rename = "uriTemplate")]
7073 pub uri_template: ::std::string::String,
7074}
7075///A reference to a resource or resource template definition.
7076///
7077/// <details><summary>JSON schema</summary>
7078///
7079/// ```json
7080///{
7081/// "description": "A reference to a resource or resource template definition.",
7082/// "type": "object",
7083/// "required": [
7084/// "type",
7085/// "uri"
7086/// ],
7087/// "properties": {
7088/// "type": {
7089/// "type": "string",
7090/// "const": "ref/resource"
7091/// },
7092/// "uri": {
7093/// "description": "The URI or URI template of the resource.",
7094/// "type": "string",
7095/// "format": "uri-template"
7096/// }
7097/// }
7098///}
7099/// ```
7100/// </details>
7101#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7102pub struct ResourceTemplateReference {
7103 #[serde(rename = "type", deserialize_with = "validate::resource_template_reference_type_")]
7104 type_: ::std::string::String,
7105 ///The URI or URI template of the resource.
7106 pub uri: ::std::string::String,
7107}
7108impl ResourceTemplateReference {
7109 pub fn new(uri: ::std::string::String) -> Self {
7110 Self {
7111 type_: "ref/resource".to_string(),
7112 uri,
7113 }
7114 }
7115 pub fn type_(&self) -> &::std::string::String {
7116 &self.type_
7117 }
7118 /// returns "ref/resource"
7119 pub fn type_value() -> &'static str {
7120 "ref/resource"
7121 }
7122}
7123///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.
7124///
7125/// <details><summary>JSON schema</summary>
7126///
7127/// ```json
7128///{
7129/// "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.",
7130/// "type": "object",
7131/// "required": [
7132/// "jsonrpc",
7133/// "method",
7134/// "params"
7135/// ],
7136/// "properties": {
7137/// "jsonrpc": {
7138/// "type": "string",
7139/// "const": "2.0"
7140/// },
7141/// "method": {
7142/// "type": "string",
7143/// "const": "notifications/resources/updated"
7144/// },
7145/// "params": {
7146/// "$ref": "#/$defs/ResourceUpdatedNotificationParams"
7147/// }
7148/// }
7149///}
7150/// ```
7151/// </details>
7152#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7153pub struct ResourceUpdatedNotification {
7154 #[serde(deserialize_with = "validate::resource_updated_notification_jsonrpc")]
7155 jsonrpc: ::std::string::String,
7156 #[serde(deserialize_with = "validate::resource_updated_notification_method")]
7157 method: ::std::string::String,
7158 pub params: ResourceUpdatedNotificationParams,
7159}
7160impl ResourceUpdatedNotification {
7161 pub fn new(params: ResourceUpdatedNotificationParams) -> Self {
7162 Self {
7163 jsonrpc: JSONRPC_VERSION.to_string(),
7164 method: "notifications/resources/updated".to_string(),
7165 params,
7166 }
7167 }
7168 pub fn jsonrpc(&self) -> &::std::string::String {
7169 &self.jsonrpc
7170 }
7171 pub fn method(&self) -> &::std::string::String {
7172 &self.method
7173 }
7174 /// returns "notifications/resources/updated"
7175 pub fn method_value() -> &'static str {
7176 "notifications/resources/updated"
7177 }
7178}
7179///Parameters for a notifications/resources/updated notification.
7180///
7181/// <details><summary>JSON schema</summary>
7182///
7183/// ```json
7184///{
7185/// "description": "Parameters for a notifications/resources/updated notification.",
7186/// "type": "object",
7187/// "required": [
7188/// "uri"
7189/// ],
7190/// "properties": {
7191/// "_meta": {
7192/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
7193/// "type": "object",
7194/// "additionalProperties": {}
7195/// },
7196/// "uri": {
7197/// "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.",
7198/// "type": "string",
7199/// "format": "uri"
7200/// }
7201/// }
7202///}
7203/// ```
7204/// </details>
7205#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7206pub struct ResourceUpdatedNotificationParams {
7207 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
7208 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
7209 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7210 ///The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
7211 pub uri: ::std::string::String,
7212}
7213///Result
7214///
7215/// <details><summary>JSON schema</summary>
7216///
7217/// ```json
7218///{
7219/// "type": "object",
7220/// "properties": {
7221/// "_meta": {
7222/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
7223/// "type": "object",
7224/// "additionalProperties": {}
7225/// }
7226/// },
7227/// "additionalProperties": {}
7228///}
7229/// ```
7230/// </details>
7231#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
7232pub struct Result {
7233 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
7234 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
7235 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7236 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
7237 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7238}
7239///The sender or recipient of messages and data in a conversation.
7240///
7241/// <details><summary>JSON schema</summary>
7242///
7243/// ```json
7244///{
7245/// "description": "The sender or recipient of messages and data in a conversation.",
7246/// "type": "string",
7247/// "enum": [
7248/// "assistant",
7249/// "user"
7250/// ]
7251///}
7252/// ```
7253/// </details>
7254#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
7255pub enum Role {
7256 #[serde(rename = "assistant")]
7257 Assistant,
7258 #[serde(rename = "user")]
7259 User,
7260}
7261impl ::std::fmt::Display for Role {
7262 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
7263 match *self {
7264 Self::Assistant => write!(f, "assistant"),
7265 Self::User => write!(f, "user"),
7266 }
7267 }
7268}
7269///Represents a root directory or file that the server can operate on.
7270///
7271/// <details><summary>JSON schema</summary>
7272///
7273/// ```json
7274///{
7275/// "description": "Represents a root directory or file that the server can operate on.",
7276/// "type": "object",
7277/// "required": [
7278/// "uri"
7279/// ],
7280/// "properties": {
7281/// "_meta": {
7282/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
7283/// "type": "object",
7284/// "additionalProperties": {}
7285/// },
7286/// "name": {
7287/// "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.",
7288/// "type": "string"
7289/// },
7290/// "uri": {
7291/// "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.",
7292/// "type": "string",
7293/// "format": "uri"
7294/// }
7295/// }
7296///}
7297/// ```
7298/// </details>
7299#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7300pub struct Root {
7301 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
7302 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
7303 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7304 /**An optional name for the root. This can be used to provide a human-readable
7305 identifier for the root, which may be useful for display purposes or for
7306 referencing the root in other parts of the application.*/
7307 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7308 pub name: ::std::option::Option<::std::string::String>,
7309 /**The URI identifying the root. This *must* start with file:// for now.
7310 This restriction may be relaxed in future versions of the protocol to allow
7311 other URI schemes.*/
7312 pub uri: ::std::string::String,
7313}
7314/**A notification from the client to the server, informing it that the list of roots has changed.
7315This notification should be sent whenever the client adds, removes, or modifies any root.
7316The server should then request an updated list of roots using the ListRootsRequest.*/
7317///
7318/// <details><summary>JSON schema</summary>
7319///
7320/// ```json
7321///{
7322/// "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.",
7323/// "type": "object",
7324/// "required": [
7325/// "jsonrpc",
7326/// "method"
7327/// ],
7328/// "properties": {
7329/// "jsonrpc": {
7330/// "type": "string",
7331/// "const": "2.0"
7332/// },
7333/// "method": {
7334/// "type": "string",
7335/// "const": "notifications/roots/list_changed"
7336/// },
7337/// "params": {
7338/// "$ref": "#/$defs/NotificationParams"
7339/// }
7340/// }
7341///}
7342/// ```
7343/// </details>
7344#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7345pub struct RootsListChangedNotification {
7346 #[serde(deserialize_with = "validate::roots_list_changed_notification_jsonrpc")]
7347 jsonrpc: ::std::string::String,
7348 #[serde(deserialize_with = "validate::roots_list_changed_notification_method")]
7349 method: ::std::string::String,
7350 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7351 pub params: ::std::option::Option<NotificationParams>,
7352}
7353impl RootsListChangedNotification {
7354 pub fn new(params: ::std::option::Option<NotificationParams>) -> Self {
7355 Self {
7356 jsonrpc: JSONRPC_VERSION.to_string(),
7357 method: "notifications/roots/list_changed".to_string(),
7358 params,
7359 }
7360 }
7361 pub fn jsonrpc(&self) -> &::std::string::String {
7362 &self.jsonrpc
7363 }
7364 pub fn method(&self) -> &::std::string::String {
7365 &self.method
7366 }
7367 /// returns "notifications/roots/list_changed"
7368 pub fn method_value() -> &'static str {
7369 "notifications/roots/list_changed"
7370 }
7371}
7372///RpcError
7373///
7374/// <details><summary>JSON schema</summary>
7375///
7376/// ```json
7377///{
7378/// "type": "object",
7379/// "required": [
7380/// "code",
7381/// "message"
7382/// ],
7383/// "properties": {
7384/// "code": {
7385/// "description": "The error type that occurred.",
7386/// "type": "integer"
7387/// },
7388/// "data": {
7389/// "description": "Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.)."
7390/// },
7391/// "message": {
7392/// "description": "A short description of the error. The message SHOULD be limited to a concise single sentence.",
7393/// "type": "string"
7394/// }
7395/// }
7396///}
7397/// ```
7398/// </details>
7399#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7400pub struct RpcError {
7401 ///The error type that occurred.
7402 pub code: i64,
7403 ///Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
7404 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7405 pub data: ::std::option::Option<::serde_json::Value>,
7406 ///A short description of the error. The message SHOULD be limited to a concise single sentence.
7407 pub message: ::std::string::String,
7408}
7409///Describes a message issued to or received from an LLM API.
7410///
7411/// <details><summary>JSON schema</summary>
7412///
7413/// ```json
7414///{
7415/// "description": "Describes a message issued to or received from an LLM API.",
7416/// "type": "object",
7417/// "required": [
7418/// "content",
7419/// "role"
7420/// ],
7421/// "properties": {
7422/// "_meta": {
7423/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
7424/// "type": "object",
7425/// "additionalProperties": {}
7426/// },
7427/// "content": {
7428/// "anyOf": [
7429/// {
7430/// "$ref": "#/$defs/TextContent"
7431/// },
7432/// {
7433/// "$ref": "#/$defs/ImageContent"
7434/// },
7435/// {
7436/// "$ref": "#/$defs/AudioContent"
7437/// },
7438/// {
7439/// "$ref": "#/$defs/ToolUseContent"
7440/// },
7441/// {
7442/// "$ref": "#/$defs/ToolResultContent"
7443/// },
7444/// {
7445/// "type": "array",
7446/// "items": {
7447/// "$ref": "#/$defs/SamplingMessageContentBlock"
7448/// }
7449/// }
7450/// ]
7451/// },
7452/// "role": {
7453/// "$ref": "#/$defs/Role"
7454/// }
7455/// }
7456///}
7457/// ```
7458/// </details>
7459#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7460pub struct SamplingMessage {
7461 pub content: SamplingMessageContent,
7462 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
7463 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
7464 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7465 pub role: Role,
7466}
7467///SamplingMessageContent
7468///
7469/// <details><summary>JSON schema</summary>
7470///
7471/// ```json
7472///{
7473/// "anyOf": [
7474/// {
7475/// "$ref": "#/$defs/TextContent"
7476/// },
7477/// {
7478/// "$ref": "#/$defs/ImageContent"
7479/// },
7480/// {
7481/// "$ref": "#/$defs/AudioContent"
7482/// },
7483/// {
7484/// "$ref": "#/$defs/ToolUseContent"
7485/// },
7486/// {
7487/// "$ref": "#/$defs/ToolResultContent"
7488/// },
7489/// {
7490/// "type": "array",
7491/// "items": {
7492/// "$ref": "#/$defs/SamplingMessageContentBlock"
7493/// }
7494/// }
7495/// ]
7496///}
7497/// ```
7498/// </details>
7499#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7500#[serde(untagged)]
7501pub enum SamplingMessageContent {
7502 TextContent(TextContent),
7503 ImageContent(ImageContent),
7504 AudioContent(AudioContent),
7505 ToolUseContent(ToolUseContent),
7506 ToolResultContent(ToolResultContent),
7507 SamplingMessageContentBlock(::std::vec::Vec<SamplingMessageContentBlock>),
7508}
7509impl ::std::convert::From<TextContent> for SamplingMessageContent {
7510 fn from(value: TextContent) -> Self {
7511 Self::TextContent(value)
7512 }
7513}
7514impl ::std::convert::From<ImageContent> for SamplingMessageContent {
7515 fn from(value: ImageContent) -> Self {
7516 Self::ImageContent(value)
7517 }
7518}
7519impl ::std::convert::From<AudioContent> for SamplingMessageContent {
7520 fn from(value: AudioContent) -> Self {
7521 Self::AudioContent(value)
7522 }
7523}
7524impl ::std::convert::From<ToolUseContent> for SamplingMessageContent {
7525 fn from(value: ToolUseContent) -> Self {
7526 Self::ToolUseContent(value)
7527 }
7528}
7529impl ::std::convert::From<ToolResultContent> for SamplingMessageContent {
7530 fn from(value: ToolResultContent) -> Self {
7531 Self::ToolResultContent(value)
7532 }
7533}
7534impl ::std::convert::From<::std::vec::Vec<SamplingMessageContentBlock>> for SamplingMessageContent {
7535 fn from(value: ::std::vec::Vec<SamplingMessageContentBlock>) -> Self {
7536 Self::SamplingMessageContentBlock(value)
7537 }
7538}
7539///SamplingMessageContentBlock
7540///
7541/// <details><summary>JSON schema</summary>
7542///
7543/// ```json
7544///{
7545/// "anyOf": [
7546/// {
7547/// "$ref": "#/$defs/TextContent"
7548/// },
7549/// {
7550/// "$ref": "#/$defs/ImageContent"
7551/// },
7552/// {
7553/// "$ref": "#/$defs/AudioContent"
7554/// },
7555/// {
7556/// "$ref": "#/$defs/ToolUseContent"
7557/// },
7558/// {
7559/// "$ref": "#/$defs/ToolResultContent"
7560/// }
7561/// ]
7562///}
7563/// ```
7564/// </details>
7565#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7566#[serde(untagged)]
7567pub enum SamplingMessageContentBlock {
7568 TextContent(TextContent),
7569 ImageContent(ImageContent),
7570 AudioContent(AudioContent),
7571 ToolUseContent(ToolUseContent),
7572 ToolResultContent(ToolResultContent),
7573}
7574impl ::std::convert::From<TextContent> for SamplingMessageContentBlock {
7575 fn from(value: TextContent) -> Self {
7576 Self::TextContent(value)
7577 }
7578}
7579impl ::std::convert::From<ImageContent> for SamplingMessageContentBlock {
7580 fn from(value: ImageContent) -> Self {
7581 Self::ImageContent(value)
7582 }
7583}
7584impl ::std::convert::From<AudioContent> for SamplingMessageContentBlock {
7585 fn from(value: AudioContent) -> Self {
7586 Self::AudioContent(value)
7587 }
7588}
7589impl ::std::convert::From<ToolUseContent> for SamplingMessageContentBlock {
7590 fn from(value: ToolUseContent) -> Self {
7591 Self::ToolUseContent(value)
7592 }
7593}
7594impl ::std::convert::From<ToolResultContent> for SamplingMessageContentBlock {
7595 fn from(value: ToolResultContent) -> Self {
7596 Self::ToolResultContent(value)
7597 }
7598}
7599///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.
7600///
7601/// <details><summary>JSON schema</summary>
7602///
7603/// ```json
7604///{
7605/// "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.",
7606/// "type": "object",
7607/// "properties": {
7608/// "completions": {
7609/// "description": "Present if the server supports argument autocompletion suggestions.",
7610/// "type": "object",
7611/// "additionalProperties": true
7612/// },
7613/// "experimental": {
7614/// "description": "Experimental, non-standard capabilities that the server supports.",
7615/// "type": "object",
7616/// "additionalProperties": {
7617/// "type": "object",
7618/// "additionalProperties": true
7619/// }
7620/// },
7621/// "logging": {
7622/// "description": "Present if the server supports sending log messages to the client.",
7623/// "type": "object",
7624/// "additionalProperties": true
7625/// },
7626/// "prompts": {
7627/// "description": "Present if the server offers any prompt templates.",
7628/// "type": "object",
7629/// "properties": {
7630/// "listChanged": {
7631/// "description": "Whether this server supports notifications for changes to the prompt list.",
7632/// "type": "boolean"
7633/// }
7634/// }
7635/// },
7636/// "resources": {
7637/// "description": "Present if the server offers any resources to read.",
7638/// "type": "object",
7639/// "properties": {
7640/// "listChanged": {
7641/// "description": "Whether this server supports notifications for changes to the resource list.",
7642/// "type": "boolean"
7643/// },
7644/// "subscribe": {
7645/// "description": "Whether this server supports subscribing to resource updates.",
7646/// "type": "boolean"
7647/// }
7648/// }
7649/// },
7650/// "tasks": {
7651/// "description": "Present if the server supports task-augmented requests.",
7652/// "type": "object",
7653/// "properties": {
7654/// "cancel": {
7655/// "description": "Whether this server supports tasks/cancel.",
7656/// "type": "object",
7657/// "additionalProperties": true
7658/// },
7659/// "list": {
7660/// "description": "Whether this server supports tasks/list.",
7661/// "type": "object",
7662/// "additionalProperties": true
7663/// },
7664/// "requests": {
7665/// "description": "Specifies which request types can be augmented with tasks.",
7666/// "type": "object",
7667/// "properties": {
7668/// "tools": {
7669/// "description": "Task support for tool-related requests.",
7670/// "type": "object",
7671/// "properties": {
7672/// "call": {
7673/// "description": "Whether the server supports task-augmented tools/call requests.",
7674/// "type": "object",
7675/// "additionalProperties": true
7676/// }
7677/// }
7678/// }
7679/// }
7680/// }
7681/// }
7682/// },
7683/// "tools": {
7684/// "description": "Present if the server offers any tools to call.",
7685/// "type": "object",
7686/// "properties": {
7687/// "listChanged": {
7688/// "description": "Whether this server supports notifications for changes to the tool list.",
7689/// "type": "boolean"
7690/// }
7691/// }
7692/// }
7693/// }
7694///}
7695/// ```
7696/// </details>
7697#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
7698pub struct ServerCapabilities {
7699 ///Present if the server supports argument autocompletion suggestions.
7700 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7701 pub completions: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7702 ///Experimental, non-standard capabilities that the server supports.
7703 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7704 pub experimental: ::std::option::Option<
7705 std::collections::BTreeMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7706 >,
7707 ///Present if the server supports sending log messages to the client.
7708 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7709 pub logging: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7710 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7711 pub prompts: ::std::option::Option<ServerCapabilitiesPrompts>,
7712 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7713 pub resources: ::std::option::Option<ServerCapabilitiesResources>,
7714 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7715 pub tasks: ::std::option::Option<ServerTasks>,
7716 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7717 pub tools: ::std::option::Option<ServerCapabilitiesTools>,
7718}
7719///Present if the server offers any prompt templates.
7720///
7721/// <details><summary>JSON schema</summary>
7722///
7723/// ```json
7724///{
7725/// "description": "Present if the server offers any prompt templates.",
7726/// "type": "object",
7727/// "properties": {
7728/// "listChanged": {
7729/// "description": "Whether this server supports notifications for changes to the prompt list.",
7730/// "type": "boolean"
7731/// }
7732/// }
7733///}
7734/// ```
7735/// </details>
7736#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
7737pub struct ServerCapabilitiesPrompts {
7738 ///Whether this server supports notifications for changes to the prompt list.
7739 #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
7740 pub list_changed: ::std::option::Option<bool>,
7741}
7742///Present if the server offers any resources to read.
7743///
7744/// <details><summary>JSON schema</summary>
7745///
7746/// ```json
7747///{
7748/// "description": "Present if the server offers any resources to read.",
7749/// "type": "object",
7750/// "properties": {
7751/// "listChanged": {
7752/// "description": "Whether this server supports notifications for changes to the resource list.",
7753/// "type": "boolean"
7754/// },
7755/// "subscribe": {
7756/// "description": "Whether this server supports subscribing to resource updates.",
7757/// "type": "boolean"
7758/// }
7759/// }
7760///}
7761/// ```
7762/// </details>
7763#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
7764pub struct ServerCapabilitiesResources {
7765 ///Whether this server supports notifications for changes to the resource list.
7766 #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
7767 pub list_changed: ::std::option::Option<bool>,
7768 ///Whether this server supports subscribing to resource updates.
7769 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7770 pub subscribe: ::std::option::Option<bool>,
7771}
7772///Present if the server offers any tools to call.
7773///
7774/// <details><summary>JSON schema</summary>
7775///
7776/// ```json
7777///{
7778/// "description": "Present if the server offers any tools to call.",
7779/// "type": "object",
7780/// "properties": {
7781/// "listChanged": {
7782/// "description": "Whether this server supports notifications for changes to the tool list.",
7783/// "type": "boolean"
7784/// }
7785/// }
7786///}
7787/// ```
7788/// </details>
7789#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
7790pub struct ServerCapabilitiesTools {
7791 ///Whether this server supports notifications for changes to the tool list.
7792 #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
7793 pub list_changed: ::std::option::Option<bool>,
7794}
7795///ServerNotification
7796///
7797/// <details><summary>JSON schema</summary>
7798///
7799/// ```json
7800///{
7801/// "anyOf": [
7802/// {
7803/// "$ref": "#/$defs/CancelledNotification"
7804/// },
7805/// {
7806/// "$ref": "#/$defs/ProgressNotification"
7807/// },
7808/// {
7809/// "$ref": "#/$defs/ResourceListChangedNotification"
7810/// },
7811/// {
7812/// "$ref": "#/$defs/ResourceUpdatedNotification"
7813/// },
7814/// {
7815/// "$ref": "#/$defs/PromptListChangedNotification"
7816/// },
7817/// {
7818/// "$ref": "#/$defs/ToolListChangedNotification"
7819/// },
7820/// {
7821/// "$ref": "#/$defs/TaskStatusNotification"
7822/// },
7823/// {
7824/// "$ref": "#/$defs/LoggingMessageNotification"
7825/// },
7826/// {
7827/// "$ref": "#/$defs/ElicitationCompleteNotification"
7828/// }
7829/// ]
7830///}
7831/// ```
7832/// </details>
7833#[derive(::serde::Serialize, Clone, Debug)]
7834#[serde(untagged)]
7835pub enum ServerNotification {
7836 CancelledNotification(CancelledNotification),
7837 ProgressNotification(ProgressNotification),
7838 ResourceListChangedNotification(ResourceListChangedNotification),
7839 ResourceUpdatedNotification(ResourceUpdatedNotification),
7840 PromptListChangedNotification(PromptListChangedNotification),
7841 ToolListChangedNotification(ToolListChangedNotification),
7842 TaskStatusNotification(TaskStatusNotification),
7843 LoggingMessageNotification(LoggingMessageNotification),
7844 ElicitationCompleteNotification(ElicitationCompleteNotification),
7845}
7846impl ::std::convert::From<CancelledNotification> for ServerNotification {
7847 fn from(value: CancelledNotification) -> Self {
7848 Self::CancelledNotification(value)
7849 }
7850}
7851impl ::std::convert::From<ProgressNotification> for ServerNotification {
7852 fn from(value: ProgressNotification) -> Self {
7853 Self::ProgressNotification(value)
7854 }
7855}
7856impl ::std::convert::From<ResourceListChangedNotification> for ServerNotification {
7857 fn from(value: ResourceListChangedNotification) -> Self {
7858 Self::ResourceListChangedNotification(value)
7859 }
7860}
7861impl ::std::convert::From<ResourceUpdatedNotification> for ServerNotification {
7862 fn from(value: ResourceUpdatedNotification) -> Self {
7863 Self::ResourceUpdatedNotification(value)
7864 }
7865}
7866impl ::std::convert::From<PromptListChangedNotification> for ServerNotification {
7867 fn from(value: PromptListChangedNotification) -> Self {
7868 Self::PromptListChangedNotification(value)
7869 }
7870}
7871impl ::std::convert::From<ToolListChangedNotification> for ServerNotification {
7872 fn from(value: ToolListChangedNotification) -> Self {
7873 Self::ToolListChangedNotification(value)
7874 }
7875}
7876impl ::std::convert::From<TaskStatusNotification> for ServerNotification {
7877 fn from(value: TaskStatusNotification) -> Self {
7878 Self::TaskStatusNotification(value)
7879 }
7880}
7881impl ::std::convert::From<LoggingMessageNotification> for ServerNotification {
7882 fn from(value: LoggingMessageNotification) -> Self {
7883 Self::LoggingMessageNotification(value)
7884 }
7885}
7886impl ::std::convert::From<ElicitationCompleteNotification> for ServerNotification {
7887 fn from(value: ElicitationCompleteNotification) -> Self {
7888 Self::ElicitationCompleteNotification(value)
7889 }
7890}
7891///ServerRequest
7892///
7893/// <details><summary>JSON schema</summary>
7894///
7895/// ```json
7896///{
7897/// "anyOf": [
7898/// {
7899/// "$ref": "#/$defs/PingRequest"
7900/// },
7901/// {
7902/// "$ref": "#/$defs/GetTaskRequest"
7903/// },
7904/// {
7905/// "$ref": "#/$defs/GetTaskPayloadRequest"
7906/// },
7907/// {
7908/// "$ref": "#/$defs/CancelTaskRequest"
7909/// },
7910/// {
7911/// "$ref": "#/$defs/ListTasksRequest"
7912/// },
7913/// {
7914/// "$ref": "#/$defs/CreateMessageRequest"
7915/// },
7916/// {
7917/// "$ref": "#/$defs/ListRootsRequest"
7918/// },
7919/// {
7920/// "$ref": "#/$defs/ElicitRequest"
7921/// }
7922/// ]
7923///}
7924/// ```
7925/// </details>
7926#[derive(::serde::Serialize, Clone, Debug)]
7927#[serde(untagged)]
7928#[allow(clippy::large_enum_variant)]
7929pub enum ServerRequest {
7930 PingRequest(PingRequest),
7931 GetTaskRequest(GetTaskRequest),
7932 GetTaskPayloadRequest(GetTaskPayloadRequest),
7933 CancelTaskRequest(CancelTaskRequest),
7934 ListTasksRequest(ListTasksRequest),
7935 CreateMessageRequest(CreateMessageRequest),
7936 ListRootsRequest(ListRootsRequest),
7937 ElicitRequest(ElicitRequest),
7938}
7939impl ::std::convert::From<PingRequest> for ServerRequest {
7940 fn from(value: PingRequest) -> Self {
7941 Self::PingRequest(value)
7942 }
7943}
7944impl ::std::convert::From<GetTaskRequest> for ServerRequest {
7945 fn from(value: GetTaskRequest) -> Self {
7946 Self::GetTaskRequest(value)
7947 }
7948}
7949impl ::std::convert::From<GetTaskPayloadRequest> for ServerRequest {
7950 fn from(value: GetTaskPayloadRequest) -> Self {
7951 Self::GetTaskPayloadRequest(value)
7952 }
7953}
7954impl ::std::convert::From<CancelTaskRequest> for ServerRequest {
7955 fn from(value: CancelTaskRequest) -> Self {
7956 Self::CancelTaskRequest(value)
7957 }
7958}
7959impl ::std::convert::From<ListTasksRequest> for ServerRequest {
7960 fn from(value: ListTasksRequest) -> Self {
7961 Self::ListTasksRequest(value)
7962 }
7963}
7964impl ::std::convert::From<CreateMessageRequest> for ServerRequest {
7965 fn from(value: CreateMessageRequest) -> Self {
7966 Self::CreateMessageRequest(value)
7967 }
7968}
7969impl ::std::convert::From<ListRootsRequest> for ServerRequest {
7970 fn from(value: ListRootsRequest) -> Self {
7971 Self::ListRootsRequest(value)
7972 }
7973}
7974impl ::std::convert::From<ElicitRequest> for ServerRequest {
7975 fn from(value: ElicitRequest) -> Self {
7976 Self::ElicitRequest(value)
7977 }
7978}
7979///ServerResult
7980///
7981/// <details><summary>JSON schema</summary>
7982///
7983/// ```json
7984///{
7985/// "anyOf": [
7986/// {
7987/// "$ref": "#/$defs/Result"
7988/// },
7989/// {
7990/// "$ref": "#/$defs/InitializeResult"
7991/// },
7992/// {
7993/// "$ref": "#/$defs/ListResourcesResult"
7994/// },
7995/// {
7996/// "$ref": "#/$defs/ListResourceTemplatesResult"
7997/// },
7998/// {
7999/// "$ref": "#/$defs/ReadResourceResult"
8000/// },
8001/// {
8002/// "$ref": "#/$defs/ListPromptsResult"
8003/// },
8004/// {
8005/// "$ref": "#/$defs/GetPromptResult"
8006/// },
8007/// {
8008/// "$ref": "#/$defs/ListToolsResult"
8009/// },
8010/// {
8011/// "$ref": "#/$defs/CallToolResult"
8012/// },
8013/// {
8014/// "description": "The response to a tasks/get request.",
8015/// "$ref": "#/$defs/GetTaskResult"
8016/// },
8017/// {
8018/// "$ref": "#/$defs/GetTaskPayloadResult"
8019/// },
8020/// {
8021/// "description": "The response to a tasks/cancel request.",
8022/// "$ref": "#/$defs/CancelTaskResult"
8023/// },
8024/// {
8025/// "$ref": "#/$defs/ListTasksResult"
8026/// },
8027/// {
8028/// "$ref": "#/$defs/CompleteResult"
8029/// }
8030/// ]
8031///}
8032/// ```
8033/// </details>
8034#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8035#[serde(untagged)]
8036#[allow(clippy::large_enum_variant)]
8037pub enum ServerResult {
8038 InitializeResult(InitializeResult),
8039 ListResourcesResult(ListResourcesResult),
8040 ListResourceTemplatesResult(ListResourceTemplatesResult),
8041 ReadResourceResult(ReadResourceResult),
8042 ListPromptsResult(ListPromptsResult),
8043 GetPromptResult(GetPromptResult),
8044 ListToolsResult(ListToolsResult),
8045 CallToolResult(CallToolResult),
8046 GetTaskResult(GetTaskResult),
8047 CancelTaskResult(CancelTaskResult),
8048 ListTasksResult(ListTasksResult),
8049 CompleteResult(CompleteResult),
8050 Result(Result),
8051 GetTaskPayloadResult(GetTaskPayloadResult),
8052}
8053impl ::std::convert::From<InitializeResult> for ServerResult {
8054 fn from(value: InitializeResult) -> Self {
8055 Self::InitializeResult(value)
8056 }
8057}
8058impl ::std::convert::From<ListResourcesResult> for ServerResult {
8059 fn from(value: ListResourcesResult) -> Self {
8060 Self::ListResourcesResult(value)
8061 }
8062}
8063impl ::std::convert::From<ListResourceTemplatesResult> for ServerResult {
8064 fn from(value: ListResourceTemplatesResult) -> Self {
8065 Self::ListResourceTemplatesResult(value)
8066 }
8067}
8068impl ::std::convert::From<ReadResourceResult> for ServerResult {
8069 fn from(value: ReadResourceResult) -> Self {
8070 Self::ReadResourceResult(value)
8071 }
8072}
8073impl ::std::convert::From<ListPromptsResult> for ServerResult {
8074 fn from(value: ListPromptsResult) -> Self {
8075 Self::ListPromptsResult(value)
8076 }
8077}
8078impl ::std::convert::From<GetPromptResult> for ServerResult {
8079 fn from(value: GetPromptResult) -> Self {
8080 Self::GetPromptResult(value)
8081 }
8082}
8083impl ::std::convert::From<ListToolsResult> for ServerResult {
8084 fn from(value: ListToolsResult) -> Self {
8085 Self::ListToolsResult(value)
8086 }
8087}
8088impl ::std::convert::From<CallToolResult> for ServerResult {
8089 fn from(value: CallToolResult) -> Self {
8090 Self::CallToolResult(value)
8091 }
8092}
8093impl ::std::convert::From<GetTaskResult> for ServerResult {
8094 fn from(value: GetTaskResult) -> Self {
8095 Self::GetTaskResult(value)
8096 }
8097}
8098impl ::std::convert::From<CancelTaskResult> for ServerResult {
8099 fn from(value: CancelTaskResult) -> Self {
8100 Self::CancelTaskResult(value)
8101 }
8102}
8103impl ::std::convert::From<ListTasksResult> for ServerResult {
8104 fn from(value: ListTasksResult) -> Self {
8105 Self::ListTasksResult(value)
8106 }
8107}
8108impl ::std::convert::From<CompleteResult> for ServerResult {
8109 fn from(value: CompleteResult) -> Self {
8110 Self::CompleteResult(value)
8111 }
8112}
8113impl ::std::convert::From<Result> for ServerResult {
8114 fn from(value: Result) -> Self {
8115 Self::Result(value)
8116 }
8117}
8118impl ::std::convert::From<GetTaskPayloadResult> for ServerResult {
8119 fn from(value: GetTaskPayloadResult) -> Self {
8120 Self::GetTaskPayloadResult(value)
8121 }
8122}
8123///Specifies which request types can be augmented with tasks.
8124///
8125/// <details><summary>JSON schema</summary>
8126///
8127/// ```json
8128///{
8129/// "description": "Specifies which request types can be augmented with tasks.",
8130/// "type": "object",
8131/// "properties": {
8132/// "tools": {
8133/// "description": "Task support for tool-related requests.",
8134/// "type": "object",
8135/// "properties": {
8136/// "call": {
8137/// "description": "Whether the server supports task-augmented tools/call requests.",
8138/// "type": "object",
8139/// "additionalProperties": true
8140/// }
8141/// }
8142/// }
8143/// }
8144///}
8145/// ```
8146/// </details>
8147#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
8148pub struct ServerTaskRequest {
8149 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8150 pub tools: ::std::option::Option<ServerTaskTools>,
8151}
8152///Task support for tool-related requests.
8153///
8154/// <details><summary>JSON schema</summary>
8155///
8156/// ```json
8157///{
8158/// "description": "Task support for tool-related requests.",
8159/// "type": "object",
8160/// "properties": {
8161/// "call": {
8162/// "description": "Whether the server supports task-augmented tools/call requests.",
8163/// "type": "object",
8164/// "additionalProperties": true
8165/// }
8166/// }
8167///}
8168/// ```
8169/// </details>
8170#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
8171pub struct ServerTaskTools {
8172 ///Whether the server supports task-augmented tools/call requests.
8173 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8174 pub call: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
8175}
8176///Present if the server supports task-augmented requests.
8177///
8178/// <details><summary>JSON schema</summary>
8179///
8180/// ```json
8181///{
8182/// "description": "Present if the server supports task-augmented requests.",
8183/// "type": "object",
8184/// "properties": {
8185/// "cancel": {
8186/// "description": "Whether this server supports tasks/cancel.",
8187/// "type": "object",
8188/// "additionalProperties": true
8189/// },
8190/// "list": {
8191/// "description": "Whether this server supports tasks/list.",
8192/// "type": "object",
8193/// "additionalProperties": true
8194/// },
8195/// "requests": {
8196/// "description": "Specifies which request types can be augmented with tasks.",
8197/// "type": "object",
8198/// "properties": {
8199/// "tools": {
8200/// "description": "Task support for tool-related requests.",
8201/// "type": "object",
8202/// "properties": {
8203/// "call": {
8204/// "description": "Whether the server supports task-augmented tools/call requests.",
8205/// "type": "object",
8206/// "additionalProperties": true
8207/// }
8208/// }
8209/// }
8210/// }
8211/// }
8212/// }
8213///}
8214/// ```
8215/// </details>
8216#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
8217pub struct ServerTasks {
8218 ///Whether this server supports tasks/cancel.
8219 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8220 pub cancel: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
8221 ///Whether this server supports tasks/list.
8222 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8223 pub list: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
8224 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8225 pub requests: ::std::option::Option<ServerTaskRequest>,
8226}
8227///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
8228///
8229/// <details><summary>JSON schema</summary>
8230///
8231/// ```json
8232///{
8233/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
8234/// "type": "object",
8235/// "properties": {
8236/// "progressToken": {
8237/// "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.",
8238/// "$ref": "#/$defs/ProgressToken"
8239/// }
8240/// },
8241/// "additionalProperties": {}
8242///}
8243/// ```
8244/// </details>
8245#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
8246pub struct SetLevelMeta {
8247 ///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.
8248 #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
8249 pub progress_token: ::std::option::Option<ProgressToken>,
8250 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
8251 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
8252}
8253///A request from the client to the server, to enable or adjust logging.
8254///
8255/// <details><summary>JSON schema</summary>
8256///
8257/// ```json
8258///{
8259/// "description": "A request from the client to the server, to enable or adjust logging.",
8260/// "type": "object",
8261/// "required": [
8262/// "id",
8263/// "jsonrpc",
8264/// "method",
8265/// "params"
8266/// ],
8267/// "properties": {
8268/// "id": {
8269/// "$ref": "#/$defs/RequestId"
8270/// },
8271/// "jsonrpc": {
8272/// "type": "string",
8273/// "const": "2.0"
8274/// },
8275/// "method": {
8276/// "type": "string",
8277/// "const": "logging/setLevel"
8278/// },
8279/// "params": {
8280/// "$ref": "#/$defs/SetLevelRequestParams"
8281/// }
8282/// }
8283///}
8284/// ```
8285/// </details>
8286#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8287pub struct SetLevelRequest {
8288 pub id: RequestId,
8289 #[serde(deserialize_with = "validate::set_level_request_jsonrpc")]
8290 jsonrpc: ::std::string::String,
8291 #[serde(deserialize_with = "validate::set_level_request_method")]
8292 method: ::std::string::String,
8293 pub params: SetLevelRequestParams,
8294}
8295impl SetLevelRequest {
8296 pub fn new(id: RequestId, params: SetLevelRequestParams) -> Self {
8297 Self {
8298 id,
8299 jsonrpc: JSONRPC_VERSION.to_string(),
8300 method: "logging/setLevel".to_string(),
8301 params,
8302 }
8303 }
8304 pub fn jsonrpc(&self) -> &::std::string::String {
8305 &self.jsonrpc
8306 }
8307 pub fn method(&self) -> &::std::string::String {
8308 &self.method
8309 }
8310 /// returns "logging/setLevel"
8311 pub fn method_value() -> &'static str {
8312 "logging/setLevel"
8313 }
8314}
8315///Parameters for a logging/setLevel request.
8316///
8317/// <details><summary>JSON schema</summary>
8318///
8319/// ```json
8320///{
8321/// "description": "Parameters for a logging/setLevel request.",
8322/// "type": "object",
8323/// "required": [
8324/// "level"
8325/// ],
8326/// "properties": {
8327/// "_meta": {
8328/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
8329/// "type": "object",
8330/// "properties": {
8331/// "progressToken": {
8332/// "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.",
8333/// "$ref": "#/$defs/ProgressToken"
8334/// }
8335/// },
8336/// "additionalProperties": {}
8337/// },
8338/// "level": {
8339/// "description": "The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/message.",
8340/// "$ref": "#/$defs/LoggingLevel"
8341/// }
8342/// }
8343///}
8344/// ```
8345/// </details>
8346#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8347pub struct SetLevelRequestParams {
8348 ///The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/message.
8349 pub level: LoggingLevel,
8350 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
8351 pub meta: ::std::option::Option<SetLevelMeta>,
8352}
8353///SingleSelectEnumSchema
8354///
8355/// <details><summary>JSON schema</summary>
8356///
8357/// ```json
8358///{
8359/// "anyOf": [
8360/// {
8361/// "$ref": "#/$defs/UntitledSingleSelectEnumSchema"
8362/// },
8363/// {
8364/// "$ref": "#/$defs/TitledSingleSelectEnumSchema"
8365/// }
8366/// ]
8367///}
8368/// ```
8369/// </details>
8370#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8371#[serde(untagged)]
8372pub enum SingleSelectEnumSchema {
8373 UntitledSingleSelectEnumSchema(UntitledSingleSelectEnumSchema),
8374 TitledSingleSelectEnumSchema(TitledSingleSelectEnumSchema),
8375}
8376impl ::std::convert::From<UntitledSingleSelectEnumSchema> for SingleSelectEnumSchema {
8377 fn from(value: UntitledSingleSelectEnumSchema) -> Self {
8378 Self::UntitledSingleSelectEnumSchema(value)
8379 }
8380}
8381impl ::std::convert::From<TitledSingleSelectEnumSchema> for SingleSelectEnumSchema {
8382 fn from(value: TitledSingleSelectEnumSchema) -> Self {
8383 Self::TitledSingleSelectEnumSchema(value)
8384 }
8385}
8386///StringSchema
8387///
8388/// <details><summary>JSON schema</summary>
8389///
8390/// ```json
8391///{
8392/// "type": "object",
8393/// "required": [
8394/// "type"
8395/// ],
8396/// "properties": {
8397/// "default": {
8398/// "type": "string"
8399/// },
8400/// "description": {
8401/// "type": "string"
8402/// },
8403/// "format": {
8404/// "type": "string",
8405/// "enum": [
8406/// "date",
8407/// "date-time",
8408/// "email",
8409/// "uri"
8410/// ]
8411/// },
8412/// "maxLength": {
8413/// "type": "integer"
8414/// },
8415/// "minLength": {
8416/// "type": "integer"
8417/// },
8418/// "title": {
8419/// "type": "string"
8420/// },
8421/// "type": {
8422/// "type": "string",
8423/// "const": "string"
8424/// }
8425/// }
8426///}
8427/// ```
8428/// </details>
8429#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8430pub struct StringSchema {
8431 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8432 pub default: ::std::option::Option<::std::string::String>,
8433 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8434 pub description: ::std::option::Option<::std::string::String>,
8435 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8436 pub format: ::std::option::Option<StringSchemaFormat>,
8437 #[serde(rename = "maxLength", default, skip_serializing_if = "::std::option::Option::is_none")]
8438 pub max_length: ::std::option::Option<i64>,
8439 #[serde(rename = "minLength", default, skip_serializing_if = "::std::option::Option::is_none")]
8440 pub min_length: ::std::option::Option<i64>,
8441 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8442 pub title: ::std::option::Option<::std::string::String>,
8443 #[serde(rename = "type", deserialize_with = "validate::string_schema_type_")]
8444 type_: ::std::string::String,
8445}
8446impl StringSchema {
8447 pub fn new(
8448 default: ::std::option::Option<::std::string::String>,
8449 description: ::std::option::Option<::std::string::String>,
8450 format: ::std::option::Option<StringSchemaFormat>,
8451 max_length: ::std::option::Option<i64>,
8452 min_length: ::std::option::Option<i64>,
8453 title: ::std::option::Option<::std::string::String>,
8454 ) -> Self {
8455 Self {
8456 default,
8457 description,
8458 format,
8459 max_length,
8460 min_length,
8461 title,
8462 type_: "string".to_string(),
8463 }
8464 }
8465 pub fn type_(&self) -> &::std::string::String {
8466 &self.type_
8467 }
8468 /// returns "string"
8469 pub fn type_value() -> &'static str {
8470 "string"
8471 }
8472}
8473///StringSchemaFormat
8474///
8475/// <details><summary>JSON schema</summary>
8476///
8477/// ```json
8478///{
8479/// "type": "string",
8480/// "enum": [
8481/// "date",
8482/// "date-time",
8483/// "email",
8484/// "uri"
8485/// ]
8486///}
8487/// ```
8488/// </details>
8489#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
8490pub enum StringSchemaFormat {
8491 #[serde(rename = "date")]
8492 Date,
8493 #[serde(rename = "date-time")]
8494 DateTime,
8495 #[serde(rename = "email")]
8496 Email,
8497 #[serde(rename = "uri")]
8498 Uri,
8499}
8500impl ::std::fmt::Display for StringSchemaFormat {
8501 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
8502 match *self {
8503 Self::Date => write!(f, "date"),
8504 Self::DateTime => write!(f, "date-time"),
8505 Self::Email => write!(f, "email"),
8506 Self::Uri => write!(f, "uri"),
8507 }
8508 }
8509}
8510///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
8511///
8512/// <details><summary>JSON schema</summary>
8513///
8514/// ```json
8515///{
8516/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
8517/// "type": "object",
8518/// "properties": {
8519/// "progressToken": {
8520/// "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.",
8521/// "$ref": "#/$defs/ProgressToken"
8522/// }
8523/// },
8524/// "additionalProperties": {}
8525///}
8526/// ```
8527/// </details>
8528#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
8529pub struct SubscribeMeta {
8530 ///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.
8531 #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
8532 pub progress_token: ::std::option::Option<ProgressToken>,
8533 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
8534 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
8535}
8536///Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
8537///
8538/// <details><summary>JSON schema</summary>
8539///
8540/// ```json
8541///{
8542/// "description": "Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.",
8543/// "type": "object",
8544/// "required": [
8545/// "id",
8546/// "jsonrpc",
8547/// "method",
8548/// "params"
8549/// ],
8550/// "properties": {
8551/// "id": {
8552/// "$ref": "#/$defs/RequestId"
8553/// },
8554/// "jsonrpc": {
8555/// "type": "string",
8556/// "const": "2.0"
8557/// },
8558/// "method": {
8559/// "type": "string",
8560/// "const": "resources/subscribe"
8561/// },
8562/// "params": {
8563/// "$ref": "#/$defs/SubscribeRequestParams"
8564/// }
8565/// }
8566///}
8567/// ```
8568/// </details>
8569#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8570pub struct SubscribeRequest {
8571 pub id: RequestId,
8572 #[serde(deserialize_with = "validate::subscribe_request_jsonrpc")]
8573 jsonrpc: ::std::string::String,
8574 #[serde(deserialize_with = "validate::subscribe_request_method")]
8575 method: ::std::string::String,
8576 pub params: SubscribeRequestParams,
8577}
8578impl SubscribeRequest {
8579 pub fn new(id: RequestId, params: SubscribeRequestParams) -> Self {
8580 Self {
8581 id,
8582 jsonrpc: JSONRPC_VERSION.to_string(),
8583 method: "resources/subscribe".to_string(),
8584 params,
8585 }
8586 }
8587 pub fn jsonrpc(&self) -> &::std::string::String {
8588 &self.jsonrpc
8589 }
8590 pub fn method(&self) -> &::std::string::String {
8591 &self.method
8592 }
8593 /// returns "resources/subscribe"
8594 pub fn method_value() -> &'static str {
8595 "resources/subscribe"
8596 }
8597}
8598///Parameters for a resources/subscribe request.
8599///
8600/// <details><summary>JSON schema</summary>
8601///
8602/// ```json
8603///{
8604/// "description": "Parameters for a resources/subscribe request.",
8605/// "type": "object",
8606/// "required": [
8607/// "uri"
8608/// ],
8609/// "properties": {
8610/// "_meta": {
8611/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
8612/// "type": "object",
8613/// "properties": {
8614/// "progressToken": {
8615/// "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.",
8616/// "$ref": "#/$defs/ProgressToken"
8617/// }
8618/// },
8619/// "additionalProperties": {}
8620/// },
8621/// "uri": {
8622/// "description": "The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.",
8623/// "type": "string",
8624/// "format": "uri"
8625/// }
8626/// }
8627///}
8628/// ```
8629/// </details>
8630#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8631pub struct SubscribeRequestParams {
8632 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
8633 pub meta: ::std::option::Option<SubscribeMeta>,
8634 ///The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.
8635 pub uri: ::std::string::String,
8636}
8637///Data associated with a task.
8638///
8639/// <details><summary>JSON schema</summary>
8640///
8641/// ```json
8642///{
8643/// "description": "Data associated with a task.",
8644/// "type": "object",
8645/// "required": [
8646/// "createdAt",
8647/// "lastUpdatedAt",
8648/// "status",
8649/// "taskId",
8650/// "ttl"
8651/// ],
8652/// "properties": {
8653/// "createdAt": {
8654/// "description": "ISO 8601 timestamp when the task was created.",
8655/// "type": "string"
8656/// },
8657/// "lastUpdatedAt": {
8658/// "description": "ISO 8601 timestamp when the task was last updated.",
8659/// "type": "string"
8660/// },
8661/// "pollInterval": {
8662/// "description": "Suggested polling interval in milliseconds.",
8663/// "type": "integer"
8664/// },
8665/// "status": {
8666/// "$ref": "#/$defs/TaskStatus"
8667/// },
8668/// "statusMessage": {
8669/// "description": "Optional human-readable message describing the current task state.\nThis can provide context for any status, including:\n- Reasons for \"cancelled\" status\n- Summaries for \"completed\" status\n- Diagnostic information for \"failed\" status (e.g., error details, what went wrong)",
8670/// "type": "string"
8671/// },
8672/// "taskId": {
8673/// "description": "The task identifier.",
8674/// "type": "string"
8675/// },
8676/// "ttl": {
8677/// "description": "Actual retention duration from creation in milliseconds, null for unlimited.",
8678/// "type": "integer"
8679/// }
8680/// }
8681///}
8682/// ```
8683/// </details>
8684#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8685pub struct Task {
8686 ///ISO 8601 timestamp when the task was created.
8687 #[serde(rename = "createdAt")]
8688 pub created_at: ::std::string::String,
8689 ///ISO 8601 timestamp when the task was last updated.
8690 #[serde(rename = "lastUpdatedAt")]
8691 pub last_updated_at: ::std::string::String,
8692 ///Suggested polling interval in milliseconds.
8693 #[serde(rename = "pollInterval", default, skip_serializing_if = "::std::option::Option::is_none")]
8694 pub poll_interval: ::std::option::Option<i64>,
8695 pub status: TaskStatus,
8696 /**Optional human-readable message describing the current task state.
8697 This can provide context for any status, including:
8698 - Reasons for "cancelled" status
8699 - Summaries for "completed" status
8700 - Diagnostic information for "failed" status (e.g., error details, what went wrong)*/
8701 #[serde(rename = "statusMessage", default, skip_serializing_if = "::std::option::Option::is_none")]
8702 pub status_message: ::std::option::Option<::std::string::String>,
8703 ///The task identifier.
8704 #[serde(rename = "taskId")]
8705 pub task_id: ::std::string::String,
8706 ///Actual retention duration from creation in milliseconds, null for unlimited.
8707 #[serde(default)]
8708 pub ttl: ::std::option::Option<i64>,
8709}
8710///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
8711///
8712/// <details><summary>JSON schema</summary>
8713///
8714/// ```json
8715///{
8716/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
8717/// "type": "object",
8718/// "properties": {
8719/// "progressToken": {
8720/// "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.",
8721/// "$ref": "#/$defs/ProgressToken"
8722/// }
8723/// },
8724/// "additionalProperties": {}
8725///}
8726/// ```
8727/// </details>
8728#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
8729pub struct TaskAugmentedMeta {
8730 ///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.
8731 #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
8732 pub progress_token: ::std::option::Option<ProgressToken>,
8733 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
8734 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
8735}
8736///Common params for any task-augmented request.
8737///
8738/// <details><summary>JSON schema</summary>
8739///
8740/// ```json
8741///{
8742/// "description": "Common params for any task-augmented request.",
8743/// "type": "object",
8744/// "properties": {
8745/// "_meta": {
8746/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
8747/// "type": "object",
8748/// "properties": {
8749/// "progressToken": {
8750/// "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.",
8751/// "$ref": "#/$defs/ProgressToken"
8752/// }
8753/// },
8754/// "additionalProperties": {}
8755/// },
8756/// "task": {
8757/// "description": "If specified, the caller is requesting task-augmented execution for this request.\nThe request will return a CreateTaskResult immediately, and the actual result can be\nretrieved later via tasks/result.\n\nTask augmentation is subject to capability negotiation - receivers MUST declare support\nfor task augmentation of specific request types in their capabilities.",
8758/// "$ref": "#/$defs/TaskMetadata"
8759/// }
8760/// }
8761///}
8762/// ```
8763/// </details>
8764#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
8765pub struct TaskAugmentedRequestParams {
8766 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
8767 pub meta: ::std::option::Option<TaskAugmentedMeta>,
8768 /**If specified, the caller is requesting task-augmented execution for this request.
8769 The request will return a CreateTaskResult immediately, and the actual result can be
8770 retrieved later via tasks/result.
8771 Task augmentation is subject to capability negotiation - receivers MUST declare support
8772 for task augmentation of specific request types in their capabilities.*/
8773 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8774 pub task: ::std::option::Option<TaskMetadata>,
8775}
8776/**Metadata for augmenting a request with task execution.
8777Include this in the task field of the request parameters.*/
8778///
8779/// <details><summary>JSON schema</summary>
8780///
8781/// ```json
8782///{
8783/// "description": "Metadata for augmenting a request with task execution.\nInclude this in the task field of the request parameters.",
8784/// "type": "object",
8785/// "properties": {
8786/// "ttl": {
8787/// "description": "Requested duration in milliseconds to retain task from creation.",
8788/// "type": "integer"
8789/// }
8790/// }
8791///}
8792/// ```
8793/// </details>
8794#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
8795pub struct TaskMetadata {
8796 ///Requested duration in milliseconds to retain task from creation.
8797 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8798 pub ttl: ::std::option::Option<i64>,
8799}
8800///The status of a task.
8801///
8802/// <details><summary>JSON schema</summary>
8803///
8804/// ```json
8805///{
8806/// "description": "The status of a task.",
8807/// "type": "string",
8808/// "enum": [
8809/// "cancelled",
8810/// "completed",
8811/// "failed",
8812/// "input_required",
8813/// "working"
8814/// ]
8815///}
8816/// ```
8817/// </details>
8818#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
8819pub enum TaskStatus {
8820 #[serde(rename = "cancelled")]
8821 Cancelled,
8822 #[serde(rename = "completed")]
8823 Completed,
8824 #[serde(rename = "failed")]
8825 Failed,
8826 #[serde(rename = "input_required")]
8827 InputRequired,
8828 #[serde(rename = "working")]
8829 Working,
8830}
8831impl ::std::fmt::Display for TaskStatus {
8832 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
8833 match *self {
8834 Self::Cancelled => write!(f, "cancelled"),
8835 Self::Completed => write!(f, "completed"),
8836 Self::Failed => write!(f, "failed"),
8837 Self::InputRequired => write!(f, "input_required"),
8838 Self::Working => write!(f, "working"),
8839 }
8840 }
8841}
8842///An optional notification from the receiver to the requestor, informing them that a task's status has changed. Receivers are not required to send these notifications.
8843///
8844/// <details><summary>JSON schema</summary>
8845///
8846/// ```json
8847///{
8848/// "description": "An optional notification from the receiver to the requestor, informing them that a task's status has changed. Receivers are not required to send these notifications.",
8849/// "type": "object",
8850/// "required": [
8851/// "jsonrpc",
8852/// "method",
8853/// "params"
8854/// ],
8855/// "properties": {
8856/// "jsonrpc": {
8857/// "type": "string",
8858/// "const": "2.0"
8859/// },
8860/// "method": {
8861/// "type": "string",
8862/// "const": "notifications/tasks/status"
8863/// },
8864/// "params": {
8865/// "$ref": "#/$defs/TaskStatusNotificationParams"
8866/// }
8867/// }
8868///}
8869/// ```
8870/// </details>
8871#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8872pub struct TaskStatusNotification {
8873 #[serde(deserialize_with = "validate::task_status_notification_jsonrpc")]
8874 jsonrpc: ::std::string::String,
8875 #[serde(deserialize_with = "validate::task_status_notification_method")]
8876 method: ::std::string::String,
8877 pub params: TaskStatusNotificationParams,
8878}
8879impl TaskStatusNotification {
8880 pub fn new(params: TaskStatusNotificationParams) -> Self {
8881 Self {
8882 jsonrpc: JSONRPC_VERSION.to_string(),
8883 method: "notifications/tasks/status".to_string(),
8884 params,
8885 }
8886 }
8887 pub fn jsonrpc(&self) -> &::std::string::String {
8888 &self.jsonrpc
8889 }
8890 pub fn method(&self) -> &::std::string::String {
8891 &self.method
8892 }
8893 /// returns "notifications/tasks/status"
8894 pub fn method_value() -> &'static str {
8895 "notifications/tasks/status"
8896 }
8897}
8898///Parameters for a notifications/tasks/status notification.
8899///
8900/// <details><summary>JSON schema</summary>
8901///
8902/// ```json
8903///{
8904/// "description": "Parameters for a notifications/tasks/status notification.",
8905/// "allOf": [
8906/// {
8907/// "$ref": "#/$defs/NotificationParams"
8908/// },
8909/// {
8910/// "$ref": "#/$defs/Task"
8911/// }
8912/// ]
8913///}
8914/// ```
8915/// </details>
8916#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8917pub struct TaskStatusNotificationParams {
8918 ///ISO 8601 timestamp when the task was created.
8919 #[serde(rename = "createdAt")]
8920 pub created_at: ::std::string::String,
8921 ///ISO 8601 timestamp when the task was last updated.
8922 #[serde(rename = "lastUpdatedAt")]
8923 pub last_updated_at: ::std::string::String,
8924 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
8925 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
8926 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
8927 ///Suggested polling interval in milliseconds.
8928 #[serde(rename = "pollInterval", default, skip_serializing_if = "::std::option::Option::is_none")]
8929 pub poll_interval: ::std::option::Option<i64>,
8930 pub status: TaskStatus,
8931 /**Optional human-readable message describing the current task state.
8932 This can provide context for any status, including:
8933 - Reasons for "cancelled" status
8934 - Summaries for "completed" status
8935 - Diagnostic information for "failed" status (e.g., error details, what went wrong)*/
8936 #[serde(rename = "statusMessage", default, skip_serializing_if = "::std::option::Option::is_none")]
8937 pub status_message: ::std::option::Option<::std::string::String>,
8938 ///The task identifier.
8939 #[serde(rename = "taskId")]
8940 pub task_id: ::std::string::String,
8941 ///Actual retention duration from creation in milliseconds, null for unlimited.
8942 #[serde(default)]
8943 pub ttl: ::std::option::Option<i64>,
8944}
8945///Text provided to or from an LLM.
8946///
8947/// <details><summary>JSON schema</summary>
8948///
8949/// ```json
8950///{
8951/// "description": "Text provided to or from an LLM.",
8952/// "type": "object",
8953/// "required": [
8954/// "text",
8955/// "type"
8956/// ],
8957/// "properties": {
8958/// "_meta": {
8959/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
8960/// "type": "object",
8961/// "additionalProperties": {}
8962/// },
8963/// "annotations": {
8964/// "description": "Optional annotations for the client.",
8965/// "$ref": "#/$defs/Annotations"
8966/// },
8967/// "text": {
8968/// "description": "The text content of the message.",
8969/// "type": "string"
8970/// },
8971/// "type": {
8972/// "type": "string",
8973/// "const": "text"
8974/// }
8975/// }
8976///}
8977/// ```
8978/// </details>
8979#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
8980pub struct TextContent {
8981 ///Optional annotations for the client.
8982 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
8983 pub annotations: ::std::option::Option<Annotations>,
8984 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
8985 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
8986 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
8987 ///The text content of the message.
8988 pub text: ::std::string::String,
8989 #[serde(rename = "type", deserialize_with = "validate::text_content_type_")]
8990 type_: ::std::string::String,
8991}
8992impl TextContent {
8993 pub fn new(
8994 text: ::std::string::String,
8995 annotations: ::std::option::Option<Annotations>,
8996 meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
8997 ) -> Self {
8998 Self {
8999 annotations,
9000 meta,
9001 text,
9002 type_: "text".to_string(),
9003 }
9004 }
9005 pub fn type_(&self) -> &::std::string::String {
9006 &self.type_
9007 }
9008 /// returns "text"
9009 pub fn type_value() -> &'static str {
9010 "text"
9011 }
9012}
9013///TextResourceContents
9014///
9015/// <details><summary>JSON schema</summary>
9016///
9017/// ```json
9018///{
9019/// "type": "object",
9020/// "required": [
9021/// "text",
9022/// "uri"
9023/// ],
9024/// "properties": {
9025/// "_meta": {
9026/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
9027/// "type": "object",
9028/// "additionalProperties": {}
9029/// },
9030/// "mimeType": {
9031/// "description": "The MIME type of this resource, if known.",
9032/// "type": "string"
9033/// },
9034/// "text": {
9035/// "description": "The text of the item. This must only be set if the item can actually be represented as text (not binary data).",
9036/// "type": "string"
9037/// },
9038/// "uri": {
9039/// "description": "The URI of this resource.",
9040/// "type": "string",
9041/// "format": "uri"
9042/// }
9043/// }
9044///}
9045/// ```
9046/// </details>
9047#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9048pub struct TextResourceContents {
9049 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
9050 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
9051 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
9052 ///The MIME type of this resource, if known.
9053 #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
9054 pub mime_type: ::std::option::Option<::std::string::String>,
9055 ///The text of the item. This must only be set if the item can actually be represented as text (not binary data).
9056 pub text: ::std::string::String,
9057 ///The URI of this resource.
9058 pub uri: ::std::string::String,
9059}
9060///Schema for multiple-selection enumeration with display titles for each option.
9061///
9062/// <details><summary>JSON schema</summary>
9063///
9064/// ```json
9065///{
9066/// "description": "Schema for multiple-selection enumeration with display titles for each option.",
9067/// "type": "object",
9068/// "required": [
9069/// "items",
9070/// "type"
9071/// ],
9072/// "properties": {
9073/// "default": {
9074/// "description": "Optional default value.",
9075/// "type": "array",
9076/// "items": {
9077/// "type": "string"
9078/// }
9079/// },
9080/// "description": {
9081/// "description": "Optional description for the enum field.",
9082/// "type": "string"
9083/// },
9084/// "items": {
9085/// "description": "Schema for array items with enum options and display labels.",
9086/// "type": "object",
9087/// "required": [
9088/// "anyOf"
9089/// ],
9090/// "properties": {
9091/// "anyOf": {
9092/// "description": "Array of enum options with values and display labels.",
9093/// "type": "array",
9094/// "items": {
9095/// "type": "object",
9096/// "required": [
9097/// "const",
9098/// "title"
9099/// ],
9100/// "properties": {
9101/// "const": {
9102/// "description": "The constant enum value.",
9103/// "type": "string"
9104/// },
9105/// "title": {
9106/// "description": "Display title for this option.",
9107/// "type": "string"
9108/// }
9109/// }
9110/// }
9111/// }
9112/// }
9113/// },
9114/// "maxItems": {
9115/// "description": "Maximum number of items to select.",
9116/// "type": "integer"
9117/// },
9118/// "minItems": {
9119/// "description": "Minimum number of items to select.",
9120/// "type": "integer"
9121/// },
9122/// "title": {
9123/// "description": "Optional title for the enum field.",
9124/// "type": "string"
9125/// },
9126/// "type": {
9127/// "type": "string",
9128/// "const": "array"
9129/// }
9130/// }
9131///}
9132/// ```
9133/// </details>
9134#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9135pub struct TitledMultiSelectEnumSchema {
9136 ///Optional default value.
9137 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
9138 pub default: ::std::vec::Vec<::std::string::String>,
9139 ///Optional description for the enum field.
9140 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9141 pub description: ::std::option::Option<::std::string::String>,
9142 pub items: TitledMultiSelectEnumSchemaItems,
9143 ///Maximum number of items to select.
9144 #[serde(rename = "maxItems", default, skip_serializing_if = "::std::option::Option::is_none")]
9145 pub max_items: ::std::option::Option<i64>,
9146 ///Minimum number of items to select.
9147 #[serde(rename = "minItems", default, skip_serializing_if = "::std::option::Option::is_none")]
9148 pub min_items: ::std::option::Option<i64>,
9149 ///Optional title for the enum field.
9150 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9151 pub title: ::std::option::Option<::std::string::String>,
9152 #[serde(rename = "type", deserialize_with = "validate::titled_multi_select_enum_schema_type_")]
9153 type_: ::std::string::String,
9154}
9155impl TitledMultiSelectEnumSchema {
9156 pub fn new(
9157 default: ::std::vec::Vec<::std::string::String>,
9158 items: TitledMultiSelectEnumSchemaItems,
9159 description: ::std::option::Option<::std::string::String>,
9160 max_items: ::std::option::Option<i64>,
9161 min_items: ::std::option::Option<i64>,
9162 title: ::std::option::Option<::std::string::String>,
9163 ) -> Self {
9164 Self {
9165 default,
9166 description,
9167 items,
9168 max_items,
9169 min_items,
9170 title,
9171 type_: "array".to_string(),
9172 }
9173 }
9174 pub fn type_(&self) -> &::std::string::String {
9175 &self.type_
9176 }
9177 /// returns "array"
9178 pub fn type_value() -> &'static str {
9179 "array"
9180 }
9181}
9182///Schema for array items with enum options and display labels.
9183///
9184/// <details><summary>JSON schema</summary>
9185///
9186/// ```json
9187///{
9188/// "description": "Schema for array items with enum options and display labels.",
9189/// "type": "object",
9190/// "required": [
9191/// "anyOf"
9192/// ],
9193/// "properties": {
9194/// "anyOf": {
9195/// "description": "Array of enum options with values and display labels.",
9196/// "type": "array",
9197/// "items": {
9198/// "type": "object",
9199/// "required": [
9200/// "const",
9201/// "title"
9202/// ],
9203/// "properties": {
9204/// "const": {
9205/// "description": "The constant enum value.",
9206/// "type": "string"
9207/// },
9208/// "title": {
9209/// "description": "Display title for this option.",
9210/// "type": "string"
9211/// }
9212/// }
9213/// }
9214/// }
9215/// }
9216///}
9217/// ```
9218/// </details>
9219#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9220pub struct TitledMultiSelectEnumSchemaItems {
9221 ///Array of enum options with values and display labels.
9222 #[serde(rename = "anyOf")]
9223 pub any_of: ::std::vec::Vec<TitledMultiSelectEnumSchemaItemsAnyOfItem>,
9224}
9225///TitledMultiSelectEnumSchemaItemsAnyOfItem
9226///
9227/// <details><summary>JSON schema</summary>
9228///
9229/// ```json
9230///{
9231/// "type": "object",
9232/// "required": [
9233/// "const",
9234/// "title"
9235/// ],
9236/// "properties": {
9237/// "const": {
9238/// "description": "The constant enum value.",
9239/// "type": "string"
9240/// },
9241/// "title": {
9242/// "description": "Display title for this option.",
9243/// "type": "string"
9244/// }
9245/// }
9246///}
9247/// ```
9248/// </details>
9249#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9250pub struct TitledMultiSelectEnumSchemaItemsAnyOfItem {
9251 ///The constant enum value.
9252 #[serde(rename = "const")]
9253 pub const_: ::std::string::String,
9254 ///Display title for this option.
9255 pub title: ::std::string::String,
9256}
9257///Schema for single-selection enumeration with display titles for each option.
9258///
9259/// <details><summary>JSON schema</summary>
9260///
9261/// ```json
9262///{
9263/// "description": "Schema for single-selection enumeration with display titles for each option.",
9264/// "type": "object",
9265/// "required": [
9266/// "oneOf",
9267/// "type"
9268/// ],
9269/// "properties": {
9270/// "default": {
9271/// "description": "Optional default value.",
9272/// "type": "string"
9273/// },
9274/// "description": {
9275/// "description": "Optional description for the enum field.",
9276/// "type": "string"
9277/// },
9278/// "oneOf": {
9279/// "description": "Array of enum options with values and display labels.",
9280/// "type": "array",
9281/// "items": {
9282/// "type": "object",
9283/// "required": [
9284/// "const",
9285/// "title"
9286/// ],
9287/// "properties": {
9288/// "const": {
9289/// "description": "The enum value.",
9290/// "type": "string"
9291/// },
9292/// "title": {
9293/// "description": "Display label for this option.",
9294/// "type": "string"
9295/// }
9296/// }
9297/// }
9298/// },
9299/// "title": {
9300/// "description": "Optional title for the enum field.",
9301/// "type": "string"
9302/// },
9303/// "type": {
9304/// "type": "string",
9305/// "const": "string"
9306/// }
9307/// }
9308///}
9309/// ```
9310/// </details>
9311#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9312pub struct TitledSingleSelectEnumSchema {
9313 ///Optional default value.
9314 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9315 pub default: ::std::option::Option<::std::string::String>,
9316 ///Optional description for the enum field.
9317 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9318 pub description: ::std::option::Option<::std::string::String>,
9319 ///Array of enum options with values and display labels.
9320 #[serde(rename = "oneOf")]
9321 pub one_of: ::std::vec::Vec<TitledSingleSelectEnumSchemaOneOfItem>,
9322 ///Optional title for the enum field.
9323 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9324 pub title: ::std::option::Option<::std::string::String>,
9325 #[serde(rename = "type", deserialize_with = "validate::titled_single_select_enum_schema_type_")]
9326 type_: ::std::string::String,
9327}
9328impl TitledSingleSelectEnumSchema {
9329 pub fn new(
9330 one_of: ::std::vec::Vec<TitledSingleSelectEnumSchemaOneOfItem>,
9331 default: ::std::option::Option<::std::string::String>,
9332 description: ::std::option::Option<::std::string::String>,
9333 title: ::std::option::Option<::std::string::String>,
9334 ) -> Self {
9335 Self {
9336 default,
9337 description,
9338 one_of,
9339 title,
9340 type_: "string".to_string(),
9341 }
9342 }
9343 pub fn type_(&self) -> &::std::string::String {
9344 &self.type_
9345 }
9346 /// returns "string"
9347 pub fn type_value() -> &'static str {
9348 "string"
9349 }
9350}
9351///TitledSingleSelectEnumSchemaOneOfItem
9352///
9353/// <details><summary>JSON schema</summary>
9354///
9355/// ```json
9356///{
9357/// "type": "object",
9358/// "required": [
9359/// "const",
9360/// "title"
9361/// ],
9362/// "properties": {
9363/// "const": {
9364/// "description": "The enum value.",
9365/// "type": "string"
9366/// },
9367/// "title": {
9368/// "description": "Display label for this option.",
9369/// "type": "string"
9370/// }
9371/// }
9372///}
9373/// ```
9374/// </details>
9375#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9376pub struct TitledSingleSelectEnumSchemaOneOfItem {
9377 ///The enum value.
9378 #[serde(rename = "const")]
9379 pub const_: ::std::string::String,
9380 ///Display label for this option.
9381 pub title: ::std::string::String,
9382}
9383///Definition for a tool the client can call.
9384///
9385/// <details><summary>JSON schema</summary>
9386///
9387/// ```json
9388///{
9389/// "description": "Definition for a tool the client can call.",
9390/// "type": "object",
9391/// "required": [
9392/// "inputSchema",
9393/// "name"
9394/// ],
9395/// "properties": {
9396/// "_meta": {
9397/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
9398/// "type": "object",
9399/// "additionalProperties": {}
9400/// },
9401/// "annotations": {
9402/// "description": "Optional additional tool information.\n\nDisplay name precedence order is: title, annotations.title, then name.",
9403/// "$ref": "#/$defs/ToolAnnotations"
9404/// },
9405/// "description": {
9406/// "description": "A human-readable description of the tool.\n\nThis can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a \"hint\" to the model.",
9407/// "type": "string"
9408/// },
9409/// "execution": {
9410/// "description": "Execution-related properties for this tool.",
9411/// "$ref": "#/$defs/ToolExecution"
9412/// },
9413/// "icons": {
9414/// "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
9415/// "type": "array",
9416/// "items": {
9417/// "$ref": "#/$defs/Icon"
9418/// }
9419/// },
9420/// "inputSchema": {
9421/// "description": "A JSON Schema object defining the expected parameters for the tool.",
9422/// "type": "object",
9423/// "required": [
9424/// "type"
9425/// ],
9426/// "properties": {
9427/// "$schema": {
9428/// "type": "string"
9429/// },
9430/// "properties": {
9431/// "type": "object",
9432/// "additionalProperties": {
9433/// "type": "object",
9434/// "additionalProperties": true
9435/// }
9436/// },
9437/// "required": {
9438/// "type": "array",
9439/// "items": {
9440/// "type": "string"
9441/// }
9442/// },
9443/// "type": {
9444/// "type": "string",
9445/// "const": "object"
9446/// }
9447/// }
9448/// },
9449/// "name": {
9450/// "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
9451/// "type": "string"
9452/// },
9453/// "outputSchema": {
9454/// "description": "An optional JSON Schema object defining the structure of the tool's output returned in\nthe structuredContent field of a CallToolResult.\n\nDefaults to JSON Schema 2020-12 when no explicit $schema is provided.\nCurrently restricted to type: \"object\" at the root level.",
9455/// "type": "object",
9456/// "required": [
9457/// "type"
9458/// ],
9459/// "properties": {
9460/// "$schema": {
9461/// "type": "string"
9462/// },
9463/// "properties": {
9464/// "type": "object",
9465/// "additionalProperties": {
9466/// "type": "object",
9467/// "additionalProperties": true
9468/// }
9469/// },
9470/// "required": {
9471/// "type": "array",
9472/// "items": {
9473/// "type": "string"
9474/// }
9475/// },
9476/// "type": {
9477/// "type": "string",
9478/// "const": "object"
9479/// }
9480/// }
9481/// },
9482/// "title": {
9483/// "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
9484/// "type": "string"
9485/// }
9486/// }
9487///}
9488/// ```
9489/// </details>
9490#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9491pub struct Tool {
9492 /**Optional additional tool information.
9493 Display name precedence order is: title, annotations.title, then name.*/
9494 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9495 pub annotations: ::std::option::Option<ToolAnnotations>,
9496 /**A human-readable description of the tool.
9497 This can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a "hint" to the model.*/
9498 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9499 pub description: ::std::option::Option<::std::string::String>,
9500 ///Execution-related properties for this tool.
9501 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9502 pub execution: ::std::option::Option<ToolExecution>,
9503 /**Optional set of sized icons that the client can display in a user interface.
9504 Clients that support rendering icons MUST support at least the following MIME types:
9505 - image/png - PNG images (safe, universal compatibility)
9506 - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
9507 Clients that support rendering icons SHOULD also support:
9508 - image/svg+xml - SVG images (scalable but requires security precautions)
9509 - image/webp - WebP images (modern, efficient format)*/
9510 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
9511 pub icons: ::std::vec::Vec<Icon>,
9512 #[serde(rename = "inputSchema")]
9513 pub input_schema: ToolInputSchema,
9514 ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
9515 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
9516 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
9517 ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
9518 pub name: ::std::string::String,
9519 #[serde(rename = "outputSchema", default, skip_serializing_if = "::std::option::Option::is_none")]
9520 pub output_schema: ::std::option::Option<ToolOutputSchema>,
9521 /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
9522 even by those unfamiliar with domain-specific terminology.
9523 If not provided, the name should be used for display (except for Tool,
9524 where annotations.title should be given precedence over using name,
9525 if present).*/
9526 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9527 pub title: ::std::option::Option<::std::string::String>,
9528}
9529/**Additional properties describing a Tool to clients.
9530NOTE: all properties in ToolAnnotations are **hints**.
9531They are not guaranteed to provide a faithful description of
9532tool behavior (including descriptive properties like title).
9533Clients should never make tool use decisions based on ToolAnnotations
9534received from untrusted servers.*/
9535///
9536/// <details><summary>JSON schema</summary>
9537///
9538/// ```json
9539///{
9540/// "description": "Additional properties describing a Tool to clients.\n\nNOTE: all properties in ToolAnnotations are **hints**.\nThey are not guaranteed to provide a faithful description of\ntool behavior (including descriptive properties like title).\n\nClients should never make tool use decisions based on ToolAnnotations\nreceived from untrusted servers.",
9541/// "type": "object",
9542/// "properties": {
9543/// "destructiveHint": {
9544/// "description": "If true, the tool may perform destructive updates to its environment.\nIf false, the tool performs only additive updates.\n\n(This property is meaningful only when readOnlyHint == false)\n\nDefault: true",
9545/// "type": "boolean"
9546/// },
9547/// "idempotentHint": {
9548/// "description": "If true, calling the tool repeatedly with the same arguments\nwill have no additional effect on its environment.\n\n(This property is meaningful only when readOnlyHint == false)\n\nDefault: false",
9549/// "type": "boolean"
9550/// },
9551/// "openWorldHint": {
9552/// "description": "If true, this tool may interact with an \"open world\" of external\nentities. If false, the tool's domain of interaction is closed.\nFor example, the world of a web search tool is open, whereas that\nof a memory tool is not.\n\nDefault: true",
9553/// "type": "boolean"
9554/// },
9555/// "readOnlyHint": {
9556/// "description": "If true, the tool does not modify its environment.\n\nDefault: false",
9557/// "type": "boolean"
9558/// },
9559/// "title": {
9560/// "description": "A human-readable title for the tool.",
9561/// "type": "string"
9562/// }
9563/// }
9564///}
9565/// ```
9566/// </details>
9567#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
9568pub struct ToolAnnotations {
9569 /**If true, the tool may perform destructive updates to its environment.
9570 If false, the tool performs only additive updates.
9571 (This property is meaningful only when readOnlyHint == false)
9572 Default: true*/
9573 #[serde(rename = "destructiveHint", default, skip_serializing_if = "::std::option::Option::is_none")]
9574 pub destructive_hint: ::std::option::Option<bool>,
9575 /**If true, calling the tool repeatedly with the same arguments
9576 will have no additional effect on its environment.
9577 (This property is meaningful only when readOnlyHint == false)
9578 Default: false*/
9579 #[serde(rename = "idempotentHint", default, skip_serializing_if = "::std::option::Option::is_none")]
9580 pub idempotent_hint: ::std::option::Option<bool>,
9581 /**If true, this tool may interact with an "open world" of external
9582 entities. If false, the tool's domain of interaction is closed.
9583 For example, the world of a web search tool is open, whereas that
9584 of a memory tool is not.
9585 Default: true*/
9586 #[serde(rename = "openWorldHint", default, skip_serializing_if = "::std::option::Option::is_none")]
9587 pub open_world_hint: ::std::option::Option<bool>,
9588 /**If true, the tool does not modify its environment.
9589 Default: false*/
9590 #[serde(rename = "readOnlyHint", default, skip_serializing_if = "::std::option::Option::is_none")]
9591 pub read_only_hint: ::std::option::Option<bool>,
9592 ///A human-readable title for the tool.
9593 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9594 pub title: ::std::option::Option<::std::string::String>,
9595}
9596///Controls tool selection behavior for sampling requests.
9597///
9598/// <details><summary>JSON schema</summary>
9599///
9600/// ```json
9601///{
9602/// "description": "Controls tool selection behavior for sampling requests.",
9603/// "type": "object",
9604/// "properties": {
9605/// "mode": {
9606/// "description": "Controls the tool use ability of the model:\n- \"auto\": Model decides whether to use tools (default)\n- \"required\": Model MUST use at least one tool before completing\n- \"none\": Model MUST NOT use any tools",
9607/// "type": "string",
9608/// "enum": [
9609/// "auto",
9610/// "none",
9611/// "required"
9612/// ]
9613/// }
9614/// }
9615///}
9616/// ```
9617/// </details>
9618#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
9619pub struct ToolChoice {
9620 /**Controls the tool use ability of the model:
9621 - "auto": Model decides whether to use tools (default)
9622 - "required": Model MUST use at least one tool before completing
9623 - "none": Model MUST NOT use any tools*/
9624 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9625 pub mode: ::std::option::Option<ToolChoiceMode>,
9626}
9627/**Controls the tool use ability of the model:
9628- "auto": Model decides whether to use tools (default)
9629- "required": Model MUST use at least one tool before completing
9630- "none": Model MUST NOT use any tools*/
9631///
9632/// <details><summary>JSON schema</summary>
9633///
9634/// ```json
9635///{
9636/// "description": "Controls the tool use ability of the model:\n- \"auto\": Model decides whether to use tools (default)\n- \"required\": Model MUST use at least one tool before completing\n- \"none\": Model MUST NOT use any tools",
9637/// "type": "string",
9638/// "enum": [
9639/// "auto",
9640/// "none",
9641/// "required"
9642/// ]
9643///}
9644/// ```
9645/// </details>
9646#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
9647pub enum ToolChoiceMode {
9648 #[serde(rename = "auto")]
9649 Auto,
9650 #[serde(rename = "none")]
9651 None,
9652 #[serde(rename = "required")]
9653 Required,
9654}
9655impl ::std::fmt::Display for ToolChoiceMode {
9656 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
9657 match *self {
9658 Self::Auto => write!(f, "auto"),
9659 Self::None => write!(f, "none"),
9660 Self::Required => write!(f, "required"),
9661 }
9662 }
9663}
9664///Execution-related properties for a tool.
9665///
9666/// <details><summary>JSON schema</summary>
9667///
9668/// ```json
9669///{
9670/// "description": "Execution-related properties for a tool.",
9671/// "type": "object",
9672/// "properties": {
9673/// "taskSupport": {
9674/// "description": "Indicates whether this tool supports task-augmented execution.\nThis allows clients to handle long-running operations through polling\nthe task system.\n\n- \"forbidden\": Tool does not support task-augmented execution (default when absent)\n- \"optional\": Tool may support task-augmented execution\n- \"required\": Tool requires task-augmented execution\n\nDefault: \"forbidden\"",
9675/// "type": "string",
9676/// "enum": [
9677/// "forbidden",
9678/// "optional",
9679/// "required"
9680/// ]
9681/// }
9682/// }
9683///}
9684/// ```
9685/// </details>
9686#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
9687pub struct ToolExecution {
9688 /**Indicates whether this tool supports task-augmented execution.
9689 This allows clients to handle long-running operations through polling
9690 the task system.
9691 - "forbidden": Tool does not support task-augmented execution (default when absent)
9692 - "optional": Tool may support task-augmented execution
9693 - "required": Tool requires task-augmented execution
9694 "*/
9695 #[serde(rename = "taskSupport", default, skip_serializing_if = "::std::option::Option::is_none")]
9696 pub task_support: ::std::option::Option<ToolExecutionTaskSupport>,
9697}
9698/**Indicates whether this tool supports task-augmented execution.
9699This allows clients to handle long-running operations through polling
9700the task system.
9701- "forbidden": Tool does not support task-augmented execution (default when absent)
9702- "optional": Tool may support task-augmented execution
9703- "required": Tool requires task-augmented execution
9704 "*/
9705///
9706/// <details><summary>JSON schema</summary>
9707///
9708/// ```json
9709///{
9710/// "description": "Indicates whether this tool supports task-augmented execution.\nThis allows clients to handle long-running operations through polling\nthe task system.\n\n- \"forbidden\": Tool does not support task-augmented execution (default when absent)\n- \"optional\": Tool may support task-augmented execution\n- \"required\": Tool requires task-augmented execution\n\nDefault: \"forbidden\"",
9711/// "type": "string",
9712/// "enum": [
9713/// "forbidden",
9714/// "optional",
9715/// "required"
9716/// ]
9717///}
9718/// ```
9719/// </details>
9720#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
9721pub enum ToolExecutionTaskSupport {
9722 #[serde(rename = "forbidden")]
9723 Forbidden,
9724 #[serde(rename = "optional")]
9725 Optional,
9726 #[serde(rename = "required")]
9727 Required,
9728}
9729impl ::std::fmt::Display for ToolExecutionTaskSupport {
9730 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
9731 match *self {
9732 Self::Forbidden => write!(f, "forbidden"),
9733 Self::Optional => write!(f, "optional"),
9734 Self::Required => write!(f, "required"),
9735 }
9736 }
9737}
9738///A JSON Schema object defining the expected parameters for the tool.
9739///
9740/// <details><summary>JSON schema</summary>
9741///
9742/// ```json
9743///{
9744/// "description": "A JSON Schema object defining the expected parameters for the tool.",
9745/// "type": "object",
9746/// "required": [
9747/// "type"
9748/// ],
9749/// "properties": {
9750/// "$schema": {
9751/// "type": "string"
9752/// },
9753/// "properties": {
9754/// "type": "object",
9755/// "additionalProperties": {
9756/// "type": "object",
9757/// "additionalProperties": true
9758/// }
9759/// },
9760/// "required": {
9761/// "type": "array",
9762/// "items": {
9763/// "type": "string"
9764/// }
9765/// },
9766/// "type": {
9767/// "type": "string",
9768/// "const": "object"
9769/// }
9770/// }
9771///}
9772/// ```
9773/// </details>
9774#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9775pub struct ToolInputSchema {
9776 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9777 pub properties: ::std::option::Option<
9778 std::collections::BTreeMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
9779 >,
9780 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
9781 pub required: ::std::vec::Vec<::std::string::String>,
9782 #[serde(rename = "$schema", default, skip_serializing_if = "::std::option::Option::is_none")]
9783 pub schema: ::std::option::Option<::std::string::String>,
9784 #[serde(rename = "type", deserialize_with = "validate::tool_input_schema_type_")]
9785 type_: ::std::string::String,
9786}
9787impl ToolInputSchema {
9788 pub fn new(
9789 required: ::std::vec::Vec<::std::string::String>,
9790 properties: ::std::option::Option<
9791 std::collections::BTreeMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
9792 >,
9793 schema: ::std::option::Option<::std::string::String>,
9794 ) -> Self {
9795 Self {
9796 properties,
9797 required,
9798 schema,
9799 type_: "object".to_string(),
9800 }
9801 }
9802 pub fn type_(&self) -> &::std::string::String {
9803 &self.type_
9804 }
9805 /// returns "object"
9806 pub fn type_value() -> &'static str {
9807 "object"
9808 }
9809}
9810///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.
9811///
9812/// <details><summary>JSON schema</summary>
9813///
9814/// ```json
9815///{
9816/// "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.",
9817/// "type": "object",
9818/// "required": [
9819/// "jsonrpc",
9820/// "method"
9821/// ],
9822/// "properties": {
9823/// "jsonrpc": {
9824/// "type": "string",
9825/// "const": "2.0"
9826/// },
9827/// "method": {
9828/// "type": "string",
9829/// "const": "notifications/tools/list_changed"
9830/// },
9831/// "params": {
9832/// "$ref": "#/$defs/NotificationParams"
9833/// }
9834/// }
9835///}
9836/// ```
9837/// </details>
9838#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9839pub struct ToolListChangedNotification {
9840 #[serde(deserialize_with = "validate::tool_list_changed_notification_jsonrpc")]
9841 jsonrpc: ::std::string::String,
9842 #[serde(deserialize_with = "validate::tool_list_changed_notification_method")]
9843 method: ::std::string::String,
9844 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9845 pub params: ::std::option::Option<NotificationParams>,
9846}
9847impl ToolListChangedNotification {
9848 pub fn new(params: ::std::option::Option<NotificationParams>) -> Self {
9849 Self {
9850 jsonrpc: JSONRPC_VERSION.to_string(),
9851 method: "notifications/tools/list_changed".to_string(),
9852 params,
9853 }
9854 }
9855 pub fn jsonrpc(&self) -> &::std::string::String {
9856 &self.jsonrpc
9857 }
9858 pub fn method(&self) -> &::std::string::String {
9859 &self.method
9860 }
9861 /// returns "notifications/tools/list_changed"
9862 pub fn method_value() -> &'static str {
9863 "notifications/tools/list_changed"
9864 }
9865}
9866/**An optional JSON Schema object defining the structure of the tool's output returned in
9867the structuredContent field of a CallToolResult.
9868Defaults to JSON Schema 2020-12 when no explicit $schema is provided.
9869Currently restricted to type: "object" at the root level.*/
9870///
9871/// <details><summary>JSON schema</summary>
9872///
9873/// ```json
9874///{
9875/// "description": "An optional JSON Schema object defining the structure of the tool's output returned in\nthe structuredContent field of a CallToolResult.\n\nDefaults to JSON Schema 2020-12 when no explicit $schema is provided.\nCurrently restricted to type: \"object\" at the root level.",
9876/// "type": "object",
9877/// "required": [
9878/// "type"
9879/// ],
9880/// "properties": {
9881/// "$schema": {
9882/// "type": "string"
9883/// },
9884/// "properties": {
9885/// "type": "object",
9886/// "additionalProperties": {
9887/// "type": "object",
9888/// "additionalProperties": true
9889/// }
9890/// },
9891/// "required": {
9892/// "type": "array",
9893/// "items": {
9894/// "type": "string"
9895/// }
9896/// },
9897/// "type": {
9898/// "type": "string",
9899/// "const": "object"
9900/// }
9901/// }
9902///}
9903/// ```
9904/// </details>
9905#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9906pub struct ToolOutputSchema {
9907 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
9908 pub properties: ::std::option::Option<
9909 std::collections::BTreeMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
9910 >,
9911 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
9912 pub required: ::std::vec::Vec<::std::string::String>,
9913 #[serde(rename = "$schema", default, skip_serializing_if = "::std::option::Option::is_none")]
9914 pub schema: ::std::option::Option<::std::string::String>,
9915 #[serde(rename = "type", deserialize_with = "validate::tool_output_schema_type_")]
9916 type_: ::std::string::String,
9917}
9918impl ToolOutputSchema {
9919 pub fn new(
9920 required: ::std::vec::Vec<::std::string::String>,
9921 properties: ::std::option::Option<
9922 std::collections::BTreeMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
9923 >,
9924 schema: ::std::option::Option<::std::string::String>,
9925 ) -> Self {
9926 Self {
9927 properties,
9928 required,
9929 schema,
9930 type_: "object".to_string(),
9931 }
9932 }
9933 pub fn type_(&self) -> &::std::string::String {
9934 &self.type_
9935 }
9936 /// returns "object"
9937 pub fn type_value() -> &'static str {
9938 "object"
9939 }
9940}
9941///The result of a tool use, provided by the user back to the assistant.
9942///
9943/// <details><summary>JSON schema</summary>
9944///
9945/// ```json
9946///{
9947/// "description": "The result of a tool use, provided by the user back to the assistant.",
9948/// "type": "object",
9949/// "required": [
9950/// "content",
9951/// "toolUseId",
9952/// "type"
9953/// ],
9954/// "properties": {
9955/// "_meta": {
9956/// "description": "Optional metadata about the tool result. Clients SHOULD preserve this field when\nincluding tool results in subsequent sampling requests to enable caching optimizations.\n\nSee [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
9957/// "type": "object",
9958/// "additionalProperties": {}
9959/// },
9960/// "content": {
9961/// "description": "The unstructured result content of the tool use.\n\nThis has the same format as CallToolResult.content and can include text, images,\naudio, resource links, and embedded resources.",
9962/// "type": "array",
9963/// "items": {
9964/// "$ref": "#/$defs/ContentBlock"
9965/// }
9966/// },
9967/// "isError": {
9968/// "description": "Whether the tool use resulted in an error.\n\nIf true, the content typically describes the error that occurred.\nDefault: false",
9969/// "type": "boolean"
9970/// },
9971/// "structuredContent": {
9972/// "description": "An optional structured result object.\n\nIf the tool defined an outputSchema, this SHOULD conform to that schema.",
9973/// "type": "object",
9974/// "additionalProperties": {}
9975/// },
9976/// "toolUseId": {
9977/// "description": "The ID of the tool use this result corresponds to.\n\nThis MUST match the ID from a previous ToolUseContent.",
9978/// "type": "string"
9979/// },
9980/// "type": {
9981/// "type": "string",
9982/// "const": "tool_result"
9983/// }
9984/// }
9985///}
9986/// ```
9987/// </details>
9988#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
9989pub struct ToolResultContent {
9990 /**The unstructured result content of the tool use.
9991 This has the same format as CallToolResult.content and can include text, images,
9992 audio, resource links, and embedded resources.*/
9993 pub content: ::std::vec::Vec<ContentBlock>,
9994 /**Whether the tool use resulted in an error.
9995 If true, the content typically describes the error that occurred.
9996 Default: false*/
9997 #[serde(rename = "isError", default, skip_serializing_if = "::std::option::Option::is_none")]
9998 pub is_error: ::std::option::Option<bool>,
9999 /**Optional metadata about the tool result. Clients SHOULD preserve this field when
10000 including tool results in subsequent sampling requests to enable caching optimizations.
10001 See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.*/
10002 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
10003 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
10004 /**An optional structured result object.
10005 If the tool defined an outputSchema, this SHOULD conform to that schema.*/
10006 #[serde(
10007 rename = "structuredContent",
10008 default,
10009 skip_serializing_if = "::std::option::Option::is_none"
10010 )]
10011 pub structured_content: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
10012 /**The ID of the tool use this result corresponds to.
10013 This MUST match the ID from a previous ToolUseContent.*/
10014 #[serde(rename = "toolUseId")]
10015 pub tool_use_id: ::std::string::String,
10016 #[serde(rename = "type", deserialize_with = "validate::tool_result_content_type_")]
10017 type_: ::std::string::String,
10018}
10019impl ToolResultContent {
10020 pub fn new(
10021 content: ::std::vec::Vec<ContentBlock>,
10022 tool_use_id: ::std::string::String,
10023 is_error: ::std::option::Option<bool>,
10024 meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
10025 structured_content: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
10026 ) -> Self {
10027 Self {
10028 content,
10029 is_error,
10030 meta,
10031 structured_content,
10032 tool_use_id,
10033 type_: "tool_result".to_string(),
10034 }
10035 }
10036 pub fn type_(&self) -> &::std::string::String {
10037 &self.type_
10038 }
10039 /// returns "tool_result"
10040 pub fn type_value() -> &'static str {
10041 "tool_result"
10042 }
10043}
10044///A request from the assistant to call a tool.
10045///
10046/// <details><summary>JSON schema</summary>
10047///
10048/// ```json
10049///{
10050/// "description": "A request from the assistant to call a tool.",
10051/// "type": "object",
10052/// "required": [
10053/// "id",
10054/// "input",
10055/// "name",
10056/// "type"
10057/// ],
10058/// "properties": {
10059/// "_meta": {
10060/// "description": "Optional metadata about the tool use. Clients SHOULD preserve this field when\nincluding tool uses in subsequent sampling requests to enable caching optimizations.\n\nSee [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
10061/// "type": "object",
10062/// "additionalProperties": {}
10063/// },
10064/// "id": {
10065/// "description": "A unique identifier for this tool use.\n\nThis ID is used to match tool results to their corresponding tool uses.",
10066/// "type": "string"
10067/// },
10068/// "input": {
10069/// "description": "The arguments to pass to the tool, conforming to the tool's input schema.",
10070/// "type": "object",
10071/// "additionalProperties": {}
10072/// },
10073/// "name": {
10074/// "description": "The name of the tool to call.",
10075/// "type": "string"
10076/// },
10077/// "type": {
10078/// "type": "string",
10079/// "const": "tool_use"
10080/// }
10081/// }
10082///}
10083/// ```
10084/// </details>
10085#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10086pub struct ToolUseContent {
10087 /**A unique identifier for this tool use.
10088 This ID is used to match tool results to their corresponding tool uses.*/
10089 pub id: ::std::string::String,
10090 ///The arguments to pass to the tool, conforming to the tool's input schema.
10091 pub input: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
10092 /**Optional metadata about the tool use. Clients SHOULD preserve this field when
10093 including tool uses in subsequent sampling requests to enable caching optimizations.
10094 See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.*/
10095 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
10096 pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
10097 ///The name of the tool to call.
10098 pub name: ::std::string::String,
10099 #[serde(rename = "type", deserialize_with = "validate::tool_use_content_type_")]
10100 type_: ::std::string::String,
10101}
10102impl ToolUseContent {
10103 pub fn new(
10104 id: ::std::string::String,
10105 input: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
10106 name: ::std::string::String,
10107 meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
10108 ) -> Self {
10109 Self {
10110 id,
10111 input,
10112 meta,
10113 name,
10114 type_: "tool_use".to_string(),
10115 }
10116 }
10117 pub fn type_(&self) -> &::std::string::String {
10118 &self.type_
10119 }
10120 /// returns "tool_use"
10121 pub fn type_value() -> &'static str {
10122 "tool_use"
10123 }
10124}
10125///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
10126///
10127/// <details><summary>JSON schema</summary>
10128///
10129/// ```json
10130///{
10131/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
10132/// "type": "object",
10133/// "properties": {
10134/// "progressToken": {
10135/// "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.",
10136/// "$ref": "#/$defs/ProgressToken"
10137/// }
10138/// },
10139/// "additionalProperties": {}
10140///}
10141/// ```
10142/// </details>
10143#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
10144pub struct UnsubscribeMeta {
10145 ///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.
10146 #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
10147 pub progress_token: ::std::option::Option<ProgressToken>,
10148 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
10149 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
10150}
10151///Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
10152///
10153/// <details><summary>JSON schema</summary>
10154///
10155/// ```json
10156///{
10157/// "description": "Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.",
10158/// "type": "object",
10159/// "required": [
10160/// "id",
10161/// "jsonrpc",
10162/// "method",
10163/// "params"
10164/// ],
10165/// "properties": {
10166/// "id": {
10167/// "$ref": "#/$defs/RequestId"
10168/// },
10169/// "jsonrpc": {
10170/// "type": "string",
10171/// "const": "2.0"
10172/// },
10173/// "method": {
10174/// "type": "string",
10175/// "const": "resources/unsubscribe"
10176/// },
10177/// "params": {
10178/// "$ref": "#/$defs/UnsubscribeRequestParams"
10179/// }
10180/// }
10181///}
10182/// ```
10183/// </details>
10184#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10185pub struct UnsubscribeRequest {
10186 pub id: RequestId,
10187 #[serde(deserialize_with = "validate::unsubscribe_request_jsonrpc")]
10188 jsonrpc: ::std::string::String,
10189 #[serde(deserialize_with = "validate::unsubscribe_request_method")]
10190 method: ::std::string::String,
10191 pub params: UnsubscribeRequestParams,
10192}
10193impl UnsubscribeRequest {
10194 pub fn new(id: RequestId, params: UnsubscribeRequestParams) -> Self {
10195 Self {
10196 id,
10197 jsonrpc: JSONRPC_VERSION.to_string(),
10198 method: "resources/unsubscribe".to_string(),
10199 params,
10200 }
10201 }
10202 pub fn jsonrpc(&self) -> &::std::string::String {
10203 &self.jsonrpc
10204 }
10205 pub fn method(&self) -> &::std::string::String {
10206 &self.method
10207 }
10208 /// returns "resources/unsubscribe"
10209 pub fn method_value() -> &'static str {
10210 "resources/unsubscribe"
10211 }
10212}
10213///Parameters for a resources/unsubscribe request.
10214///
10215/// <details><summary>JSON schema</summary>
10216///
10217/// ```json
10218///{
10219/// "description": "Parameters for a resources/unsubscribe request.",
10220/// "type": "object",
10221/// "required": [
10222/// "uri"
10223/// ],
10224/// "properties": {
10225/// "_meta": {
10226/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
10227/// "type": "object",
10228/// "properties": {
10229/// "progressToken": {
10230/// "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.",
10231/// "$ref": "#/$defs/ProgressToken"
10232/// }
10233/// },
10234/// "additionalProperties": {}
10235/// },
10236/// "uri": {
10237/// "description": "The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.",
10238/// "type": "string",
10239/// "format": "uri"
10240/// }
10241/// }
10242///}
10243/// ```
10244/// </details>
10245#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10246pub struct UnsubscribeRequestParams {
10247 #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
10248 pub meta: ::std::option::Option<UnsubscribeMeta>,
10249 ///The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.
10250 pub uri: ::std::string::String,
10251}
10252///Schema for multiple-selection enumeration without display titles for options.
10253///
10254/// <details><summary>JSON schema</summary>
10255///
10256/// ```json
10257///{
10258/// "description": "Schema for multiple-selection enumeration without display titles for options.",
10259/// "type": "object",
10260/// "required": [
10261/// "items",
10262/// "type"
10263/// ],
10264/// "properties": {
10265/// "default": {
10266/// "description": "Optional default value.",
10267/// "type": "array",
10268/// "items": {
10269/// "type": "string"
10270/// }
10271/// },
10272/// "description": {
10273/// "description": "Optional description for the enum field.",
10274/// "type": "string"
10275/// },
10276/// "items": {
10277/// "description": "Schema for the array items.",
10278/// "type": "object",
10279/// "required": [
10280/// "enum",
10281/// "type"
10282/// ],
10283/// "properties": {
10284/// "enum": {
10285/// "description": "Array of enum values to choose from.",
10286/// "type": "array",
10287/// "items": {
10288/// "type": "string"
10289/// }
10290/// },
10291/// "type": {
10292/// "type": "string",
10293/// "const": "string"
10294/// }
10295/// }
10296/// },
10297/// "maxItems": {
10298/// "description": "Maximum number of items to select.",
10299/// "type": "integer"
10300/// },
10301/// "minItems": {
10302/// "description": "Minimum number of items to select.",
10303/// "type": "integer"
10304/// },
10305/// "title": {
10306/// "description": "Optional title for the enum field.",
10307/// "type": "string"
10308/// },
10309/// "type": {
10310/// "type": "string",
10311/// "const": "array"
10312/// }
10313/// }
10314///}
10315/// ```
10316/// </details>
10317#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10318pub struct UntitledMultiSelectEnumSchema {
10319 ///Optional default value.
10320 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
10321 pub default: ::std::vec::Vec<::std::string::String>,
10322 ///Optional description for the enum field.
10323 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
10324 pub description: ::std::option::Option<::std::string::String>,
10325 pub items: UntitledMultiSelectEnumSchemaItems,
10326 ///Maximum number of items to select.
10327 #[serde(rename = "maxItems", default, skip_serializing_if = "::std::option::Option::is_none")]
10328 pub max_items: ::std::option::Option<i64>,
10329 ///Minimum number of items to select.
10330 #[serde(rename = "minItems", default, skip_serializing_if = "::std::option::Option::is_none")]
10331 pub min_items: ::std::option::Option<i64>,
10332 ///Optional title for the enum field.
10333 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
10334 pub title: ::std::option::Option<::std::string::String>,
10335 #[serde(rename = "type", deserialize_with = "validate::untitled_multi_select_enum_schema_type_")]
10336 type_: ::std::string::String,
10337}
10338impl UntitledMultiSelectEnumSchema {
10339 pub fn new(
10340 default: ::std::vec::Vec<::std::string::String>,
10341 items: UntitledMultiSelectEnumSchemaItems,
10342 description: ::std::option::Option<::std::string::String>,
10343 max_items: ::std::option::Option<i64>,
10344 min_items: ::std::option::Option<i64>,
10345 title: ::std::option::Option<::std::string::String>,
10346 ) -> Self {
10347 Self {
10348 default,
10349 description,
10350 items,
10351 max_items,
10352 min_items,
10353 title,
10354 type_: "array".to_string(),
10355 }
10356 }
10357 pub fn type_(&self) -> &::std::string::String {
10358 &self.type_
10359 }
10360 /// returns "array"
10361 pub fn type_value() -> &'static str {
10362 "array"
10363 }
10364}
10365///Schema for the array items.
10366///
10367/// <details><summary>JSON schema</summary>
10368///
10369/// ```json
10370///{
10371/// "description": "Schema for the array items.",
10372/// "type": "object",
10373/// "required": [
10374/// "enum",
10375/// "type"
10376/// ],
10377/// "properties": {
10378/// "enum": {
10379/// "description": "Array of enum values to choose from.",
10380/// "type": "array",
10381/// "items": {
10382/// "type": "string"
10383/// }
10384/// },
10385/// "type": {
10386/// "type": "string",
10387/// "const": "string"
10388/// }
10389/// }
10390///}
10391/// ```
10392/// </details>
10393#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10394pub struct UntitledMultiSelectEnumSchemaItems {
10395 ///Array of enum values to choose from.
10396 #[serde(rename = "enum")]
10397 pub enum_: ::std::vec::Vec<::std::string::String>,
10398 #[serde(
10399 rename = "type",
10400 deserialize_with = "validate::untitled_multi_select_enum_schema_items_type_"
10401 )]
10402 type_: ::std::string::String,
10403}
10404impl UntitledMultiSelectEnumSchemaItems {
10405 pub fn new(enum_: ::std::vec::Vec<::std::string::String>) -> Self {
10406 Self {
10407 enum_,
10408 type_: "string".to_string(),
10409 }
10410 }
10411 pub fn type_(&self) -> &::std::string::String {
10412 &self.type_
10413 }
10414 /// returns "string"
10415 pub fn type_value() -> &'static str {
10416 "string"
10417 }
10418}
10419///Schema for single-selection enumeration without display titles for options.
10420///
10421/// <details><summary>JSON schema</summary>
10422///
10423/// ```json
10424///{
10425/// "description": "Schema for single-selection enumeration without display titles for options.",
10426/// "type": "object",
10427/// "required": [
10428/// "enum",
10429/// "type"
10430/// ],
10431/// "properties": {
10432/// "default": {
10433/// "description": "Optional default value.",
10434/// "type": "string"
10435/// },
10436/// "description": {
10437/// "description": "Optional description for the enum field.",
10438/// "type": "string"
10439/// },
10440/// "enum": {
10441/// "description": "Array of enum values to choose from.",
10442/// "type": "array",
10443/// "items": {
10444/// "type": "string"
10445/// }
10446/// },
10447/// "title": {
10448/// "description": "Optional title for the enum field.",
10449/// "type": "string"
10450/// },
10451/// "type": {
10452/// "type": "string",
10453/// "const": "string"
10454/// }
10455/// }
10456///}
10457/// ```
10458/// </details>
10459#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10460pub struct UntitledSingleSelectEnumSchema {
10461 ///Optional default value.
10462 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
10463 pub default: ::std::option::Option<::std::string::String>,
10464 ///Optional description for the enum field.
10465 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
10466 pub description: ::std::option::Option<::std::string::String>,
10467 ///Array of enum values to choose from.
10468 #[serde(rename = "enum")]
10469 pub enum_: ::std::vec::Vec<::std::string::String>,
10470 ///Optional title for the enum field.
10471 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
10472 pub title: ::std::option::Option<::std::string::String>,
10473 #[serde(rename = "type", deserialize_with = "validate::untitled_single_select_enum_schema_type_")]
10474 type_: ::std::string::String,
10475}
10476impl UntitledSingleSelectEnumSchema {
10477 pub fn new(
10478 enum_: ::std::vec::Vec<::std::string::String>,
10479 default: ::std::option::Option<::std::string::String>,
10480 description: ::std::option::Option<::std::string::String>,
10481 title: ::std::option::Option<::std::string::String>,
10482 ) -> Self {
10483 Self {
10484 default,
10485 description,
10486 enum_,
10487 title,
10488 type_: "string".to_string(),
10489 }
10490 }
10491 pub fn type_(&self) -> &::std::string::String {
10492 &self.type_
10493 }
10494 /// returns "string"
10495 pub fn type_value() -> &'static str {
10496 "string"
10497 }
10498}
10499///UrlElicitError
10500///
10501/// <details><summary>JSON schema</summary>
10502///
10503/// ```json
10504///{
10505/// "allOf": [
10506/// {
10507/// "$ref": "#/$defs/Error"
10508/// },
10509/// {
10510/// "type": "object",
10511/// "required": [
10512/// "code",
10513/// "data"
10514/// ],
10515/// "properties": {
10516/// "code": {
10517/// "type": "integer"
10518/// },
10519/// "data": {
10520/// "type": "object",
10521/// "required": [
10522/// "elicitations"
10523/// ],
10524/// "properties": {
10525/// "elicitations": {
10526/// "type": "array",
10527/// "items": {
10528/// "$ref": "#/$defs/ElicitRequestURLParams"
10529/// }
10530/// }
10531/// },
10532/// "additionalProperties": {}
10533/// }
10534/// }
10535/// }
10536/// ]
10537///}
10538/// ```
10539/// </details>
10540#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10541pub struct UrlElicitError {
10542 #[serde(deserialize_with = "validate::url_elicit_error_code")]
10543 code: i64,
10544 pub data: UrlElicitErrorData,
10545 ///A short description of the error. The message SHOULD be limited to a concise single sentence.
10546 pub message: ::std::string::String,
10547}
10548impl UrlElicitError {
10549 pub fn new(data: UrlElicitErrorData, message: ::std::string::String) -> Self {
10550 Self {
10551 code: -32042i64,
10552 data,
10553 message,
10554 }
10555 }
10556 pub fn code(&self) -> &i64 {
10557 &self.code
10558 }
10559 /// returns -32042i64
10560 pub fn code_value() -> i64 {
10561 -32042i64
10562 }
10563}
10564///UrlElicitErrorData
10565///
10566/// <details><summary>JSON schema</summary>
10567///
10568/// ```json
10569///{
10570/// "type": "object",
10571/// "required": [
10572/// "elicitations"
10573/// ],
10574/// "properties": {
10575/// "elicitations": {
10576/// "type": "array",
10577/// "items": {
10578/// "$ref": "#/$defs/ElicitRequestURLParams"
10579/// }
10580/// }
10581/// },
10582/// "additionalProperties": {}
10583///}
10584/// ```
10585/// </details>
10586#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10587pub struct UrlElicitErrorData {
10588 pub elicitations: ::std::vec::Vec<ElicitRequestUrlParams>,
10589 #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
10590 pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
10591}
10592///An error response that indicates that the server requires the client to provide additional information via an elicitation request.
10593///
10594/// <details><summary>JSON schema</summary>
10595///
10596/// ```json
10597///{
10598/// "description": "An error response that indicates that the server requires the client to provide additional information via an elicitation request.",
10599/// "type": "object",
10600/// "required": [
10601/// "error",
10602/// "jsonrpc"
10603/// ],
10604/// "properties": {
10605/// "error": {
10606/// "allOf": [
10607/// {
10608/// "$ref": "#/$defs/Error"
10609/// },
10610/// {
10611/// "type": "object",
10612/// "required": [
10613/// "code",
10614/// "data"
10615/// ],
10616/// "properties": {
10617/// "code": {
10618/// "type": "integer"
10619/// },
10620/// "data": {
10621/// "type": "object",
10622/// "required": [
10623/// "elicitations"
10624/// ],
10625/// "properties": {
10626/// "elicitations": {
10627/// "type": "array",
10628/// "items": {
10629/// "$ref": "#/$defs/ElicitRequestURLParams"
10630/// }
10631/// }
10632/// },
10633/// "additionalProperties": {}
10634/// }
10635/// }
10636/// }
10637/// ]
10638/// },
10639/// "id": {
10640/// "$ref": "#/$defs/RequestId"
10641/// },
10642/// "jsonrpc": {
10643/// "type": "string",
10644/// "const": "2.0"
10645/// }
10646/// }
10647///}
10648/// ```
10649/// </details>
10650#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
10651pub struct UrlElicitationRequiredError {
10652 pub error: UrlElicitError,
10653 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
10654 pub id: ::std::option::Option<RequestId>,
10655 #[serde(deserialize_with = "validate::url_elicitation_required_error_jsonrpc")]
10656 jsonrpc: ::std::string::String,
10657}
10658impl UrlElicitationRequiredError {
10659 pub fn new(error: UrlElicitError, id: ::std::option::Option<RequestId>) -> Self {
10660 Self {
10661 error,
10662 id,
10663 jsonrpc: JSONRPC_VERSION.to_string(),
10664 }
10665 }
10666 pub fn jsonrpc(&self) -> &::std::string::String {
10667 &self.jsonrpc
10668 }
10669}
10670/// Implementing the Deserialize trait
10671/// This allows enum to be deserialized into correct type based on the value of the "method"
10672impl<'de> serde::Deserialize<'de> for ClientRequest {
10673 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10674 where
10675 D: serde::Deserializer<'de>,
10676 {
10677 let value: serde_json::Value = serde::Deserialize::deserialize(deserializer)?;
10678 let method_option = value.get("method").and_then(|v| v.as_str());
10679 if let Some(method) = method_option {
10680 match method {
10681 "initialize" => {
10682 let req = serde_json::from_value::<InitializeRequest>(value).map_err(serde::de::Error::custom)?;
10683 Ok(ClientRequest::InitializeRequest(req))
10684 }
10685 "ping" => {
10686 let req = serde_json::from_value::<PingRequest>(value).map_err(serde::de::Error::custom)?;
10687 Ok(ClientRequest::PingRequest(req))
10688 }
10689 "resources/list" => {
10690 let req = serde_json::from_value::<ListResourcesRequest>(value).map_err(serde::de::Error::custom)?;
10691 Ok(ClientRequest::ListResourcesRequest(req))
10692 }
10693 "resources/templates/list" => {
10694 let req =
10695 serde_json::from_value::<ListResourceTemplatesRequest>(value).map_err(serde::de::Error::custom)?;
10696 Ok(ClientRequest::ListResourceTemplatesRequest(req))
10697 }
10698 "resources/read" => {
10699 let req = serde_json::from_value::<ReadResourceRequest>(value).map_err(serde::de::Error::custom)?;
10700 Ok(ClientRequest::ReadResourceRequest(req))
10701 }
10702 "resources/subscribe" => {
10703 let req = serde_json::from_value::<SubscribeRequest>(value).map_err(serde::de::Error::custom)?;
10704 Ok(ClientRequest::SubscribeRequest(req))
10705 }
10706 "resources/unsubscribe" => {
10707 let req = serde_json::from_value::<UnsubscribeRequest>(value).map_err(serde::de::Error::custom)?;
10708 Ok(ClientRequest::UnsubscribeRequest(req))
10709 }
10710 "prompts/list" => {
10711 let req = serde_json::from_value::<ListPromptsRequest>(value).map_err(serde::de::Error::custom)?;
10712 Ok(ClientRequest::ListPromptsRequest(req))
10713 }
10714 "prompts/get" => {
10715 let req = serde_json::from_value::<GetPromptRequest>(value).map_err(serde::de::Error::custom)?;
10716 Ok(ClientRequest::GetPromptRequest(req))
10717 }
10718 "tools/list" => {
10719 let req = serde_json::from_value::<ListToolsRequest>(value).map_err(serde::de::Error::custom)?;
10720 Ok(ClientRequest::ListToolsRequest(req))
10721 }
10722 "tools/call" => {
10723 let req = serde_json::from_value::<CallToolRequest>(value).map_err(serde::de::Error::custom)?;
10724 Ok(ClientRequest::CallToolRequest(req))
10725 }
10726 "tasks/get" => {
10727 let req = serde_json::from_value::<GetTaskRequest>(value).map_err(serde::de::Error::custom)?;
10728 Ok(ClientRequest::GetTaskRequest(req))
10729 }
10730 "tasks/result" => {
10731 let req = serde_json::from_value::<GetTaskPayloadRequest>(value).map_err(serde::de::Error::custom)?;
10732 Ok(ClientRequest::GetTaskPayloadRequest(req))
10733 }
10734 "tasks/cancel" => {
10735 let req = serde_json::from_value::<CancelTaskRequest>(value).map_err(serde::de::Error::custom)?;
10736 Ok(ClientRequest::CancelTaskRequest(req))
10737 }
10738 "tasks/list" => {
10739 let req = serde_json::from_value::<ListTasksRequest>(value).map_err(serde::de::Error::custom)?;
10740 Ok(ClientRequest::ListTasksRequest(req))
10741 }
10742 "logging/setLevel" => {
10743 let req = serde_json::from_value::<SetLevelRequest>(value).map_err(serde::de::Error::custom)?;
10744 Ok(ClientRequest::SetLevelRequest(req))
10745 }
10746 "completion/complete" => {
10747 let req = serde_json::from_value::<CompleteRequest>(value).map_err(serde::de::Error::custom)?;
10748 Ok(ClientRequest::CompleteRequest(req))
10749 }
10750 _ => Err(serde::de::Error::unknown_variant("method", &[""])),
10751 }
10752 } else {
10753 Err(serde::de::Error::missing_field("method"))
10754 }
10755 }
10756}
10757impl ClientRequest {
10758 pub fn method(&self) -> &str {
10759 match self {
10760 ClientRequest::InitializeRequest(request) => request.method(),
10761 ClientRequest::PingRequest(request) => request.method(),
10762 ClientRequest::ListResourcesRequest(request) => request.method(),
10763 ClientRequest::ListResourceTemplatesRequest(request) => request.method(),
10764 ClientRequest::ReadResourceRequest(request) => request.method(),
10765 ClientRequest::SubscribeRequest(request) => request.method(),
10766 ClientRequest::UnsubscribeRequest(request) => request.method(),
10767 ClientRequest::ListPromptsRequest(request) => request.method(),
10768 ClientRequest::GetPromptRequest(request) => request.method(),
10769 ClientRequest::ListToolsRequest(request) => request.method(),
10770 ClientRequest::CallToolRequest(request) => request.method(),
10771 ClientRequest::GetTaskRequest(request) => request.method(),
10772 ClientRequest::GetTaskPayloadRequest(request) => request.method(),
10773 ClientRequest::CancelTaskRequest(request) => request.method(),
10774 ClientRequest::ListTasksRequest(request) => request.method(),
10775 ClientRequest::SetLevelRequest(request) => request.method(),
10776 ClientRequest::CompleteRequest(request) => request.method(),
10777 }
10778 }
10779}
10780/// Implementing the Deserialize trait
10781/// This allows enum to be deserialized into correct type based on the value of the "method"
10782impl<'de> serde::Deserialize<'de> for ClientNotification {
10783 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10784 where
10785 D: serde::Deserializer<'de>,
10786 {
10787 let value: serde_json::Value = serde::Deserialize::deserialize(deserializer)?;
10788 let method_option = value.get("method").and_then(|v| v.as_str());
10789 if let Some(method) = method_option {
10790 match method {
10791 "notifications/cancelled" => {
10792 let req = serde_json::from_value::<CancelledNotification>(value).map_err(serde::de::Error::custom)?;
10793 Ok(ClientNotification::CancelledNotification(req))
10794 }
10795 "notifications/initialized" => {
10796 let req = serde_json::from_value::<InitializedNotification>(value).map_err(serde::de::Error::custom)?;
10797 Ok(ClientNotification::InitializedNotification(req))
10798 }
10799 "notifications/progress" => {
10800 let req = serde_json::from_value::<ProgressNotification>(value).map_err(serde::de::Error::custom)?;
10801 Ok(ClientNotification::ProgressNotification(req))
10802 }
10803 "notifications/tasks/status" => {
10804 let req = serde_json::from_value::<TaskStatusNotification>(value).map_err(serde::de::Error::custom)?;
10805 Ok(ClientNotification::TaskStatusNotification(req))
10806 }
10807 "notifications/roots/list_changed" => {
10808 let req =
10809 serde_json::from_value::<RootsListChangedNotification>(value).map_err(serde::de::Error::custom)?;
10810 Ok(ClientNotification::RootsListChangedNotification(req))
10811 }
10812 _ => Err(serde::de::Error::unknown_variant("method", &[""])),
10813 }
10814 } else {
10815 Err(serde::de::Error::missing_field("method"))
10816 }
10817 }
10818}
10819impl ClientNotification {
10820 pub fn method(&self) -> &str {
10821 match self {
10822 ClientNotification::CancelledNotification(request) => request.method(),
10823 ClientNotification::InitializedNotification(request) => request.method(),
10824 ClientNotification::ProgressNotification(request) => request.method(),
10825 ClientNotification::TaskStatusNotification(request) => request.method(),
10826 ClientNotification::RootsListChangedNotification(request) => request.method(),
10827 }
10828 }
10829}
10830/// Implementing the Deserialize trait
10831/// This allows enum to be deserialized into correct type based on the value of the "method"
10832impl<'de> serde::Deserialize<'de> for ServerRequest {
10833 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10834 where
10835 D: serde::Deserializer<'de>,
10836 {
10837 let value: serde_json::Value = serde::Deserialize::deserialize(deserializer)?;
10838 let method_option = value.get("method").and_then(|v| v.as_str());
10839 if let Some(method) = method_option {
10840 match method {
10841 "ping" => {
10842 let req = serde_json::from_value::<PingRequest>(value).map_err(serde::de::Error::custom)?;
10843 Ok(ServerRequest::PingRequest(req))
10844 }
10845 "tasks/get" => {
10846 let req = serde_json::from_value::<GetTaskRequest>(value).map_err(serde::de::Error::custom)?;
10847 Ok(ServerRequest::GetTaskRequest(req))
10848 }
10849 "tasks/result" => {
10850 let req = serde_json::from_value::<GetTaskPayloadRequest>(value).map_err(serde::de::Error::custom)?;
10851 Ok(ServerRequest::GetTaskPayloadRequest(req))
10852 }
10853 "tasks/cancel" => {
10854 let req = serde_json::from_value::<CancelTaskRequest>(value).map_err(serde::de::Error::custom)?;
10855 Ok(ServerRequest::CancelTaskRequest(req))
10856 }
10857 "tasks/list" => {
10858 let req = serde_json::from_value::<ListTasksRequest>(value).map_err(serde::de::Error::custom)?;
10859 Ok(ServerRequest::ListTasksRequest(req))
10860 }
10861 "sampling/createMessage" => {
10862 let req = serde_json::from_value::<CreateMessageRequest>(value).map_err(serde::de::Error::custom)?;
10863 Ok(ServerRequest::CreateMessageRequest(req))
10864 }
10865 "roots/list" => {
10866 let req = serde_json::from_value::<ListRootsRequest>(value).map_err(serde::de::Error::custom)?;
10867 Ok(ServerRequest::ListRootsRequest(req))
10868 }
10869 "elicitation/create" => {
10870 let req = serde_json::from_value::<ElicitRequest>(value).map_err(serde::de::Error::custom)?;
10871 Ok(ServerRequest::ElicitRequest(req))
10872 }
10873 _ => Err(serde::de::Error::unknown_variant("method", &[""])),
10874 }
10875 } else {
10876 Err(serde::de::Error::missing_field("method"))
10877 }
10878 }
10879}
10880impl ServerRequest {
10881 pub fn method(&self) -> &str {
10882 match self {
10883 ServerRequest::PingRequest(request) => request.method(),
10884 ServerRequest::GetTaskRequest(request) => request.method(),
10885 ServerRequest::GetTaskPayloadRequest(request) => request.method(),
10886 ServerRequest::CancelTaskRequest(request) => request.method(),
10887 ServerRequest::ListTasksRequest(request) => request.method(),
10888 ServerRequest::CreateMessageRequest(request) => request.method(),
10889 ServerRequest::ListRootsRequest(request) => request.method(),
10890 ServerRequest::ElicitRequest(request) => request.method(),
10891 }
10892 }
10893}
10894/// Implementing the Deserialize trait
10895/// This allows enum to be deserialized into correct type based on the value of the "method"
10896impl<'de> serde::Deserialize<'de> for ServerNotification {
10897 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10898 where
10899 D: serde::Deserializer<'de>,
10900 {
10901 let value: serde_json::Value = serde::Deserialize::deserialize(deserializer)?;
10902 let method_option = value.get("method").and_then(|v| v.as_str());
10903 if let Some(method) = method_option {
10904 match method {
10905 "notifications/cancelled" => {
10906 let req = serde_json::from_value::<CancelledNotification>(value).map_err(serde::de::Error::custom)?;
10907 Ok(ServerNotification::CancelledNotification(req))
10908 }
10909 "notifications/progress" => {
10910 let req = serde_json::from_value::<ProgressNotification>(value).map_err(serde::de::Error::custom)?;
10911 Ok(ServerNotification::ProgressNotification(req))
10912 }
10913 "notifications/resources/list_changed" => {
10914 let req = serde_json::from_value::<ResourceListChangedNotification>(value)
10915 .map_err(serde::de::Error::custom)?;
10916 Ok(ServerNotification::ResourceListChangedNotification(req))
10917 }
10918 "notifications/resources/updated" => {
10919 let req =
10920 serde_json::from_value::<ResourceUpdatedNotification>(value).map_err(serde::de::Error::custom)?;
10921 Ok(ServerNotification::ResourceUpdatedNotification(req))
10922 }
10923 "notifications/prompts/list_changed" => {
10924 let req =
10925 serde_json::from_value::<PromptListChangedNotification>(value).map_err(serde::de::Error::custom)?;
10926 Ok(ServerNotification::PromptListChangedNotification(req))
10927 }
10928 "notifications/tools/list_changed" => {
10929 let req =
10930 serde_json::from_value::<ToolListChangedNotification>(value).map_err(serde::de::Error::custom)?;
10931 Ok(ServerNotification::ToolListChangedNotification(req))
10932 }
10933 "notifications/tasks/status" => {
10934 let req = serde_json::from_value::<TaskStatusNotification>(value).map_err(serde::de::Error::custom)?;
10935 Ok(ServerNotification::TaskStatusNotification(req))
10936 }
10937 "notifications/message" => {
10938 let req =
10939 serde_json::from_value::<LoggingMessageNotification>(value).map_err(serde::de::Error::custom)?;
10940 Ok(ServerNotification::LoggingMessageNotification(req))
10941 }
10942 "notifications/elicitation/complete" => {
10943 let req = serde_json::from_value::<ElicitationCompleteNotification>(value)
10944 .map_err(serde::de::Error::custom)?;
10945 Ok(ServerNotification::ElicitationCompleteNotification(req))
10946 }
10947 _ => Err(serde::de::Error::unknown_variant("method", &[""])),
10948 }
10949 } else {
10950 Err(serde::de::Error::missing_field("method"))
10951 }
10952 }
10953}
10954impl ServerNotification {
10955 pub fn method(&self) -> &str {
10956 match self {
10957 ServerNotification::CancelledNotification(request) => request.method(),
10958 ServerNotification::ProgressNotification(request) => request.method(),
10959 ServerNotification::ResourceListChangedNotification(request) => request.method(),
10960 ServerNotification::ResourceUpdatedNotification(request) => request.method(),
10961 ServerNotification::PromptListChangedNotification(request) => request.method(),
10962 ServerNotification::ToolListChangedNotification(request) => request.method(),
10963 ServerNotification::TaskStatusNotification(request) => request.method(),
10964 ServerNotification::LoggingMessageNotification(request) => request.method(),
10965 ServerNotification::ElicitationCompleteNotification(request) => request.method(),
10966 }
10967 }
10968}
10969/// Converts any serializable struct into a `GenericResult`.
10970/// This is used internally to convert ServerResult and ClientResult variants
10971/// into GenericResult (Result)
10972fn into_result<T>(value: T) -> GenericResult
10973where
10974 T: serde::Serialize,
10975{
10976 let json_value = serde_json::to_value(value).unwrap_or(serde_json::Value::Null);
10977 if let serde_json::Value::Object(mut map) = json_value {
10978 let meta = map.remove("_meta").and_then(|v| match v {
10979 serde_json::Value::Object(obj) => Some(obj),
10980 _ => None,
10981 });
10982 let extra = if map.is_empty() { None } else { Some(map) };
10983 GenericResult { meta, extra }
10984 } else {
10985 GenericResult { meta: None, extra: None }
10986 }
10987}
10988impl From<InitializeResult> for GenericResult {
10989 fn from(value: InitializeResult) -> Self {
10990 into_result(value)
10991 }
10992}
10993impl From<ListResourcesResult> for GenericResult {
10994 fn from(value: ListResourcesResult) -> Self {
10995 into_result(value)
10996 }
10997}
10998impl From<ListResourceTemplatesResult> for GenericResult {
10999 fn from(value: ListResourceTemplatesResult) -> Self {
11000 into_result(value)
11001 }
11002}
11003impl From<ReadResourceResult> for GenericResult {
11004 fn from(value: ReadResourceResult) -> Self {
11005 into_result(value)
11006 }
11007}
11008impl From<ListPromptsResult> for GenericResult {
11009 fn from(value: ListPromptsResult) -> Self {
11010 into_result(value)
11011 }
11012}
11013impl From<GetPromptResult> for GenericResult {
11014 fn from(value: GetPromptResult) -> Self {
11015 into_result(value)
11016 }
11017}
11018impl From<ListToolsResult> for GenericResult {
11019 fn from(value: ListToolsResult) -> Self {
11020 into_result(value)
11021 }
11022}
11023impl From<CallToolResult> for GenericResult {
11024 fn from(value: CallToolResult) -> Self {
11025 into_result(value)
11026 }
11027}
11028impl From<GetTaskResult> for GenericResult {
11029 fn from(value: GetTaskResult) -> Self {
11030 into_result(value)
11031 }
11032}
11033impl From<GetTaskPayloadResult> for GenericResult {
11034 fn from(value: GetTaskPayloadResult) -> Self {
11035 into_result(value)
11036 }
11037}
11038impl From<CancelTaskResult> for GenericResult {
11039 fn from(value: CancelTaskResult) -> Self {
11040 into_result(value)
11041 }
11042}
11043impl From<ListTasksResult> for GenericResult {
11044 fn from(value: ListTasksResult) -> Self {
11045 into_result(value)
11046 }
11047}
11048impl From<CompleteResult> for GenericResult {
11049 fn from(value: CompleteResult) -> Self {
11050 into_result(value)
11051 }
11052}
11053/// Alias to avoid conflicts with Rust's standard `Result` type.
11054pub type GenericResult = Result;