mmcp_protocol/
mcp.rs

1#![cfg_attr(rustfmt, rustfmt_skip)]
2#![expect(clippy::large_enum_variant)]
3///Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
4#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
5pub struct Annotations {
6    /**Describes who the intended customer of this object or data is.
7
8It can include multiple entries to indicate content useful for multiple audiences (e.g., `["user", "assistant"]`).*/
9    #[serde(default, skip_serializing_if = "Option::is_none")]
10    pub audience: Option<Vec<Role>>,
11    /**Describes how important this data is for operating the server.
12
13A value of 1 means "most important," and indicates that the data is
14effectively required, while 0 means "least important," and indicates that
15the data is entirely optional.*/
16    #[serde(default, skip_serializing_if = "Option::is_none")]
17    pub priority: Option<f64>,
18    /// Additional parameters that are not part of the schema.
19    #[serde(flatten)]
20    pub extra: serde_json::Map<String, serde_json::Value>,
21}
22///Audio provided to or from an LLM.
23#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
24#[serde_with::serde_as]
25pub struct AudioContent {
26    ///Optional annotations for the client.
27    #[serde(default, skip_serializing_if = "Option::is_none")]
28    pub annotations: Option<Annotations>,
29    ///The base64-encoded audio data.
30    #[serde_as(as = "Base64")]
31    pub data: Vec<u8>,
32    ///The MIME type of the audio. Different providers may support different audio types.
33    #[serde(rename = "mimeType")]
34    pub mime_type: String,
35    pub r#type: monostate::MustBe!("audio"),
36    /// Additional parameters that are not part of the schema.
37    #[serde(flatten)]
38    pub extra: serde_json::Map<String, serde_json::Value>,
39}
40///Generated from JSON schema definition for BlobResourceContents
41#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
42#[serde_with::serde_as]
43pub struct BlobResourceContents {
44    ///A base64-encoded string representing the binary data of the item.
45    #[serde_as(as = "Base64")]
46    pub blob: Vec<u8>,
47    ///The MIME type of this resource, if known.
48    #[serde(rename = "mimeType")]
49    #[serde(default, skip_serializing_if = "Option::is_none")]
50    pub mime_type: Option<String>,
51    ///The URI of this resource.
52    pub uri: String,
53    /// Additional parameters that are not part of the schema.
54    #[serde(flatten)]
55    pub extra: serde_json::Map<String, serde_json::Value>,
56}
57///Generated from JSON schema definition for CallToolRequestParams
58#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
59pub struct CallToolRequestParams {
60    #[serde(default, skip_serializing_if = "Option::is_none")]
61    pub arguments: Option<serde_json::Map<String, serde_json::Value>>,
62    pub name: String,
63    /// Additional parameters that are not part of the schema.
64    #[serde(flatten)]
65    pub extra: serde_json::Map<String, serde_json::Value>,
66}
67///Used by the client to invoke a tool provided by the server.
68#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
69pub struct CallToolRequest {
70    pub method: monostate::MustBe!("tools/call"),
71    pub params: CallToolRequestParams,
72    /// Additional parameters that are not part of the schema.
73    #[serde(flatten)]
74    pub extra: serde_json::Map<String, serde_json::Value>,
75}
76///Generated from JSON schema definition for CallToolResultContent
77#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
78#[serde(untagged)]
79pub enum CallToolResultContent {
80    ///Text provided to or from an LLM.
81    TextContent(TextContent),
82    ///An image provided to or from an LLM.
83    ImageContent(ImageContent),
84    ///Audio provided to or from an LLM.
85    AudioContent(AudioContent),
86    /**The contents of a resource, embedded into a prompt or tool call result.
87
88It is up to the client how best to render embedded resources for the benefit
89of the LLM and/or the user.*/
90    EmbeddedResource(EmbeddedResource),
91}
92/**The server's response to a tool call.
93
94Any errors that originate from the tool SHOULD be reported inside the result
95object, with `isError` set to true, _not_ as an MCP protocol-level error
96response. Otherwise, the LLM would not be able to see that an error occurred
97and self-correct.
98
99However, any errors in _finding_ the tool, an error indicating that the
100server does not support tool calls, or any other exceptional conditions,
101should be reported as an MCP error response.*/
102#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
103pub struct CallToolResult {
104    ///This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
105    #[serde(rename = "_meta")]
106    #[serde(default, skip_serializing_if = "Option::is_none")]
107    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
108    pub content: Vec<CallToolResultContent>,
109    /**Whether the tool call ended in an error.
110
111If not set, this is assumed to be false (the call was successful).*/
112    #[serde(rename = "isError")]
113    #[serde(default, skip_serializing_if = "Option::is_none")]
114    pub is_error: Option<bool>,
115    /// Additional parameters that are not part of the schema.
116    #[serde(flatten)]
117    pub extra: serde_json::Map<String, serde_json::Value>,
118}
119///Generated from JSON schema definition for CancelledNotificationParams
120#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
121pub struct CancelledNotificationParams {
122    ///An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
123    #[serde(default, skip_serializing_if = "Option::is_none")]
124    pub reason: Option<String>,
125    /**The ID of the request to cancel.
126
127This MUST correspond to the ID of a request previously issued in the same direction.*/
128    #[serde(rename = "requestId")]
129    pub request_id: RequestId,
130    /// Additional parameters that are not part of the schema.
131    #[serde(flatten)]
132    pub extra: serde_json::Map<String, serde_json::Value>,
133}
134/**This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
135
136The 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.
137
138This notification indicates that the result will be unused, so any associated processing SHOULD cease.
139
140A client MUST NOT attempt to cancel its `initialize` request.*/
141#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
142pub struct CancelledNotification {
143    pub method: monostate::MustBe!("notifications/cancelled"),
144    pub params: CancelledNotificationParams,
145    /// Additional parameters that are not part of the schema.
146    #[serde(flatten)]
147    pub extra: serde_json::Map<String, serde_json::Value>,
148}
149///Present if the client supports listing roots.
150#[derive(
151    Debug,
152    Clone,
153    PartialEq,
154    serde::Serialize,
155    serde::Deserialize,
156    Eq,
157    Hash,
158    Default
159)]
160pub struct ClientCapabilitiesRoots {
161    ///Whether the client supports notifications for changes to the roots list.
162    #[serde(rename = "listChanged")]
163    #[serde(default, skip_serializing_if = "Option::is_none")]
164    pub list_changed: Option<bool>,
165    /// Additional parameters that are not part of the schema.
166    #[serde(flatten)]
167    pub extra: serde_json::Map<String, serde_json::Value>,
168}
169///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.
170#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
171pub struct ClientCapabilities {
172    ///Experimental, non-standard capabilities that the client supports.
173    #[serde(default, skip_serializing_if = "Option::is_none")]
174    pub experimental: Option<
175        indexmap::IndexMap<String, serde_json::Map<String, serde_json::Value>>,
176    >,
177    ///Present if the client supports listing roots.
178    #[serde(default, skip_serializing_if = "Option::is_none")]
179    pub roots: Option<ClientCapabilitiesRoots>,
180    ///Present if the client supports sampling from an LLM.
181    #[serde(default, skip_serializing_if = "Option::is_none")]
182    pub sampling: Option<serde_json::Map<String, serde_json::Value>>,
183    /// Additional parameters that are not part of the schema.
184    #[serde(flatten)]
185    pub extra: serde_json::Map<String, serde_json::Value>,
186}
187///Generated from JSON schema definition for ClientNotification
188#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
189#[serde(untagged)]
190pub enum ClientNotification {
191    /**This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
192
193The 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.
194
195This notification indicates that the result will be unused, so any associated processing SHOULD cease.
196
197A client MUST NOT attempt to cancel its `initialize` request.*/
198    CancelledNotification(CancelledNotification),
199    ///This notification is sent from the client to the server after initialization has finished.
200    InitializedNotification(InitializedNotification),
201    ///An out-of-band notification used to inform the receiver of a progress update for a long-running request.
202    ProgressNotification(ProgressNotification),
203    /**A notification from the client to the server, informing it that the list of roots has changed.
204This notification should be sent whenever the client adds, removes, or modifies any root.
205The server should then request an updated list of roots using the ListRootsRequest.*/
206    RootsListChangedNotification(RootsListChangedNotification),
207}
208///Generated from JSON schema definition for ClientRequest
209#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
210#[serde(untagged)]
211pub enum ClientRequest {
212    ///This request is sent from the client to the server when it first connects, asking it to begin initialization.
213    InitializeRequest(InitializeRequest),
214    ///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.
215    PingRequest(PingRequest),
216    ///Sent from the client to request a list of resources the server has.
217    ListResourcesRequest(ListResourcesRequest),
218    ///Sent from the client to the server, to read a specific resource URI.
219    ReadResourceRequest(ReadResourceRequest),
220    ///Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
221    SubscribeRequest(SubscribeRequest),
222    ///Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
223    UnsubscribeRequest(UnsubscribeRequest),
224    ///Sent from the client to request a list of prompts and prompt templates the server has.
225    ListPromptsRequest(ListPromptsRequest),
226    ///Used by the client to get a prompt provided by the server.
227    GetPromptRequest(GetPromptRequest),
228    ///Sent from the client to request a list of tools the server has.
229    ListToolsRequest(ListToolsRequest),
230    ///Used by the client to invoke a tool provided by the server.
231    CallToolRequest(CallToolRequest),
232    ///A request from the client to the server, to enable or adjust logging.
233    SetLevelRequest(SetLevelRequest),
234    ///A request from the client to the server, to ask for completion options.
235    CompleteRequest(CompleteRequest),
236}
237///Generated from JSON schema definition for ClientResult
238#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
239#[serde(untagged)]
240pub enum ClientResult {
241    Result(Result),
242    ///The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.
243    CreateMessageResult(CreateMessageResult),
244    /**The client's response to a roots/list request from the server.
245This result contains an array of Root objects, each representing a root directory
246or file that the server can operate on.*/
247    ListRootsResult(ListRootsResult),
248}
249///The argument's information
250#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Eq, Hash)]
251pub struct CompleteRequestParamsArgument {
252    ///The name of the argument
253    pub name: String,
254    ///The value of the argument to use for completion matching.
255    pub value: String,
256    /// Additional parameters that are not part of the schema.
257    #[serde(flatten)]
258    pub extra: serde_json::Map<String, serde_json::Value>,
259}
260///Generated from JSON schema definition for CompleteRequestParamsRef
261#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
262#[serde(untagged)]
263pub enum CompleteRequestParamsRef {
264    ///Identifies a prompt.
265    PromptReference(PromptReference),
266    ///A reference to a resource or resource template definition.
267    ResourceReference(ResourceReference),
268}
269///Generated from JSON schema definition for CompleteRequestParams
270#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
271pub struct CompleteRequestParams {
272    ///The argument's information
273    pub argument: CompleteRequestParamsArgument,
274    pub r#ref: CompleteRequestParamsRef,
275    /// Additional parameters that are not part of the schema.
276    #[serde(flatten)]
277    pub extra: serde_json::Map<String, serde_json::Value>,
278}
279///A request from the client to the server, to ask for completion options.
280#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
281pub struct CompleteRequest {
282    pub method: monostate::MustBe!("completion/complete"),
283    pub params: CompleteRequestParams,
284    /// Additional parameters that are not part of the schema.
285    #[serde(flatten)]
286    pub extra: serde_json::Map<String, serde_json::Value>,
287}
288///Generated from JSON schema definition for CompleteResultCompletion
289#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
290pub struct CompleteResultCompletion {
291    ///Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
292    #[serde(rename = "hasMore")]
293    #[serde(default, skip_serializing_if = "Option::is_none")]
294    pub has_more: Option<bool>,
295    ///The total number of completion options available. This can exceed the number of values actually sent in the response.
296    #[serde(default, skip_serializing_if = "Option::is_none")]
297    pub total: Option<i64>,
298    ///An array of completion values. Must not exceed 100 items.
299    pub values: Vec<String>,
300    /// Additional parameters that are not part of the schema.
301    #[serde(flatten)]
302    pub extra: serde_json::Map<String, serde_json::Value>,
303}
304///The server's response to a completion/complete request
305#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
306pub struct CompleteResult {
307    ///This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
308    #[serde(rename = "_meta")]
309    #[serde(default, skip_serializing_if = "Option::is_none")]
310    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
311    pub completion: CompleteResultCompletion,
312    /// Additional parameters that are not part of the schema.
313    #[serde(flatten)]
314    pub extra: serde_json::Map<String, serde_json::Value>,
315}
316///A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.
317#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Eq, Hash)]
318pub enum CreateMessageRequestParamsIncludeContext {
319    #[serde(rename = "allServers")]
320    AllServers,
321    #[serde(rename = "none")]
322    None,
323    #[serde(rename = "thisServer")]
324    ThisServer,
325}
326///Generated from JSON schema definition for CreateMessageRequestParams
327#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
328pub struct CreateMessageRequestParams {
329    ///A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.
330    #[serde(rename = "includeContext")]
331    #[serde(default, skip_serializing_if = "Option::is_none")]
332    pub include_context: Option<CreateMessageRequestParamsIncludeContext>,
333    ///The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested.
334    #[serde(rename = "maxTokens")]
335    pub max_tokens: i64,
336    pub messages: Vec<SamplingMessage>,
337    ///Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
338    #[serde(default, skip_serializing_if = "Option::is_none")]
339    pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
340    ///The server's preferences for which model to select. The client MAY ignore these preferences.
341    #[serde(rename = "modelPreferences")]
342    #[serde(default, skip_serializing_if = "Option::is_none")]
343    pub model_preferences: Option<ModelPreferences>,
344    #[serde(rename = "stopSequences")]
345    #[serde(default, skip_serializing_if = "Option::is_none")]
346    pub stop_sequences: Option<Vec<String>>,
347    ///An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
348    #[serde(rename = "systemPrompt")]
349    #[serde(default, skip_serializing_if = "Option::is_none")]
350    pub system_prompt: Option<String>,
351    #[serde(default, skip_serializing_if = "Option::is_none")]
352    pub temperature: Option<f64>,
353    /// Additional parameters that are not part of the schema.
354    #[serde(flatten)]
355    pub extra: serde_json::Map<String, serde_json::Value>,
356}
357///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.
358#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
359pub struct CreateMessageRequest {
360    pub method: monostate::MustBe!("sampling/createMessage"),
361    pub params: CreateMessageRequestParams,
362    /// Additional parameters that are not part of the schema.
363    #[serde(flatten)]
364    pub extra: serde_json::Map<String, serde_json::Value>,
365}
366///Generated from JSON schema definition for CreateMessageResultContent
367#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
368#[serde(untagged)]
369pub enum CreateMessageResultContent {
370    ///Text provided to or from an LLM.
371    TextContent(TextContent),
372    ///An image provided to or from an LLM.
373    ImageContent(ImageContent),
374    ///Audio provided to or from an LLM.
375    AudioContent(AudioContent),
376}
377///The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.
378#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
379pub struct CreateMessageResult {
380    ///This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
381    #[serde(rename = "_meta")]
382    #[serde(default, skip_serializing_if = "Option::is_none")]
383    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
384    pub content: CreateMessageResultContent,
385    ///The name of the model that generated the message.
386    pub model: String,
387    pub role: Role,
388    ///The reason why sampling stopped, if known.
389    #[serde(rename = "stopReason")]
390    #[serde(default, skip_serializing_if = "Option::is_none")]
391    pub stop_reason: Option<String>,
392    /// Additional parameters that are not part of the schema.
393    #[serde(flatten)]
394    pub extra: serde_json::Map<String, serde_json::Value>,
395}
396///An opaque token used to represent a cursor for pagination.
397#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Eq, Hash)]
398#[serde(transparent)]
399pub struct Cursor(pub String);
400///Generated from JSON schema definition for EmbeddedResourceResource
401#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
402#[serde(untagged)]
403pub enum EmbeddedResourceResource {
404    TextResourceContents(TextResourceContents),
405    BlobResourceContents(BlobResourceContents),
406}
407/**The contents of a resource, embedded into a prompt or tool call result.
408
409It is up to the client how best to render embedded resources for the benefit
410of the LLM and/or the user.*/
411#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
412pub struct EmbeddedResource {
413    ///Optional annotations for the client.
414    #[serde(default, skip_serializing_if = "Option::is_none")]
415    pub annotations: Option<Annotations>,
416    pub resource: EmbeddedResourceResource,
417    pub r#type: monostate::MustBe!("resource"),
418    /// Additional parameters that are not part of the schema.
419    #[serde(flatten)]
420    pub extra: serde_json::Map<String, serde_json::Value>,
421}
422///Generated from JSON schema definition for EmptyResult
423#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
424#[serde(transparent)]
425pub struct EmptyResult(pub Result);
426///Generated from JSON schema definition for GetPromptRequestParams
427#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
428pub struct GetPromptRequestParams {
429    ///Arguments to use for templating the prompt.
430    #[serde(default, skip_serializing_if = "Option::is_none")]
431    pub arguments: Option<indexmap::IndexMap<String, String>>,
432    ///The name of the prompt or prompt template.
433    pub name: String,
434    /// Additional parameters that are not part of the schema.
435    #[serde(flatten)]
436    pub extra: serde_json::Map<String, serde_json::Value>,
437}
438///Used by the client to get a prompt provided by the server.
439#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
440pub struct GetPromptRequest {
441    pub method: monostate::MustBe!("prompts/get"),
442    pub params: GetPromptRequestParams,
443    /// Additional parameters that are not part of the schema.
444    #[serde(flatten)]
445    pub extra: serde_json::Map<String, serde_json::Value>,
446}
447///The server's response to a prompts/get request from the client.
448#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
449pub struct GetPromptResult {
450    ///This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
451    #[serde(rename = "_meta")]
452    #[serde(default, skip_serializing_if = "Option::is_none")]
453    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
454    ///An optional description for the prompt.
455    #[serde(default, skip_serializing_if = "Option::is_none")]
456    pub description: Option<String>,
457    pub messages: Vec<PromptMessage>,
458    /// Additional parameters that are not part of the schema.
459    #[serde(flatten)]
460    pub extra: serde_json::Map<String, serde_json::Value>,
461}
462///An image provided to or from an LLM.
463#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
464#[serde_with::serde_as]
465pub struct ImageContent {
466    ///Optional annotations for the client.
467    #[serde(default, skip_serializing_if = "Option::is_none")]
468    pub annotations: Option<Annotations>,
469    ///The base64-encoded image data.
470    #[serde_as(as = "Base64")]
471    pub data: Vec<u8>,
472    ///The MIME type of the image. Different providers may support different image types.
473    #[serde(rename = "mimeType")]
474    pub mime_type: String,
475    pub r#type: monostate::MustBe!("image"),
476    /// Additional parameters that are not part of the schema.
477    #[serde(flatten)]
478    pub extra: serde_json::Map<String, serde_json::Value>,
479}
480///Describes the name and version of an MCP implementation.
481#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Eq, Hash)]
482pub struct Implementation {
483    pub name: String,
484    pub version: String,
485    /// Additional parameters that are not part of the schema.
486    #[serde(flatten)]
487    pub extra: serde_json::Map<String, serde_json::Value>,
488}
489///Generated from JSON schema definition for InitializeRequestParams
490#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
491pub struct InitializeRequestParams {
492    pub capabilities: ClientCapabilities,
493    #[serde(rename = "clientInfo")]
494    pub client_info: Implementation,
495    ///The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
496    #[serde(rename = "protocolVersion")]
497    pub protocol_version: String,
498    /// Additional parameters that are not part of the schema.
499    #[serde(flatten)]
500    pub extra: serde_json::Map<String, serde_json::Value>,
501}
502///This request is sent from the client to the server when it first connects, asking it to begin initialization.
503#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
504pub struct InitializeRequest {
505    pub method: monostate::MustBe!("initialize"),
506    pub params: InitializeRequestParams,
507    /// Additional parameters that are not part of the schema.
508    #[serde(flatten)]
509    pub extra: serde_json::Map<String, serde_json::Value>,
510}
511///After receiving an initialize request from the client, the server sends this response.
512#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
513pub struct InitializeResult {
514    ///This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
515    #[serde(rename = "_meta")]
516    #[serde(default, skip_serializing_if = "Option::is_none")]
517    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
518    pub capabilities: ServerCapabilities,
519    /**Instructions describing how to use the server and its features.
520
521This 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.*/
522    #[serde(default, skip_serializing_if = "Option::is_none")]
523    pub instructions: Option<String>,
524    ///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.
525    #[serde(rename = "protocolVersion")]
526    pub protocol_version: String,
527    #[serde(rename = "serverInfo")]
528    pub server_info: Implementation,
529    /// Additional parameters that are not part of the schema.
530    #[serde(flatten)]
531    pub extra: serde_json::Map<String, serde_json::Value>,
532}
533///Generated from JSON schema definition for InitializedNotificationParams
534#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
535pub struct InitializedNotificationParams {
536    ///This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.
537    #[serde(rename = "_meta")]
538    #[serde(default, skip_serializing_if = "Option::is_none")]
539    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
540    /// Additional parameters that are not part of the schema.
541    #[serde(flatten)]
542    pub extra: serde_json::Map<String, serde_json::Value>,
543}
544///This notification is sent from the client to the server after initialization has finished.
545#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
546pub struct InitializedNotification {
547    pub method: monostate::MustBe!("notifications/initialized"),
548    #[serde(default, skip_serializing_if = "Option::is_none")]
549    pub params: Option<InitializedNotificationParams>,
550    /// Additional parameters that are not part of the schema.
551    #[serde(flatten)]
552    pub extra: serde_json::Map<String, serde_json::Value>,
553}
554///Generated from JSON schema definition for JsonrpcBatchRequestItem
555#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
556#[serde(untagged)]
557pub enum JsonrpcBatchRequestItem {
558    ///A request that expects a response.
559    JSONRPCRequest(JSONRPCRequest),
560    ///A notification which does not expect a response.
561    JSONRPCNotification(JSONRPCNotification),
562}
563///A JSON-RPC batch request, as described in https://www.jsonrpc.org/specification#batch.
564#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
565#[serde(transparent)]
566pub struct JSONRPCBatchRequest(pub Vec<JsonrpcBatchRequestItem>);
567///Generated from JSON schema definition for JsonrpcBatchResponseItem
568#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
569#[serde(untagged)]
570pub enum JsonrpcBatchResponseItem {
571    ///A successful (non-error) response to a request.
572    JSONRPCResponse(JSONRPCResponse),
573    ///A response to a request that indicates an error occurred.
574    JSONRPCError(JSONRPCError),
575}
576///A JSON-RPC batch response, as described in https://www.jsonrpc.org/specification#batch.
577#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
578#[serde(transparent)]
579pub struct JSONRPCBatchResponse(pub Vec<JsonrpcBatchResponseItem>);
580///Generated from JSON schema definition for JsonrpcErrorError
581#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
582pub struct JsonrpcErrorError {
583    ///The error type that occurred.
584    pub code: i64,
585    ///Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
586    #[serde(default, skip_serializing_if = "Option::is_none")]
587    pub data: Option<serde_json::Value>,
588    ///A short description of the error. The message SHOULD be limited to a concise single sentence.
589    pub message: String,
590    /// Additional parameters that are not part of the schema.
591    #[serde(flatten)]
592    pub extra: serde_json::Map<String, serde_json::Value>,
593}
594///A response to a request that indicates an error occurred.
595#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
596pub struct JSONRPCError {
597    pub error: JsonrpcErrorError,
598    pub id: RequestId,
599    pub jsonrpc: monostate::MustBe!("2.0"),
600    /// Additional parameters that are not part of the schema.
601    #[serde(flatten)]
602    pub extra: serde_json::Map<String, serde_json::Value>,
603}
604///Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.
605#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
606#[serde(untagged)]
607pub enum JSONRPCMessage {
608    ///A request that expects a response.
609    JSONRPCRequest(JSONRPCRequest),
610    ///A notification which does not expect a response.
611    JSONRPCNotification(JSONRPCNotification),
612    ///A JSON-RPC batch request, as described in https://www.jsonrpc.org/specification#batch.
613    JSONRPCBatchRequest(JSONRPCBatchRequest),
614    ///A successful (non-error) response to a request.
615    JSONRPCResponse(JSONRPCResponse),
616    ///A response to a request that indicates an error occurred.
617    JSONRPCError(JSONRPCError),
618    ///A JSON-RPC batch response, as described in https://www.jsonrpc.org/specification#batch.
619    JSONRPCBatchResponse(JSONRPCBatchResponse),
620}
621///Generated from JSON schema definition for JsonrpcNotificationParams
622#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
623pub struct JsonrpcNotificationParams {
624    ///This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.
625    #[serde(rename = "_meta")]
626    #[serde(default, skip_serializing_if = "Option::is_none")]
627    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
628    /// Additional parameters that are not part of the schema.
629    #[serde(flatten)]
630    pub extra: serde_json::Map<String, serde_json::Value>,
631}
632///A notification which does not expect a response.
633#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
634pub struct JSONRPCNotification {
635    pub jsonrpc: monostate::MustBe!("2.0"),
636    pub method: String,
637    #[serde(default, skip_serializing_if = "Option::is_none")]
638    pub params: Option<JsonrpcNotificationParams>,
639    /// Additional parameters that are not part of the schema.
640    #[serde(flatten)]
641    pub extra: serde_json::Map<String, serde_json::Value>,
642}
643///Generated from JSON schema definition for JsonrpcRequestParamsMeta
644#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
645pub struct JsonrpcRequestParamsMeta {
646    ///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.
647    #[serde(rename = "progressToken")]
648    #[serde(default, skip_serializing_if = "Option::is_none")]
649    pub progress_token: Option<ProgressToken>,
650    /// Additional parameters that are not part of the schema.
651    #[serde(flatten)]
652    pub extra: serde_json::Map<String, serde_json::Value>,
653}
654///Generated from JSON schema definition for JsonrpcRequestParams
655#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
656pub struct JsonrpcRequestParams {
657    #[serde(rename = "_meta")]
658    #[serde(default, skip_serializing_if = "Option::is_none")]
659    pub meta: Option<JsonrpcRequestParamsMeta>,
660    /// Additional parameters that are not part of the schema.
661    #[serde(flatten)]
662    pub extra: serde_json::Map<String, serde_json::Value>,
663}
664///A request that expects a response.
665#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
666pub struct JSONRPCRequest {
667    pub id: RequestId,
668    pub jsonrpc: monostate::MustBe!("2.0"),
669    pub method: String,
670    #[serde(default, skip_serializing_if = "Option::is_none")]
671    pub params: Option<JsonrpcRequestParams>,
672    /// Additional parameters that are not part of the schema.
673    #[serde(flatten)]
674    pub extra: serde_json::Map<String, serde_json::Value>,
675}
676///A successful (non-error) response to a request.
677#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
678pub struct JSONRPCResponse {
679    pub id: RequestId,
680    pub jsonrpc: monostate::MustBe!("2.0"),
681    pub result: Result,
682    /// Additional parameters that are not part of the schema.
683    #[serde(flatten)]
684    pub extra: serde_json::Map<String, serde_json::Value>,
685}
686///Generated from JSON schema definition for ListPromptsRequestParams
687#[derive(
688    Debug,
689    Clone,
690    PartialEq,
691    serde::Serialize,
692    serde::Deserialize,
693    Eq,
694    Hash,
695    Default
696)]
697pub struct ListPromptsRequestParams {
698    /**An opaque token representing the current pagination position.
699If provided, the server should return results starting after this cursor.*/
700    #[serde(default, skip_serializing_if = "Option::is_none")]
701    pub cursor: Option<String>,
702    /// Additional parameters that are not part of the schema.
703    #[serde(flatten)]
704    pub extra: serde_json::Map<String, serde_json::Value>,
705}
706///Sent from the client to request a list of prompts and prompt templates the server has.
707#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
708pub struct ListPromptsRequest {
709    pub method: monostate::MustBe!("prompts/list"),
710    #[serde(default, skip_serializing_if = "Option::is_none")]
711    pub params: Option<ListPromptsRequestParams>,
712    /// Additional parameters that are not part of the schema.
713    #[serde(flatten)]
714    pub extra: serde_json::Map<String, serde_json::Value>,
715}
716///The server's response to a prompts/list request from the client.
717#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
718pub struct ListPromptsResult {
719    ///This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
720    #[serde(rename = "_meta")]
721    #[serde(default, skip_serializing_if = "Option::is_none")]
722    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
723    /**An opaque token representing the pagination position after the last returned result.
724If present, there may be more results available.*/
725    #[serde(rename = "nextCursor")]
726    #[serde(default, skip_serializing_if = "Option::is_none")]
727    pub next_cursor: Option<String>,
728    pub prompts: Vec<Prompt>,
729    /// Additional parameters that are not part of the schema.
730    #[serde(flatten)]
731    pub extra: serde_json::Map<String, serde_json::Value>,
732}
733///Generated from JSON schema definition for ListResourceTemplatesRequestParams
734#[derive(
735    Debug,
736    Clone,
737    PartialEq,
738    serde::Serialize,
739    serde::Deserialize,
740    Eq,
741    Hash,
742    Default
743)]
744pub struct ListResourceTemplatesRequestParams {
745    /**An opaque token representing the current pagination position.
746If provided, the server should return results starting after this cursor.*/
747    #[serde(default, skip_serializing_if = "Option::is_none")]
748    pub cursor: Option<String>,
749    /// Additional parameters that are not part of the schema.
750    #[serde(flatten)]
751    pub extra: serde_json::Map<String, serde_json::Value>,
752}
753///Sent from the client to request a list of resource templates the server has.
754#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
755pub struct ListResourceTemplatesRequest {
756    pub method: monostate::MustBe!("resources/templates/list"),
757    #[serde(default, skip_serializing_if = "Option::is_none")]
758    pub params: Option<ListResourceTemplatesRequestParams>,
759    /// Additional parameters that are not part of the schema.
760    #[serde(flatten)]
761    pub extra: serde_json::Map<String, serde_json::Value>,
762}
763///The server's response to a resources/templates/list request from the client.
764#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
765pub struct ListResourceTemplatesResult {
766    ///This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
767    #[serde(rename = "_meta")]
768    #[serde(default, skip_serializing_if = "Option::is_none")]
769    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
770    /**An opaque token representing the pagination position after the last returned result.
771If present, there may be more results available.*/
772    #[serde(rename = "nextCursor")]
773    #[serde(default, skip_serializing_if = "Option::is_none")]
774    pub next_cursor: Option<String>,
775    #[serde(rename = "resourceTemplates")]
776    pub resource_templates: Vec<ResourceTemplate>,
777    /// Additional parameters that are not part of the schema.
778    #[serde(flatten)]
779    pub extra: serde_json::Map<String, serde_json::Value>,
780}
781///Generated from JSON schema definition for ListResourcesRequestParams
782#[derive(
783    Debug,
784    Clone,
785    PartialEq,
786    serde::Serialize,
787    serde::Deserialize,
788    Eq,
789    Hash,
790    Default
791)]
792pub struct ListResourcesRequestParams {
793    /**An opaque token representing the current pagination position.
794If provided, the server should return results starting after this cursor.*/
795    #[serde(default, skip_serializing_if = "Option::is_none")]
796    pub cursor: Option<String>,
797    /// Additional parameters that are not part of the schema.
798    #[serde(flatten)]
799    pub extra: serde_json::Map<String, serde_json::Value>,
800}
801///Sent from the client to request a list of resources the server has.
802#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
803pub struct ListResourcesRequest {
804    pub method: monostate::MustBe!("resources/list"),
805    #[serde(default, skip_serializing_if = "Option::is_none")]
806    pub params: Option<ListResourcesRequestParams>,
807    /// Additional parameters that are not part of the schema.
808    #[serde(flatten)]
809    pub extra: serde_json::Map<String, serde_json::Value>,
810}
811///The server's response to a resources/list request from the client.
812#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
813pub struct ListResourcesResult {
814    ///This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
815    #[serde(rename = "_meta")]
816    #[serde(default, skip_serializing_if = "Option::is_none")]
817    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
818    /**An opaque token representing the pagination position after the last returned result.
819If present, there may be more results available.*/
820    #[serde(rename = "nextCursor")]
821    #[serde(default, skip_serializing_if = "Option::is_none")]
822    pub next_cursor: Option<String>,
823    pub resources: Vec<Resource>,
824    /// Additional parameters that are not part of the schema.
825    #[serde(flatten)]
826    pub extra: serde_json::Map<String, serde_json::Value>,
827}
828///Generated from JSON schema definition for ListRootsRequestParamsMeta
829#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
830pub struct ListRootsRequestParamsMeta {
831    ///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.
832    #[serde(rename = "progressToken")]
833    #[serde(default, skip_serializing_if = "Option::is_none")]
834    pub progress_token: Option<ProgressToken>,
835    /// Additional parameters that are not part of the schema.
836    #[serde(flatten)]
837    pub extra: serde_json::Map<String, serde_json::Value>,
838}
839///Generated from JSON schema definition for ListRootsRequestParams
840#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
841pub struct ListRootsRequestParams {
842    #[serde(rename = "_meta")]
843    #[serde(default, skip_serializing_if = "Option::is_none")]
844    pub meta: Option<ListRootsRequestParamsMeta>,
845    /// Additional parameters that are not part of the schema.
846    #[serde(flatten)]
847    pub extra: serde_json::Map<String, serde_json::Value>,
848}
849/**Sent from the server to request a list of root URIs from the client. Roots allow
850servers to ask for specific directories or files to operate on. A common example
851for roots is providing a set of repositories or directories a server should operate
852on.
853
854This request is typically used when the server needs to understand the file system
855structure or access specific locations that the client has permission to read from.*/
856#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
857pub struct ListRootsRequest {
858    pub method: monostate::MustBe!("roots/list"),
859    #[serde(default, skip_serializing_if = "Option::is_none")]
860    pub params: Option<ListRootsRequestParams>,
861    /// Additional parameters that are not part of the schema.
862    #[serde(flatten)]
863    pub extra: serde_json::Map<String, serde_json::Value>,
864}
865/**The client's response to a roots/list request from the server.
866This result contains an array of Root objects, each representing a root directory
867or file that the server can operate on.*/
868#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
869pub struct ListRootsResult {
870    ///This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
871    #[serde(rename = "_meta")]
872    #[serde(default, skip_serializing_if = "Option::is_none")]
873    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
874    pub roots: Vec<Root>,
875    /// Additional parameters that are not part of the schema.
876    #[serde(flatten)]
877    pub extra: serde_json::Map<String, serde_json::Value>,
878}
879///Generated from JSON schema definition for ListToolsRequestParams
880#[derive(
881    Debug,
882    Clone,
883    PartialEq,
884    serde::Serialize,
885    serde::Deserialize,
886    Eq,
887    Hash,
888    Default
889)]
890pub struct ListToolsRequestParams {
891    /**An opaque token representing the current pagination position.
892If provided, the server should return results starting after this cursor.*/
893    #[serde(default, skip_serializing_if = "Option::is_none")]
894    pub cursor: Option<String>,
895    /// Additional parameters that are not part of the schema.
896    #[serde(flatten)]
897    pub extra: serde_json::Map<String, serde_json::Value>,
898}
899///Sent from the client to request a list of tools the server has.
900#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
901pub struct ListToolsRequest {
902    pub method: monostate::MustBe!("tools/list"),
903    #[serde(default, skip_serializing_if = "Option::is_none")]
904    pub params: Option<ListToolsRequestParams>,
905    /// Additional parameters that are not part of the schema.
906    #[serde(flatten)]
907    pub extra: serde_json::Map<String, serde_json::Value>,
908}
909///The server's response to a tools/list request from the client.
910#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
911pub struct ListToolsResult {
912    ///This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
913    #[serde(rename = "_meta")]
914    #[serde(default, skip_serializing_if = "Option::is_none")]
915    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
916    /**An opaque token representing the pagination position after the last returned result.
917If present, there may be more results available.*/
918    #[serde(rename = "nextCursor")]
919    #[serde(default, skip_serializing_if = "Option::is_none")]
920    pub next_cursor: Option<String>,
921    pub tools: Vec<Tool>,
922    /// Additional parameters that are not part of the schema.
923    #[serde(flatten)]
924    pub extra: serde_json::Map<String, serde_json::Value>,
925}
926/**The severity of a log message.
927
928These map to syslog message severities, as specified in RFC-5424:
929https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1*/
930#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Eq, Hash)]
931pub enum LoggingLevel {
932    #[serde(rename = "alert")]
933    Alert,
934    #[serde(rename = "critical")]
935    Critical,
936    #[serde(rename = "debug")]
937    Debug,
938    #[serde(rename = "emergency")]
939    Emergency,
940    #[serde(rename = "error")]
941    Error,
942    #[serde(rename = "info")]
943    Info,
944    #[serde(rename = "notice")]
945    Notice,
946    #[serde(rename = "warning")]
947    Warning,
948}
949///Generated from JSON schema definition for LoggingMessageNotificationParams
950#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
951pub struct LoggingMessageNotificationParams {
952    ///The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
953    pub data: serde_json::Value,
954    ///The severity of this log message.
955    pub level: LoggingLevel,
956    ///An optional name of the logger issuing this message.
957    #[serde(default, skip_serializing_if = "Option::is_none")]
958    pub logger: Option<String>,
959    /// Additional parameters that are not part of the schema.
960    #[serde(flatten)]
961    pub extra: serde_json::Map<String, serde_json::Value>,
962}
963///Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.
964#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
965pub struct LoggingMessageNotification {
966    pub method: monostate::MustBe!("notifications/message"),
967    pub params: LoggingMessageNotificationParams,
968    /// Additional parameters that are not part of the schema.
969    #[serde(flatten)]
970    pub extra: serde_json::Map<String, serde_json::Value>,
971}
972/**Hints to use for model selection.
973
974Keys not declared here are currently left unspecified by the spec and are up
975to the client to interpret.*/
976#[derive(
977    Debug,
978    Clone,
979    PartialEq,
980    serde::Serialize,
981    serde::Deserialize,
982    Eq,
983    Hash,
984    Default
985)]
986pub struct ModelHint {
987    /**A hint for a model name.
988
989The client SHOULD treat this as a substring of a model name; for example:
990 - `claude-3-5-sonnet` should match `claude-3-5-sonnet-20241022`
991 - `sonnet` should match `claude-3-5-sonnet-20241022`, `claude-3-sonnet-20240229`, etc.
992 - `claude` should match any Claude model
993
994The 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:
995 - `gemini-1.5-flash` could match `claude-3-haiku-20240307`*/
996    #[serde(default, skip_serializing_if = "Option::is_none")]
997    pub name: Option<String>,
998    /// Additional parameters that are not part of the schema.
999    #[serde(flatten)]
1000    pub extra: serde_json::Map<String, serde_json::Value>,
1001}
1002/**The server's preferences for model selection, requested of the client during sampling.
1003
1004Because LLMs can vary along multiple dimensions, choosing the "best" model is
1005rarely straightforward.  Different models excel in different areas—some are
1006faster but less capable, others are more capable but more expensive, and so
1007on. This interface allows servers to express their priorities across multiple
1008dimensions to help clients make an appropriate selection for their use case.
1009
1010These preferences are always advisory. The client MAY ignore them. It is also
1011up to the client to decide how to interpret these preferences and how to
1012balance them against other considerations.*/
1013#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
1014pub struct ModelPreferences {
1015    /**How much to prioritize cost when selecting a model. A value of 0 means cost
1016is not important, while a value of 1 means cost is the most important
1017factor.*/
1018    #[serde(rename = "costPriority")]
1019    #[serde(default, skip_serializing_if = "Option::is_none")]
1020    pub cost_priority: Option<f64>,
1021    /**Optional hints to use for model selection.
1022
1023If multiple hints are specified, the client MUST evaluate them in order
1024(such that the first match is taken).
1025
1026The client SHOULD prioritize these hints over the numeric priorities, but
1027MAY still use the priorities to select from ambiguous matches.*/
1028    #[serde(default, skip_serializing_if = "Option::is_none")]
1029    pub hints: Option<Vec<ModelHint>>,
1030    /**How much to prioritize intelligence and capabilities when selecting a
1031model. A value of 0 means intelligence is not important, while a value of 1
1032means intelligence is the most important factor.*/
1033    #[serde(rename = "intelligencePriority")]
1034    #[serde(default, skip_serializing_if = "Option::is_none")]
1035    pub intelligence_priority: Option<f64>,
1036    /**How much to prioritize sampling speed (latency) when selecting a model. A
1037value of 0 means speed is not important, while a value of 1 means speed is
1038the most important factor.*/
1039    #[serde(rename = "speedPriority")]
1040    #[serde(default, skip_serializing_if = "Option::is_none")]
1041    pub speed_priority: Option<f64>,
1042    /// Additional parameters that are not part of the schema.
1043    #[serde(flatten)]
1044    pub extra: serde_json::Map<String, serde_json::Value>,
1045}
1046///Generated from JSON schema definition for NotificationParams
1047#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
1048pub struct NotificationParams {
1049    ///This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.
1050    #[serde(rename = "_meta")]
1051    #[serde(default, skip_serializing_if = "Option::is_none")]
1052    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
1053    /// Additional parameters that are not part of the schema.
1054    #[serde(flatten)]
1055    pub extra: serde_json::Map<String, serde_json::Value>,
1056}
1057///Generated from JSON schema definition for Notification
1058#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1059pub struct Notification {
1060    pub method: String,
1061    #[serde(default, skip_serializing_if = "Option::is_none")]
1062    pub params: Option<NotificationParams>,
1063    /// Additional parameters that are not part of the schema.
1064    #[serde(flatten)]
1065    pub extra: serde_json::Map<String, serde_json::Value>,
1066}
1067///Generated from JSON schema definition for PaginatedRequestParams
1068#[derive(
1069    Debug,
1070    Clone,
1071    PartialEq,
1072    serde::Serialize,
1073    serde::Deserialize,
1074    Eq,
1075    Hash,
1076    Default
1077)]
1078pub struct PaginatedRequestParams {
1079    /**An opaque token representing the current pagination position.
1080If provided, the server should return results starting after this cursor.*/
1081    #[serde(default, skip_serializing_if = "Option::is_none")]
1082    pub cursor: Option<String>,
1083    /// Additional parameters that are not part of the schema.
1084    #[serde(flatten)]
1085    pub extra: serde_json::Map<String, serde_json::Value>,
1086}
1087///Generated from JSON schema definition for PaginatedRequest
1088#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1089pub struct PaginatedRequest {
1090    pub method: String,
1091    #[serde(default, skip_serializing_if = "Option::is_none")]
1092    pub params: Option<PaginatedRequestParams>,
1093    /// Additional parameters that are not part of the schema.
1094    #[serde(flatten)]
1095    pub extra: serde_json::Map<String, serde_json::Value>,
1096}
1097///Generated from JSON schema definition for PaginatedResult
1098#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
1099pub struct PaginatedResult {
1100    ///This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
1101    #[serde(rename = "_meta")]
1102    #[serde(default, skip_serializing_if = "Option::is_none")]
1103    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
1104    /**An opaque token representing the pagination position after the last returned result.
1105If present, there may be more results available.*/
1106    #[serde(rename = "nextCursor")]
1107    #[serde(default, skip_serializing_if = "Option::is_none")]
1108    pub next_cursor: Option<String>,
1109    /// Additional parameters that are not part of the schema.
1110    #[serde(flatten)]
1111    pub extra: serde_json::Map<String, serde_json::Value>,
1112}
1113///Generated from JSON schema definition for PingRequestParamsMeta
1114#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
1115pub struct PingRequestParamsMeta {
1116    ///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.
1117    #[serde(rename = "progressToken")]
1118    #[serde(default, skip_serializing_if = "Option::is_none")]
1119    pub progress_token: Option<ProgressToken>,
1120    /// Additional parameters that are not part of the schema.
1121    #[serde(flatten)]
1122    pub extra: serde_json::Map<String, serde_json::Value>,
1123}
1124///Generated from JSON schema definition for PingRequestParams
1125#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
1126pub struct PingRequestParams {
1127    #[serde(rename = "_meta")]
1128    #[serde(default, skip_serializing_if = "Option::is_none")]
1129    pub meta: Option<PingRequestParamsMeta>,
1130    /// Additional parameters that are not part of the schema.
1131    #[serde(flatten)]
1132    pub extra: serde_json::Map<String, serde_json::Value>,
1133}
1134///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.
1135#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1136pub struct PingRequest {
1137    pub method: monostate::MustBe!("ping"),
1138    #[serde(default, skip_serializing_if = "Option::is_none")]
1139    pub params: Option<PingRequestParams>,
1140    /// Additional parameters that are not part of the schema.
1141    #[serde(flatten)]
1142    pub extra: serde_json::Map<String, serde_json::Value>,
1143}
1144///Generated from JSON schema definition for ProgressNotificationParams
1145#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1146pub struct ProgressNotificationParams {
1147    ///An optional message describing the current progress.
1148    #[serde(default, skip_serializing_if = "Option::is_none")]
1149    pub message: Option<String>,
1150    ///The progress thus far. This should increase every time progress is made, even if the total is unknown.
1151    pub progress: f64,
1152    ///The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
1153    #[serde(rename = "progressToken")]
1154    pub progress_token: ProgressToken,
1155    ///Total number of items to process (or total progress required), if known.
1156    #[serde(default, skip_serializing_if = "Option::is_none")]
1157    pub total: Option<f64>,
1158    /// Additional parameters that are not part of the schema.
1159    #[serde(flatten)]
1160    pub extra: serde_json::Map<String, serde_json::Value>,
1161}
1162///An out-of-band notification used to inform the receiver of a progress update for a long-running request.
1163#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1164pub struct ProgressNotification {
1165    pub method: monostate::MustBe!("notifications/progress"),
1166    pub params: ProgressNotificationParams,
1167    /// Additional parameters that are not part of the schema.
1168    #[serde(flatten)]
1169    pub extra: serde_json::Map<String, serde_json::Value>,
1170}
1171///A progress token, used to associate progress notifications with the original request.
1172#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Eq, Hash)]
1173#[serde(untagged)]
1174pub enum ProgressToken {
1175    String(String),
1176    Integer(i64),
1177}
1178///A prompt or prompt template that the server offers.
1179#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1180pub struct Prompt {
1181    ///A list of arguments to use for templating the prompt.
1182    #[serde(default, skip_serializing_if = "Option::is_none")]
1183    pub arguments: Option<Vec<PromptArgument>>,
1184    ///An optional description of what this prompt provides
1185    #[serde(default, skip_serializing_if = "Option::is_none")]
1186    pub description: Option<String>,
1187    ///The name of the prompt or prompt template.
1188    pub name: String,
1189    /// Additional parameters that are not part of the schema.
1190    #[serde(flatten)]
1191    pub extra: serde_json::Map<String, serde_json::Value>,
1192}
1193///Describes an argument that a prompt can accept.
1194#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Eq, Hash)]
1195pub struct PromptArgument {
1196    ///A human-readable description of the argument.
1197    #[serde(default, skip_serializing_if = "Option::is_none")]
1198    pub description: Option<String>,
1199    ///The name of the argument.
1200    pub name: String,
1201    ///Whether this argument must be provided.
1202    #[serde(default, skip_serializing_if = "Option::is_none")]
1203    pub required: Option<bool>,
1204    /// Additional parameters that are not part of the schema.
1205    #[serde(flatten)]
1206    pub extra: serde_json::Map<String, serde_json::Value>,
1207}
1208///Generated from JSON schema definition for PromptListChangedNotificationParams
1209#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
1210pub struct PromptListChangedNotificationParams {
1211    ///This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.
1212    #[serde(rename = "_meta")]
1213    #[serde(default, skip_serializing_if = "Option::is_none")]
1214    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
1215    /// Additional parameters that are not part of the schema.
1216    #[serde(flatten)]
1217    pub extra: serde_json::Map<String, serde_json::Value>,
1218}
1219///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.
1220#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1221pub struct PromptListChangedNotification {
1222    pub method: monostate::MustBe!("notifications/prompts/list_changed"),
1223    #[serde(default, skip_serializing_if = "Option::is_none")]
1224    pub params: Option<PromptListChangedNotificationParams>,
1225    /// Additional parameters that are not part of the schema.
1226    #[serde(flatten)]
1227    pub extra: serde_json::Map<String, serde_json::Value>,
1228}
1229///Generated from JSON schema definition for PromptMessageContent
1230#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1231#[serde(untagged)]
1232pub enum PromptMessageContent {
1233    ///Text provided to or from an LLM.
1234    TextContent(TextContent),
1235    ///An image provided to or from an LLM.
1236    ImageContent(ImageContent),
1237    ///Audio provided to or from an LLM.
1238    AudioContent(AudioContent),
1239    /**The contents of a resource, embedded into a prompt or tool call result.
1240
1241It is up to the client how best to render embedded resources for the benefit
1242of the LLM and/or the user.*/
1243    EmbeddedResource(EmbeddedResource),
1244}
1245/**Describes a message returned as part of a prompt.
1246
1247This is similar to `SamplingMessage`, but also supports the embedding of
1248resources from the MCP server.*/
1249#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1250pub struct PromptMessage {
1251    pub content: PromptMessageContent,
1252    pub role: Role,
1253    /// Additional parameters that are not part of the schema.
1254    #[serde(flatten)]
1255    pub extra: serde_json::Map<String, serde_json::Value>,
1256}
1257///Identifies a prompt.
1258#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Eq, Hash)]
1259pub struct PromptReference {
1260    ///The name of the prompt or prompt template
1261    pub name: String,
1262    pub r#type: monostate::MustBe!("ref/prompt"),
1263    /// Additional parameters that are not part of the schema.
1264    #[serde(flatten)]
1265    pub extra: serde_json::Map<String, serde_json::Value>,
1266}
1267///Generated from JSON schema definition for ReadResourceRequestParams
1268#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Eq, Hash)]
1269pub struct ReadResourceRequestParams {
1270    ///The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
1271    pub uri: String,
1272    /// Additional parameters that are not part of the schema.
1273    #[serde(flatten)]
1274    pub extra: serde_json::Map<String, serde_json::Value>,
1275}
1276///Sent from the client to the server, to read a specific resource URI.
1277#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1278pub struct ReadResourceRequest {
1279    pub method: monostate::MustBe!("resources/read"),
1280    pub params: ReadResourceRequestParams,
1281    /// Additional parameters that are not part of the schema.
1282    #[serde(flatten)]
1283    pub extra: serde_json::Map<String, serde_json::Value>,
1284}
1285///Generated from JSON schema definition for ReadResourceResultContents
1286#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1287#[serde(untagged)]
1288pub enum ReadResourceResultContents {
1289    TextResourceContents(TextResourceContents),
1290    BlobResourceContents(BlobResourceContents),
1291}
1292///The server's response to a resources/read request from the client.
1293#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1294pub struct ReadResourceResult {
1295    ///This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
1296    #[serde(rename = "_meta")]
1297    #[serde(default, skip_serializing_if = "Option::is_none")]
1298    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
1299    pub contents: Vec<ReadResourceResultContents>,
1300    /// Additional parameters that are not part of the schema.
1301    #[serde(flatten)]
1302    pub extra: serde_json::Map<String, serde_json::Value>,
1303}
1304///Generated from JSON schema definition for RequestParamsMeta
1305#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
1306pub struct RequestParamsMeta {
1307    ///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.
1308    #[serde(rename = "progressToken")]
1309    #[serde(default, skip_serializing_if = "Option::is_none")]
1310    pub progress_token: Option<ProgressToken>,
1311    /// Additional parameters that are not part of the schema.
1312    #[serde(flatten)]
1313    pub extra: serde_json::Map<String, serde_json::Value>,
1314}
1315///Generated from JSON schema definition for RequestParams
1316#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
1317pub struct RequestParams {
1318    #[serde(rename = "_meta")]
1319    #[serde(default, skip_serializing_if = "Option::is_none")]
1320    pub meta: Option<RequestParamsMeta>,
1321    /// Additional parameters that are not part of the schema.
1322    #[serde(flatten)]
1323    pub extra: serde_json::Map<String, serde_json::Value>,
1324}
1325///Generated from JSON schema definition for Request
1326#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1327pub struct Request {
1328    pub method: String,
1329    #[serde(default, skip_serializing_if = "Option::is_none")]
1330    pub params: Option<RequestParams>,
1331    /// Additional parameters that are not part of the schema.
1332    #[serde(flatten)]
1333    pub extra: serde_json::Map<String, serde_json::Value>,
1334}
1335///A uniquely identifying ID for a request in JSON-RPC.
1336#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Eq, Hash)]
1337#[serde(untagged)]
1338pub enum RequestId {
1339    String(String),
1340    Integer(i64),
1341}
1342///A known resource that the server is capable of reading.
1343#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1344pub struct Resource {
1345    ///Optional annotations for the client.
1346    #[serde(default, skip_serializing_if = "Option::is_none")]
1347    pub annotations: Option<Annotations>,
1348    /**A description of what this resource represents.
1349
1350This 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.*/
1351    #[serde(default, skip_serializing_if = "Option::is_none")]
1352    pub description: Option<String>,
1353    ///The MIME type of this resource, if known.
1354    #[serde(rename = "mimeType")]
1355    #[serde(default, skip_serializing_if = "Option::is_none")]
1356    pub mime_type: Option<String>,
1357    /**A human-readable name for this resource.
1358
1359This can be used by clients to populate UI elements.*/
1360    pub name: String,
1361    ///The URI of this resource.
1362    pub uri: String,
1363    /// Additional parameters that are not part of the schema.
1364    #[serde(flatten)]
1365    pub extra: serde_json::Map<String, serde_json::Value>,
1366}
1367///The contents of a specific resource or sub-resource.
1368#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Eq, Hash)]
1369pub struct ResourceContents {
1370    ///The MIME type of this resource, if known.
1371    #[serde(rename = "mimeType")]
1372    #[serde(default, skip_serializing_if = "Option::is_none")]
1373    pub mime_type: Option<String>,
1374    ///The URI of this resource.
1375    pub uri: String,
1376    /// Additional parameters that are not part of the schema.
1377    #[serde(flatten)]
1378    pub extra: serde_json::Map<String, serde_json::Value>,
1379}
1380///Generated from JSON schema definition for ResourceListChangedNotificationParams
1381#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
1382pub struct ResourceListChangedNotificationParams {
1383    ///This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.
1384    #[serde(rename = "_meta")]
1385    #[serde(default, skip_serializing_if = "Option::is_none")]
1386    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
1387    /// Additional parameters that are not part of the schema.
1388    #[serde(flatten)]
1389    pub extra: serde_json::Map<String, serde_json::Value>,
1390}
1391///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.
1392#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1393pub struct ResourceListChangedNotification {
1394    pub method: monostate::MustBe!("notifications/resources/list_changed"),
1395    #[serde(default, skip_serializing_if = "Option::is_none")]
1396    pub params: Option<ResourceListChangedNotificationParams>,
1397    /// Additional parameters that are not part of the schema.
1398    #[serde(flatten)]
1399    pub extra: serde_json::Map<String, serde_json::Value>,
1400}
1401///A reference to a resource or resource template definition.
1402#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Eq, Hash)]
1403pub struct ResourceReference {
1404    pub r#type: monostate::MustBe!("ref/resource"),
1405    ///The URI or URI template of the resource.
1406    pub uri: String,
1407    /// Additional parameters that are not part of the schema.
1408    #[serde(flatten)]
1409    pub extra: serde_json::Map<String, serde_json::Value>,
1410}
1411///A template description for resources available on the server.
1412#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1413pub struct ResourceTemplate {
1414    ///Optional annotations for the client.
1415    #[serde(default, skip_serializing_if = "Option::is_none")]
1416    pub annotations: Option<Annotations>,
1417    /**A description of what this template is for.
1418
1419This 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.*/
1420    #[serde(default, skip_serializing_if = "Option::is_none")]
1421    pub description: Option<String>,
1422    ///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.
1423    #[serde(rename = "mimeType")]
1424    #[serde(default, skip_serializing_if = "Option::is_none")]
1425    pub mime_type: Option<String>,
1426    /**A human-readable name for the type of resource this template refers to.
1427
1428This can be used by clients to populate UI elements.*/
1429    pub name: String,
1430    ///A URI template (according to RFC 6570) that can be used to construct resource URIs.
1431    #[serde(rename = "uriTemplate")]
1432    pub uri_template: String,
1433    /// Additional parameters that are not part of the schema.
1434    #[serde(flatten)]
1435    pub extra: serde_json::Map<String, serde_json::Value>,
1436}
1437///Generated from JSON schema definition for ResourceUpdatedNotificationParams
1438#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Eq, Hash)]
1439pub struct ResourceUpdatedNotificationParams {
1440    ///The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
1441    pub uri: String,
1442    /// Additional parameters that are not part of the schema.
1443    #[serde(flatten)]
1444    pub extra: serde_json::Map<String, serde_json::Value>,
1445}
1446///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.
1447#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1448pub struct ResourceUpdatedNotification {
1449    pub method: monostate::MustBe!("notifications/resources/updated"),
1450    pub params: ResourceUpdatedNotificationParams,
1451    /// Additional parameters that are not part of the schema.
1452    #[serde(flatten)]
1453    pub extra: serde_json::Map<String, serde_json::Value>,
1454}
1455///Generated from JSON schema definition for Result
1456#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
1457pub struct Result {
1458    ///This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
1459    #[serde(rename = "_meta")]
1460    #[serde(default, skip_serializing_if = "Option::is_none")]
1461    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
1462    /// Additional parameters that are not part of the schema.
1463    #[serde(flatten)]
1464    pub extra: serde_json::Map<String, serde_json::Value>,
1465}
1466///The sender or recipient of messages and data in a conversation.
1467#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Eq, Hash)]
1468pub enum Role {
1469    #[serde(rename = "assistant")]
1470    Assistant,
1471    #[serde(rename = "user")]
1472    User,
1473}
1474///Represents a root directory or file that the server can operate on.
1475#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Eq, Hash)]
1476pub struct Root {
1477    /**An optional name for the root. This can be used to provide a human-readable
1478identifier for the root, which may be useful for display purposes or for
1479referencing the root in other parts of the application.*/
1480    #[serde(default, skip_serializing_if = "Option::is_none")]
1481    pub name: Option<String>,
1482    /**The URI identifying the root. This *must* start with file:// for now.
1483This restriction may be relaxed in future versions of the protocol to allow
1484other URI schemes.*/
1485    pub uri: String,
1486    /// Additional parameters that are not part of the schema.
1487    #[serde(flatten)]
1488    pub extra: serde_json::Map<String, serde_json::Value>,
1489}
1490///Generated from JSON schema definition for RootsListChangedNotificationParams
1491#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
1492pub struct RootsListChangedNotificationParams {
1493    ///This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.
1494    #[serde(rename = "_meta")]
1495    #[serde(default, skip_serializing_if = "Option::is_none")]
1496    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
1497    /// Additional parameters that are not part of the schema.
1498    #[serde(flatten)]
1499    pub extra: serde_json::Map<String, serde_json::Value>,
1500}
1501/**A notification from the client to the server, informing it that the list of roots has changed.
1502This notification should be sent whenever the client adds, removes, or modifies any root.
1503The server should then request an updated list of roots using the ListRootsRequest.*/
1504#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1505pub struct RootsListChangedNotification {
1506    pub method: monostate::MustBe!("notifications/roots/list_changed"),
1507    #[serde(default, skip_serializing_if = "Option::is_none")]
1508    pub params: Option<RootsListChangedNotificationParams>,
1509    /// Additional parameters that are not part of the schema.
1510    #[serde(flatten)]
1511    pub extra: serde_json::Map<String, serde_json::Value>,
1512}
1513///Generated from JSON schema definition for SamplingMessageContent
1514#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1515#[serde(untagged)]
1516pub enum SamplingMessageContent {
1517    ///Text provided to or from an LLM.
1518    TextContent(TextContent),
1519    ///An image provided to or from an LLM.
1520    ImageContent(ImageContent),
1521    ///Audio provided to or from an LLM.
1522    AudioContent(AudioContent),
1523}
1524///Describes a message issued to or received from an LLM API.
1525#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1526pub struct SamplingMessage {
1527    pub content: SamplingMessageContent,
1528    pub role: Role,
1529    /// Additional parameters that are not part of the schema.
1530    #[serde(flatten)]
1531    pub extra: serde_json::Map<String, serde_json::Value>,
1532}
1533///Present if the server offers any prompt templates.
1534#[derive(
1535    Debug,
1536    Clone,
1537    PartialEq,
1538    serde::Serialize,
1539    serde::Deserialize,
1540    Eq,
1541    Hash,
1542    Default
1543)]
1544pub struct ServerCapabilitiesPrompts {
1545    ///Whether this server supports notifications for changes to the prompt list.
1546    #[serde(rename = "listChanged")]
1547    #[serde(default, skip_serializing_if = "Option::is_none")]
1548    pub list_changed: Option<bool>,
1549    /// Additional parameters that are not part of the schema.
1550    #[serde(flatten)]
1551    pub extra: serde_json::Map<String, serde_json::Value>,
1552}
1553///Present if the server offers any resources to read.
1554#[derive(
1555    Debug,
1556    Clone,
1557    PartialEq,
1558    serde::Serialize,
1559    serde::Deserialize,
1560    Eq,
1561    Hash,
1562    Default
1563)]
1564pub struct ServerCapabilitiesResources {
1565    ///Whether this server supports notifications for changes to the resource list.
1566    #[serde(rename = "listChanged")]
1567    #[serde(default, skip_serializing_if = "Option::is_none")]
1568    pub list_changed: Option<bool>,
1569    ///Whether this server supports subscribing to resource updates.
1570    #[serde(default, skip_serializing_if = "Option::is_none")]
1571    pub subscribe: Option<bool>,
1572    /// Additional parameters that are not part of the schema.
1573    #[serde(flatten)]
1574    pub extra: serde_json::Map<String, serde_json::Value>,
1575}
1576///Present if the server offers any tools to call.
1577#[derive(
1578    Debug,
1579    Clone,
1580    PartialEq,
1581    serde::Serialize,
1582    serde::Deserialize,
1583    Eq,
1584    Hash,
1585    Default
1586)]
1587pub struct ServerCapabilitiesTools {
1588    ///Whether this server supports notifications for changes to the tool list.
1589    #[serde(rename = "listChanged")]
1590    #[serde(default, skip_serializing_if = "Option::is_none")]
1591    pub list_changed: Option<bool>,
1592    /// Additional parameters that are not part of the schema.
1593    #[serde(flatten)]
1594    pub extra: serde_json::Map<String, serde_json::Value>,
1595}
1596///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.
1597#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
1598pub struct ServerCapabilities {
1599    ///Present if the server supports argument autocompletion suggestions.
1600    #[serde(default, skip_serializing_if = "Option::is_none")]
1601    pub completions: Option<serde_json::Map<String, serde_json::Value>>,
1602    ///Experimental, non-standard capabilities that the server supports.
1603    #[serde(default, skip_serializing_if = "Option::is_none")]
1604    pub experimental: Option<
1605        indexmap::IndexMap<String, serde_json::Map<String, serde_json::Value>>,
1606    >,
1607    ///Present if the server supports sending log messages to the client.
1608    #[serde(default, skip_serializing_if = "Option::is_none")]
1609    pub logging: Option<serde_json::Map<String, serde_json::Value>>,
1610    ///Present if the server offers any prompt templates.
1611    #[serde(default, skip_serializing_if = "Option::is_none")]
1612    pub prompts: Option<ServerCapabilitiesPrompts>,
1613    ///Present if the server offers any resources to read.
1614    #[serde(default, skip_serializing_if = "Option::is_none")]
1615    pub resources: Option<ServerCapabilitiesResources>,
1616    ///Present if the server offers any tools to call.
1617    #[serde(default, skip_serializing_if = "Option::is_none")]
1618    pub tools: Option<ServerCapabilitiesTools>,
1619    /// Additional parameters that are not part of the schema.
1620    #[serde(flatten)]
1621    pub extra: serde_json::Map<String, serde_json::Value>,
1622}
1623///Generated from JSON schema definition for ServerNotification
1624#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1625#[serde(untagged)]
1626pub enum ServerNotification {
1627    /**This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
1628
1629The 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.
1630
1631This notification indicates that the result will be unused, so any associated processing SHOULD cease.
1632
1633A client MUST NOT attempt to cancel its `initialize` request.*/
1634    CancelledNotification(CancelledNotification),
1635    ///An out-of-band notification used to inform the receiver of a progress update for a long-running request.
1636    ProgressNotification(ProgressNotification),
1637    ///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.
1638    ResourceListChangedNotification(ResourceListChangedNotification),
1639    ///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.
1640    ResourceUpdatedNotification(ResourceUpdatedNotification),
1641    ///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.
1642    PromptListChangedNotification(PromptListChangedNotification),
1643    ///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.
1644    ToolListChangedNotification(ToolListChangedNotification),
1645    ///Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.
1646    LoggingMessageNotification(LoggingMessageNotification),
1647}
1648///Generated from JSON schema definition for ServerRequest
1649#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1650#[serde(untagged)]
1651pub enum ServerRequest {
1652    ///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.
1653    PingRequest(PingRequest),
1654    ///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.
1655    CreateMessageRequest(CreateMessageRequest),
1656    /**Sent from the server to request a list of root URIs from the client. Roots allow
1657servers to ask for specific directories or files to operate on. A common example
1658for roots is providing a set of repositories or directories a server should operate
1659on.
1660
1661This request is typically used when the server needs to understand the file system
1662structure or access specific locations that the client has permission to read from.*/
1663    ListRootsRequest(ListRootsRequest),
1664}
1665///Generated from JSON schema definition for ServerResult
1666#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1667#[serde(untagged)]
1668pub enum ServerResult {
1669    Result(Result),
1670    ///After receiving an initialize request from the client, the server sends this response.
1671    InitializeResult(InitializeResult),
1672    ///The server's response to a resources/list request from the client.
1673    ListResourcesResult(ListResourcesResult),
1674    ///The server's response to a resources/read request from the client.
1675    ReadResourceResult(ReadResourceResult),
1676    ///The server's response to a prompts/list request from the client.
1677    ListPromptsResult(ListPromptsResult),
1678    ///The server's response to a prompts/get request from the client.
1679    GetPromptResult(GetPromptResult),
1680    ///The server's response to a tools/list request from the client.
1681    ListToolsResult(ListToolsResult),
1682    /**The server's response to a tool call.
1683
1684Any errors that originate from the tool SHOULD be reported inside the result
1685object, with `isError` set to true, _not_ as an MCP protocol-level error
1686response. Otherwise, the LLM would not be able to see that an error occurred
1687and self-correct.
1688
1689However, any errors in _finding_ the tool, an error indicating that the
1690server does not support tool calls, or any other exceptional conditions,
1691should be reported as an MCP error response.*/
1692    CallToolResult(CallToolResult),
1693    ///The server's response to a completion/complete request
1694    CompleteResult(CompleteResult),
1695}
1696///Generated from JSON schema definition for SetLevelRequestParams
1697#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1698pub struct SetLevelRequestParams {
1699    ///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.
1700    pub level: LoggingLevel,
1701    /// Additional parameters that are not part of the schema.
1702    #[serde(flatten)]
1703    pub extra: serde_json::Map<String, serde_json::Value>,
1704}
1705///A request from the client to the server, to enable or adjust logging.
1706#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1707pub struct SetLevelRequest {
1708    pub method: monostate::MustBe!("logging/setLevel"),
1709    pub params: SetLevelRequestParams,
1710    /// Additional parameters that are not part of the schema.
1711    #[serde(flatten)]
1712    pub extra: serde_json::Map<String, serde_json::Value>,
1713}
1714///Generated from JSON schema definition for SubscribeRequestParams
1715#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Eq, Hash)]
1716pub struct SubscribeRequestParams {
1717    ///The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.
1718    pub uri: String,
1719    /// Additional parameters that are not part of the schema.
1720    #[serde(flatten)]
1721    pub extra: serde_json::Map<String, serde_json::Value>,
1722}
1723///Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
1724#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1725pub struct SubscribeRequest {
1726    pub method: monostate::MustBe!("resources/subscribe"),
1727    pub params: SubscribeRequestParams,
1728    /// Additional parameters that are not part of the schema.
1729    #[serde(flatten)]
1730    pub extra: serde_json::Map<String, serde_json::Value>,
1731}
1732///Text provided to or from an LLM.
1733#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1734pub struct TextContent {
1735    ///Optional annotations for the client.
1736    #[serde(default, skip_serializing_if = "Option::is_none")]
1737    pub annotations: Option<Annotations>,
1738    ///The text content of the message.
1739    pub text: String,
1740    pub r#type: monostate::MustBe!("text"),
1741    /// Additional parameters that are not part of the schema.
1742    #[serde(flatten)]
1743    pub extra: serde_json::Map<String, serde_json::Value>,
1744}
1745///Generated from JSON schema definition for TextResourceContents
1746#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Eq, Hash)]
1747pub struct TextResourceContents {
1748    ///The MIME type of this resource, if known.
1749    #[serde(rename = "mimeType")]
1750    #[serde(default, skip_serializing_if = "Option::is_none")]
1751    pub mime_type: Option<String>,
1752    ///The text of the item. This must only be set if the item can actually be represented as text (not binary data).
1753    pub text: String,
1754    ///The URI of this resource.
1755    pub uri: String,
1756    /// Additional parameters that are not part of the schema.
1757    #[serde(flatten)]
1758    pub extra: serde_json::Map<String, serde_json::Value>,
1759}
1760///A JSON Schema object defining the expected parameters for the tool.
1761#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1762pub struct ToolInputSchema {
1763    #[serde(default, skip_serializing_if = "Option::is_none")]
1764    pub properties: Option<
1765        indexmap::IndexMap<String, serde_json::Map<String, serde_json::Value>>,
1766    >,
1767    #[serde(default, skip_serializing_if = "Option::is_none")]
1768    pub required: Option<Vec<String>>,
1769    pub r#type: monostate::MustBe!("object"),
1770    /// Additional parameters that are not part of the schema.
1771    #[serde(flatten)]
1772    pub extra: serde_json::Map<String, serde_json::Value>,
1773}
1774///Definition for a tool the client can call.
1775#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1776pub struct Tool {
1777    ///Optional additional tool information.
1778    #[serde(default, skip_serializing_if = "Option::is_none")]
1779    pub annotations: Option<ToolAnnotations>,
1780    /**A human-readable description of the tool.
1781
1782This 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.*/
1783    #[serde(default, skip_serializing_if = "Option::is_none")]
1784    pub description: Option<String>,
1785    ///A JSON Schema object defining the expected parameters for the tool.
1786    #[serde(rename = "inputSchema")]
1787    pub input_schema: ToolInputSchema,
1788    ///The name of the tool.
1789    pub name: String,
1790    /// Additional parameters that are not part of the schema.
1791    #[serde(flatten)]
1792    pub extra: serde_json::Map<String, serde_json::Value>,
1793}
1794/**Additional properties describing a Tool to clients.
1795
1796NOTE: all properties in ToolAnnotations are **hints**.
1797They are not guaranteed to provide a faithful description of
1798tool behavior (including descriptive properties like `title`).
1799
1800Clients should never make tool use decisions based on ToolAnnotations
1801received from untrusted servers.*/
1802#[derive(
1803    Debug,
1804    Clone,
1805    PartialEq,
1806    serde::Serialize,
1807    serde::Deserialize,
1808    Eq,
1809    Hash,
1810    Default
1811)]
1812pub struct ToolAnnotations {
1813    /**If true, the tool may perform destructive updates to its environment.
1814If false, the tool performs only additive updates.
1815
1816(This property is meaningful only when `readOnlyHint == false`)
1817
1818Default: true*/
1819    #[serde(rename = "destructiveHint")]
1820    #[serde(default, skip_serializing_if = "Option::is_none")]
1821    pub destructive_hint: Option<bool>,
1822    /**If true, calling the tool repeatedly with the same arguments
1823will have no additional effect on the its environment.
1824
1825(This property is meaningful only when `readOnlyHint == false`)
1826
1827Default: false*/
1828    #[serde(rename = "idempotentHint")]
1829    #[serde(default, skip_serializing_if = "Option::is_none")]
1830    pub idempotent_hint: Option<bool>,
1831    /**If true, this tool may interact with an "open world" of external
1832entities. If false, the tool's domain of interaction is closed.
1833For example, the world of a web search tool is open, whereas that
1834of a memory tool is not.
1835
1836Default: true*/
1837    #[serde(rename = "openWorldHint")]
1838    #[serde(default, skip_serializing_if = "Option::is_none")]
1839    pub open_world_hint: Option<bool>,
1840    /**If true, the tool does not modify its environment.
1841
1842Default: false*/
1843    #[serde(rename = "readOnlyHint")]
1844    #[serde(default, skip_serializing_if = "Option::is_none")]
1845    pub read_only_hint: Option<bool>,
1846    ///A human-readable title for the tool.
1847    #[serde(default, skip_serializing_if = "Option::is_none")]
1848    pub title: Option<String>,
1849    /// Additional parameters that are not part of the schema.
1850    #[serde(flatten)]
1851    pub extra: serde_json::Map<String, serde_json::Value>,
1852}
1853///Generated from JSON schema definition for ToolListChangedNotificationParams
1854#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
1855pub struct ToolListChangedNotificationParams {
1856    ///This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.
1857    #[serde(rename = "_meta")]
1858    #[serde(default, skip_serializing_if = "Option::is_none")]
1859    pub meta: Option<serde_json::Map<String, serde_json::Value>>,
1860    /// Additional parameters that are not part of the schema.
1861    #[serde(flatten)]
1862    pub extra: serde_json::Map<String, serde_json::Value>,
1863}
1864///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.
1865#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1866pub struct ToolListChangedNotification {
1867    pub method: monostate::MustBe!("notifications/tools/list_changed"),
1868    #[serde(default, skip_serializing_if = "Option::is_none")]
1869    pub params: Option<ToolListChangedNotificationParams>,
1870    /// Additional parameters that are not part of the schema.
1871    #[serde(flatten)]
1872    pub extra: serde_json::Map<String, serde_json::Value>,
1873}
1874///Generated from JSON schema definition for UnsubscribeRequestParams
1875#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Eq, Hash)]
1876pub struct UnsubscribeRequestParams {
1877    ///The URI of the resource to unsubscribe from.
1878    pub uri: String,
1879    /// Additional parameters that are not part of the schema.
1880    #[serde(flatten)]
1881    pub extra: serde_json::Map<String, serde_json::Value>,
1882}
1883///Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
1884#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1885pub struct UnsubscribeRequest {
1886    pub method: monostate::MustBe!("resources/unsubscribe"),
1887    pub params: UnsubscribeRequestParams,
1888    /// Additional parameters that are not part of the schema.
1889    #[serde(flatten)]
1890    pub extra: serde_json::Map<String, serde_json::Value>,
1891}