diff --git a/Cargo.toml b/Cargo.toml
index b5bbf50..f6be0e0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,6 +9,8 @@ documentation = "https://docs.rs/rust-mcp-schema"
keywords = ["rust-mcp-stack", "model", "context", "protocol", "schema"]
license = "MIT"
edition = "2021"
+rust-version = "1.80.0"
+
[lib]
path = "src/rust-mcp-schema.rs"
@@ -24,11 +26,11 @@ json5 = { version = "0.4" }
[package.metadata.docs.rs]
-features = ["2025_06_18", "schema_utils"]
+features = ["2025_11_25", "schema_utils"]
rustdoc-args = ["--generate-link-to-definition"]
[package.metadata.playground]
-features = ["2025_06_18", "schema_utils"]
+features = ["2025_11_25", "schema_utils"]
### FEATURES #################################################################
@@ -36,12 +38,14 @@ features = ["2025_06_18", "schema_utils"]
[features]
# default features
-default = ["2025_06_18", "schema_utils"] # Default features
+default = ["2025_11_25", "schema_utils"] # Default features
# activates the latest MCP schema version, this will be updated once a new version of schema is published
-latest = ["2025_06_18"]
+latest = ["2025_11_25"]
+# enabled mcp schema version 2025_11_25
+2025_11_25 = ["latest"]
# enabled mcp schema version 2025_06_18
-2025_06_18 = ["latest"]
+2025_06_18 = []
# enabled mcp schema version 2025_03_26
2025_03_26 = []
# enabled mcp schema version 2024_11_05
diff --git a/README.md b/README.md
index b4f247f..81f9781 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,13 @@
[
](https://github.com/rust-mcp-stack/rust-mcp-schema/actions/workflows/ci.yml)
-A type-safe Rust implementation of the official Model Context Protocol (MCP) schema, supporting all official released versions including `2025_06_18`, `2025_03_26`, `2024_11_05` and `draft` version for early adoption.
+A type-safe Rust implementation of the official Model Context Protocol (MCP) schema, supporting all official MCP Protocol versions:
+
+- `2025-11-25`
+- `2025-06-18`
+- `2025-03-26`
+- `2024-11-05`
+- `draft`
The MCP schemas in this repository are [automatically generated](#how-are-schemas-generated) from the official Model Context Protocol, ensuring they are always up-to-date and aligned with the latest official specifications.
@@ -46,7 +52,7 @@ Focus on your app's logic while [rust-mcp-sdk](https://crates.io/crates/rust-mcp
- 🧩 Type-safe implementation of the MCP protocol specification.
- 💎 Auto-generated schemas are always synchronized with the official schema specifications.
-- 📜 Includes all official released versions : `2025_06_18`, `2025_03_26`, `2024_11_05` and `draft` version for early adoption.
+- 📜 Includes all official released versions : `2025-11-25`, `2025-06-18`, `2025-03-26`, `2024-11-05` and `draft` version for early adoption.
- 🛠Complimentary schema utility module (schema_utils) to boost productivity and ensure development integrity.
## How can this crate be used?
@@ -70,9 +76,10 @@ For more information on the MCP architecture, refer to the [official documentati
This repository provides all official released versions the schema , including draft version, enabling you to prepare and adapt your applications ahead of upcoming official schema releases.
-- [2025_06_18](src/generated_schema/2025_06_18)
-- [2025_03_26](src/generated_schema/2025_03_26)
-- [2024_11_05](src/generated_schema/2024_11_05)
+- [2025-11-25](src/generated_schema/2025_11_25)
+- [2025-06-18](src/generated_schema/2025_06_18)
+- [2025-03-26](src/generated_schema/2025_03_26)
+- [2024-11-05](src/generated_schema/2024_11_05)
- [draft](src/generated_schema/draft)
### How to switch between different schema versions?
@@ -83,19 +90,19 @@ Each schema version has a corresponding Cargo feature that can be enabled in you
Multiple schema versions may be enabled concurrently if needed. Non-default versions are available under explicitly named modules, for example:
-- rust_mcp_schema::mcp_2024_11_05
+- rust_mcp_schema::mcp_2025_06_18
- rust_mcp_schema::mcp_draft"
-Example: enable `2024_11_05` version of the schema:
+Example: enable `2025-06-18` version of the schema:
```toml
# Cargo.toml
-rust-mcp-schema = { version: 0.7.5 , default-features = false, features=["2024_11_05"] }
+rust-mcp-schema = { version: 0.7.5 , default-features = false, features=["2025_06_18"] }
```
-Example: enable `draft`` version of the schema (2024_11_05) :
+Example: enable `draft`` version of the schema :
```toml
#Cargo.toml
diff --git a/examples/mcp_client_handle_message.rs b/examples/mcp_client_handle_message.rs
index d072191..e3fc590 100644
--- a/examples/mcp_client_handle_message.rs
+++ b/examples/mcp_client_handle_message.rs
@@ -4,6 +4,12 @@ mod schema {
pub use rust_mcp_schema::*;
}
+#[cfg(feature = "2025_06_18")]
+mod schema {
+ pub use rust_mcp_schema::mcp_2025_06_18::schema_utils::*;
+ pub use rust_mcp_schema::mcp_2025_06_18::*;
+}
+
#[cfg(feature = "2024_11_05")]
mod schema {
pub use rust_mcp_schema::mcp_2024_11_05::schema_utils::*;
@@ -77,10 +83,26 @@ fn handle_message(message_payload: &str) -> std::result::Result<(), AppError> {
ServerRequest::ListRootsRequest(list_roots_request) => {
dbg!(list_roots_request);
}
- #[cfg(any(feature = "2025_06_18", feature = "draft"))]
+ #[cfg(any(feature = "2025_06_18", feature = "2025_11_25", feature = "draft"))]
ServerRequest::ElicitRequest(elicit_request) => {
dbg!(elicit_request);
}
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ServerRequest::GetTaskRequest(get_task_request) => {
+ dbg!(get_task_request);
+ }
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ServerRequest::GetTaskPayloadRequest(get_task_payload_request) => {
+ dbg!(get_task_payload_request);
+ }
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ServerRequest::CancelTaskRequest(cancel_task_request) => {
+ dbg!(cancel_task_request);
+ }
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ServerRequest::ListTasksRequest(list_tasks_request) => {
+ dbg!(list_tasks_request);
+ }
}
}
// Check if it's a CustomRequest; the value can be deserialized into your own custom types.
@@ -115,6 +137,14 @@ fn handle_message(message_payload: &str) -> std::result::Result<(), AppError> {
ServerNotification::LoggingMessageNotification(logging_message_notification) => {
dbg!(logging_message_notification);
}
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ServerNotification::TaskStatusNotification(task_status_notification) => {
+ dbg!(task_status_notification);
+ }
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ServerNotification::ElicitationCompleteNotification(elicitation_complete_notification) => {
+ dbg!(elicitation_complete_notification);
+ }
}
}
// Check if it's a CustomNotification; the value can be deserialized into your custom types.
@@ -156,6 +186,22 @@ fn handle_message(message_payload: &str) -> std::result::Result<(), AppError> {
ServerResult::CompleteResult(complete_result) => {
dbg!(complete_result);
}
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ServerResult::GetTaskResult(get_task_result) => {
+ dbg!(get_task_result);
+ }
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ServerResult::GetTaskPayloadResult(get_task_payload_result) => {
+ dbg!(get_task_payload_result);
+ }
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ServerResult::CancelTaskResult(cancel_task_result) => {
+ dbg!(cancel_task_result);
+ }
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ServerResult::ListTasksResult(list_tasks_result) => {
+ dbg!(list_tasks_result);
+ }
},
// Check if it's a CustomResult; the value can be deserialized into your custom types.
ResultFromServer::CustomResult(value) => {
diff --git a/examples/mcp_server_handle_message.rs b/examples/mcp_server_handle_message.rs
index 391ef5d..6b3e430 100644
--- a/examples/mcp_server_handle_message.rs
+++ b/examples/mcp_server_handle_message.rs
@@ -4,6 +4,12 @@ mod schema {
pub use rust_mcp_schema::*;
}
+#[cfg(feature = "2025_06_18")]
+mod schema {
+ pub use rust_mcp_schema::mcp_2025_06_18::schema_utils::*;
+ pub use rust_mcp_schema::mcp_2025_06_18::*;
+}
+
#[cfg(feature = "2024_11_05")]
mod schema {
pub use rust_mcp_schema::mcp_2024_11_05::schema_utils::*;
@@ -68,53 +74,58 @@ fn handle_message(message_payload: &str) -> std::result::Result<(), AppError> {
ClientRequest::InitializeRequest(initialize_request) => {
dbg!(initialize_request);
}
-
ClientRequest::PingRequest(ping_request) => {
dbg!(ping_request);
}
ClientRequest::ListResourcesRequest(list_resources_request) => {
dbg!(list_resources_request);
}
-
ClientRequest::ListResourceTemplatesRequest(list_resource_templates_request) => {
dbg!(list_resource_templates_request);
}
-
ClientRequest::ReadResourceRequest(read_resource_request) => {
dbg!(read_resource_request);
}
-
ClientRequest::SubscribeRequest(subscribe_request) => {
dbg!(subscribe_request);
}
-
ClientRequest::UnsubscribeRequest(unsubscribe_request) => {
dbg!(unsubscribe_request);
}
-
ClientRequest::ListPromptsRequest(list_prompts_request) => {
dbg!(list_prompts_request);
}
-
ClientRequest::GetPromptRequest(get_prompt_request) => {
dbg!(get_prompt_request);
}
-
ClientRequest::ListToolsRequest(list_tools_request) => {
dbg!(list_tools_request);
}
-
ClientRequest::CallToolRequest(call_tool_request) => {
dbg!(call_tool_request);
}
-
ClientRequest::SetLevelRequest(set_level_request) => {
dbg!(set_level_request);
}
-
ClientRequest::CompleteRequest(complete_request) => {
dbg!(complete_request);
}
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ClientRequest::GetTaskRequest(get_task_request) => {
+ dbg!(get_task_request);
+ }
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ClientRequest::GetTaskPayloadRequest(get_task_payload_request) => {
+ dbg!(get_task_payload_request);
+ }
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ClientRequest::CancelTaskRequest(cancel_task_request) => {
+ dbg!(cancel_task_request);
+ }
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ClientRequest::ListTasksRequest(list_tasks_request) => {
+ dbg!(list_tasks_request);
+ }
},
// Check if it's a CustomRequest; the value can be deserialized into your own custom types.
@@ -132,18 +143,19 @@ fn handle_message(message_payload: &str) -> std::result::Result<(), AppError> {
ClientNotification::CancelledNotification(cancelled_notification) => {
dbg!(cancelled_notification);
}
-
ClientNotification::InitializedNotification(initialized_notification) => {
dbg!(initialized_notification);
}
-
ClientNotification::ProgressNotification(progress_notification) => {
dbg!(progress_notification);
}
-
ClientNotification::RootsListChangedNotification(progress_notification) => {
dbg!(progress_notification);
}
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ClientNotification::TaskStatusNotification(task_status_notification) => {
+ dbg!(task_status_notification);
+ }
}
}
@@ -166,10 +178,26 @@ fn handle_message(message_payload: &str) -> std::result::Result<(), AppError> {
ClientResult::ListRootsResult(list_roots_result) => {
dbg!(list_roots_result);
}
- #[cfg(any(feature = "2025_06_18", feature = "draft"))]
+ #[cfg(any(feature = "2025_06_18", feature = "2025_11_25", feature = "draft"))]
ClientResult::ElicitResult(elicit_result) => {
dbg!(elicit_result);
}
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ClientResult::GetTaskResult(get_task_result) => {
+ dbg!(get_task_result);
+ }
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ClientResult::GetTaskPayloadResult(get_task_payload_result) => {
+ dbg!(get_task_payload_result);
+ }
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ClientResult::CancelTaskResult(cancel_task_result) => {
+ dbg!(cancel_task_result);
+ }
+ #[cfg(any(feature = "2025_11_25", feature = "draft"))]
+ ClientResult::ListTasksResult(list_tasks_result) => {
+ dbg!(list_tasks_result);
+ }
},
// Check if it's a CustomResult; the value can be deserialized into your custom types.
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
deleted file mode 100644
index 7855e6d..0000000
--- a/rust-toolchain.toml
+++ /dev/null
@@ -1,3 +0,0 @@
-[toolchain]
-channel = "1.88.0"
-components = ["rustfmt", "clippy"]
diff --git a/scripts/run_clippy.sh b/scripts/run_clippy.sh
index 5ec2aee..c0759b3 100755
--- a/scripts/run_clippy.sh
+++ b/scripts/run_clippy.sh
@@ -4,7 +4,7 @@
COMMON_FEATURES=("schema_utils")
# schema versions features (passed to clippy one at a time)
-SCHEMA_VERSION_FEATURES=("2025_06_18", "2025_03_26", "2024_11_05", "draft")
+SCHEMA_VERSION_FEATURES=("2025_11_25", "2025_06_18", "2025_03_26", "2024_11_05", "draft")
# space-separated string
COMMON_FEATURES_STR="${COMMON_FEATURES[*]}"
diff --git a/scripts/run_test.sh b/scripts/run_test.sh
index 764b552..43a5900 100755
--- a/scripts/run_test.sh
+++ b/scripts/run_test.sh
@@ -4,7 +4,7 @@
COMMON_FEATURES=("schema_utils")
# schema versions features (tested one at a time)
-SCHEMA_VERSION_FEATURES=("2025_06_18", "2025_03_26", "2024_11_05") #// TODO: add the "draft" tests back
+SCHEMA_VERSION_FEATURES=("2025_11_25", "2025_06_18", "2025_03_26", "2024_11_05") #// TODO: add the "draft" tests back
# space-separated string
COMMON_FEATURES_STR="${COMMON_FEATURES[*]}"
diff --git a/src/generated_schema.rs b/src/generated_schema.rs
index be88bf1..57a4f51 100644
--- a/src/generated_schema.rs
+++ b/src/generated_schema.rs
@@ -31,9 +31,9 @@ macro_rules! define_schema_version {
};
}
-/// Latest MCP Protocol 2025_06_18
-#[cfg(feature = "2025_06_18")]
-pub use mcp_2025_06_18::*;
+/// Latest MCP Protocol 2025_11_25
+#[cfg(feature = "2025_11_25")]
+pub use mcp_2025_11_25::*;
#[cfg(feature = "2025_06_18")]
define_schema_version!(
@@ -68,6 +68,17 @@ define_schema_version!(
__int_utils_2024_11_05
);
+#[cfg(feature = "2025_11_25")]
+define_schema_version!(
+ "2025_11_25",
+ mcp_2025_11_25,
+ "generated_schema/2025_11_25/mcp_schema.rs",
+ "generated_schema/2025_11_25/schema_utils.rs",
+ "generated_schema/2025_11_25/validators.rs",
+ __int_2025_11_25,
+ __int_utils_2025_11_25
+);
+
#[cfg(feature = "draft")]
define_schema_version!(
"draft",
diff --git a/src/generated_schema/2024_11_05/mcp_schema.rs b/src/generated_schema/2024_11_05/mcp_schema.rs
index aeffa9f..7bc16f9 100644
--- a/src/generated_schema/2024_11_05/mcp_schema.rs
+++ b/src/generated_schema/2024_11_05/mcp_schema.rs
@@ -1,12 +1,14 @@
+/// Copyright (c) 2025 Ali Hashemi (rust-mcp-stack)
+/// Licensed under the MIT License. See LICENSE in the project root.
/// ----------------------------------------------------------------------------
-/// This file is auto-generated by mcp-schema-gen v0.4.4.
+/// This file is auto-generated by mcp-schema-gen v0.5.0.
/// WARNING:
/// It is not recommended to modify this file directly. You are free to
/// modify or extend the implementations as needed, but please do so at your own risk.
///
/// Generated from :
-/// Hash : 71204c22f8e062795dca00a87d31070033572ba2
-/// Generated at : 2025-10-03 15:17:01
+/// Hash : 391c69f42f21bab3a5df0923b45b9ad3174414b9
+/// Generated at : 2025-12-01 18:52:52
/// ----------------------------------------------------------------------------
///
use super::validators as validate;
@@ -186,6 +188,11 @@ impl CallToolRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "tools/call"
+ pub fn method_value() -> ::std::string::String {
+ "tools/call".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"tools/call".to_string()
}
@@ -375,6 +382,11 @@ impl CancelledNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/cancelled"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/cancelled".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/cancelled".to_string()
}
@@ -456,34 +468,11 @@ pub struct ClientCapabilities {
::std::collections::HashMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
- pub roots: ::std::option::Option,
+ pub roots: ::std::option::Option,
///Present if the client supports sampling from an LLM.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub sampling: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
}
-///Present if the client supports listing roots.
-///
-/// JSON schema
-///
-/// ```json
-///{
-/// "description": "Present if the client supports listing roots.",
-/// "type": "object",
-/// "properties": {
-/// "listChanged": {
-/// "description": "Whether the client supports notifications for changes to the roots list.",
-/// "type": "boolean"
-/// }
-/// }
-///}
-/// ```
-///
-#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
-pub struct ClientCapabilitiesRoots {
- ///Whether the client supports notifications for changes to the roots list.
- #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
- pub list_changed: ::std::option::Option,
-}
///ClientNotification
///
/// JSON schema
@@ -709,6 +698,29 @@ impl ::std::convert::From for ClientResult {
Self::Result(value)
}
}
+///Present if the client supports listing roots.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Present if the client supports listing roots.",
+/// "type": "object",
+/// "properties": {
+/// "listChanged": {
+/// "description": "Whether the client supports notifications for changes to the roots list.",
+/// "type": "boolean"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ClientRoots {
+ ///Whether the client supports notifications for changes to the roots list.
+ #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub list_changed: ::std::option::Option,
+}
///A request from the client to the server, to ask for completion options.
///
/// JSON schema
@@ -783,10 +795,47 @@ impl CompleteRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "completion/complete"
+ pub fn method_value() -> ::std::string::String {
+ "completion/complete".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"completion/complete".to_string()
}
}
+///The argument's information
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The argument's information",
+/// "type": "object",
+/// "required": [
+/// "name",
+/// "value"
+/// ],
+/// "properties": {
+/// "name": {
+/// "description": "The name of the argument",
+/// "type": "string"
+/// },
+/// "value": {
+/// "description": "The value of the argument to use for completion matching.",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CompleteRequestArgument {
+ ///The name of the argument
+ pub name: ::std::string::String,
+ ///The value of the argument to use for completion matching.
+ pub value: ::std::string::String,
+}
///CompleteRequestParams
///
/// JSON schema
@@ -833,43 +882,11 @@ impl CompleteRequest {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CompleteRequestParams {
- pub argument: CompleteRequestParamsArgument,
+ pub argument: CompleteRequestArgument,
#[serde(rename = "ref")]
- pub ref_: CompleteRequestParamsRef,
-}
-///The argument's information
-///
-/// JSON schema
-///
-/// ```json
-///{
-/// "description": "The argument's information",
-/// "type": "object",
-/// "required": [
-/// "name",
-/// "value"
-/// ],
-/// "properties": {
-/// "name": {
-/// "description": "The name of the argument",
-/// "type": "string"
-/// },
-/// "value": {
-/// "description": "The value of the argument to use for completion matching.",
-/// "type": "string"
-/// }
-/// }
-///}
-/// ```
-///
-#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
-pub struct CompleteRequestParamsArgument {
- ///The name of the argument
- pub name: ::std::string::String,
- ///The value of the argument to use for completion matching.
- pub value: ::std::string::String,
+ pub ref_: CompleteRequestRef,
}
-///CompleteRequestParamsRef
+///CompleteRequestRef
///
/// JSON schema
///
@@ -888,16 +905,16 @@ pub struct CompleteRequestParamsArgument {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
-pub enum CompleteRequestParamsRef {
+pub enum CompleteRequestRef {
PromptReference(PromptReference),
ResourceReference(ResourceReference),
}
-impl ::std::convert::From for CompleteRequestParamsRef {
+impl ::std::convert::From for CompleteRequestRef {
fn from(value: PromptReference) -> Self {
Self::PromptReference(value)
}
}
-impl ::std::convert::From for CompleteRequestParamsRef {
+impl ::std::convert::From for CompleteRequestRef {
fn from(value: ResourceReference) -> Self {
Self::ResourceReference(value)
}
@@ -1081,6 +1098,11 @@ impl CreateMessageRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "sampling/createMessage"
+ pub fn method_value() -> ::std::string::String {
+ "sampling/createMessage".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"sampling/createMessage".to_string()
}
@@ -1146,7 +1168,7 @@ impl CreateMessageRequest {
pub struct CreateMessageRequestParams {
///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.
#[serde(rename = "includeContext", default, skip_serializing_if = "::std::option::Option::is_none")]
- pub include_context: ::std::option::Option,
+ pub include_context: ::std::option::Option,
///The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested.
#[serde(rename = "maxTokens")]
pub max_tokens: i64,
@@ -1169,40 +1191,6 @@ pub struct CreateMessageRequestParams {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub temperature: ::std::option::Option,
}
-///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.
-///
-/// JSON schema
-///
-/// ```json
-///{
-/// "description": "A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.",
-/// "type": "string",
-/// "enum": [
-/// "allServers",
-/// "none",
-/// "thisServer"
-/// ]
-///}
-/// ```
-///
-#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
-pub enum CreateMessageRequestParamsIncludeContext {
- #[serde(rename = "allServers")]
- AllServers,
- #[serde(rename = "none")]
- None,
- #[serde(rename = "thisServer")]
- ThisServer,
-}
-impl ::std::fmt::Display for CreateMessageRequestParamsIncludeContext {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- match *self {
- Self::AllServers => write!(f, "allServers"),
- Self::None => write!(f, "none"),
- Self::ThisServer => write!(f, "thisServer"),
- }
- }
-}
///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.
///
/// JSON schema
@@ -1377,6 +1365,11 @@ impl EmbeddedResource {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "resource"
+ pub fn type_value() -> ::std::string::String {
+ "resource".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"resource".to_string()
}
@@ -1517,6 +1510,11 @@ impl GetPromptRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "prompts/get"
+ pub fn method_value() -> ::std::string::String {
+ "prompts/get".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"prompts/get".to_string()
}
@@ -1673,6 +1671,11 @@ impl ImageContent {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "image"
+ pub fn type_value() -> ::std::string::String {
+ "image".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"image".to_string()
}
@@ -1739,6 +1742,40 @@ pub struct Implementation {
pub name: ::std::string::String,
pub version: ::std::string::String,
}
+///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.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.",
+/// "type": "string",
+/// "enum": [
+/// "allServers",
+/// "none",
+/// "thisServer"
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+pub enum IncludeContext {
+ #[serde(rename = "allServers")]
+ AllServers,
+ #[serde(rename = "none")]
+ None,
+ #[serde(rename = "thisServer")]
+ ThisServer,
+}
+impl ::std::fmt::Display for IncludeContext {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ match *self {
+ Self::AllServers => write!(f, "allServers"),
+ Self::None => write!(f, "none"),
+ Self::ThisServer => write!(f, "thisServer"),
+ }
+ }
+}
///This request is sent from the client to the server when it first connects, asking it to begin initialization.
///
/// JSON schema
@@ -1796,6 +1833,11 @@ impl InitializeRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "initialize"
+ pub fn method_value() -> ::std::string::String {
+ "initialize".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"initialize".to_string()
}
@@ -1937,6 +1979,11 @@ impl InitializedNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/initialized"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/initialized".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/initialized".to_string()
}
@@ -2372,6 +2419,11 @@ impl ListPromptsRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "prompts/list"
+ pub fn method_value() -> ::std::string::String {
+ "prompts/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"prompts/list".to_string()
}
@@ -2487,6 +2539,11 @@ impl ListResourceTemplatesRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "resources/templates/list"
+ pub fn method_value() -> ::std::string::String {
+ "resources/templates/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"resources/templates/list".to_string()
}
@@ -2603,6 +2660,11 @@ impl ListResourcesRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "resources/list"
+ pub fn method_value() -> ::std::string::String {
+ "resources/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"resources/list".to_string()
}
@@ -2729,6 +2791,11 @@ impl ListRootsRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "roots/list"
+ pub fn method_value() -> ::std::string::String {
+ "roots/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"roots/list".to_string()
}
@@ -2866,6 +2933,11 @@ impl ListToolsRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "tools/list"
+ pub fn method_value() -> ::std::string::String {
+ "tools/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"tools/list".to_string()
}
@@ -3048,6 +3120,11 @@ impl LoggingMessageNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/message"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/message".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/message".to_string()
}
@@ -3386,6 +3463,11 @@ impl PingRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "ping"
+ pub fn method_value() -> ::std::string::String {
+ "ping".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"ping".to_string()
}
@@ -3499,6 +3581,11 @@ impl ProgressNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/progress"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/progress".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/progress".to_string()
}
@@ -3694,6 +3781,11 @@ impl PromptListChangedNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/prompts/list_changed"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/prompts/list_changed".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/prompts/list_changed".to_string()
}
@@ -3848,10 +3940,48 @@ impl PromptReference {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "ref/prompt"
+ pub fn type_value() -> ::std::string::String {
+ "ref/prompt".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"ref/prompt".to_string()
}
}
+///ReadResourceContent
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "$ref": "#/definitions/TextResourceContents"
+/// },
+/// {
+/// "$ref": "#/definitions/BlobResourceContents"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum ReadResourceContent {
+ TextResourceContents(TextResourceContents),
+ BlobResourceContents(BlobResourceContents),
+}
+impl ::std::convert::From for ReadResourceContent {
+ fn from(value: TextResourceContents) -> Self {
+ Self::TextResourceContents(value)
+ }
+}
+impl ::std::convert::From for ReadResourceContent {
+ fn from(value: BlobResourceContents) -> Self {
+ Self::BlobResourceContents(value)
+ }
+}
///Sent from the client to the server, to read a specific resource URI.
///
/// JSON schema
@@ -3902,6 +4032,11 @@ impl ReadResourceRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "resources/read"
+ pub fn method_value() -> ::std::string::String {
+ "resources/read".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"resources/read".to_string()
}
@@ -3967,44 +4102,11 @@ pub struct ReadResourceRequestParams {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReadResourceResult {
- pub contents: ::std::vec::Vec,
+ pub contents: ::std::vec::Vec,
///This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
}
-///ReadResourceResultContentsItem
-///
-/// JSON schema
-///
-/// ```json
-///{
-/// "anyOf": [
-/// {
-/// "$ref": "#/definitions/TextResourceContents"
-/// },
-/// {
-/// "$ref": "#/definitions/BlobResourceContents"
-/// }
-/// ]
-///}
-/// ```
-///
-#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
-#[serde(untagged)]
-pub enum ReadResourceResultContentsItem {
- TextResourceContents(TextResourceContents),
- BlobResourceContents(BlobResourceContents),
-}
-impl ::std::convert::From for ReadResourceResultContentsItem {
- fn from(value: TextResourceContents) -> Self {
- Self::TextResourceContents(value)
- }
-}
-impl ::std::convert::From for ReadResourceResultContentsItem {
- fn from(value: BlobResourceContents) -> Self {
- Self::BlobResourceContents(value)
- }
-}
///Request
///
/// JSON schema
@@ -4312,6 +4414,11 @@ impl ResourceListChangedNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/resources/list_changed"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/resources/list_changed".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/resources/list_changed".to_string()
}
@@ -4385,6 +4492,11 @@ impl ResourceReference {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "ref/resource"
+ pub fn type_value() -> ::std::string::String {
+ "ref/resource".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"ref/resource".to_string()
}
@@ -4543,6 +4655,11 @@ impl ResourceUpdatedNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/resources/updated"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/resources/updated".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/resources/updated".to_string()
}
@@ -4715,6 +4832,11 @@ impl RootsListChangedNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/roots/list_changed"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/roots/list_changed".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/roots/list_changed".to_string()
}
@@ -5279,6 +5401,11 @@ impl SetLevelRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "logging/setLevel"
+ pub fn method_value() -> ::std::string::String {
+ "logging/setLevel".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"logging/setLevel".to_string()
}
@@ -5357,6 +5484,11 @@ impl SubscribeRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "resources/subscribe"
+ pub fn method_value() -> ::std::string::String {
+ "resources/subscribe".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"resources/subscribe".to_string()
}
@@ -5449,6 +5581,11 @@ impl TextContent {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "text"
+ pub fn type_value() -> ::std::string::String {
+ "text".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"text".to_string()
}
@@ -5650,6 +5787,11 @@ impl ToolInputSchema {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "object"
+ pub fn type_value() -> ::std::string::String {
+ "object".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"object".to_string()
}
@@ -5702,6 +5844,11 @@ impl ToolListChangedNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/tools/list_changed"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/tools/list_changed".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/tools/list_changed".to_string()
}
@@ -5782,6 +5929,11 @@ impl UnsubscribeRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "resources/unsubscribe"
+ pub fn method_value() -> ::std::string::String {
+ "resources/unsubscribe".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"resources/unsubscribe".to_string()
}
@@ -6049,5 +6201,17 @@ impl ServerNotification {
}
}
}
-#[deprecated(since = "0.3.0", note = "Use `RpcError` instead.")]
-pub type JsonrpcErrorError = RpcError;
+/// Deprecating the old auto-generated verbose names.
+/// These were renamed to clearer, shorter names in v0.8.0.
+/// The old names are deprecated but kept for backward-compatibility for a smooth migration period.
+///
+#[deprecated(since = "0.8.0", note = "Use `ClientRoots` instead.")]
+pub type ClientCapabilitiesRoots = ClientRoots;
+#[deprecated(since = "0.8.0", note = "Use `IncludeContext` instead.")]
+pub type CreateMessageRequestParamsIncludeContext = IncludeContext;
+#[deprecated(since = "0.8.0", note = "Use `CompleteRequestRef` instead.")]
+pub type CompleteRequestParamsRef = CompleteRequestRef;
+#[deprecated(since = "0.8.0", note = "Use `CompleteRequestArgument` instead.")]
+pub type CompleteRequestParamsArgument = CompleteRequestArgument;
+#[deprecated(since = "0.8.0", note = "Use `ReadResourceContent` instead.")]
+pub type ReadResourceResultContentsItem = ReadResourceContent;
diff --git a/src/generated_schema/2024_11_05/schema_utils.rs b/src/generated_schema/2024_11_05/schema_utils.rs
index 66fa72a..bf53f9a 100644
--- a/src/generated_schema/2024_11_05/schema_utils.rs
+++ b/src/generated_schema/2024_11_05/schema_utils.rs
@@ -1492,7 +1492,7 @@ impl CallToolError {
/// # Examples
///
/// ```
- /// let err = CallToolError::from_message("Something went wrong");
+ /// let err = rust_mcp_schema::schema_utils::CallToolError::from_message("Something went wrong");
/// println!("{:?}", err);
/// ```
///
@@ -2608,7 +2608,7 @@ impl SdkError {
self
}
}
-/// Enum representing standard JSON-RPC error codes.
+/// Enum representing standard and mcp specific JSON-RPC error codes.
#[allow(non_camel_case_types)]
pub enum RpcErrorCodes {
PARSE_ERROR = -32700isize,
@@ -2780,7 +2780,7 @@ impl FromStr for RpcError {
.map_err(|error| RpcError::parse_error().with_data(Some(json!({ "details" : error.to_string() }))))
}
}
-/// Constructs a new JsonrpcError using the provided arguments.
+///Constructs a new `JsonrpcError` using the provided arguments.
impl JsonrpcError {
pub fn create(
id: RequestId,
diff --git a/src/generated_schema/2025_03_26/mcp_schema.rs b/src/generated_schema/2025_03_26/mcp_schema.rs
index 6387502..87edea1 100644
--- a/src/generated_schema/2025_03_26/mcp_schema.rs
+++ b/src/generated_schema/2025_03_26/mcp_schema.rs
@@ -1,12 +1,14 @@
+/// Copyright (c) 2025 Ali Hashemi (rust-mcp-stack)
+/// Licensed under the MIT License. See LICENSE in the project root.
/// ----------------------------------------------------------------------------
-/// This file is auto-generated by mcp-schema-gen v0.4.4.
+/// This file is auto-generated by mcp-schema-gen v0.5.0.
/// WARNING:
/// It is not recommended to modify this file directly. You are free to
/// modify or extend the implementations as needed, but please do so at your own risk.
///
/// Generated from :
-/// Hash : 71204c22f8e062795dca00a87d31070033572ba2
-/// Generated at : 2025-10-03 15:17:03
+/// Hash : 391c69f42f21bab3a5df0923b45b9ad3174414b9
+/// Generated at : 2025-12-01 18:52:54
/// ----------------------------------------------------------------------------
///
use super::validators as validate;
@@ -123,6 +125,11 @@ impl AudioContent {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "audio"
+ pub fn type_value() -> ::std::string::String {
+ "audio".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"audio".to_string()
}
@@ -219,6 +226,11 @@ impl CallToolRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "tools/call"
+ pub fn method_value() -> ::std::string::String {
+ "tools/call".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"tools/call".to_string()
}
@@ -420,6 +432,11 @@ impl CancelledNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/cancelled"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/cancelled".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/cancelled".to_string()
}
@@ -501,34 +518,11 @@ pub struct ClientCapabilities {
::std::collections::HashMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
- pub roots: ::std::option::Option,
+ pub roots: ::std::option::Option,
///Present if the client supports sampling from an LLM.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub sampling: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
}
-///Present if the client supports listing roots.
-///
-/// JSON schema
-///
-/// ```json
-///{
-/// "description": "Present if the client supports listing roots.",
-/// "type": "object",
-/// "properties": {
-/// "listChanged": {
-/// "description": "Whether the client supports notifications for changes to the roots list.",
-/// "type": "boolean"
-/// }
-/// }
-///}
-/// ```
-///
-#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
-pub struct ClientCapabilitiesRoots {
- ///Whether the client supports notifications for changes to the roots list.
- #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
- pub list_changed: ::std::option::Option,
-}
///ClientNotification
///
/// JSON schema
@@ -754,6 +748,29 @@ impl ::std::convert::From for ClientResult {
Self::Result(value)
}
}
+///Present if the client supports listing roots.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Present if the client supports listing roots.",
+/// "type": "object",
+/// "properties": {
+/// "listChanged": {
+/// "description": "Whether the client supports notifications for changes to the roots list.",
+/// "type": "boolean"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ClientRoots {
+ ///Whether the client supports notifications for changes to the roots list.
+ #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub list_changed: ::std::option::Option,
+}
///A request from the client to the server, to ask for completion options.
///
/// JSON schema
@@ -828,10 +845,47 @@ impl CompleteRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "completion/complete"
+ pub fn method_value() -> ::std::string::String {
+ "completion/complete".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"completion/complete".to_string()
}
}
+///The argument's information
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The argument's information",
+/// "type": "object",
+/// "required": [
+/// "name",
+/// "value"
+/// ],
+/// "properties": {
+/// "name": {
+/// "description": "The name of the argument",
+/// "type": "string"
+/// },
+/// "value": {
+/// "description": "The value of the argument to use for completion matching.",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CompleteRequestArgument {
+ ///The name of the argument
+ pub name: ::std::string::String,
+ ///The value of the argument to use for completion matching.
+ pub value: ::std::string::String,
+}
///CompleteRequestParams
///
/// JSON schema
@@ -878,43 +932,11 @@ impl CompleteRequest {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CompleteRequestParams {
- pub argument: CompleteRequestParamsArgument,
+ pub argument: CompleteRequestArgument,
#[serde(rename = "ref")]
- pub ref_: CompleteRequestParamsRef,
-}
-///The argument's information
-///
-/// JSON schema
-///
-/// ```json
-///{
-/// "description": "The argument's information",
-/// "type": "object",
-/// "required": [
-/// "name",
-/// "value"
-/// ],
-/// "properties": {
-/// "name": {
-/// "description": "The name of the argument",
-/// "type": "string"
-/// },
-/// "value": {
-/// "description": "The value of the argument to use for completion matching.",
-/// "type": "string"
-/// }
-/// }
-///}
-/// ```
-///
-#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
-pub struct CompleteRequestParamsArgument {
- ///The name of the argument
- pub name: ::std::string::String,
- ///The value of the argument to use for completion matching.
- pub value: ::std::string::String,
+ pub ref_: CompleteRequestRef,
}
-///CompleteRequestParamsRef
+///CompleteRequestRef
///
/// JSON schema
///
@@ -933,16 +955,16 @@ pub struct CompleteRequestParamsArgument {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
-pub enum CompleteRequestParamsRef {
+pub enum CompleteRequestRef {
PromptReference(PromptReference),
ResourceReference(ResourceReference),
}
-impl ::std::convert::From for CompleteRequestParamsRef {
+impl ::std::convert::From for CompleteRequestRef {
fn from(value: PromptReference) -> Self {
Self::PromptReference(value)
}
}
-impl ::std::convert::From for CompleteRequestParamsRef {
+impl ::std::convert::From for CompleteRequestRef {
fn from(value: ResourceReference) -> Self {
Self::ResourceReference(value)
}
@@ -1039,6 +1061,48 @@ pub struct CompleteResultCompletion {
///An array of completion values. Must not exceed 100 items.
pub values: ::std::vec::Vec<::std::string::String>,
}
+///CreateMessageContent
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "$ref": "#/definitions/TextContent"
+/// },
+/// {
+/// "$ref": "#/definitions/ImageContent"
+/// },
+/// {
+/// "$ref": "#/definitions/AudioContent"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum CreateMessageContent {
+ TextContent(TextContent),
+ ImageContent(ImageContent),
+ AudioContent(AudioContent),
+}
+impl ::std::convert::From for CreateMessageContent {
+ fn from(value: TextContent) -> Self {
+ Self::TextContent(value)
+ }
+}
+impl ::std::convert::From for CreateMessageContent {
+ fn from(value: ImageContent) -> Self {
+ Self::ImageContent(value)
+ }
+}
+impl ::std::convert::From for CreateMessageContent {
+ fn from(value: AudioContent) -> Self {
+ Self::AudioContent(value)
+ }
+}
///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.
///
/// JSON schema
@@ -1126,6 +1190,11 @@ impl CreateMessageRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "sampling/createMessage"
+ pub fn method_value() -> ::std::string::String {
+ "sampling/createMessage".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"sampling/createMessage".to_string()
}
@@ -1191,7 +1260,7 @@ impl CreateMessageRequest {
pub struct CreateMessageRequestParams {
///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.
#[serde(rename = "includeContext", default, skip_serializing_if = "::std::option::Option::is_none")]
- pub include_context: ::std::option::Option,
+ pub include_context: ::std::option::Option,
///The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested.
#[serde(rename = "maxTokens")]
pub max_tokens: i64,
@@ -1214,40 +1283,6 @@ pub struct CreateMessageRequestParams {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub temperature: ::std::option::Option,
}
-///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.
-///
-/// JSON schema
-///
-/// ```json
-///{
-/// "description": "A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.",
-/// "type": "string",
-/// "enum": [
-/// "allServers",
-/// "none",
-/// "thisServer"
-/// ]
-///}
-/// ```
-///
-#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
-pub enum CreateMessageRequestParamsIncludeContext {
- #[serde(rename = "allServers")]
- AllServers,
- #[serde(rename = "none")]
- None,
- #[serde(rename = "thisServer")]
- ThisServer,
-}
-impl ::std::fmt::Display for CreateMessageRequestParamsIncludeContext {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- match *self {
- Self::AllServers => write!(f, "allServers"),
- Self::None => write!(f, "none"),
- Self::ThisServer => write!(f, "thisServer"),
- }
- }
-}
///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.
///
/// JSON schema
@@ -1297,7 +1332,7 @@ impl ::std::fmt::Display for CreateMessageRequestParamsIncludeContext {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateMessageResult {
- pub content: CreateMessageResultContent,
+ pub content: CreateMessageContent,
///This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
@@ -1308,48 +1343,6 @@ pub struct CreateMessageResult {
#[serde(rename = "stopReason", default, skip_serializing_if = "::std::option::Option::is_none")]
pub stop_reason: ::std::option::Option<::std::string::String>,
}
-///CreateMessageResultContent
-///
-/// JSON schema
-///
-/// ```json
-///{
-/// "anyOf": [
-/// {
-/// "$ref": "#/definitions/TextContent"
-/// },
-/// {
-/// "$ref": "#/definitions/ImageContent"
-/// },
-/// {
-/// "$ref": "#/definitions/AudioContent"
-/// }
-/// ]
-///}
-/// ```
-///
-#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
-#[serde(untagged)]
-pub enum CreateMessageResultContent {
- TextContent(TextContent),
- ImageContent(ImageContent),
- AudioContent(AudioContent),
-}
-impl ::std::convert::From for CreateMessageResultContent {
- fn from(value: TextContent) -> Self {
- Self::TextContent(value)
- }
-}
-impl ::std::convert::From for CreateMessageResultContent {
- fn from(value: ImageContent) -> Self {
- Self::ImageContent(value)
- }
-}
-impl ::std::convert::From for CreateMessageResultContent {
- fn from(value: AudioContent) -> Self {
- Self::AudioContent(value)
- }
-}
///An opaque token used to represent a cursor for pagination.
///
/// JSON schema
@@ -1421,6 +1414,11 @@ impl EmbeddedResource {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "resource"
+ pub fn type_value() -> ::std::string::String {
+ "resource".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"resource".to_string()
}
@@ -1527,6 +1525,11 @@ impl GetPromptRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "prompts/get"
+ pub fn method_value() -> ::std::string::String {
+ "prompts/get".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"prompts/get".to_string()
}
@@ -1670,6 +1673,11 @@ impl ImageContent {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "image"
+ pub fn type_value() -> ::std::string::String {
+ "image".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"image".to_string()
}
@@ -1702,6 +1710,40 @@ pub struct Implementation {
pub name: ::std::string::String,
pub version: ::std::string::String,
}
+///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.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.",
+/// "type": "string",
+/// "enum": [
+/// "allServers",
+/// "none",
+/// "thisServer"
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+pub enum IncludeContext {
+ #[serde(rename = "allServers")]
+ AllServers,
+ #[serde(rename = "none")]
+ None,
+ #[serde(rename = "thisServer")]
+ ThisServer,
+}
+impl ::std::fmt::Display for IncludeContext {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ match *self {
+ Self::AllServers => write!(f, "allServers"),
+ Self::None => write!(f, "none"),
+ Self::ThisServer => write!(f, "thisServer"),
+ }
+ }
+}
///This request is sent from the client to the server when it first connects, asking it to begin initialization.
///
/// JSON schema
@@ -1759,6 +1801,11 @@ impl InitializeRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "initialize"
+ pub fn method_value() -> ::std::string::String {
+ "initialize".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"initialize".to_string()
}
@@ -1900,6 +1947,11 @@ impl InitializedNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/initialized"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/initialized".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/initialized".to_string()
}
@@ -2468,6 +2520,11 @@ impl ListPromptsRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "prompts/list"
+ pub fn method_value() -> ::std::string::String {
+ "prompts/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"prompts/list".to_string()
}
@@ -2583,6 +2640,11 @@ impl ListResourceTemplatesRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "resources/templates/list"
+ pub fn method_value() -> ::std::string::String {
+ "resources/templates/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"resources/templates/list".to_string()
}
@@ -2699,6 +2761,11 @@ impl ListResourcesRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "resources/list"
+ pub fn method_value() -> ::std::string::String {
+ "resources/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"resources/list".to_string()
}
@@ -2825,6 +2892,11 @@ impl ListRootsRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "roots/list"
+ pub fn method_value() -> ::std::string::String {
+ "roots/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"roots/list".to_string()
}
@@ -2962,6 +3034,11 @@ impl ListToolsRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "tools/list"
+ pub fn method_value() -> ::std::string::String {
+ "tools/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"tools/list".to_string()
}
@@ -3144,6 +3221,11 @@ impl LoggingMessageNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/message"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/message".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/message".to_string()
}
@@ -3482,6 +3564,11 @@ impl PingRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "ping"
+ pub fn method_value() -> ::std::string::String {
+ "ping".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"ping".to_string()
}
@@ -3599,6 +3686,11 @@ impl ProgressNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/progress"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/progress".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/progress".to_string()
}
@@ -3801,6 +3893,11 @@ impl PromptListChangedNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/prompts/list_changed"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/prompts/list_changed".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/prompts/list_changed".to_string()
}
@@ -3967,10 +4064,48 @@ impl PromptReference {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "ref/prompt"
+ pub fn type_value() -> ::std::string::String {
+ "ref/prompt".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"ref/prompt".to_string()
}
}
+///ReadResourceContent
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "$ref": "#/definitions/TextResourceContents"
+/// },
+/// {
+/// "$ref": "#/definitions/BlobResourceContents"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum ReadResourceContent {
+ TextResourceContents(TextResourceContents),
+ BlobResourceContents(BlobResourceContents),
+}
+impl ::std::convert::From for ReadResourceContent {
+ fn from(value: TextResourceContents) -> Self {
+ Self::TextResourceContents(value)
+ }
+}
+impl ::std::convert::From for ReadResourceContent {
+ fn from(value: BlobResourceContents) -> Self {
+ Self::BlobResourceContents(value)
+ }
+}
///Sent from the client to the server, to read a specific resource URI.
///
/// JSON schema
@@ -4021,6 +4156,11 @@ impl ReadResourceRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "resources/read"
+ pub fn method_value() -> ::std::string::String {
+ "resources/read".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"resources/read".to_string()
}
@@ -4086,44 +4226,11 @@ pub struct ReadResourceRequestParams {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReadResourceResult {
- pub contents: ::std::vec::Vec,
+ pub contents: ::std::vec::Vec,
///This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
}
-///ReadResourceResultContentsItem
-///
-/// JSON schema
-///
-/// ```json
-///{
-/// "anyOf": [
-/// {
-/// "$ref": "#/definitions/TextResourceContents"
-/// },
-/// {
-/// "$ref": "#/definitions/BlobResourceContents"
-/// }
-/// ]
-///}
-/// ```
-///
-#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
-#[serde(untagged)]
-pub enum ReadResourceResultContentsItem {
- TextResourceContents(TextResourceContents),
- BlobResourceContents(BlobResourceContents),
-}
-impl ::std::convert::From for ReadResourceResultContentsItem {
- fn from(value: TextResourceContents) -> Self {
- Self::TextResourceContents(value)
- }
-}
-impl ::std::convert::From for ReadResourceResultContentsItem {
- fn from(value: BlobResourceContents) -> Self {
- Self::BlobResourceContents(value)
- }
-}
///Request
///
/// JSON schema
@@ -4384,6 +4491,11 @@ impl ResourceListChangedNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/resources/list_changed"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/resources/list_changed".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/resources/list_changed".to_string()
}
@@ -4457,6 +4569,11 @@ impl ResourceReference {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "ref/resource"
+ pub fn type_value() -> ::std::string::String {
+ "ref/resource".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"ref/resource".to_string()
}
@@ -4568,6 +4685,11 @@ impl ResourceUpdatedNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/resources/updated"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/resources/updated".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/resources/updated".to_string()
}
@@ -4740,6 +4862,11 @@ impl RootsListChangedNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/roots/list_changed"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/roots/list_changed".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/roots/list_changed".to_string()
}
@@ -5324,6 +5451,11 @@ impl SetLevelRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "logging/setLevel"
+ pub fn method_value() -> ::std::string::String {
+ "logging/setLevel".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"logging/setLevel".to_string()
}
@@ -5402,6 +5534,11 @@ impl SubscribeRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "resources/subscribe"
+ pub fn method_value() -> ::std::string::String {
+ "resources/subscribe".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"resources/subscribe".to_string()
}
@@ -5481,6 +5618,11 @@ impl TextContent {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "text"
+ pub fn type_value() -> ::std::string::String {
+ "text".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"text".to_string()
}
@@ -5723,6 +5865,11 @@ impl ToolInputSchema {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "object"
+ pub fn type_value() -> ::std::string::String {
+ "object".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"object".to_string()
}
@@ -5775,6 +5922,11 @@ impl ToolListChangedNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/tools/list_changed"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/tools/list_changed".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/tools/list_changed".to_string()
}
@@ -5855,6 +6007,11 @@ impl UnsubscribeRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "resources/unsubscribe"
+ pub fn method_value() -> ::std::string::String {
+ "resources/unsubscribe".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"resources/unsubscribe".to_string()
}
@@ -6122,5 +6279,19 @@ impl ServerNotification {
}
}
}
-#[deprecated(since = "0.3.0", note = "Use `RpcError` instead.")]
-pub type JsonrpcErrorError = RpcError;
+/// Deprecating the old auto-generated verbose names.
+/// These were renamed to clearer, shorter names in v0.8.0.
+/// The old names are deprecated but kept for backward-compatibility for a smooth migration period.
+///
+#[deprecated(since = "0.8.0", note = "Use `ClientRoots` instead.")]
+pub type ClientCapabilitiesRoots = ClientRoots;
+#[deprecated(since = "0.8.0", note = "Use `IncludeContext` instead.")]
+pub type CreateMessageRequestParamsIncludeContext = IncludeContext;
+#[deprecated(since = "0.8.0", note = "Use `CompleteRequestRef` instead.")]
+pub type CompleteRequestParamsRef = CompleteRequestRef;
+#[deprecated(since = "0.8.0", note = "Use `CompleteRequestArgument` instead.")]
+pub type CompleteRequestParamsArgument = CompleteRequestArgument;
+#[deprecated(since = "0.8.0", note = "Use `CreateMessageContent` instead.")]
+pub type CreateMessageResultContent = CreateMessageContent;
+#[deprecated(since = "0.8.0", note = "Use `ReadResourceContent` instead.")]
+pub type ReadResourceResultContentsItem = ReadResourceContent;
diff --git a/src/generated_schema/2025_03_26/schema_utils.rs b/src/generated_schema/2025_03_26/schema_utils.rs
index be14dcd..284db1d 100644
--- a/src/generated_schema/2025_03_26/schema_utils.rs
+++ b/src/generated_schema/2025_03_26/schema_utils.rs
@@ -1492,7 +1492,7 @@ impl CallToolError {
/// # Examples
///
/// ```
- /// let err = CallToolError::from_message("Something went wrong");
+ /// let err = rust_mcp_schema::schema_utils::CallToolError::from_message("Something went wrong");
/// println!("{:?}", err);
/// ```
///
@@ -2608,7 +2608,7 @@ impl SdkError {
self
}
}
-/// Enum representing standard JSON-RPC error codes.
+/// Enum representing standard and mcp specific JSON-RPC error codes.
#[allow(non_camel_case_types)]
pub enum RpcErrorCodes {
PARSE_ERROR = -32700isize,
@@ -2780,7 +2780,7 @@ impl FromStr for RpcError {
.map_err(|error| RpcError::parse_error().with_data(Some(json!({ "details" : error.to_string() }))))
}
}
-/// Constructs a new JsonrpcError using the provided arguments.
+///Constructs a new `JsonrpcError` using the provided arguments.
impl JsonrpcError {
pub fn create(
id: RequestId,
diff --git a/src/generated_schema/2025_06_18/mcp_schema.rs b/src/generated_schema/2025_06_18/mcp_schema.rs
index 8154108..1d6ff2a 100644
--- a/src/generated_schema/2025_06_18/mcp_schema.rs
+++ b/src/generated_schema/2025_06_18/mcp_schema.rs
@@ -1,12 +1,14 @@
+/// Copyright (c) 2025 Ali Hashemi (rust-mcp-stack)
+/// Licensed under the MIT License. See LICENSE in the project root.
/// ----------------------------------------------------------------------------
-/// This file is auto-generated by mcp-schema-gen v0.4.4.
+/// This file is auto-generated by mcp-schema-gen v0.5.0.
/// WARNING:
/// It is not recommended to modify this file directly. You are free to
/// modify or extend the implementations as needed, but please do so at your own risk.
///
/// Generated from :
-/// Hash : 71204c22f8e062795dca00a87d31070033572ba2
-/// Generated at : 2025-10-03 15:17:04
+/// Hash : 391c69f42f21bab3a5df0923b45b9ad3174414b9
+/// Generated at : 2025-12-01 18:52:54
/// ----------------------------------------------------------------------------
///
use super::validators as validate;
@@ -84,7 +86,7 @@ pub struct Annotations {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -116,7 +118,7 @@ pub struct AudioContent {
pub annotations: ::std::option::Option,
///The base64-encoded audio data.
pub data: ::std::string::String,
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
///The MIME type of the audio. Different providers may support different audio types.
@@ -143,6 +145,11 @@ impl AudioContent {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "audio"
+ pub fn type_value() -> ::std::string::String {
+ "audio".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"audio".to_string()
}
@@ -196,7 +203,7 @@ pub struct BaseMetadata {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -222,7 +229,7 @@ pub struct BaseMetadata {
pub struct BlobResourceContents {
///A base64-encoded string representing the binary data of the item.
pub blob: ::std::string::String,
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
///The MIME type of this resource, if known.
@@ -286,6 +293,11 @@ impl BooleanSchema {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "boolean"
+ pub fn type_value() -> ::std::string::String {
+ "boolean".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"boolean".to_string()
}
@@ -342,6 +354,11 @@ impl CallToolRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "tools/call"
+ pub fn method_value() -> ::std::string::String {
+ "tools/call".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"tools/call".to_string()
}
@@ -387,7 +404,7 @@ pub struct CallToolRequestParams {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -426,7 +443,7 @@ pub struct CallToolResult {
should be reported as an MCP error response.*/
#[serde(rename = "isError", default, skip_serializing_if = "::std::option::Option::is_none")]
pub is_error: ::std::option::Option,
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
///An optional JSON object that represents the structured result of the tool call.
@@ -493,6 +510,11 @@ impl CancelledNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/cancelled"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/cancelled".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/cancelled".to_string()
}
@@ -582,34 +604,11 @@ pub struct ClientCapabilities {
::std::collections::HashMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
- pub roots: ::std::option::Option,
+ pub roots: ::std::option::Option,
///Present if the client supports sampling from an LLM.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub sampling: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
}
-///Present if the client supports listing roots.
-///
-/// JSON schema
-///
-/// ```json
-///{
-/// "description": "Present if the client supports listing roots.",
-/// "type": "object",
-/// "properties": {
-/// "listChanged": {
-/// "description": "Whether the client supports notifications for changes to the roots list.",
-/// "type": "boolean"
-/// }
-/// }
-///}
-/// ```
-///
-#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
-pub struct ClientCapabilitiesRoots {
- ///Whether the client supports notifications for changes to the roots list.
- #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
- pub list_changed: ::std::option::Option,
-}
///ClientNotification
///
/// JSON schema
@@ -844,6 +843,29 @@ impl ::std::convert::From for ClientResult {
Self::Result(value)
}
}
+///Present if the client supports listing roots.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Present if the client supports listing roots.",
+/// "type": "object",
+/// "properties": {
+/// "listChanged": {
+/// "description": "Whether the client supports notifications for changes to the roots list.",
+/// "type": "boolean"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ClientRoots {
+ ///Whether the client supports notifications for changes to the roots list.
+ #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub list_changed: ::std::option::Option,
+}
///A request from the client to the server, to ask for completion options.
///
/// JSON schema
@@ -931,10 +953,73 @@ impl CompleteRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "completion/complete"
+ pub fn method_value() -> ::std::string::String {
+ "completion/complete".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"completion/complete".to_string()
}
}
+///The argument's information
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The argument's information",
+/// "type": "object",
+/// "required": [
+/// "name",
+/// "value"
+/// ],
+/// "properties": {
+/// "name": {
+/// "description": "The name of the argument",
+/// "type": "string"
+/// },
+/// "value": {
+/// "description": "The value of the argument to use for completion matching.",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CompleteRequestArgument {
+ ///The name of the argument
+ pub name: ::std::string::String,
+ ///The value of the argument to use for completion matching.
+ pub value: ::std::string::String,
+}
+///Additional, optional context for completions
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Additional, optional context for completions",
+/// "type": "object",
+/// "properties": {
+/// "arguments": {
+/// "description": "Previously-resolved variables in a URI template or prompt.",
+/// "type": "object",
+/// "additionalProperties": {
+/// "type": "string"
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct CompleteRequestContext {
+ ///Previously-resolved variables in a URI template or prompt.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub arguments: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
+}
///CompleteRequestParams
///
/// JSON schema
@@ -994,71 +1079,13 @@ impl CompleteRequest {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CompleteRequestParams {
- pub argument: CompleteRequestParamsArgument,
+ pub argument: CompleteRequestArgument,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
- pub context: ::std::option::Option,
+ pub context: ::std::option::Option,
#[serde(rename = "ref")]
- pub ref_: CompleteRequestParamsRef,
-}
-///The argument's information
-///
-/// JSON schema
-///
-/// ```json
-///{
-/// "description": "The argument's information",
-/// "type": "object",
-/// "required": [
-/// "name",
-/// "value"
-/// ],
-/// "properties": {
-/// "name": {
-/// "description": "The name of the argument",
-/// "type": "string"
-/// },
-/// "value": {
-/// "description": "The value of the argument to use for completion matching.",
-/// "type": "string"
-/// }
-/// }
-///}
-/// ```
-///
-#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
-pub struct CompleteRequestParamsArgument {
- ///The name of the argument
- pub name: ::std::string::String,
- ///The value of the argument to use for completion matching.
- pub value: ::std::string::String,
+ pub ref_: CompleteRequestRef,
}
-///Additional, optional context for completions
-///
-/// JSON schema
-///
-/// ```json
-///{
-/// "description": "Additional, optional context for completions",
-/// "type": "object",
-/// "properties": {
-/// "arguments": {
-/// "description": "Previously-resolved variables in a URI template or prompt.",
-/// "type": "object",
-/// "additionalProperties": {
-/// "type": "string"
-/// }
-/// }
-/// }
-///}
-/// ```
-///
-#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
-pub struct CompleteRequestParamsContext {
- ///Previously-resolved variables in a URI template or prompt.
- #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
- pub arguments: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
-}
-///CompleteRequestParamsRef
+///CompleteRequestRef
///
/// JSON schema
///
@@ -1077,16 +1104,16 @@ pub struct CompleteRequestParamsContext {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
-pub enum CompleteRequestParamsRef {
+pub enum CompleteRequestRef {
PromptReference(PromptReference),
ResourceTemplateReference(ResourceTemplateReference),
}
-impl ::std::convert::From for CompleteRequestParamsRef {
+impl ::std::convert::From for CompleteRequestRef {
fn from(value: PromptReference) -> Self {
Self::PromptReference(value)
}
}
-impl ::std::convert::From for CompleteRequestParamsRef {
+impl ::std::convert::From for CompleteRequestRef {
fn from(value: ResourceTemplateReference) -> Self {
Self::ResourceTemplateReference(value)
}
@@ -1104,7 +1131,7 @@ impl ::std::convert::From for CompleteRequestParamsRe
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -1138,7 +1165,7 @@ impl ::std::convert::From for CompleteRequestParamsRe
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CompleteResult {
pub completion: CompleteResultCompletion,
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
}
@@ -1243,6 +1270,48 @@ impl ::std::convert::From for ContentBlock {
Self::EmbeddedResource(value)
}
}
+///CreateMessageContent
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "$ref": "#/definitions/TextContent"
+/// },
+/// {
+/// "$ref": "#/definitions/ImageContent"
+/// },
+/// {
+/// "$ref": "#/definitions/AudioContent"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum CreateMessageContent {
+ TextContent(TextContent),
+ ImageContent(ImageContent),
+ AudioContent(AudioContent),
+}
+impl ::std::convert::From for CreateMessageContent {
+ fn from(value: TextContent) -> Self {
+ Self::TextContent(value)
+ }
+}
+impl ::std::convert::From for CreateMessageContent {
+ fn from(value: ImageContent) -> Self {
+ Self::ImageContent(value)
+ }
+}
+impl ::std::convert::From for CreateMessageContent {
+ fn from(value: AudioContent) -> Self {
+ Self::AudioContent(value)
+ }
+}
///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.
///
/// JSON schema
@@ -1330,6 +1399,11 @@ impl CreateMessageRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "sampling/createMessage"
+ pub fn method_value() -> ::std::string::String {
+ "sampling/createMessage".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"sampling/createMessage".to_string()
}
@@ -1395,7 +1469,7 @@ impl CreateMessageRequest {
pub struct CreateMessageRequestParams {
///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.
#[serde(rename = "includeContext", default, skip_serializing_if = "::std::option::Option::is_none")]
- pub include_context: ::std::option::Option,
+ pub include_context: ::std::option::Option,
/**The requested maximum number of tokens to sample (to prevent runaway completions).
The client MAY choose to sample fewer tokens than the requested maximum.*/
#[serde(rename = "maxTokens")]
@@ -1419,40 +1493,6 @@ pub struct CreateMessageRequestParams {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub temperature: ::std::option::Option,
}
-///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.
-///
-/// JSON schema
-///
-/// ```json
-///{
-/// "description": "A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.",
-/// "type": "string",
-/// "enum": [
-/// "allServers",
-/// "none",
-/// "thisServer"
-/// ]
-///}
-/// ```
-///
-#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
-pub enum CreateMessageRequestParamsIncludeContext {
- #[serde(rename = "allServers")]
- AllServers,
- #[serde(rename = "none")]
- None,
- #[serde(rename = "thisServer")]
- ThisServer,
-}
-impl ::std::fmt::Display for CreateMessageRequestParamsIncludeContext {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- match *self {
- Self::AllServers => write!(f, "allServers"),
- Self::None => write!(f, "none"),
- Self::ThisServer => write!(f, "thisServer"),
- }
- }
-}
///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.
///
/// JSON schema
@@ -1468,7 +1508,7 @@ impl ::std::fmt::Display for CreateMessageRequestParamsIncludeContext {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -1502,8 +1542,8 @@ impl ::std::fmt::Display for CreateMessageRequestParamsIncludeContext {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateMessageResult {
- pub content: CreateMessageResultContent,
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ pub content: CreateMessageContent,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
///The name of the model that generated the message.
@@ -1513,48 +1553,6 @@ pub struct CreateMessageResult {
#[serde(rename = "stopReason", default, skip_serializing_if = "::std::option::Option::is_none")]
pub stop_reason: ::std::option::Option<::std::string::String>,
}
-///CreateMessageResultContent
-///
-/// JSON schema
-///
-/// ```json
-///{
-/// "anyOf": [
-/// {
-/// "$ref": "#/definitions/TextContent"
-/// },
-/// {
-/// "$ref": "#/definitions/ImageContent"
-/// },
-/// {
-/// "$ref": "#/definitions/AudioContent"
-/// }
-/// ]
-///}
-/// ```
-///
-#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
-#[serde(untagged)]
-pub enum CreateMessageResultContent {
- TextContent(TextContent),
- ImageContent(ImageContent),
- AudioContent(AudioContent),
-}
-impl ::std::convert::From for CreateMessageResultContent {
- fn from(value: TextContent) -> Self {
- Self::TextContent(value)
- }
-}
-impl ::std::convert::From for CreateMessageResultContent {
- fn from(value: ImageContent) -> Self {
- Self::ImageContent(value)
- }
-}
-impl ::std::convert::From for CreateMessageResultContent {
- fn from(value: AudioContent) -> Self {
- Self::AudioContent(value)
- }
-}
///An opaque token used to represent a cursor for pagination.
///
/// JSON schema
@@ -1645,6 +1643,11 @@ impl ElicitRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "elicitation/create"
+ pub fn method_value() -> ::std::string::String {
+ "elicitation/create".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"elicitation/create".to_string()
}
@@ -1758,6 +1761,11 @@ impl ElicitRequestedSchema {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "object"
+ pub fn type_value() -> ::std::string::String {
+ "object".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"object".to_string()
}
@@ -1775,7 +1783,7 @@ impl ElicitRequestedSchema {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -1813,8 +1821,8 @@ pub struct ElicitResult {
/**The submitted form data, only present when action is "accept".
Contains values matching the requested schema.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
- pub content: ::std::option::Option<::std::collections::HashMap<::std::string::String, ElicitResultContentValue>>,
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ pub content: ::std::option::Option<::std::collections::HashMap<::std::string::String, ElicitResultContent>>,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
}
@@ -1855,7 +1863,7 @@ impl ::std::fmt::Display for ElicitResultAction {
}
}
}
-///ElicitResultContentValue
+///ElicitResultContent
///
/// JSON schema
///
@@ -1871,17 +1879,17 @@ impl ::std::fmt::Display for ElicitResultAction {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
-pub enum ElicitResultContentValue {
+pub enum ElicitResultContent {
Boolean(bool),
String(::std::string::String),
Integer(i64),
}
-impl ::std::convert::From for ElicitResultContentValue {
+impl ::std::convert::From for ElicitResultContent {
fn from(value: bool) -> Self {
Self::Boolean(value)
}
}
-impl ::std::convert::From for ElicitResultContentValue {
+impl ::std::convert::From for ElicitResultContent {
fn from(value: i64) -> Self {
Self::Integer(value)
}
@@ -1902,7 +1910,7 @@ of the LLM and/or the user.*/
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -1933,7 +1941,7 @@ pub struct EmbeddedResource {
///Optional annotations for the client.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub annotations: ::std::option::Option,
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
pub resource: EmbeddedResourceResource,
@@ -1956,6 +1964,11 @@ impl EmbeddedResource {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "resource"
+ pub fn type_value() -> ::std::string::String {
+ "resource".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"resource".to_string()
}
@@ -2075,6 +2088,11 @@ impl EnumSchema {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "string"
+ pub fn type_value() -> ::std::string::String {
+ "string".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"string".to_string()
}
@@ -2135,6 +2153,11 @@ impl GetPromptRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "prompts/get"
+ pub fn method_value() -> ::std::string::String {
+ "prompts/get".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"prompts/get".to_string()
}
@@ -2186,7 +2209,7 @@ pub struct GetPromptRequestParams {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -2210,7 +2233,7 @@ pub struct GetPromptResult {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
pub messages: ::std::vec::Vec,
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
}
@@ -2229,7 +2252,7 @@ pub struct GetPromptResult {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -2261,7 +2284,7 @@ pub struct ImageContent {
pub annotations: ::std::option::Option,
///The base64-encoded image data.
pub data: ::std::string::String,
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
///The MIME type of the image. Different providers may support different image types.
@@ -2288,6 +2311,11 @@ impl ImageContent {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "image"
+ pub fn type_value() -> ::std::string::String {
+ "image".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"image".to_string()
}
@@ -2333,6 +2361,40 @@ pub struct Implementation {
pub title: ::std::option::Option<::std::string::String>,
pub version: ::std::string::String,
}
+///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.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.",
+/// "type": "string",
+/// "enum": [
+/// "allServers",
+/// "none",
+/// "thisServer"
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+pub enum IncludeContext {
+ #[serde(rename = "allServers")]
+ AllServers,
+ #[serde(rename = "none")]
+ None,
+ #[serde(rename = "thisServer")]
+ ThisServer,
+}
+impl ::std::fmt::Display for IncludeContext {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ match *self {
+ Self::AllServers => write!(f, "allServers"),
+ Self::None => write!(f, "none"),
+ Self::ThisServer => write!(f, "thisServer"),
+ }
+ }
+}
///This request is sent from the client to the server when it first connects, asking it to begin initialization.
///
/// JSON schema
@@ -2390,6 +2452,11 @@ impl InitializeRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "initialize"
+ pub fn method_value() -> ::std::string::String {
+ "initialize".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"initialize".to_string()
}
@@ -2445,7 +2512,7 @@ pub struct InitializeRequestParams {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -2474,7 +2541,7 @@ pub struct InitializeResult {
This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub instructions: ::std::option::Option<::std::string::String>,
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
///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.
@@ -2503,7 +2570,7 @@ pub struct InitializeResult {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// }
@@ -2531,6 +2598,11 @@ impl InitializedNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/initialized"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/initialized".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/initialized".to_string()
}
@@ -2544,7 +2616,7 @@ impl InitializedNotification {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// }
@@ -2555,7 +2627,7 @@ impl InitializedNotification {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
pub struct InitializedNotificationParams {
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
#[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
@@ -2701,7 +2773,7 @@ impl ::std::convert::From for JsonrpcMessage {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// }
@@ -2741,7 +2813,7 @@ impl JsonrpcNotification {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// }
@@ -2752,7 +2824,7 @@ impl JsonrpcNotification {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
pub struct JsonrpcNotificationParams {
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
#[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
@@ -2786,7 +2858,7 @@ pub struct JsonrpcNotificationParams {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "properties": {
/// "progressToken": {
@@ -2834,7 +2906,7 @@ impl JsonrpcRequest {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "properties": {
/// "progressToken": {
@@ -2856,13 +2928,13 @@ pub struct JsonrpcRequestParams {
#[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
}
-///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
///
/// JSON schema
///
/// ```json
///{
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "properties": {
/// "progressToken": {
@@ -2975,6 +3047,11 @@ impl ListPromptsRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "prompts/list"
+ pub fn method_value() -> ::std::string::String {
+ "prompts/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"prompts/list".to_string()
}
@@ -3015,7 +3092,7 @@ pub struct ListPromptsRequestParams {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -3035,7 +3112,7 @@ pub struct ListPromptsRequestParams {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListPromptsResult {
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
/**An opaque token representing the pagination position after the last returned result.
@@ -3090,6 +3167,11 @@ impl ListResourceTemplatesRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "resources/templates/list"
+ pub fn method_value() -> ::std::string::String {
+ "resources/templates/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"resources/templates/list".to_string()
}
@@ -3130,7 +3212,7 @@ pub struct ListResourceTemplatesRequestParams {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -3150,7 +3232,7 @@ pub struct ListResourceTemplatesRequestParams {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListResourceTemplatesResult {
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
/**An opaque token representing the pagination position after the last returned result.
@@ -3206,6 +3288,11 @@ impl ListResourcesRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "resources/list"
+ pub fn method_value() -> ::std::string::String {
+ "resources/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"resources/list".to_string()
}
@@ -3246,7 +3333,7 @@ pub struct ListResourcesRequestParams {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -3266,7 +3353,7 @@ pub struct ListResourcesRequestParams {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListResourcesResult {
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
/**An opaque token representing the pagination position after the last returned result.
@@ -3300,7 +3387,7 @@ structure or access specific locations that the client has permission to read fr
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "properties": {
/// "progressToken": {
@@ -3334,6 +3421,11 @@ impl ListRootsRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "roots/list"
+ pub fn method_value() -> ::std::string::String {
+ "roots/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"roots/list".to_string()
}
@@ -3347,7 +3439,7 @@ impl ListRootsRequest {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "properties": {
/// "progressToken": {
@@ -3369,13 +3461,13 @@ pub struct ListRootsRequestParams {
#[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
}
-///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
///
/// JSON schema
///
/// ```json
///{
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "properties": {
/// "progressToken": {
@@ -3410,7 +3502,7 @@ or file that the server can operate on.*/
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -3426,7 +3518,7 @@ or file that the server can operate on.*/
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListRootsResult {
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
pub roots: ::std::vec::Vec,
@@ -3477,6 +3569,11 @@ impl ListToolsRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "tools/list"
+ pub fn method_value() -> ::std::string::String {
+ "tools/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"tools/list".to_string()
}
@@ -3517,7 +3614,7 @@ pub struct ListToolsRequestParams {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -3537,7 +3634,7 @@ pub struct ListToolsRequestParams {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListToolsResult {
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
/**An opaque token representing the pagination position after the last returned result.
@@ -3659,6 +3756,11 @@ impl LoggingMessageNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/message"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/message".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/message".to_string()
}
@@ -3815,7 +3917,7 @@ pub struct ModelPreferences {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// }
@@ -3841,7 +3943,7 @@ pub struct Notification {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// }
@@ -3852,7 +3954,7 @@ pub struct Notification {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
pub struct NotificationParams {
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
#[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
@@ -3999,7 +4101,7 @@ pub struct PaginatedRequestParams {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -4013,7 +4115,7 @@ pub struct PaginatedRequestParams {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
pub struct PaginatedResult {
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
/**An opaque token representing the pagination position after the last returned result.
@@ -4041,7 +4143,7 @@ pub struct PaginatedResult {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "properties": {
/// "progressToken": {
@@ -4075,6 +4177,11 @@ impl PingRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "ping"
+ pub fn method_value() -> ::std::string::String {
+ "ping".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"ping".to_string()
}
@@ -4088,7 +4195,7 @@ impl PingRequest {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "properties": {
/// "progressToken": {
@@ -4110,13 +4217,13 @@ pub struct PingRequestParams {
#[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
}
-///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
///
/// JSON schema
///
/// ```json
///{
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "properties": {
/// "progressToken": {
@@ -4251,6 +4358,11 @@ impl ProgressNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/progress"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/progress".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/progress".to_string()
}
@@ -4337,7 +4449,7 @@ impl ::std::convert::From for ProgressToken {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -4372,7 +4484,7 @@ pub struct Prompt {
///An optional description of what this prompt provides
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
@@ -4455,7 +4567,7 @@ pub struct PromptArgument {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// }
@@ -4483,6 +4595,11 @@ impl PromptListChangedNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/prompts/list_changed"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/prompts/list_changed".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/prompts/list_changed".to_string()
}
@@ -4496,7 +4613,7 @@ impl PromptListChangedNotification {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// }
@@ -4507,7 +4624,7 @@ impl PromptListChangedNotification {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
pub struct PromptListChangedNotificationParams {
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
#[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
@@ -4597,10 +4714,48 @@ impl PromptReference {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "ref/prompt"
+ pub fn type_value() -> ::std::string::String {
+ "ref/prompt".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"ref/prompt".to_string()
}
}
+///ReadResourceContent
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "$ref": "#/definitions/TextResourceContents"
+/// },
+/// {
+/// "$ref": "#/definitions/BlobResourceContents"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum ReadResourceContent {
+ TextResourceContents(TextResourceContents),
+ BlobResourceContents(BlobResourceContents),
+}
+impl ::std::convert::From for ReadResourceContent {
+ fn from(value: TextResourceContents) -> Self {
+ Self::TextResourceContents(value)
+ }
+}
+impl ::std::convert::From for ReadResourceContent {
+ fn from(value: BlobResourceContents) -> Self {
+ Self::BlobResourceContents(value)
+ }
+}
///Sent from the client to the server, to read a specific resource URI.
///
/// JSON schema
@@ -4651,6 +4806,11 @@ impl ReadResourceRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "resources/read"
+ pub fn method_value() -> ::std::string::String {
+ "resources/read".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"resources/read".to_string()
}
@@ -4693,7 +4853,7 @@ pub struct ReadResourceRequestParams {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -4716,44 +4876,11 @@ pub struct ReadResourceRequestParams {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReadResourceResult {
- pub contents: ::std::vec::Vec,
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ pub contents: ::std::vec::Vec,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
}
-///ReadResourceResultContentsItem
-///
-/// JSON schema
-///
-/// ```json
-///{
-/// "anyOf": [
-/// {
-/// "$ref": "#/definitions/TextResourceContents"
-/// },
-/// {
-/// "$ref": "#/definitions/BlobResourceContents"
-/// }
-/// ]
-///}
-/// ```
-///
-#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
-#[serde(untagged)]
-pub enum ReadResourceResultContentsItem {
- TextResourceContents(TextResourceContents),
- BlobResourceContents(BlobResourceContents),
-}
-impl ::std::convert::From for ReadResourceResultContentsItem {
- fn from(value: TextResourceContents) -> Self {
- Self::TextResourceContents(value)
- }
-}
-impl ::std::convert::From for ReadResourceResultContentsItem {
- fn from(value: BlobResourceContents) -> Self {
- Self::BlobResourceContents(value)
- }
-}
///Request
///
/// JSON schema
@@ -4772,7 +4899,7 @@ impl ::std::convert::From for ReadResourceResultContentsIt
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "properties": {
/// "progressToken": {
@@ -4829,7 +4956,7 @@ impl ::std::convert::From for RequestId {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "properties": {
/// "progressToken": {
@@ -4851,13 +4978,13 @@ pub struct RequestParams {
#[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
}
-///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
///
/// JSON schema
///
/// ```json
///{
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "properties": {
/// "progressToken": {
@@ -4891,7 +5018,7 @@ pub struct RequestParamsMeta {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -4937,7 +5064,7 @@ pub struct Resource {
This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
///The MIME type of this resource, if known.
@@ -4972,7 +5099,7 @@ pub struct Resource {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -4991,7 +5118,7 @@ pub struct Resource {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ResourceContents {
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
///The MIME type of this resource, if known.
@@ -5016,7 +5143,7 @@ Note: resource links returned by tools are not guaranteed to appear in the resul
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -5066,7 +5193,7 @@ pub struct ResourceLink {
This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
///The MIME type of this resource, if known.
@@ -5117,6 +5244,11 @@ impl ResourceLink {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "resource_link"
+ pub fn type_value() -> ::std::string::String {
+ "resource_link".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"resource_link".to_string()
}
@@ -5141,7 +5273,7 @@ impl ResourceLink {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// }
@@ -5169,6 +5301,11 @@ impl ResourceListChangedNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/resources/list_changed"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/resources/list_changed".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/resources/list_changed".to_string()
}
@@ -5182,7 +5319,7 @@ impl ResourceListChangedNotification {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// }
@@ -5193,7 +5330,7 @@ impl ResourceListChangedNotification {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
pub struct ResourceListChangedNotificationParams {
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
#[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
@@ -5213,7 +5350,7 @@ pub struct ResourceListChangedNotificationParams {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -5255,7 +5392,7 @@ pub struct ResourceTemplate {
This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
///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.
@@ -5317,6 +5454,11 @@ impl ResourceTemplateReference {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "ref/resource"
+ pub fn type_value() -> ::std::string::String {
+ "ref/resource".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"ref/resource".to_string()
}
@@ -5371,6 +5513,11 @@ impl ResourceUpdatedNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/resources/updated"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/resources/updated".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/resources/updated".to_string()
}
@@ -5409,7 +5556,7 @@ pub struct ResourceUpdatedNotificationParams {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// }
@@ -5420,7 +5567,7 @@ pub struct ResourceUpdatedNotificationParams {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
pub struct Result {
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
#[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
@@ -5469,7 +5616,7 @@ impl ::std::fmt::Display for Role {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -5488,7 +5635,7 @@ impl ::std::fmt::Display for Role {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Root {
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
/**An optional name for the root. This can be used to provide a human-readable
@@ -5523,7 +5670,7 @@ The server should then request an updated list of roots using the ListRootsReque
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// }
@@ -5551,6 +5698,11 @@ impl RootsListChangedNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/roots/list_changed"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/roots/list_changed".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/roots/list_changed".to_string()
}
@@ -5564,7 +5716,7 @@ impl RootsListChangedNotification {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// }
@@ -5575,7 +5727,7 @@ impl RootsListChangedNotification {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
pub struct RootsListChangedNotificationParams {
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
#[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
@@ -6144,6 +6296,11 @@ impl SetLevelRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "logging/setLevel"
+ pub fn method_value() -> ::std::string::String {
+ "logging/setLevel".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"logging/setLevel".to_string()
}
@@ -6247,6 +6404,11 @@ impl StringSchema {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "string"
+ pub fn type_value() -> ::std::string::String {
+ "string".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"string".to_string()
}
@@ -6338,6 +6500,11 @@ impl SubscribeRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "resources/subscribe"
+ pub fn method_value() -> ::std::string::String {
+ "resources/subscribe".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"resources/subscribe".to_string()
}
@@ -6381,7 +6548,7 @@ pub struct SubscribeRequestParams {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -6406,7 +6573,7 @@ pub struct TextContent {
///Optional annotations for the client.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub annotations: ::std::option::Option,
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
///The text content of the message.
@@ -6430,6 +6597,11 @@ impl TextContent {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "text"
+ pub fn type_value() -> ::std::string::String {
+ "text".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"text".to_string()
}
@@ -6447,7 +6619,7 @@ impl TextContent {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -6470,7 +6642,7 @@ impl TextContent {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TextResourceContents {
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
///The MIME type of this resource, if known.
@@ -6495,7 +6667,7 @@ pub struct TextResourceContents {
/// ],
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// },
@@ -6583,7 +6755,7 @@ pub struct Tool {
pub description: ::std::option::Option<::std::string::String>,
#[serde(rename = "inputSchema")]
pub input_schema: ToolInputSchema,
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
@@ -6728,6 +6900,11 @@ impl ToolInputSchema {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "object"
+ pub fn type_value() -> ::std::string::String {
+ "object".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"object".to_string()
}
@@ -6752,7 +6929,7 @@ impl ToolInputSchema {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// }
@@ -6780,6 +6957,11 @@ impl ToolListChangedNotification {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "notifications/tools/list_changed"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/tools/list_changed".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"notifications/tools/list_changed".to_string()
}
@@ -6793,7 +6975,7 @@ impl ToolListChangedNotification {
/// "type": "object",
/// "properties": {
/// "_meta": {
-/// "description": "See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.",
/// "type": "object",
/// "additionalProperties": {}
/// }
@@ -6804,7 +6986,7 @@ impl ToolListChangedNotification {
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
pub struct ToolListChangedNotificationParams {
- ///See [General fields: _meta](/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta) for notes on _meta usage.
#[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
#[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
@@ -6874,6 +7056,11 @@ impl ToolOutputSchema {
pub fn type_(&self) -> &::std::string::String {
&self.type_
}
+ /// returns "object"
+ pub fn type_value() -> ::std::string::String {
+ "object".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
pub fn type_name() -> ::std::string::String {
"object".to_string()
}
@@ -6928,6 +7115,11 @@ impl UnsubscribeRequest {
pub fn method(&self) -> &::std::string::String {
&self.method
}
+ /// returns "resources/unsubscribe"
+ pub fn method_value() -> ::std::string::String {
+ "resources/unsubscribe".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
pub fn method_name() -> ::std::string::String {
"resources/unsubscribe".to_string()
}
@@ -7200,7 +7392,25 @@ impl ServerNotification {
}
}
}
-#[deprecated(since = "0.3.0", note = "Use `RpcError` instead.")]
-pub type JsonrpcErrorError = RpcError;
-#[deprecated(since = "0.7.0", note = "Use `ElicitRequestedSchema` instead.")]
+/// Deprecating the old auto-generated verbose names.
+/// These were renamed to clearer, shorter names in v0.8.0.
+/// The old names are deprecated but kept for backward-compatibility for a smooth migration period.
+///
+#[deprecated(since = "0.8.0", note = "Use `ClientRoots` instead.")]
+pub type ClientCapabilitiesRoots = ClientRoots;
+#[deprecated(since = "0.8.0", note = "Use `IncludeContext` instead.")]
+pub type CreateMessageRequestParamsIncludeContext = IncludeContext;
+#[deprecated(since = "0.8.0", note = "Use `CompleteRequestRef` instead.")]
+pub type CompleteRequestParamsRef = CompleteRequestRef;
+#[deprecated(since = "0.8.0", note = "Use `CompleteRequestContext` instead.")]
+pub type CompleteRequestParamsContext = CompleteRequestContext;
+#[deprecated(since = "0.8.0", note = "Use `CompleteRequestArgument` instead.")]
+pub type CompleteRequestParamsArgument = CompleteRequestArgument;
+#[deprecated(since = "0.8.0", note = "Use `ElicitRequestedSchema` instead.")]
pub type ElicitRequestParamsRequestedSchema = ElicitRequestedSchema;
+#[deprecated(since = "0.8.0", note = "Use `CreateMessageContent` instead.")]
+pub type CreateMessageResultContent = CreateMessageContent;
+#[deprecated(since = "0.8.0", note = "Use `ElicitResultContent` instead.")]
+pub type ElicitResultContentValue = ElicitResultContent;
+#[deprecated(since = "0.8.0", note = "Use `ReadResourceContent` instead.")]
+pub type ReadResourceResultContentsItem = ReadResourceContent;
diff --git a/src/generated_schema/2025_06_18/schema_utils.rs b/src/generated_schema/2025_06_18/schema_utils.rs
index 14f3094..daebcab 100644
--- a/src/generated_schema/2025_06_18/schema_utils.rs
+++ b/src/generated_schema/2025_06_18/schema_utils.rs
@@ -1,4 +1,4 @@
-use crate::generated_schema::*;
+use crate::generated_schema::mcp_2025_06_18::*;
use serde::ser::SerializeStruct;
use serde_json::{json, Value};
use std::hash::{Hash, Hasher};
@@ -2740,7 +2740,7 @@ impl SdkError {
self
}
}
-/// Enum representing standard JSON-RPC error codes.
+/// Enum representing standard and mcp specific JSON-RPC error codes.
#[allow(non_camel_case_types)]
pub enum RpcErrorCodes {
PARSE_ERROR = -32700isize,
@@ -2912,7 +2912,7 @@ impl FromStr for RpcError {
.map_err(|error| RpcError::parse_error().with_data(Some(json!({ "details" : error.to_string() }))))
}
}
-/// Constructs a new JsonrpcError using the provided arguments.
+///Constructs a new `JsonrpcError` using the provided arguments.
impl JsonrpcError {
pub fn create(
id: RequestId,
diff --git a/src/generated_schema/2025_11_25/mcp_schema.rs b/src/generated_schema/2025_11_25/mcp_schema.rs
new file mode 100644
index 0000000..3183de0
--- /dev/null
+++ b/src/generated_schema/2025_11_25/mcp_schema.rs
@@ -0,0 +1,11208 @@
+/// Copyright (c) 2025 Ali Hashemi (rust-mcp-stack)
+/// Licensed under the MIT License. See LICENSE in the project root.
+/// ----------------------------------------------------------------------------
+/// This file is auto-generated by mcp-schema-gen v0.5.0.
+/// WARNING:
+/// It is not recommended to modify this file directly. You are free to
+/// modify or extend the implementations as needed, but please do so at your own risk.
+///
+/// Generated from :
+/// Hash : 391c69f42f21bab3a5df0923b45b9ad3174414b9
+/// Generated at : 2025-12-01 18:52:55
+/// ----------------------------------------------------------------------------
+///
+use super::validators as validate;
+/// MCP Protocol Version
+pub const LATEST_PROTOCOL_VERSION: &str = "DRAFT-2025-v3";
+/// JSON-RPC Version
+pub const JSONRPC_VERSION: &str = "2.0";
+/// Parse error. Invalid JSON was received. An error occurred while parsing the JSON text.
+pub const PARSE_ERROR: i64 = -32700i64;
+/// Invalid Request. The JSON sent is not a valid Request object.
+pub const INVALID_REQUEST: i64 = -32600i64;
+/// Method not found. The method does not exist / is not available.
+pub const METHOD_NOT_FOUND: i64 = -32601i64;
+/// Invalid param. Invalid method parameter(s).
+pub const INVALID_PARAMS: i64 = -32602i64;
+/// Internal error. Internal JSON-RPC error.
+pub const INTERNAL_ERROR: i64 = -32603i64;
+/// The server cannot proceed without additional client input.
+pub const URL_ELICITATION_REQUIRED: i64 = -32042i64;
+///Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Optional annotations for the client. The client can use annotations to inform how objects are used or displayed",
+/// "type": "object",
+/// "properties": {
+/// "audience": {
+/// "description": "Describes who the intended audience of this object or data is.\n\nIt can include multiple entries to indicate content useful for multiple audiences (e.g., [\"user\", \"assistant\"]).",
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/Role"
+/// }
+/// },
+/// "lastModified": {
+/// "description": "The moment the resource was last modified, as an ISO 8601 formatted string.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").\n\nExamples: last activity timestamp in an open file, timestamp when the resource\nwas attached, etc.",
+/// "type": "string"
+/// },
+/// "priority": {
+/// "description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
+/// "type": "number",
+/// "maximum": 1.0,
+/// "minimum": 0.0
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct Annotations {
+ /**Describes who the intended audience of this object or data is.
+ It can include multiple entries to indicate content useful for multiple audiences (e.g., ["user", "assistant"]).*/
+ #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
+ pub audience: ::std::vec::Vec,
+ /**The moment the resource was last modified, as an ISO 8601 formatted string.
+ Should be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z").
+ Examples: last activity timestamp in an open file, timestamp when the resource
+ was attached, etc.*/
+ #[serde(rename = "lastModified", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub last_modified: ::std::option::Option<::std::string::String>,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub priority: ::std::option::Option,
+}
+///Audio provided to or from an LLM.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Audio provided to or from an LLM.",
+/// "type": "object",
+/// "required": [
+/// "data",
+/// "mimeType",
+/// "type"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "annotations": {
+/// "description": "Optional annotations for the client.",
+/// "$ref": "#/$defs/Annotations"
+/// },
+/// "data": {
+/// "description": "The base64-encoded audio data.",
+/// "type": "string",
+/// "format": "byte"
+/// },
+/// "mimeType": {
+/// "description": "The MIME type of the audio. Different providers may support different audio types.",
+/// "type": "string"
+/// },
+/// "type": {
+/// "type": "string",
+/// "const": "audio"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct AudioContent {
+ ///Optional annotations for the client.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub annotations: ::std::option::Option,
+ ///The base64-encoded audio data.
+ pub data: ::std::string::String,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ///The MIME type of the audio. Different providers may support different audio types.
+ #[serde(rename = "mimeType")]
+ pub mime_type: ::std::string::String,
+ #[serde(rename = "type", deserialize_with = "validate::audio_content_type_")]
+ type_: ::std::string::String,
+}
+impl AudioContent {
+ pub fn new(
+ data: ::std::string::String,
+ mime_type: ::std::string::String,
+ annotations: ::std::option::Option,
+ meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ) -> Self {
+ Self {
+ annotations,
+ data,
+ meta,
+ mime_type,
+ type_: "audio".to_string(),
+ }
+ }
+ pub fn type_(&self) -> &::std::string::String {
+ &self.type_
+ }
+ /// returns "audio"
+ pub fn type_value() -> ::std::string::String {
+ "audio".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
+ pub fn type_name() -> ::std::string::String {
+ "audio".to_string()
+ }
+}
+///Base interface for metadata with name (identifier) and title (display name) properties.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Base interface for metadata with name (identifier) and title (display name) properties.",
+/// "type": "object",
+/// "required": [
+/// "name"
+/// ],
+/// "properties": {
+/// "name": {
+/// "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
+/// "type": "string"
+/// },
+/// "title": {
+/// "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct BaseMetadata {
+ ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
+ pub name: ::std::string::String,
+ /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
+ even by those unfamiliar with domain-specific terminology.
+ If not provided, the name should be used for display (except for Tool,
+ where annotations.title should be given precedence over using name,
+ if present).*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub title: ::std::option::Option<::std::string::String>,
+}
+///BlobResourceContents
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "type": "object",
+/// "required": [
+/// "blob",
+/// "uri"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "blob": {
+/// "description": "A base64-encoded string representing the binary data of the item.",
+/// "type": "string",
+/// "format": "byte"
+/// },
+/// "mimeType": {
+/// "description": "The MIME type of this resource, if known.",
+/// "type": "string"
+/// },
+/// "uri": {
+/// "description": "The URI of this resource.",
+/// "type": "string",
+/// "format": "uri"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct BlobResourceContents {
+ ///A base64-encoded string representing the binary data of the item.
+ pub blob: ::std::string::String,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ///The MIME type of this resource, if known.
+ #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub mime_type: ::std::option::Option<::std::string::String>,
+ ///The URI of this resource.
+ pub uri: ::std::string::String,
+}
+///BooleanSchema
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "type": "object",
+/// "required": [
+/// "type"
+/// ],
+/// "properties": {
+/// "default": {
+/// "type": "boolean"
+/// },
+/// "description": {
+/// "type": "string"
+/// },
+/// "title": {
+/// "type": "string"
+/// },
+/// "type": {
+/// "type": "string",
+/// "const": "boolean"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct BooleanSchema {
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub default: ::std::option::Option,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub description: ::std::option::Option<::std::string::String>,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub title: ::std::option::Option<::std::string::String>,
+ #[serde(rename = "type", deserialize_with = "validate::boolean_schema_type_")]
+ type_: ::std::string::String,
+}
+impl BooleanSchema {
+ pub fn new(
+ default: ::std::option::Option,
+ description: ::std::option::Option<::std::string::String>,
+ title: ::std::option::Option<::std::string::String>,
+ ) -> Self {
+ Self {
+ default,
+ description,
+ title,
+ type_: "boolean".to_string(),
+ }
+ }
+ pub fn type_(&self) -> &::std::string::String {
+ &self.type_
+ }
+ /// returns "boolean"
+ pub fn type_value() -> ::std::string::String {
+ "boolean".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
+ pub fn type_name() -> ::std::string::String {
+ "boolean".to_string()
+ }
+}
+///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct CallToolMeta {
+ ///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.
+ #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub progress_token: ::std::option::Option,
+ #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///Used by the client to invoke a tool provided by the server.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Used by the client to invoke a tool provided by the server.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method",
+/// "params"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "tools/call"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/CallToolRequestParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CallToolRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::call_tool_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::call_tool_request_method")]
+ method: ::std::string::String,
+ pub params: CallToolRequestParams,
+}
+impl CallToolRequest {
+ pub fn new(id: RequestId, params: CallToolRequestParams) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "tools/call".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "tools/call"
+ pub fn method_value() -> ::std::string::String {
+ "tools/call".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "tools/call".to_string()
+ }
+}
+///Parameters for a tools/call request.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Parameters for a tools/call request.",
+/// "type": "object",
+/// "required": [
+/// "name"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+/// },
+/// "arguments": {
+/// "description": "Arguments to use for the tool call.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "name": {
+/// "description": "The name of the tool.",
+/// "type": "string"
+/// },
+/// "task": {
+/// "description": "If specified, the caller is requesting task-augmented execution for this request.\nThe request will return a CreateTaskResult immediately, and the actual result can be\nretrieved later via tasks/result.\n\nTask augmentation is subject to capability negotiation - receivers MUST declare support\nfor task augmentation of specific request types in their capabilities.",
+/// "$ref": "#/$defs/TaskMetadata"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CallToolRequestParams {
+ ///Arguments to use for the tool call.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub arguments: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option,
+ ///The name of the tool.
+ pub name: ::std::string::String,
+ /**If specified, the caller is requesting task-augmented execution for this request.
+ The request will return a CreateTaskResult immediately, and the actual result can be
+ retrieved later via tasks/result.
+ Task augmentation is subject to capability negotiation - receivers MUST declare support
+ for task augmentation of specific request types in their capabilities.*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub task: ::std::option::Option,
+}
+///The server's response to a tool call.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The server's response to a tool call.",
+/// "type": "object",
+/// "required": [
+/// "content"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "content": {
+/// "description": "A list of content objects that represent the unstructured result of the tool call.",
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/ContentBlock"
+/// }
+/// },
+/// "isError": {
+/// "description": "Whether the tool call ended in an error.\n\nIf not set, this is assumed to be false (the call was successful).\n\nAny errors that originate from the tool SHOULD be reported inside the result\nobject, with isError set to true, _not_ as an MCP protocol-level error\nresponse. Otherwise, the LLM would not be able to see that an error occurred\nand self-correct.\n\nHowever, any errors in _finding_ the tool, an error indicating that the\nserver does not support tool calls, or any other exceptional conditions,\nshould be reported as an MCP error response.",
+/// "type": "boolean"
+/// },
+/// "structuredContent": {
+/// "description": "An optional JSON object that represents the structured result of the tool call.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CallToolResult {
+ ///A list of content objects that represent the unstructured result of the tool call.
+ pub content: ::std::vec::Vec,
+ /**Whether the tool call ended in an error.
+ If not set, this is assumed to be false (the call was successful).
+ Any errors that originate from the tool SHOULD be reported inside the result
+ object, with isError set to true, _not_ as an MCP protocol-level error
+ response. Otherwise, the LLM would not be able to see that an error occurred
+ and self-correct.
+ However, any errors in _finding_ the tool, an error indicating that the
+ server does not support tool calls, or any other exceptional conditions,
+ should be reported as an MCP error response.*/
+ #[serde(rename = "isError", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub is_error: ::std::option::Option,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ///An optional JSON object that represents the structured result of the tool call.
+ #[serde(
+ rename = "structuredContent",
+ default,
+ skip_serializing_if = "::std::option::Option::is_none"
+ )]
+ pub structured_content: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///CancelTaskParams
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "type": "object",
+/// "required": [
+/// "taskId"
+/// ],
+/// "properties": {
+/// "taskId": {
+/// "description": "The task identifier to cancel.",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CancelTaskParams {
+ ///The task identifier to cancel.
+ #[serde(rename = "taskId")]
+ pub task_id: ::std::string::String,
+}
+///A request to cancel a task.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A request to cancel a task.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method",
+/// "params"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "tasks/cancel"
+/// },
+/// "params": {
+/// "type": "object",
+/// "required": [
+/// "taskId"
+/// ],
+/// "properties": {
+/// "taskId": {
+/// "description": "The task identifier to cancel.",
+/// "type": "string"
+/// }
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CancelTaskRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::cancel_task_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::cancel_task_request_method")]
+ method: ::std::string::String,
+ pub params: CancelTaskParams,
+}
+impl CancelTaskRequest {
+ pub fn new(id: RequestId, params: CancelTaskParams) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "tasks/cancel".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "tasks/cancel"
+ pub fn method_value() -> ::std::string::String {
+ "tasks/cancel".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "tasks/cancel".to_string()
+ }
+}
+///The response to a tasks/cancel request.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The response to a tasks/cancel request.",
+/// "allOf": [
+/// {
+/// "$ref": "#/$defs/Result"
+/// },
+/// {
+/// "$ref": "#/$defs/Task"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CancelTaskResult {
+ #[serde(rename = "createdAt")]
+ pub created_at: ::std::string::String,
+ #[serde(rename = "lastUpdatedAt")]
+ pub last_updated_at: ::std::string::String,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ #[serde(rename = "pollInterval", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub poll_interval: ::std::option::Option,
+ pub status: TaskStatus,
+ #[serde(rename = "statusMessage", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub status_message: ::std::option::Option<::std::string::String>,
+ #[serde(rename = "taskId")]
+ pub task_id: ::std::string::String,
+ pub ttl: i64,
+ #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+/**This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
+The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.
+This notification indicates that the result will be unused, so any associated processing SHOULD cease.
+A client MUST NOT attempt to cancel its initialize request.
+For task cancellation, use the tasks/cancel request instead of this notification.*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "This notification can be sent by either side to indicate that it is cancelling a previously-issued request.\n\nThe request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.\n\nThis notification indicates that the result will be unused, so any associated processing SHOULD cease.\n\nA client MUST NOT attempt to cancel its initialize request.\n\nFor task cancellation, use the tasks/cancel request instead of this notification.",
+/// "type": "object",
+/// "required": [
+/// "jsonrpc",
+/// "method",
+/// "params"
+/// ],
+/// "properties": {
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "notifications/cancelled"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/CancelledNotificationParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CancelledNotification {
+ #[serde(deserialize_with = "validate::cancelled_notification_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::cancelled_notification_method")]
+ method: ::std::string::String,
+ pub params: CancelledNotificationParams,
+}
+impl CancelledNotification {
+ pub fn new(params: CancelledNotificationParams) -> Self {
+ Self {
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "notifications/cancelled".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "notifications/cancelled"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/cancelled".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "notifications/cancelled".to_string()
+ }
+}
+///Parameters for a notifications/cancelled notification.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Parameters for a notifications/cancelled notification.",
+/// "type": "object",
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "reason": {
+/// "description": "An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.",
+/// "type": "string"
+/// },
+/// "requestId": {
+/// "description": "The ID of the request to cancel.\n\nThis MUST correspond to the ID of a request previously issued in the same direction.\nThis MUST be provided for cancelling non-task requests.\nThis MUST NOT be used for cancelling tasks (use the tasks/cancel request instead).",
+/// "$ref": "#/$defs/RequestId"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct CancelledNotificationParams {
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ///An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub reason: ::std::option::Option<::std::string::String>,
+ /**The ID of the request to cancel.
+ This MUST correspond to the ID of a request previously issued in the same direction.
+ This MUST be provided for cancelling non-task requests.
+ This MUST NOT be used for cancelling tasks (use the tasks/cancel request instead).*/
+ #[serde(rename = "requestId", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub request_id: ::std::option::Option,
+}
+///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.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.",
+/// "type": "object",
+/// "properties": {
+/// "elicitation": {
+/// "description": "Present if the client supports elicitation from the server.",
+/// "type": "object",
+/// "properties": {
+/// "form": {
+/// "type": "object",
+/// "additionalProperties": true
+/// },
+/// "url": {
+/// "type": "object",
+/// "additionalProperties": true
+/// }
+/// }
+/// },
+/// "experimental": {
+/// "description": "Experimental, non-standard capabilities that the client supports.",
+/// "type": "object",
+/// "additionalProperties": {
+/// "type": "object",
+/// "additionalProperties": true
+/// }
+/// },
+/// "roots": {
+/// "description": "Present if the client supports listing roots.",
+/// "type": "object",
+/// "properties": {
+/// "listChanged": {
+/// "description": "Whether the client supports notifications for changes to the roots list.",
+/// "type": "boolean"
+/// }
+/// }
+/// },
+/// "sampling": {
+/// "description": "Present if the client supports sampling from an LLM.",
+/// "type": "object",
+/// "properties": {
+/// "context": {
+/// "description": "Whether the client supports context inclusion via includeContext parameter.\nIf not declared, servers SHOULD only use includeContext: \"none\" (or omit it).",
+/// "type": "object",
+/// "additionalProperties": true
+/// },
+/// "tools": {
+/// "description": "Whether the client supports tool use via tools and toolChoice parameters.",
+/// "type": "object",
+/// "additionalProperties": true
+/// }
+/// }
+/// },
+/// "tasks": {
+/// "description": "Present if the client supports task-augmented requests.",
+/// "type": "object",
+/// "properties": {
+/// "cancel": {
+/// "description": "Whether this client supports tasks/cancel.",
+/// "type": "object",
+/// "additionalProperties": true
+/// },
+/// "list": {
+/// "description": "Whether this client supports tasks/list.",
+/// "type": "object",
+/// "additionalProperties": true
+/// },
+/// "requests": {
+/// "description": "Specifies which request types can be augmented with tasks.",
+/// "type": "object",
+/// "properties": {
+/// "elicitation": {
+/// "description": "Task support for elicitation-related requests.",
+/// "type": "object",
+/// "properties": {
+/// "create": {
+/// "description": "Whether the client supports task-augmented elicitation/create requests.",
+/// "type": "object",
+/// "additionalProperties": true
+/// }
+/// }
+/// },
+/// "sampling": {
+/// "description": "Task support for sampling-related requests.",
+/// "type": "object",
+/// "properties": {
+/// "createMessage": {
+/// "description": "Whether the client supports task-augmented sampling/createMessage requests.",
+/// "type": "object",
+/// "additionalProperties": true
+/// }
+/// }
+/// }
+/// }
+/// }
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ClientCapabilities {
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub elicitation: ::std::option::Option,
+ ///Experimental, non-standard capabilities that the client supports.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub experimental: ::std::option::Option<
+ ::std::collections::HashMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ >,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub roots: ::std::option::Option,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub sampling: ::std::option::Option,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub tasks: ::std::option::Option,
+}
+///Present if the client supports elicitation from the server.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Present if the client supports elicitation from the server.",
+/// "type": "object",
+/// "properties": {
+/// "form": {
+/// "type": "object",
+/// "additionalProperties": true
+/// },
+/// "url": {
+/// "type": "object",
+/// "additionalProperties": true
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ClientElicitation {
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub form: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub url: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///ClientNotification
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/CancelledNotification"
+/// },
+/// {
+/// "$ref": "#/$defs/InitializedNotification"
+/// },
+/// {
+/// "$ref": "#/$defs/ProgressNotification"
+/// },
+/// {
+/// "$ref": "#/$defs/TaskStatusNotification"
+/// },
+/// {
+/// "$ref": "#/$defs/RootsListChangedNotification"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum ClientNotification {
+ CancelledNotification(CancelledNotification),
+ InitializedNotification(InitializedNotification),
+ ProgressNotification(ProgressNotification),
+ TaskStatusNotification(TaskStatusNotification),
+ RootsListChangedNotification(RootsListChangedNotification),
+}
+impl ::std::convert::From for ClientNotification {
+ fn from(value: CancelledNotification) -> Self {
+ Self::CancelledNotification(value)
+ }
+}
+impl ::std::convert::From for ClientNotification {
+ fn from(value: InitializedNotification) -> Self {
+ Self::InitializedNotification(value)
+ }
+}
+impl ::std::convert::From for ClientNotification {
+ fn from(value: ProgressNotification) -> Self {
+ Self::ProgressNotification(value)
+ }
+}
+impl ::std::convert::From for ClientNotification {
+ fn from(value: TaskStatusNotification) -> Self {
+ Self::TaskStatusNotification(value)
+ }
+}
+impl ::std::convert::From for ClientNotification {
+ fn from(value: RootsListChangedNotification) -> Self {
+ Self::RootsListChangedNotification(value)
+ }
+}
+///ClientRequest
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/InitializeRequest"
+/// },
+/// {
+/// "$ref": "#/$defs/PingRequest"
+/// },
+/// {
+/// "$ref": "#/$defs/ListResourcesRequest"
+/// },
+/// {
+/// "$ref": "#/$defs/ListResourceTemplatesRequest"
+/// },
+/// {
+/// "$ref": "#/$defs/ReadResourceRequest"
+/// },
+/// {
+/// "$ref": "#/$defs/SubscribeRequest"
+/// },
+/// {
+/// "$ref": "#/$defs/UnsubscribeRequest"
+/// },
+/// {
+/// "$ref": "#/$defs/ListPromptsRequest"
+/// },
+/// {
+/// "$ref": "#/$defs/GetPromptRequest"
+/// },
+/// {
+/// "$ref": "#/$defs/ListToolsRequest"
+/// },
+/// {
+/// "$ref": "#/$defs/CallToolRequest"
+/// },
+/// {
+/// "$ref": "#/$defs/GetTaskRequest"
+/// },
+/// {
+/// "$ref": "#/$defs/GetTaskPayloadRequest"
+/// },
+/// {
+/// "$ref": "#/$defs/CancelTaskRequest"
+/// },
+/// {
+/// "$ref": "#/$defs/ListTasksRequest"
+/// },
+/// {
+/// "$ref": "#/$defs/SetLevelRequest"
+/// },
+/// {
+/// "$ref": "#/$defs/CompleteRequest"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum ClientRequest {
+ InitializeRequest(InitializeRequest),
+ PingRequest(PingRequest),
+ ListResourcesRequest(ListResourcesRequest),
+ ListResourceTemplatesRequest(ListResourceTemplatesRequest),
+ ReadResourceRequest(ReadResourceRequest),
+ SubscribeRequest(SubscribeRequest),
+ UnsubscribeRequest(UnsubscribeRequest),
+ ListPromptsRequest(ListPromptsRequest),
+ GetPromptRequest(GetPromptRequest),
+ ListToolsRequest(ListToolsRequest),
+ CallToolRequest(CallToolRequest),
+ GetTaskRequest(GetTaskRequest),
+ GetTaskPayloadRequest(GetTaskPayloadRequest),
+ CancelTaskRequest(CancelTaskRequest),
+ ListTasksRequest(ListTasksRequest),
+ SetLevelRequest(SetLevelRequest),
+ CompleteRequest(CompleteRequest),
+}
+impl ::std::convert::From for ClientRequest {
+ fn from(value: InitializeRequest) -> Self {
+ Self::InitializeRequest(value)
+ }
+}
+impl ::std::convert::From for ClientRequest {
+ fn from(value: PingRequest) -> Self {
+ Self::PingRequest(value)
+ }
+}
+impl ::std::convert::From for ClientRequest {
+ fn from(value: ListResourcesRequest) -> Self {
+ Self::ListResourcesRequest(value)
+ }
+}
+impl ::std::convert::From for ClientRequest {
+ fn from(value: ListResourceTemplatesRequest) -> Self {
+ Self::ListResourceTemplatesRequest(value)
+ }
+}
+impl ::std::convert::From for ClientRequest {
+ fn from(value: ReadResourceRequest) -> Self {
+ Self::ReadResourceRequest(value)
+ }
+}
+impl ::std::convert::From for ClientRequest {
+ fn from(value: SubscribeRequest) -> Self {
+ Self::SubscribeRequest(value)
+ }
+}
+impl ::std::convert::From for ClientRequest {
+ fn from(value: UnsubscribeRequest) -> Self {
+ Self::UnsubscribeRequest(value)
+ }
+}
+impl ::std::convert::From for ClientRequest {
+ fn from(value: ListPromptsRequest) -> Self {
+ Self::ListPromptsRequest(value)
+ }
+}
+impl ::std::convert::From for ClientRequest {
+ fn from(value: GetPromptRequest) -> Self {
+ Self::GetPromptRequest(value)
+ }
+}
+impl ::std::convert::From for ClientRequest {
+ fn from(value: ListToolsRequest) -> Self {
+ Self::ListToolsRequest(value)
+ }
+}
+impl ::std::convert::From for ClientRequest {
+ fn from(value: CallToolRequest) -> Self {
+ Self::CallToolRequest(value)
+ }
+}
+impl ::std::convert::From for ClientRequest {
+ fn from(value: GetTaskRequest) -> Self {
+ Self::GetTaskRequest(value)
+ }
+}
+impl ::std::convert::From for ClientRequest {
+ fn from(value: GetTaskPayloadRequest) -> Self {
+ Self::GetTaskPayloadRequest(value)
+ }
+}
+impl ::std::convert::From for ClientRequest {
+ fn from(value: CancelTaskRequest) -> Self {
+ Self::CancelTaskRequest(value)
+ }
+}
+impl ::std::convert::From for ClientRequest {
+ fn from(value: ListTasksRequest) -> Self {
+ Self::ListTasksRequest(value)
+ }
+}
+impl ::std::convert::From for ClientRequest {
+ fn from(value: SetLevelRequest) -> Self {
+ Self::SetLevelRequest(value)
+ }
+}
+impl ::std::convert::From for ClientRequest {
+ fn from(value: CompleteRequest) -> Self {
+ Self::CompleteRequest(value)
+ }
+}
+///ClientResult
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/Result"
+/// },
+/// {
+/// "description": "The response to a tasks/get request.",
+/// "$ref": "#/$defs/GetTaskResult"
+/// },
+/// {
+/// "$ref": "#/$defs/GetTaskPayloadResult"
+/// },
+/// {
+/// "description": "The response to a tasks/cancel request.",
+/// "$ref": "#/$defs/CancelTaskResult"
+/// },
+/// {
+/// "$ref": "#/$defs/ListTasksResult"
+/// },
+/// {
+/// "$ref": "#/$defs/CreateMessageResult"
+/// },
+/// {
+/// "$ref": "#/$defs/ListRootsResult"
+/// },
+/// {
+/// "$ref": "#/$defs/ElicitResult"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum ClientResult {
+ GetTaskResult(GetTaskResult),
+ GetTaskPayloadResult(GetTaskPayloadResult),
+ CancelTaskResult(CancelTaskResult),
+ ListTasksResult(ListTasksResult),
+ CreateMessageResult(CreateMessageResult),
+ ListRootsResult(ListRootsResult),
+ ElicitResult(ElicitResult),
+ Result(Result),
+}
+impl ::std::convert::From for ClientResult {
+ fn from(value: GetTaskResult) -> Self {
+ Self::GetTaskResult(value)
+ }
+}
+impl ::std::convert::From for ClientResult {
+ fn from(value: GetTaskPayloadResult) -> Self {
+ Self::GetTaskPayloadResult(value)
+ }
+}
+impl ::std::convert::From for ClientResult {
+ fn from(value: CancelTaskResult) -> Self {
+ Self::CancelTaskResult(value)
+ }
+}
+impl ::std::convert::From for ClientResult {
+ fn from(value: ListTasksResult) -> Self {
+ Self::ListTasksResult(value)
+ }
+}
+impl ::std::convert::From for ClientResult {
+ fn from(value: CreateMessageResult) -> Self {
+ Self::CreateMessageResult(value)
+ }
+}
+impl ::std::convert::From for ClientResult {
+ fn from(value: ListRootsResult) -> Self {
+ Self::ListRootsResult(value)
+ }
+}
+impl ::std::convert::From for ClientResult {
+ fn from(value: ElicitResult) -> Self {
+ Self::ElicitResult(value)
+ }
+}
+impl ::std::convert::From for ClientResult {
+ fn from(value: Result) -> Self {
+ Self::Result(value)
+ }
+}
+///Present if the client supports listing roots.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Present if the client supports listing roots.",
+/// "type": "object",
+/// "properties": {
+/// "listChanged": {
+/// "description": "Whether the client supports notifications for changes to the roots list.",
+/// "type": "boolean"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ClientRoots {
+ ///Whether the client supports notifications for changes to the roots list.
+ #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub list_changed: ::std::option::Option,
+}
+///Present if the client supports sampling from an LLM.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Present if the client supports sampling from an LLM.",
+/// "type": "object",
+/// "properties": {
+/// "context": {
+/// "description": "Whether the client supports context inclusion via includeContext parameter.\nIf not declared, servers SHOULD only use includeContext: \"none\" (or omit it).",
+/// "type": "object",
+/// "additionalProperties": true
+/// },
+/// "tools": {
+/// "description": "Whether the client supports tool use via tools and toolChoice parameters.",
+/// "type": "object",
+/// "additionalProperties": true
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ClientSampling {
+ /**Whether the client supports context inclusion via includeContext parameter.
+ If not declared, servers SHOULD only use includeContext: "none" (or omit it).*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub context: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ///Whether the client supports tool use via tools and toolChoice parameters.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub tools: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///Task support for elicitation-related requests.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Task support for elicitation-related requests.",
+/// "type": "object",
+/// "properties": {
+/// "create": {
+/// "description": "Whether the client supports task-augmented elicitation/create requests.",
+/// "type": "object",
+/// "additionalProperties": true
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ClientTaskElicitation {
+ ///Whether the client supports task-augmented elicitation/create requests.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub create: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///Specifies which request types can be augmented with tasks.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Specifies which request types can be augmented with tasks.",
+/// "type": "object",
+/// "properties": {
+/// "elicitation": {
+/// "description": "Task support for elicitation-related requests.",
+/// "type": "object",
+/// "properties": {
+/// "create": {
+/// "description": "Whether the client supports task-augmented elicitation/create requests.",
+/// "type": "object",
+/// "additionalProperties": true
+/// }
+/// }
+/// },
+/// "sampling": {
+/// "description": "Task support for sampling-related requests.",
+/// "type": "object",
+/// "properties": {
+/// "createMessage": {
+/// "description": "Whether the client supports task-augmented sampling/createMessage requests.",
+/// "type": "object",
+/// "additionalProperties": true
+/// }
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ClientTaskRequest {
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub elicitation: ::std::option::Option,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub sampling: ::std::option::Option,
+}
+///Task support for sampling-related requests.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Task support for sampling-related requests.",
+/// "type": "object",
+/// "properties": {
+/// "createMessage": {
+/// "description": "Whether the client supports task-augmented sampling/createMessage requests.",
+/// "type": "object",
+/// "additionalProperties": true
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ClientTaskSampling {
+ ///Whether the client supports task-augmented sampling/createMessage requests.
+ #[serde(rename = "createMessage", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub create_message: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///Present if the client supports task-augmented requests.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Present if the client supports task-augmented requests.",
+/// "type": "object",
+/// "properties": {
+/// "cancel": {
+/// "description": "Whether this client supports tasks/cancel.",
+/// "type": "object",
+/// "additionalProperties": true
+/// },
+/// "list": {
+/// "description": "Whether this client supports tasks/list.",
+/// "type": "object",
+/// "additionalProperties": true
+/// },
+/// "requests": {
+/// "description": "Specifies which request types can be augmented with tasks.",
+/// "type": "object",
+/// "properties": {
+/// "elicitation": {
+/// "description": "Task support for elicitation-related requests.",
+/// "type": "object",
+/// "properties": {
+/// "create": {
+/// "description": "Whether the client supports task-augmented elicitation/create requests.",
+/// "type": "object",
+/// "additionalProperties": true
+/// }
+/// }
+/// },
+/// "sampling": {
+/// "description": "Task support for sampling-related requests.",
+/// "type": "object",
+/// "properties": {
+/// "createMessage": {
+/// "description": "Whether the client supports task-augmented sampling/createMessage requests.",
+/// "type": "object",
+/// "additionalProperties": true
+/// }
+/// }
+/// }
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ClientTasks {
+ ///Whether this client supports tasks/cancel.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub cancel: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ///Whether this client supports tasks/list.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub list: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub requests: ::std::option::Option,
+}
+///A request from the client to the server, to ask for completion options.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A request from the client to the server, to ask for completion options.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method",
+/// "params"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "completion/complete"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/CompleteRequestParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CompleteRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::complete_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::complete_request_method")]
+ method: ::std::string::String,
+ pub params: CompleteRequestParams,
+}
+impl CompleteRequest {
+ pub fn new(id: RequestId, params: CompleteRequestParams) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "completion/complete".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "completion/complete"
+ pub fn method_value() -> ::std::string::String {
+ "completion/complete".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "completion/complete".to_string()
+ }
+}
+///The argument's information
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The argument's information",
+/// "type": "object",
+/// "required": [
+/// "name",
+/// "value"
+/// ],
+/// "properties": {
+/// "name": {
+/// "description": "The name of the argument",
+/// "type": "string"
+/// },
+/// "value": {
+/// "description": "The value of the argument to use for completion matching.",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CompleteRequestArgument {
+ ///The name of the argument
+ pub name: ::std::string::String,
+ ///The value of the argument to use for completion matching.
+ pub value: ::std::string::String,
+}
+///Additional, optional context for completions
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Additional, optional context for completions",
+/// "type": "object",
+/// "properties": {
+/// "arguments": {
+/// "description": "Previously-resolved variables in a URI template or prompt.",
+/// "type": "object",
+/// "additionalProperties": {
+/// "type": "string"
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct CompleteRequestContext {
+ ///Previously-resolved variables in a URI template or prompt.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub arguments: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
+}
+///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct CompleteRequestMeta {
+ ///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.
+ #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub progress_token: ::std::option::Option,
+ #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///Parameters for a completion/complete request.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Parameters for a completion/complete request.",
+/// "type": "object",
+/// "required": [
+/// "argument",
+/// "ref"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+/// },
+/// "argument": {
+/// "description": "The argument's information",
+/// "type": "object",
+/// "required": [
+/// "name",
+/// "value"
+/// ],
+/// "properties": {
+/// "name": {
+/// "description": "The name of the argument",
+/// "type": "string"
+/// },
+/// "value": {
+/// "description": "The value of the argument to use for completion matching.",
+/// "type": "string"
+/// }
+/// }
+/// },
+/// "context": {
+/// "description": "Additional, optional context for completions",
+/// "type": "object",
+/// "properties": {
+/// "arguments": {
+/// "description": "Previously-resolved variables in a URI template or prompt.",
+/// "type": "object",
+/// "additionalProperties": {
+/// "type": "string"
+/// }
+/// }
+/// }
+/// },
+/// "ref": {
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/PromptReference"
+/// },
+/// {
+/// "$ref": "#/$defs/ResourceTemplateReference"
+/// }
+/// ]
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CompleteRequestParams {
+ pub argument: CompleteRequestArgument,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub context: ::std::option::Option,
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option,
+ #[serde(rename = "ref")]
+ pub ref_: CompleteRequestRef,
+}
+///CompleteRequestRef
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/PromptReference"
+/// },
+/// {
+/// "$ref": "#/$defs/ResourceTemplateReference"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum CompleteRequestRef {
+ PromptReference(PromptReference),
+ ResourceTemplateReference(ResourceTemplateReference),
+}
+impl ::std::convert::From for CompleteRequestRef {
+ fn from(value: PromptReference) -> Self {
+ Self::PromptReference(value)
+ }
+}
+impl ::std::convert::From for CompleteRequestRef {
+ fn from(value: ResourceTemplateReference) -> Self {
+ Self::ResourceTemplateReference(value)
+ }
+}
+///The server's response to a completion/complete request
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The server's response to a completion/complete request",
+/// "type": "object",
+/// "required": [
+/// "completion"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "completion": {
+/// "type": "object",
+/// "required": [
+/// "values"
+/// ],
+/// "properties": {
+/// "hasMore": {
+/// "description": "Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.",
+/// "type": "boolean"
+/// },
+/// "total": {
+/// "description": "The total number of completion options available. This can exceed the number of values actually sent in the response.",
+/// "type": "integer"
+/// },
+/// "values": {
+/// "description": "An array of completion values. Must not exceed 100 items.",
+/// "type": "array",
+/// "items": {
+/// "type": "string"
+/// }
+/// }
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CompleteResult {
+ pub completion: CompleteResultCompletion,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///CompleteResultCompletion
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "type": "object",
+/// "required": [
+/// "values"
+/// ],
+/// "properties": {
+/// "hasMore": {
+/// "description": "Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.",
+/// "type": "boolean"
+/// },
+/// "total": {
+/// "description": "The total number of completion options available. This can exceed the number of values actually sent in the response.",
+/// "type": "integer"
+/// },
+/// "values": {
+/// "description": "An array of completion values. Must not exceed 100 items.",
+/// "type": "array",
+/// "items": {
+/// "type": "string"
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CompleteResultCompletion {
+ ///Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
+ #[serde(rename = "hasMore", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub has_more: ::std::option::Option,
+ ///The total number of completion options available. This can exceed the number of values actually sent in the response.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub total: ::std::option::Option,
+ ///An array of completion values. Must not exceed 100 items.
+ pub values: ::std::vec::Vec<::std::string::String>,
+}
+///ContentBlock
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/TextContent"
+/// },
+/// {
+/// "$ref": "#/$defs/ImageContent"
+/// },
+/// {
+/// "$ref": "#/$defs/AudioContent"
+/// },
+/// {
+/// "$ref": "#/$defs/ResourceLink"
+/// },
+/// {
+/// "$ref": "#/$defs/EmbeddedResource"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum ContentBlock {
+ TextContent(TextContent),
+ ImageContent(ImageContent),
+ AudioContent(AudioContent),
+ ResourceLink(ResourceLink),
+ EmbeddedResource(EmbeddedResource),
+}
+impl ::std::convert::From for ContentBlock {
+ fn from(value: TextContent) -> Self {
+ Self::TextContent(value)
+ }
+}
+impl ::std::convert::From for ContentBlock {
+ fn from(value: ImageContent) -> Self {
+ Self::ImageContent(value)
+ }
+}
+impl ::std::convert::From for ContentBlock {
+ fn from(value: AudioContent) -> Self {
+ Self::AudioContent(value)
+ }
+}
+impl ::std::convert::From for ContentBlock {
+ fn from(value: ResourceLink) -> Self {
+ Self::ResourceLink(value)
+ }
+}
+impl ::std::convert::From for ContentBlock {
+ fn from(value: EmbeddedResource) -> Self {
+ Self::EmbeddedResource(value)
+ }
+}
+///CreateMessageContent
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/TextContent"
+/// },
+/// {
+/// "$ref": "#/$defs/ImageContent"
+/// },
+/// {
+/// "$ref": "#/$defs/AudioContent"
+/// },
+/// {
+/// "$ref": "#/$defs/ToolUseContent"
+/// },
+/// {
+/// "$ref": "#/$defs/ToolResultContent"
+/// },
+/// {
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/SamplingMessageContentBlock"
+/// }
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum CreateMessageContent {
+ TextContent(TextContent),
+ ImageContent(ImageContent),
+ AudioContent(AudioContent),
+ ToolUseContent(ToolUseContent),
+ ToolResultContent(ToolResultContent),
+ SamplingMessageContentBlock(::std::vec::Vec),
+}
+impl ::std::convert::From for CreateMessageContent {
+ fn from(value: TextContent) -> Self {
+ Self::TextContent(value)
+ }
+}
+impl ::std::convert::From for CreateMessageContent {
+ fn from(value: ImageContent) -> Self {
+ Self::ImageContent(value)
+ }
+}
+impl ::std::convert::From for CreateMessageContent {
+ fn from(value: AudioContent) -> Self {
+ Self::AudioContent(value)
+ }
+}
+impl ::std::convert::From for CreateMessageContent {
+ fn from(value: ToolUseContent) -> Self {
+ Self::ToolUseContent(value)
+ }
+}
+impl ::std::convert::From for CreateMessageContent {
+ fn from(value: ToolResultContent) -> Self {
+ Self::ToolResultContent(value)
+ }
+}
+impl ::std::convert::From<::std::vec::Vec> for CreateMessageContent {
+ fn from(value: ::std::vec::Vec) -> Self {
+ Self::SamplingMessageContentBlock(value)
+ }
+}
+///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.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method",
+/// "params"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "sampling/createMessage"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/CreateMessageRequestParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CreateMessageRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::create_message_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::create_message_request_method")]
+ method: ::std::string::String,
+ pub params: CreateMessageRequestParams,
+}
+impl CreateMessageRequest {
+ pub fn new(id: RequestId, params: CreateMessageRequestParams) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "sampling/createMessage".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "sampling/createMessage"
+ pub fn method_value() -> ::std::string::String {
+ "sampling/createMessage".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "sampling/createMessage".to_string()
+ }
+}
+///Parameters for a sampling/createMessage request.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Parameters for a sampling/createMessage request.",
+/// "type": "object",
+/// "required": [
+/// "maxTokens",
+/// "messages"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+/// },
+/// "includeContext": {
+/// "description": "A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.\nThe client MAY ignore this request.\n\nDefault is \"none\". Values \"thisServer\" and \"allServers\" are soft-deprecated. Servers SHOULD only use these values if the client\ndeclares ClientCapabilities.sampling.context. These values may be removed in future spec releases.",
+/// "type": "string",
+/// "enum": [
+/// "allServers",
+/// "none",
+/// "thisServer"
+/// ]
+/// },
+/// "maxTokens": {
+/// "description": "The requested maximum number of tokens to sample (to prevent runaway completions).\n\nThe client MAY choose to sample fewer tokens than the requested maximum.",
+/// "type": "integer"
+/// },
+/// "messages": {
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/SamplingMessage"
+/// }
+/// },
+/// "metadata": {
+/// "description": "Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.",
+/// "type": "object",
+/// "additionalProperties": true
+/// },
+/// "modelPreferences": {
+/// "description": "The server's preferences for which model to select. The client MAY ignore these preferences.",
+/// "$ref": "#/$defs/ModelPreferences"
+/// },
+/// "stopSequences": {
+/// "type": "array",
+/// "items": {
+/// "type": "string"
+/// }
+/// },
+/// "systemPrompt": {
+/// "description": "An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.",
+/// "type": "string"
+/// },
+/// "task": {
+/// "description": "If specified, the caller is requesting task-augmented execution for this request.\nThe request will return a CreateTaskResult immediately, and the actual result can be\nretrieved later via tasks/result.\n\nTask augmentation is subject to capability negotiation - receivers MUST declare support\nfor task augmentation of specific request types in their capabilities.",
+/// "$ref": "#/$defs/TaskMetadata"
+/// },
+/// "temperature": {
+/// "type": "number"
+/// },
+/// "toolChoice": {
+/// "description": "Controls how the model uses tools.\nThe client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.\nDefault is { mode: \"auto\" }.",
+/// "$ref": "#/$defs/ToolChoice"
+/// },
+/// "tools": {
+/// "description": "Tools that the model may use during generation.\nThe client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.",
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/Tool"
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CreateMessageRequestParams {
+ /**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.
+ Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
+ declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.*/
+ #[serde(rename = "includeContext", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub include_context: ::std::option::Option,
+ /**The requested maximum number of tokens to sample (to prevent runaway completions).
+ The client MAY choose to sample fewer tokens than the requested maximum.*/
+ #[serde(rename = "maxTokens")]
+ pub max_tokens: i64,
+ pub messages: ::std::vec::Vec,
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option,
+ ///Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub metadata: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ///The server's preferences for which model to select. The client MAY ignore these preferences.
+ #[serde(
+ rename = "modelPreferences",
+ default,
+ skip_serializing_if = "::std::option::Option::is_none"
+ )]
+ pub model_preferences: ::std::option::Option,
+ #[serde(rename = "stopSequences", default, skip_serializing_if = "::std::vec::Vec::is_empty")]
+ pub stop_sequences: ::std::vec::Vec<::std::string::String>,
+ ///An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
+ #[serde(rename = "systemPrompt", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub system_prompt: ::std::option::Option<::std::string::String>,
+ /**If specified, the caller is requesting task-augmented execution for this request.
+ The request will return a CreateTaskResult immediately, and the actual result can be
+ retrieved later via tasks/result.
+ Task augmentation is subject to capability negotiation - receivers MUST declare support
+ for task augmentation of specific request types in their capabilities.*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub task: ::std::option::Option,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub temperature: ::std::option::Option,
+ /**Controls how the model uses tools.
+ The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
+ Default is { mode: "auto" }.*/
+ #[serde(rename = "toolChoice", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub tool_choice: ::std::option::Option,
+ /**Tools that the model may use during generation.
+ The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.*/
+ #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
+ pub tools: ::std::vec::Vec,
+}
+/**The client's response to a sampling/createMessage 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.*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The client's response to a sampling/createMessage request from the server.\nThe client should inform the user before returning the sampled message, to allow them\nto inspect the response (human in the loop) and decide whether to allow the server to see it.",
+/// "type": "object",
+/// "required": [
+/// "content",
+/// "model",
+/// "role"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "content": {
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/TextContent"
+/// },
+/// {
+/// "$ref": "#/$defs/ImageContent"
+/// },
+/// {
+/// "$ref": "#/$defs/AudioContent"
+/// },
+/// {
+/// "$ref": "#/$defs/ToolUseContent"
+/// },
+/// {
+/// "$ref": "#/$defs/ToolResultContent"
+/// },
+/// {
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/SamplingMessageContentBlock"
+/// }
+/// }
+/// ]
+/// },
+/// "model": {
+/// "description": "The name of the model that generated the message.",
+/// "type": "string"
+/// },
+/// "role": {
+/// "$ref": "#/$defs/Role"
+/// },
+/// "stopReason": {
+/// "description": "The reason why sampling stopped, if known.\n\nStandard values:\n- \"endTurn\": Natural end of the assistant's turn\n- \"stopSequence\": A stop sequence was encountered\n- \"maxTokens\": Maximum token limit was reached\n- \"toolUse\": The model wants to use one or more tools\n\nThis field is an open string to allow for provider-specific stop reasons.",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CreateMessageResult {
+ pub content: CreateMessageContent,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ///The name of the model that generated the message.
+ pub model: ::std::string::String,
+ pub role: Role,
+ /**The reason why sampling stopped, if known.
+ Standard values:
+ - "endTurn": Natural end of the assistant's turn
+ - "stopSequence": A stop sequence was encountered
+ - "maxTokens": Maximum token limit was reached
+ - "toolUse": The model wants to use one or more tools
+ This field is an open string to allow for provider-specific stop reasons.*/
+ #[serde(rename = "stopReason", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub stop_reason: ::std::option::Option<::std::string::String>,
+}
+///A response to a task-augmented request.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A response to a task-augmented request.",
+/// "type": "object",
+/// "required": [
+/// "task"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "task": {
+/// "$ref": "#/$defs/Task"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct CreateTaskResult {
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ pub task: Task,
+}
+///An opaque token used to represent a cursor for pagination.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "An opaque token used to represent a cursor for pagination.",
+/// "type": "string"
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+#[serde(transparent)]
+pub struct Cursor(pub ::std::string::String);
+///ElicitCompleteParams
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "type": "object",
+/// "required": [
+/// "elicitationId"
+/// ],
+/// "properties": {
+/// "elicitationId": {
+/// "description": "The ID of the elicitation that completed.",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ElicitCompleteParams {
+ ///The ID of the elicitation that completed.
+ #[serde(rename = "elicitationId")]
+ pub elicitation_id: ::std::string::String,
+}
+///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ElicitFormMeta {
+ ///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.
+ #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub progress_token: ::std::option::Option,
+ #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+/**A restricted subset of JSON Schema.
+Only top-level properties are allowed, without nesting.*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A restricted subset of JSON Schema.\nOnly top-level properties are allowed, without nesting.",
+/// "type": "object",
+/// "required": [
+/// "properties",
+/// "type"
+/// ],
+/// "properties": {
+/// "$schema": {
+/// "type": "string"
+/// },
+/// "properties": {
+/// "type": "object",
+/// "additionalProperties": {
+/// "$ref": "#/$defs/PrimitiveSchemaDefinition"
+/// }
+/// },
+/// "required": {
+/// "type": "array",
+/// "items": {
+/// "type": "string"
+/// }
+/// },
+/// "type": {
+/// "type": "string",
+/// "const": "object"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ElicitFormSchema {
+ pub properties: ::std::collections::HashMap<::std::string::String, PrimitiveSchemaDefinition>,
+ #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
+ pub required: ::std::vec::Vec<::std::string::String>,
+ #[serde(rename = "$schema", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub schema: ::std::option::Option<::std::string::String>,
+ #[serde(rename = "type", deserialize_with = "validate::elicit_form_schema_type_")]
+ type_: ::std::string::String,
+}
+impl ElicitFormSchema {
+ pub fn new(
+ properties: ::std::collections::HashMap<::std::string::String, PrimitiveSchemaDefinition>,
+ required: ::std::vec::Vec<::std::string::String>,
+ schema: ::std::option::Option<::std::string::String>,
+ ) -> Self {
+ Self {
+ properties,
+ required,
+ schema,
+ type_: "object".to_string(),
+ }
+ }
+ pub fn type_(&self) -> &::std::string::String {
+ &self.type_
+ }
+ /// returns "object"
+ pub fn type_value() -> ::std::string::String {
+ "object".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
+ pub fn type_name() -> ::std::string::String {
+ "object".to_string()
+ }
+}
+///A request from the server to elicit additional information from the user via the client.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A request from the server to elicit additional information from the user via the client.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method",
+/// "params"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "elicitation/create"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/ElicitRequestParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ElicitRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::elicit_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::elicit_request_method")]
+ method: ::std::string::String,
+ pub params: ElicitRequestParams,
+}
+impl ElicitRequest {
+ pub fn new(id: RequestId, params: ElicitRequestParams) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "elicitation/create".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "elicitation/create"
+ pub fn method_value() -> ::std::string::String {
+ "elicitation/create".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "elicitation/create".to_string()
+ }
+}
+///The parameters for a request to elicit non-sensitive information from the user via a form in the client.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The parameters for a request to elicit non-sensitive information from the user via a form in the client.",
+/// "type": "object",
+/// "required": [
+/// "message",
+/// "requestedSchema"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+/// },
+/// "message": {
+/// "description": "The message to present to the user describing what information is being requested.",
+/// "type": "string"
+/// },
+/// "mode": {
+/// "description": "The elicitation mode.",
+/// "type": "string",
+/// "const": "form"
+/// },
+/// "requestedSchema": {
+/// "description": "A restricted subset of JSON Schema.\nOnly top-level properties are allowed, without nesting.",
+/// "type": "object",
+/// "required": [
+/// "properties",
+/// "type"
+/// ],
+/// "properties": {
+/// "$schema": {
+/// "type": "string"
+/// },
+/// "properties": {
+/// "type": "object",
+/// "additionalProperties": {
+/// "$ref": "#/$defs/PrimitiveSchemaDefinition"
+/// }
+/// },
+/// "required": {
+/// "type": "array",
+/// "items": {
+/// "type": "string"
+/// }
+/// },
+/// "type": {
+/// "type": "string",
+/// "const": "object"
+/// }
+/// }
+/// },
+/// "task": {
+/// "description": "If specified, the caller is requesting task-augmented execution for this request.\nThe request will return a CreateTaskResult immediately, and the actual result can be\nretrieved later via tasks/result.\n\nTask augmentation is subject to capability negotiation - receivers MUST declare support\nfor task augmentation of specific request types in their capabilities.",
+/// "$ref": "#/$defs/TaskMetadata"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ElicitRequestFormParams {
+ ///The message to present to the user describing what information is being requested.
+ pub message: ::std::string::String,
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option,
+ ///The elicitation mode.
+ #[serde(
+ default,
+ skip_serializing_if = "::std::option::Option::is_none",
+ deserialize_with = "validate::elicit_request_form_params_mode"
+ )]
+ mode: ::std::option::Option<::std::string::String>,
+ #[serde(rename = "requestedSchema")]
+ pub requested_schema: ElicitFormSchema,
+ /**If specified, the caller is requesting task-augmented execution for this request.
+ The request will return a CreateTaskResult immediately, and the actual result can be
+ retrieved later via tasks/result.
+ Task augmentation is subject to capability negotiation - receivers MUST declare support
+ for task augmentation of specific request types in their capabilities.*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub task: ::std::option::Option,
+}
+impl ElicitRequestFormParams {
+ pub fn new(
+ message: ::std::string::String,
+ requested_schema: ElicitFormSchema,
+ meta: ::std::option::Option,
+ task: ::std::option::Option,
+ ) -> Self {
+ Self {
+ message,
+ meta,
+ mode: Some("form".to_string()),
+ requested_schema,
+ task,
+ }
+ }
+ pub fn mode(&self) -> &::std::option::Option<::std::string::String> {
+ &self.mode
+ }
+ /// returns "form"
+ pub fn mode_value() -> ::std::string::String {
+ "form".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `mode_value()` instead.")]
+ pub fn mode_name() -> ::std::string::String {
+ "form".to_string()
+ }
+}
+///The parameters for a request to elicit additional information from the user via the client.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The parameters for a request to elicit additional information from the user via the client.",
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/ElicitRequestURLParams"
+/// },
+/// {
+/// "$ref": "#/$defs/ElicitRequestFormParams"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum ElicitRequestParams {
+ UrlParams(ElicitRequestUrlParams),
+ FormParams(ElicitRequestFormParams),
+}
+impl ::std::convert::From for ElicitRequestParams {
+ fn from(value: ElicitRequestUrlParams) -> Self {
+ Self::UrlParams(value)
+ }
+}
+impl ::std::convert::From for ElicitRequestParams {
+ fn from(value: ElicitRequestFormParams) -> Self {
+ Self::FormParams(value)
+ }
+}
+///The parameters for a request to elicit information from the user via a URL in the client.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The parameters for a request to elicit information from the user via a URL in the client.",
+/// "type": "object",
+/// "required": [
+/// "elicitationId",
+/// "message",
+/// "mode",
+/// "url"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+/// },
+/// "elicitationId": {
+/// "description": "The ID of the elicitation, which must be unique within the context of the server.\nThe client MUST treat this ID as an opaque value.",
+/// "type": "string"
+/// },
+/// "message": {
+/// "description": "The message to present to the user explaining why the interaction is needed.",
+/// "type": "string"
+/// },
+/// "mode": {
+/// "description": "The elicitation mode.",
+/// "type": "string",
+/// "const": "url"
+/// },
+/// "task": {
+/// "description": "If specified, the caller is requesting task-augmented execution for this request.\nThe request will return a CreateTaskResult immediately, and the actual result can be\nretrieved later via tasks/result.\n\nTask augmentation is subject to capability negotiation - receivers MUST declare support\nfor task augmentation of specific request types in their capabilities.",
+/// "$ref": "#/$defs/TaskMetadata"
+/// },
+/// "url": {
+/// "description": "The URL that the user should navigate to.",
+/// "type": "string",
+/// "format": "uri"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ElicitRequestUrlParams {
+ /**The ID of the elicitation, which must be unique within the context of the server.
+ The client MUST treat this ID as an opaque value.*/
+ #[serde(rename = "elicitationId")]
+ pub elicitation_id: ::std::string::String,
+ ///The message to present to the user explaining why the interaction is needed.
+ pub message: ::std::string::String,
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option,
+ ///The elicitation mode.
+ #[serde(deserialize_with = "validate::elicit_request_url_params_mode")]
+ mode: ::std::string::String,
+ /**If specified, the caller is requesting task-augmented execution for this request.
+ The request will return a CreateTaskResult immediately, and the actual result can be
+ retrieved later via tasks/result.
+ Task augmentation is subject to capability negotiation - receivers MUST declare support
+ for task augmentation of specific request types in their capabilities.*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub task: ::std::option::Option,
+ ///The URL that the user should navigate to.
+ pub url: ::std::string::String,
+}
+impl ElicitRequestUrlParams {
+ pub fn new(
+ elicitation_id: ::std::string::String,
+ message: ::std::string::String,
+ url: ::std::string::String,
+ meta: ::std::option::Option,
+ task: ::std::option::Option,
+ ) -> Self {
+ Self {
+ elicitation_id,
+ message,
+ meta,
+ mode: "url".to_string(),
+ task,
+ url,
+ }
+ }
+ pub fn mode(&self) -> &::std::string::String {
+ &self.mode
+ }
+ /// returns "url"
+ pub fn mode_value() -> ::std::string::String {
+ "url".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `mode_value()` instead.")]
+ pub fn mode_name() -> ::std::string::String {
+ "url".to_string()
+ }
+}
+///The client's response to an elicitation request.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The client's response to an elicitation request.",
+/// "type": "object",
+/// "required": [
+/// "action"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "action": {
+/// "description": "The user action in response to the elicitation.\n- \"accept\": User submitted the form/confirmed the action\n- \"decline\": User explicitly decline the action\n- \"cancel\": User dismissed without making an explicit choice",
+/// "type": "string",
+/// "enum": [
+/// "accept",
+/// "cancel",
+/// "decline"
+/// ]
+/// },
+/// "content": {
+/// "description": "The submitted form data, only present when action is \"accept\" and mode was \"form\".\nContains values matching the requested schema.\nOmitted for out-of-band mode responses.",
+/// "type": "object",
+/// "additionalProperties": {
+/// "anyOf": [
+/// {
+/// "type": "array",
+/// "items": {
+/// "type": "string"
+/// }
+/// },
+/// {
+/// "type": [
+/// "string",
+/// "integer",
+/// "boolean"
+/// ]
+/// }
+/// ]
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ElicitResult {
+ /**The user action in response to the elicitation.
+ - "accept": User submitted the form/confirmed the action
+ - "decline": User explicitly decline the action
+ - "cancel": User dismissed without making an explicit choice*/
+ pub action: ElicitResultAction,
+ /**The submitted form data, only present when action is "accept" and mode was "form".
+ Contains values matching the requested schema.
+ Omitted for out-of-band mode responses.*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub content: ::std::option::Option<::std::collections::HashMap<::std::string::String, ElicitResultContent>>,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+/**The user action in response to the elicitation.
+- "accept": User submitted the form/confirmed the action
+- "decline": User explicitly decline the action
+- "cancel": User dismissed without making an explicit choice*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The user action in response to the elicitation.\n- \"accept\": User submitted the form/confirmed the action\n- \"decline\": User explicitly decline the action\n- \"cancel\": User dismissed without making an explicit choice",
+/// "type": "string",
+/// "enum": [
+/// "accept",
+/// "cancel",
+/// "decline"
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+pub enum ElicitResultAction {
+ #[serde(rename = "accept")]
+ Accept,
+ #[serde(rename = "cancel")]
+ Cancel,
+ #[serde(rename = "decline")]
+ Decline,
+}
+impl ::std::fmt::Display for ElicitResultAction {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ match *self {
+ Self::Accept => write!(f, "accept"),
+ Self::Cancel => write!(f, "cancel"),
+ Self::Decline => write!(f, "decline"),
+ }
+ }
+}
+///ElicitResultContent
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "type": "array",
+/// "items": {
+/// "type": "string"
+/// }
+/// },
+/// {
+/// "type": [
+/// "string",
+/// "integer",
+/// "boolean"
+/// ]
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum ElicitResultContent {
+ StringArray(::std::vec::Vec<::std::string::String>),
+ Primitive(ElicitResultContentPrimitive),
+}
+impl ::std::convert::From<::std::vec::Vec<::std::string::String>> for ElicitResultContent {
+ fn from(value: ::std::vec::Vec<::std::string::String>) -> Self {
+ Self::StringArray(value)
+ }
+}
+impl ::std::convert::From for ElicitResultContent {
+ fn from(value: ElicitResultContentPrimitive) -> Self {
+ Self::Primitive(value)
+ }
+}
+///ElicitResultContentPrimitive
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "type": [
+/// "string",
+/// "integer",
+/// "boolean"
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum ElicitResultContentPrimitive {
+ Boolean(bool),
+ String(::std::string::String),
+ Integer(i64),
+}
+impl ::std::convert::From for ElicitResultContentPrimitive {
+ fn from(value: bool) -> Self {
+ Self::Boolean(value)
+ }
+}
+impl ::std::convert::From for ElicitResultContentPrimitive {
+ fn from(value: i64) -> Self {
+ Self::Integer(value)
+ }
+}
+///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ElicitUrlMeta {
+ ///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.
+ #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub progress_token: ::std::option::Option,
+ #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///An optional notification from the server to the client, informing it of a completion of a out-of-band elicitation request.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "An optional notification from the server to the client, informing it of a completion of a out-of-band elicitation request.",
+/// "type": "object",
+/// "required": [
+/// "jsonrpc",
+/// "method",
+/// "params"
+/// ],
+/// "properties": {
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "notifications/elicitation/complete"
+/// },
+/// "params": {
+/// "type": "object",
+/// "required": [
+/// "elicitationId"
+/// ],
+/// "properties": {
+/// "elicitationId": {
+/// "description": "The ID of the elicitation that completed.",
+/// "type": "string"
+/// }
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ElicitationCompleteNotification {
+ #[serde(deserialize_with = "validate::elicitation_complete_notification_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::elicitation_complete_notification_method")]
+ method: ::std::string::String,
+ pub params: ElicitCompleteParams,
+}
+impl ElicitationCompleteNotification {
+ pub fn new(params: ElicitCompleteParams) -> Self {
+ Self {
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "notifications/elicitation/complete".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "notifications/elicitation/complete"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/elicitation/complete".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "notifications/elicitation/complete".to_string()
+ }
+}
+/**The contents of a resource, embedded into a prompt or tool call result.
+It is up to the client how best to render embedded resources for the benefit
+of the LLM and/or the user.*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The contents of a resource, embedded into a prompt or tool call result.\n\nIt is up to the client how best to render embedded resources for the benefit\nof the LLM and/or the user.",
+/// "type": "object",
+/// "required": [
+/// "resource",
+/// "type"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "annotations": {
+/// "description": "Optional annotations for the client.",
+/// "$ref": "#/$defs/Annotations"
+/// },
+/// "resource": {
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/TextResourceContents"
+/// },
+/// {
+/// "$ref": "#/$defs/BlobResourceContents"
+/// }
+/// ]
+/// },
+/// "type": {
+/// "type": "string",
+/// "const": "resource"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct EmbeddedResource {
+ ///Optional annotations for the client.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub annotations: ::std::option::Option,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ pub resource: EmbeddedResourceResource,
+ #[serde(rename = "type", deserialize_with = "validate::embedded_resource_type_")]
+ type_: ::std::string::String,
+}
+impl EmbeddedResource {
+ pub fn new(
+ resource: EmbeddedResourceResource,
+ annotations: ::std::option::Option,
+ meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ) -> Self {
+ Self {
+ annotations,
+ meta,
+ resource,
+ type_: "resource".to_string(),
+ }
+ }
+ pub fn type_(&self) -> &::std::string::String {
+ &self.type_
+ }
+ /// returns "resource"
+ pub fn type_value() -> ::std::string::String {
+ "resource".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
+ pub fn type_name() -> ::std::string::String {
+ "resource".to_string()
+ }
+}
+///EmbeddedResourceResource
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/TextResourceContents"
+/// },
+/// {
+/// "$ref": "#/$defs/BlobResourceContents"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum EmbeddedResourceResource {
+ TextResourceContents(TextResourceContents),
+ BlobResourceContents(BlobResourceContents),
+}
+impl ::std::convert::From for EmbeddedResourceResource {
+ fn from(value: TextResourceContents) -> Self {
+ Self::TextResourceContents(value)
+ }
+}
+impl ::std::convert::From for EmbeddedResourceResource {
+ fn from(value: BlobResourceContents) -> Self {
+ Self::BlobResourceContents(value)
+ }
+}
+///EmptyResult
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "$ref": "#/$defs/Result"
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(transparent)]
+pub struct EmptyResult(pub Result);
+///EnumSchema
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/UntitledSingleSelectEnumSchema"
+/// },
+/// {
+/// "$ref": "#/$defs/TitledSingleSelectEnumSchema"
+/// },
+/// {
+/// "$ref": "#/$defs/UntitledMultiSelectEnumSchema"
+/// },
+/// {
+/// "$ref": "#/$defs/TitledMultiSelectEnumSchema"
+/// },
+/// {
+/// "$ref": "#/$defs/LegacyTitledEnumSchema"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum EnumSchema {
+ UntitledSingleSelectEnumSchema(UntitledSingleSelectEnumSchema),
+ TitledSingleSelectEnumSchema(TitledSingleSelectEnumSchema),
+ UntitledMultiSelectEnumSchema(UntitledMultiSelectEnumSchema),
+ TitledMultiSelectEnumSchema(TitledMultiSelectEnumSchema),
+ LegacyTitledEnumSchema(LegacyTitledEnumSchema),
+}
+impl ::std::convert::From for EnumSchema {
+ fn from(value: UntitledSingleSelectEnumSchema) -> Self {
+ Self::UntitledSingleSelectEnumSchema(value)
+ }
+}
+impl ::std::convert::From for EnumSchema {
+ fn from(value: TitledSingleSelectEnumSchema) -> Self {
+ Self::TitledSingleSelectEnumSchema(value)
+ }
+}
+impl ::std::convert::From for EnumSchema {
+ fn from(value: UntitledMultiSelectEnumSchema) -> Self {
+ Self::UntitledMultiSelectEnumSchema(value)
+ }
+}
+impl ::std::convert::From for EnumSchema {
+ fn from(value: TitledMultiSelectEnumSchema) -> Self {
+ Self::TitledMultiSelectEnumSchema(value)
+ }
+}
+impl ::std::convert::From for EnumSchema {
+ fn from(value: LegacyTitledEnumSchema) -> Self {
+ Self::LegacyTitledEnumSchema(value)
+ }
+}
+///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct GetPromptMeta {
+ ///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.
+ #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub progress_token: ::std::option::Option,
+ #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///Used by the client to get a prompt provided by the server.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Used by the client to get a prompt provided by the server.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method",
+/// "params"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "prompts/get"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/GetPromptRequestParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct GetPromptRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::get_prompt_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::get_prompt_request_method")]
+ method: ::std::string::String,
+ pub params: GetPromptRequestParams,
+}
+impl GetPromptRequest {
+ pub fn new(id: RequestId, params: GetPromptRequestParams) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "prompts/get".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "prompts/get"
+ pub fn method_value() -> ::std::string::String {
+ "prompts/get".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "prompts/get".to_string()
+ }
+}
+///Parameters for a prompts/get request.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Parameters for a prompts/get request.",
+/// "type": "object",
+/// "required": [
+/// "name"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+/// },
+/// "arguments": {
+/// "description": "Arguments to use for templating the prompt.",
+/// "type": "object",
+/// "additionalProperties": {
+/// "type": "string"
+/// }
+/// },
+/// "name": {
+/// "description": "The name of the prompt or prompt template.",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct GetPromptRequestParams {
+ ///Arguments to use for templating the prompt.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub arguments: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option,
+ ///The name of the prompt or prompt template.
+ pub name: ::std::string::String,
+}
+///The server's response to a prompts/get request from the client.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The server's response to a prompts/get request from the client.",
+/// "type": "object",
+/// "required": [
+/// "messages"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "description": {
+/// "description": "An optional description for the prompt.",
+/// "type": "string"
+/// },
+/// "messages": {
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/PromptMessage"
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct GetPromptResult {
+ ///An optional description for the prompt.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub description: ::std::option::Option<::std::string::String>,
+ pub messages: ::std::vec::Vec,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///GetTaskParams
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "type": "object",
+/// "required": [
+/// "taskId"
+/// ],
+/// "properties": {
+/// "taskId": {
+/// "description": "The task identifier to query.",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct GetTaskParams {
+ ///The task identifier to query.
+ #[serde(rename = "taskId")]
+ pub task_id: ::std::string::String,
+}
+///GetTaskPayloadParams
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "type": "object",
+/// "required": [
+/// "taskId"
+/// ],
+/// "properties": {
+/// "taskId": {
+/// "description": "The task identifier to retrieve results for.",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct GetTaskPayloadParams {
+ ///The task identifier to retrieve results for.
+ #[serde(rename = "taskId")]
+ pub task_id: ::std::string::String,
+}
+///A request to retrieve the result of a completed task.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A request to retrieve the result of a completed task.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method",
+/// "params"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "tasks/result"
+/// },
+/// "params": {
+/// "type": "object",
+/// "required": [
+/// "taskId"
+/// ],
+/// "properties": {
+/// "taskId": {
+/// "description": "The task identifier to retrieve results for.",
+/// "type": "string"
+/// }
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct GetTaskPayloadRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::get_task_payload_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::get_task_payload_request_method")]
+ method: ::std::string::String,
+ pub params: GetTaskPayloadParams,
+}
+impl GetTaskPayloadRequest {
+ pub fn new(id: RequestId, params: GetTaskPayloadParams) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "tasks/result".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "tasks/result"
+ pub fn method_value() -> ::std::string::String {
+ "tasks/result".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "tasks/result".to_string()
+ }
+}
+/**The response to a tasks/result request.
+The structure matches the result type of the original request.
+For example, a tools/call task would return the CallToolResult structure.*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The response to a tasks/result request.\nThe structure matches the result type of the original request.\nFor example, a tools/call task would return the CallToolResult structure.",
+/// "type": "object",
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// }
+/// },
+/// "additionalProperties": {}
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct GetTaskPayloadResult {
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///A request to retrieve the state of a task.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A request to retrieve the state of a task.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method",
+/// "params"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "tasks/get"
+/// },
+/// "params": {
+/// "type": "object",
+/// "required": [
+/// "taskId"
+/// ],
+/// "properties": {
+/// "taskId": {
+/// "description": "The task identifier to query.",
+/// "type": "string"
+/// }
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct GetTaskRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::get_task_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::get_task_request_method")]
+ method: ::std::string::String,
+ pub params: GetTaskParams,
+}
+impl GetTaskRequest {
+ pub fn new(id: RequestId, params: GetTaskParams) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "tasks/get".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "tasks/get"
+ pub fn method_value() -> ::std::string::String {
+ "tasks/get".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "tasks/get".to_string()
+ }
+}
+///The response to a tasks/get request.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The response to a tasks/get request.",
+/// "allOf": [
+/// {
+/// "$ref": "#/$defs/Result"
+/// },
+/// {
+/// "$ref": "#/$defs/Task"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct GetTaskResult {
+ #[serde(rename = "createdAt")]
+ pub created_at: ::std::string::String,
+ #[serde(rename = "lastUpdatedAt")]
+ pub last_updated_at: ::std::string::String,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ #[serde(rename = "pollInterval", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub poll_interval: ::std::option::Option,
+ pub status: TaskStatus,
+ #[serde(rename = "statusMessage", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub status_message: ::std::option::Option<::std::string::String>,
+ #[serde(rename = "taskId")]
+ pub task_id: ::std::string::String,
+ pub ttl: i64,
+ #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///An optionally-sized icon that can be displayed in a user interface.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "An optionally-sized icon that can be displayed in a user interface.",
+/// "type": "object",
+/// "required": [
+/// "src"
+/// ],
+/// "properties": {
+/// "mimeType": {
+/// "description": "Optional MIME type override if the source MIME type is missing or generic.\nFor example: \"image/png\", \"image/jpeg\", or \"image/svg+xml\".",
+/// "type": "string"
+/// },
+/// "sizes": {
+/// "description": "Optional array of strings that specify sizes at which the icon can be used.\nEach string should be in WxH format (e.g., \"48x48\", \"96x96\") or \"any\" for scalable formats like SVG.\n\nIf not provided, the client should assume that the icon can be used at any size.",
+/// "type": "array",
+/// "items": {
+/// "type": "string"
+/// }
+/// },
+/// "src": {
+/// "description": "A standard URI pointing to an icon resource. May be an HTTP/HTTPS URL or a\ndata: URI with Base64-encoded image data.\n\nConsumers SHOULD takes steps to ensure URLs serving icons are from the\nsame domain as the client/server or a trusted domain.\n\nConsumers SHOULD take appropriate precautions when consuming SVGs as they can contain\nexecutable JavaScript.",
+/// "type": "string",
+/// "format": "uri"
+/// },
+/// "theme": {
+/// "description": "Optional specifier for the theme this icon is designed for. light indicates\nthe icon is designed to be used with a light background, and dark indicates\nthe icon is designed to be used with a dark background.\n\nIf not provided, the client should assume the icon can be used with any theme.",
+/// "type": "string",
+/// "enum": [
+/// "dark",
+/// "light"
+/// ]
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct Icon {
+ /**Optional MIME type override if the source MIME type is missing or generic.
+ For example: "image/png", "image/jpeg", or "image/svg+xml".*/
+ #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub mime_type: ::std::option::Option<::std::string::String>,
+ /**Optional array of strings that specify sizes at which the icon can be used.
+ Each string should be in WxH format (e.g., "48x48", "96x96") or "any" for scalable formats like SVG.
+ If not provided, the client should assume that the icon can be used at any size.*/
+ #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
+ pub sizes: ::std::vec::Vec<::std::string::String>,
+ /**A standard URI pointing to an icon resource. May be an HTTP/HTTPS URL or a
+ data: URI with Base64-encoded image data.
+ Consumers SHOULD takes steps to ensure URLs serving icons are from the
+ same domain as the client/server or a trusted domain.
+ Consumers SHOULD take appropriate precautions when consuming SVGs as they can contain
+ executable JavaScript.*/
+ pub src: ::std::string::String,
+ /**Optional specifier for the theme this icon is designed for. light indicates
+ the icon is designed to be used with a light background, and dark indicates
+ the icon is designed to be used with a dark background.
+ If not provided, the client should assume the icon can be used with any theme.*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub theme: ::std::option::Option,
+}
+/**Optional specifier for the theme this icon is designed for. light indicates
+the icon is designed to be used with a light background, and dark indicates
+the icon is designed to be used with a dark background.
+If not provided, the client should assume the icon can be used with any theme.*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Optional specifier for the theme this icon is designed for. light indicates\nthe icon is designed to be used with a light background, and dark indicates\nthe icon is designed to be used with a dark background.\n\nIf not provided, the client should assume the icon can be used with any theme.",
+/// "type": "string",
+/// "enum": [
+/// "dark",
+/// "light"
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+pub enum IconTheme {
+ #[serde(rename = "dark")]
+ Dark,
+ #[serde(rename = "light")]
+ Light,
+}
+impl ::std::fmt::Display for IconTheme {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ match *self {
+ Self::Dark => write!(f, "dark"),
+ Self::Light => write!(f, "light"),
+ }
+ }
+}
+///Base interface to add icons property.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Base interface to add icons property.",
+/// "type": "object",
+/// "properties": {
+/// "icons": {
+/// "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/Icon"
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct Icons {
+ /**Optional set of sized icons that the client can display in a user interface.
+ Clients that support rendering icons MUST support at least the following MIME types:
+ - image/png - PNG images (safe, universal compatibility)
+ - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
+ Clients that support rendering icons SHOULD also support:
+ - image/svg+xml - SVG images (scalable but requires security precautions)
+ - image/webp - WebP images (modern, efficient format)*/
+ #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
+ pub icons: ::std::vec::Vec,
+}
+///An image provided to or from an LLM.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "An image provided to or from an LLM.",
+/// "type": "object",
+/// "required": [
+/// "data",
+/// "mimeType",
+/// "type"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "annotations": {
+/// "description": "Optional annotations for the client.",
+/// "$ref": "#/$defs/Annotations"
+/// },
+/// "data": {
+/// "description": "The base64-encoded image data.",
+/// "type": "string",
+/// "format": "byte"
+/// },
+/// "mimeType": {
+/// "description": "The MIME type of the image. Different providers may support different image types.",
+/// "type": "string"
+/// },
+/// "type": {
+/// "type": "string",
+/// "const": "image"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ImageContent {
+ ///Optional annotations for the client.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub annotations: ::std::option::Option,
+ ///The base64-encoded image data.
+ pub data: ::std::string::String,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ///The MIME type of the image. Different providers may support different image types.
+ #[serde(rename = "mimeType")]
+ pub mime_type: ::std::string::String,
+ #[serde(rename = "type", deserialize_with = "validate::image_content_type_")]
+ type_: ::std::string::String,
+}
+impl ImageContent {
+ pub fn new(
+ data: ::std::string::String,
+ mime_type: ::std::string::String,
+ annotations: ::std::option::Option,
+ meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ) -> Self {
+ Self {
+ annotations,
+ data,
+ meta,
+ mime_type,
+ type_: "image".to_string(),
+ }
+ }
+ pub fn type_(&self) -> &::std::string::String {
+ &self.type_
+ }
+ /// returns "image"
+ pub fn type_value() -> ::std::string::String {
+ "image".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
+ pub fn type_name() -> ::std::string::String {
+ "image".to_string()
+ }
+}
+///Describes the MCP implementation.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Describes the MCP implementation.",
+/// "type": "object",
+/// "required": [
+/// "name",
+/// "version"
+/// ],
+/// "properties": {
+/// "description": {
+/// "description": "An optional human-readable description of what this implementation does.\n\nThis can be used by clients or servers to provide context about their purpose\nand capabilities. For example, a server might describe the types of resources\nor tools it provides, while a client might describe its intended use case.",
+/// "type": "string"
+/// },
+/// "icons": {
+/// "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/Icon"
+/// }
+/// },
+/// "name": {
+/// "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
+/// "type": "string"
+/// },
+/// "title": {
+/// "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
+/// "type": "string"
+/// },
+/// "version": {
+/// "type": "string"
+/// },
+/// "websiteUrl": {
+/// "description": "An optional URL of the website for this implementation.",
+/// "type": "string",
+/// "format": "uri"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct Implementation {
+ /**An optional human-readable description of what this implementation does.
+ This can be used by clients or servers to provide context about their purpose
+ and capabilities. For example, a server might describe the types of resources
+ or tools it provides, while a client might describe its intended use case.*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub description: ::std::option::Option<::std::string::String>,
+ /**Optional set of sized icons that the client can display in a user interface.
+ Clients that support rendering icons MUST support at least the following MIME types:
+ - image/png - PNG images (safe, universal compatibility)
+ - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
+ Clients that support rendering icons SHOULD also support:
+ - image/svg+xml - SVG images (scalable but requires security precautions)
+ - image/webp - WebP images (modern, efficient format)*/
+ #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
+ pub icons: ::std::vec::Vec,
+ ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
+ pub name: ::std::string::String,
+ /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
+ even by those unfamiliar with domain-specific terminology.
+ If not provided, the name should be used for display (except for Tool,
+ where annotations.title should be given precedence over using name,
+ if present).*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub title: ::std::option::Option<::std::string::String>,
+ pub version: ::std::string::String,
+ ///An optional URL of the website for this implementation.
+ #[serde(rename = "websiteUrl", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub website_url: ::std::option::Option<::std::string::String>,
+}
+/**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.
+Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
+declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.\nThe client MAY ignore this request.\n\nDefault is \"none\". Values \"thisServer\" and \"allServers\" are soft-deprecated. Servers SHOULD only use these values if the client\ndeclares ClientCapabilities.sampling.context. These values may be removed in future spec releases.",
+/// "type": "string",
+/// "enum": [
+/// "allServers",
+/// "none",
+/// "thisServer"
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+pub enum IncludeContext {
+ #[serde(rename = "allServers")]
+ AllServers,
+ #[serde(rename = "none")]
+ None,
+ #[serde(rename = "thisServer")]
+ ThisServer,
+}
+impl ::std::fmt::Display for IncludeContext {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ match *self {
+ Self::AllServers => write!(f, "allServers"),
+ Self::None => write!(f, "none"),
+ Self::ThisServer => write!(f, "thisServer"),
+ }
+ }
+}
+///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct InitializeMeta {
+ ///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.
+ #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub progress_token: ::std::option::Option,
+ #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///This request is sent from the client to the server when it first connects, asking it to begin initialization.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "This request is sent from the client to the server when it first connects, asking it to begin initialization.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method",
+/// "params"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "initialize"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/InitializeRequestParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct InitializeRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::initialize_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::initialize_request_method")]
+ method: ::std::string::String,
+ pub params: InitializeRequestParams,
+}
+impl InitializeRequest {
+ pub fn new(id: RequestId, params: InitializeRequestParams) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "initialize".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "initialize"
+ pub fn method_value() -> ::std::string::String {
+ "initialize".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "initialize".to_string()
+ }
+}
+///Parameters for an initialize request.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Parameters for an initialize request.",
+/// "type": "object",
+/// "required": [
+/// "capabilities",
+/// "clientInfo",
+/// "protocolVersion"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+/// },
+/// "capabilities": {
+/// "$ref": "#/$defs/ClientCapabilities"
+/// },
+/// "clientInfo": {
+/// "$ref": "#/$defs/Implementation"
+/// },
+/// "protocolVersion": {
+/// "description": "The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct InitializeRequestParams {
+ pub capabilities: ClientCapabilities,
+ #[serde(rename = "clientInfo")]
+ pub client_info: Implementation,
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option,
+ ///The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
+ #[serde(rename = "protocolVersion")]
+ pub protocol_version: ::std::string::String,
+}
+///After receiving an initialize request from the client, the server sends this response.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "After receiving an initialize request from the client, the server sends this response.",
+/// "type": "object",
+/// "required": [
+/// "capabilities",
+/// "protocolVersion",
+/// "serverInfo"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "capabilities": {
+/// "$ref": "#/$defs/ServerCapabilities"
+/// },
+/// "instructions": {
+/// "description": "Instructions describing how to use the server and its features.\n\nThis can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a \"hint\" to the model. For example, this information MAY be added to the system prompt.",
+/// "type": "string"
+/// },
+/// "protocolVersion": {
+/// "description": "The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.",
+/// "type": "string"
+/// },
+/// "serverInfo": {
+/// "$ref": "#/$defs/Implementation"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct InitializeResult {
+ pub capabilities: ServerCapabilities,
+ /**Instructions describing how to use the server and its features.
+ This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub instructions: ::std::option::Option<::std::string::String>,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ///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.
+ #[serde(rename = "protocolVersion")]
+ pub protocol_version: ::std::string::String,
+ #[serde(rename = "serverInfo")]
+ pub server_info: Implementation,
+}
+///This notification is sent from the client to the server after initialization has finished.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "This notification is sent from the client to the server after initialization has finished.",
+/// "type": "object",
+/// "required": [
+/// "jsonrpc",
+/// "method"
+/// ],
+/// "properties": {
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "notifications/initialized"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/NotificationParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct InitializedNotification {
+ #[serde(deserialize_with = "validate::initialized_notification_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::initialized_notification_method")]
+ method: ::std::string::String,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub params: ::std::option::Option,
+}
+impl InitializedNotification {
+ pub fn new(params: ::std::option::Option) -> Self {
+ Self {
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "notifications/initialized".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "notifications/initialized"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/initialized".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "notifications/initialized".to_string()
+ }
+}
+///A response to a request that indicates an error occurred.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A response to a request that indicates an error occurred.",
+/// "type": "object",
+/// "required": [
+/// "error",
+/// "jsonrpc"
+/// ],
+/// "properties": {
+/// "error": {
+/// "$ref": "#/$defs/Error"
+/// },
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct JsonrpcErrorResponse {
+ pub error: RpcError,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub id: ::std::option::Option,
+ #[serde(deserialize_with = "validate::jsonrpc_error_response_jsonrpc")]
+ jsonrpc: ::std::string::String,
+}
+impl JsonrpcErrorResponse {
+ pub fn new(error: RpcError, id: ::std::option::Option) -> Self {
+ Self {
+ error,
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+}
+///Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.",
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/JSONRPCRequest"
+/// },
+/// {
+/// "$ref": "#/$defs/JSONRPCNotification"
+/// },
+/// {
+/// "$ref": "#/$defs/JSONRPCResultResponse"
+/// },
+/// {
+/// "$ref": "#/$defs/JSONRPCErrorResponse"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum JsonrpcMessage {
+ Request(JsonrpcRequest),
+ Notification(JsonrpcNotification),
+ ResultResponse(JsonrpcResultResponse),
+ ErrorResponse(JsonrpcErrorResponse),
+}
+impl ::std::convert::From for JsonrpcMessage {
+ fn from(value: JsonrpcRequest) -> Self {
+ Self::Request(value)
+ }
+}
+impl ::std::convert::From for JsonrpcMessage {
+ fn from(value: JsonrpcNotification) -> Self {
+ Self::Notification(value)
+ }
+}
+impl ::std::convert::From for JsonrpcMessage {
+ fn from(value: JsonrpcResultResponse) -> Self {
+ Self::ResultResponse(value)
+ }
+}
+impl ::std::convert::From for JsonrpcMessage {
+ fn from(value: JsonrpcErrorResponse) -> Self {
+ Self::ErrorResponse(value)
+ }
+}
+///A notification which does not expect a response.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A notification which does not expect a response.",
+/// "type": "object",
+/// "required": [
+/// "jsonrpc",
+/// "method"
+/// ],
+/// "properties": {
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string"
+/// },
+/// "params": {
+/// "type": "object",
+/// "additionalProperties": {}
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct JsonrpcNotification {
+ #[serde(deserialize_with = "validate::jsonrpc_notification_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ pub method: ::std::string::String,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub params: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+impl JsonrpcNotification {
+ pub fn new(
+ method: ::std::string::String,
+ params: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ) -> Self {
+ Self {
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method,
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+}
+///A request that expects a response.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A request that expects a response.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string"
+/// },
+/// "params": {
+/// "type": "object",
+/// "additionalProperties": {}
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct JsonrpcRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::jsonrpc_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ pub method: ::std::string::String,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub params: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+impl JsonrpcRequest {
+ pub fn new(
+ id: RequestId,
+ method: ::std::string::String,
+ params: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method,
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+}
+///A response to a request, containing either the result or error.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A response to a request, containing either the result or error.",
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/JSONRPCResultResponse"
+/// },
+/// {
+/// "$ref": "#/$defs/JSONRPCErrorResponse"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum JsonrpcResponse {
+ ResultResponse(JsonrpcResultResponse),
+ ErrorResponse(JsonrpcErrorResponse),
+}
+impl ::std::convert::From for JsonrpcResponse {
+ fn from(value: JsonrpcResultResponse) -> Self {
+ Self::ResultResponse(value)
+ }
+}
+impl ::std::convert::From for JsonrpcResponse {
+ fn from(value: JsonrpcErrorResponse) -> Self {
+ Self::ErrorResponse(value)
+ }
+}
+///A successful (non-error) response to a request.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A successful (non-error) response to a request.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "result"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "result": {
+/// "$ref": "#/$defs/Result"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct JsonrpcResultResponse {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::jsonrpc_result_response_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ pub result: Result,
+}
+impl JsonrpcResultResponse {
+ pub fn new(id: RequestId, result: Result) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ result,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+}
+/**Use TitledSingleSelectEnumSchema instead.
+This interface will be removed in a future version.*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Use TitledSingleSelectEnumSchema instead.\nThis interface will be removed in a future version.",
+/// "type": "object",
+/// "required": [
+/// "enum",
+/// "type"
+/// ],
+/// "properties": {
+/// "default": {
+/// "type": "string"
+/// },
+/// "description": {
+/// "type": "string"
+/// },
+/// "enum": {
+/// "type": "array",
+/// "items": {
+/// "type": "string"
+/// }
+/// },
+/// "enumNames": {
+/// "description": "(Legacy) Display names for enum values.\nNon-standard according to JSON schema 2020-12.",
+/// "type": "array",
+/// "items": {
+/// "type": "string"
+/// }
+/// },
+/// "title": {
+/// "type": "string"
+/// },
+/// "type": {
+/// "type": "string",
+/// "const": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct LegacyTitledEnumSchema {
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub default: ::std::option::Option<::std::string::String>,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub description: ::std::option::Option<::std::string::String>,
+ #[serde(rename = "enum")]
+ pub enum_: ::std::vec::Vec<::std::string::String>,
+ /**(Legacy) Display names for enum values.
+ Non-standard according to JSON schema 2020-12.*/
+ #[serde(rename = "enumNames", default, skip_serializing_if = "::std::vec::Vec::is_empty")]
+ pub enum_names: ::std::vec::Vec<::std::string::String>,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub title: ::std::option::Option<::std::string::String>,
+ #[serde(rename = "type", deserialize_with = "validate::legacy_titled_enum_schema_type_")]
+ type_: ::std::string::String,
+}
+impl LegacyTitledEnumSchema {
+ pub fn new(
+ enum_: ::std::vec::Vec<::std::string::String>,
+ enum_names: ::std::vec::Vec<::std::string::String>,
+ default: ::std::option::Option<::std::string::String>,
+ description: ::std::option::Option<::std::string::String>,
+ title: ::std::option::Option<::std::string::String>,
+ ) -> Self {
+ Self {
+ default,
+ description,
+ enum_,
+ enum_names,
+ title,
+ type_: "string".to_string(),
+ }
+ }
+ pub fn type_(&self) -> &::std::string::String {
+ &self.type_
+ }
+ /// returns "string"
+ pub fn type_value() -> ::std::string::String {
+ "string".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
+ pub fn type_name() -> ::std::string::String {
+ "string".to_string()
+ }
+}
+///Sent from the client to request a list of prompts and prompt templates the server has.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Sent from the client to request a list of prompts and prompt templates the server has.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "prompts/list"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/PaginatedRequestParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ListPromptsRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::list_prompts_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::list_prompts_request_method")]
+ method: ::std::string::String,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub params: ::std::option::Option,
+}
+impl ListPromptsRequest {
+ pub fn new(id: RequestId, params: ::std::option::Option) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "prompts/list".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "prompts/list"
+ pub fn method_value() -> ::std::string::String {
+ "prompts/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "prompts/list".to_string()
+ }
+}
+///The server's response to a prompts/list request from the client.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The server's response to a prompts/list request from the client.",
+/// "type": "object",
+/// "required": [
+/// "prompts"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "nextCursor": {
+/// "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
+/// "type": "string"
+/// },
+/// "prompts": {
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/Prompt"
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ListPromptsResult {
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ /**An opaque token representing the pagination position after the last returned result.
+ If present, there may be more results available.*/
+ #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub next_cursor: ::std::option::Option<::std::string::String>,
+ pub prompts: ::std::vec::Vec,
+}
+///Sent from the client to request a list of resource templates the server has.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Sent from the client to request a list of resource templates the server has.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "resources/templates/list"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/PaginatedRequestParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ListResourceTemplatesRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::list_resource_templates_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::list_resource_templates_request_method")]
+ method: ::std::string::String,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub params: ::std::option::Option,
+}
+impl ListResourceTemplatesRequest {
+ pub fn new(id: RequestId, params: ::std::option::Option) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "resources/templates/list".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "resources/templates/list"
+ pub fn method_value() -> ::std::string::String {
+ "resources/templates/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "resources/templates/list".to_string()
+ }
+}
+///The server's response to a resources/templates/list request from the client.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The server's response to a resources/templates/list request from the client.",
+/// "type": "object",
+/// "required": [
+/// "resourceTemplates"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "nextCursor": {
+/// "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
+/// "type": "string"
+/// },
+/// "resourceTemplates": {
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/ResourceTemplate"
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ListResourceTemplatesResult {
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ /**An opaque token representing the pagination position after the last returned result.
+ If present, there may be more results available.*/
+ #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub next_cursor: ::std::option::Option<::std::string::String>,
+ #[serde(rename = "resourceTemplates")]
+ pub resource_templates: ::std::vec::Vec,
+}
+///Sent from the client to request a list of resources the server has.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Sent from the client to request a list of resources the server has.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "resources/list"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/PaginatedRequestParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ListResourcesRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::list_resources_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::list_resources_request_method")]
+ method: ::std::string::String,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub params: ::std::option::Option,
+}
+impl ListResourcesRequest {
+ pub fn new(id: RequestId, params: ::std::option::Option) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "resources/list".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "resources/list"
+ pub fn method_value() -> ::std::string::String {
+ "resources/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "resources/list".to_string()
+ }
+}
+///The server's response to a resources/list request from the client.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The server's response to a resources/list request from the client.",
+/// "type": "object",
+/// "required": [
+/// "resources"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "nextCursor": {
+/// "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
+/// "type": "string"
+/// },
+/// "resources": {
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/Resource"
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ListResourcesResult {
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ /**An opaque token representing the pagination position after the last returned result.
+ If present, there may be more results available.*/
+ #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub next_cursor: ::std::option::Option<::std::string::String>,
+ pub resources: ::std::vec::Vec,
+}
+/**Sent from the server to request a list of root URIs from the client. Roots allow
+servers to ask for specific directories or files to operate on. A common example
+for roots is providing a set of repositories or directories a server should operate
+on.
+This request is typically used when the server needs to understand the file system
+structure or access specific locations that the client has permission to read from.*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Sent from the server to request a list of root URIs from the client. Roots allow\nservers to ask for specific directories or files to operate on. A common example\nfor roots is providing a set of repositories or directories a server should operate\non.\n\nThis request is typically used when the server needs to understand the file system\nstructure or access specific locations that the client has permission to read from.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "roots/list"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/RequestParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ListRootsRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::list_roots_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::list_roots_request_method")]
+ method: ::std::string::String,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub params: ::std::option::Option,
+}
+impl ListRootsRequest {
+ pub fn new(id: RequestId, params: ::std::option::Option) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "roots/list".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "roots/list"
+ pub fn method_value() -> ::std::string::String {
+ "roots/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "roots/list".to_string()
+ }
+}
+/**The client's response to a roots/list request from the server.
+This result contains an array of Root objects, each representing a root directory
+or file that the server can operate on.*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The client's response to a roots/list request from the server.\nThis result contains an array of Root objects, each representing a root directory\nor file that the server can operate on.",
+/// "type": "object",
+/// "required": [
+/// "roots"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "roots": {
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/Root"
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ListRootsResult {
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ pub roots: ::std::vec::Vec,
+}
+///A request to retrieve a list of tasks.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A request to retrieve a list of tasks.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "tasks/list"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/PaginatedRequestParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ListTasksRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::list_tasks_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::list_tasks_request_method")]
+ method: ::std::string::String,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub params: ::std::option::Option,
+}
+impl ListTasksRequest {
+ pub fn new(id: RequestId, params: ::std::option::Option) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "tasks/list".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "tasks/list"
+ pub fn method_value() -> ::std::string::String {
+ "tasks/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "tasks/list".to_string()
+ }
+}
+///The response to a tasks/list request.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The response to a tasks/list request.",
+/// "type": "object",
+/// "required": [
+/// "tasks"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "nextCursor": {
+/// "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
+/// "type": "string"
+/// },
+/// "tasks": {
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/Task"
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ListTasksResult {
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ /**An opaque token representing the pagination position after the last returned result.
+ If present, there may be more results available.*/
+ #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub next_cursor: ::std::option::Option<::std::string::String>,
+ pub tasks: ::std::vec::Vec,
+}
+///Sent from the client to request a list of tools the server has.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Sent from the client to request a list of tools the server has.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "tools/list"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/PaginatedRequestParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ListToolsRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::list_tools_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::list_tools_request_method")]
+ method: ::std::string::String,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub params: ::std::option::Option,
+}
+impl ListToolsRequest {
+ pub fn new(id: RequestId, params: ::std::option::Option) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "tools/list".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "tools/list"
+ pub fn method_value() -> ::std::string::String {
+ "tools/list".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "tools/list".to_string()
+ }
+}
+///The server's response to a tools/list request from the client.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The server's response to a tools/list request from the client.",
+/// "type": "object",
+/// "required": [
+/// "tools"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "nextCursor": {
+/// "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
+/// "type": "string"
+/// },
+/// "tools": {
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/Tool"
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ListToolsResult {
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ /**An opaque token representing the pagination position after the last returned result.
+ If present, there may be more results available.*/
+ #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub next_cursor: ::std::option::Option<::std::string::String>,
+ pub tools: ::std::vec::Vec,
+}
+/**The severity of a log message.
+These map to syslog message severities, as specified in RFC-5424:
+*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The severity of a log message.\n\nThese map to syslog message severities, as specified in RFC-5424:\n",
+/// "type": "string",
+/// "enum": [
+/// "alert",
+/// "critical",
+/// "debug",
+/// "emergency",
+/// "error",
+/// "info",
+/// "notice",
+/// "warning"
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+pub enum LoggingLevel {
+ #[serde(rename = "alert")]
+ Alert,
+ #[serde(rename = "critical")]
+ Critical,
+ #[serde(rename = "debug")]
+ Debug,
+ #[serde(rename = "emergency")]
+ Emergency,
+ #[serde(rename = "error")]
+ Error,
+ #[serde(rename = "info")]
+ Info,
+ #[serde(rename = "notice")]
+ Notice,
+ #[serde(rename = "warning")]
+ Warning,
+}
+impl ::std::fmt::Display for LoggingLevel {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ match *self {
+ Self::Alert => write!(f, "alert"),
+ Self::Critical => write!(f, "critical"),
+ Self::Debug => write!(f, "debug"),
+ Self::Emergency => write!(f, "emergency"),
+ Self::Error => write!(f, "error"),
+ Self::Info => write!(f, "info"),
+ Self::Notice => write!(f, "notice"),
+ Self::Warning => write!(f, "warning"),
+ }
+ }
+}
+///JSONRPCNotification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "JSONRPCNotification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.",
+/// "type": "object",
+/// "required": [
+/// "jsonrpc",
+/// "method",
+/// "params"
+/// ],
+/// "properties": {
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "notifications/message"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/LoggingMessageNotificationParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct LoggingMessageNotification {
+ #[serde(deserialize_with = "validate::logging_message_notification_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::logging_message_notification_method")]
+ method: ::std::string::String,
+ pub params: LoggingMessageNotificationParams,
+}
+impl LoggingMessageNotification {
+ pub fn new(params: LoggingMessageNotificationParams) -> Self {
+ Self {
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "notifications/message".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "notifications/message"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/message".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "notifications/message".to_string()
+ }
+}
+///Parameters for a notifications/message notification.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Parameters for a notifications/message notification.",
+/// "type": "object",
+/// "required": [
+/// "data",
+/// "level"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "data": {
+/// "description": "The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here."
+/// },
+/// "level": {
+/// "description": "The severity of this log message.",
+/// "$ref": "#/$defs/LoggingLevel"
+/// },
+/// "logger": {
+/// "description": "An optional name of the logger issuing this message.",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct LoggingMessageNotificationParams {
+ ///The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
+ pub data: ::serde_json::Value,
+ ///The severity of this log message.
+ pub level: LoggingLevel,
+ ///An optional name of the logger issuing this message.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub logger: ::std::option::Option<::std::string::String>,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct MessageMeta {
+ ///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.
+ #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub progress_token: ::std::option::Option,
+ #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+/**Hints to use for model selection.
+Keys not declared here are currently left unspecified by the spec and are up
+to the client to interpret.*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Hints to use for model selection.\n\nKeys not declared here are currently left unspecified by the spec and are up\nto the client to interpret.",
+/// "type": "object",
+/// "properties": {
+/// "name": {
+/// "description": "A hint for a model name.\n\nThe client SHOULD treat this as a substring of a model name; for example:\n - claude-3-5-sonnet should match claude-3-5-sonnet-20241022\n - sonnet should match claude-3-5-sonnet-20241022, claude-3-sonnet-20240229, etc.\n - claude should match any Claude model\n\nThe client MAY also map the string to a different provider's model name or a different model family, as long as it fills a similar niche; for example:\n - gemini-1.5-flash could match claude-3-haiku-20240307",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ModelHint {
+ /**A hint for a model name.
+ The client SHOULD treat this as a substring of a model name; for example:
+ - claude-3-5-sonnet should match claude-3-5-sonnet-20241022
+ - sonnet should match claude-3-5-sonnet-20241022, claude-3-sonnet-20240229, etc.
+ - claude should match any Claude model
+ The client MAY also map the string to a different provider's model name or a different model family, as long as it fills a similar niche; for example:
+ - gemini-1.5-flash could match claude-3-haiku-20240307*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub name: ::std::option::Option<::std::string::String>,
+}
+/**The server's preferences for model selection, requested of the client during sampling.
+Because LLMs can vary along multiple dimensions, choosing the "best" model is
+rarely straightforward. Different models excel in different areas—some are
+faster but less capable, others are more capable but more expensive, and so
+on. This interface allows servers to express their priorities across multiple
+dimensions to help clients make an appropriate selection for their use case.
+These preferences are always advisory. The client MAY ignore them. It is also
+up to the client to decide how to interpret these preferences and how to
+balance them against other considerations.*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The server's preferences for model selection, requested of the client during sampling.\n\nBecause LLMs can vary along multiple dimensions, choosing the \"best\" model is\nrarely straightforward. Different models excel in different areas—some are\nfaster but less capable, others are more capable but more expensive, and so\non. This interface allows servers to express their priorities across multiple\ndimensions to help clients make an appropriate selection for their use case.\n\nThese preferences are always advisory. The client MAY ignore them. It is also\nup to the client to decide how to interpret these preferences and how to\nbalance them against other considerations.",
+/// "type": "object",
+/// "properties": {
+/// "costPriority": {
+/// "description": "How much to prioritize cost when selecting a model. A value of 0 means cost\nis not important, while a value of 1 means cost is the most important\nfactor.",
+/// "type": "number",
+/// "maximum": 1.0,
+/// "minimum": 0.0
+/// },
+/// "hints": {
+/// "description": "Optional hints to use for model selection.\n\nIf multiple hints are specified, the client MUST evaluate them in order\n(such that the first match is taken).\n\nThe client SHOULD prioritize these hints over the numeric priorities, but\nMAY still use the priorities to select from ambiguous matches.",
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/ModelHint"
+/// }
+/// },
+/// "intelligencePriority": {
+/// "description": "How much to prioritize intelligence and capabilities when selecting a\nmodel. A value of 0 means intelligence is not important, while a value of 1\nmeans intelligence is the most important factor.",
+/// "type": "number",
+/// "maximum": 1.0,
+/// "minimum": 0.0
+/// },
+/// "speedPriority": {
+/// "description": "How much to prioritize sampling speed (latency) when selecting a model. A\nvalue of 0 means speed is not important, while a value of 1 means speed is\nthe most important factor.",
+/// "type": "number",
+/// "maximum": 1.0,
+/// "minimum": 0.0
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ModelPreferences {
+ #[serde(rename = "costPriority", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub cost_priority: ::std::option::Option,
+ /**Optional hints to use for model selection.
+ If multiple hints are specified, the client MUST evaluate them in order
+ (such that the first match is taken).
+ The client SHOULD prioritize these hints over the numeric priorities, but
+ MAY still use the priorities to select from ambiguous matches.*/
+ #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
+ pub hints: ::std::vec::Vec,
+ #[serde(
+ rename = "intelligencePriority",
+ default,
+ skip_serializing_if = "::std::option::Option::is_none"
+ )]
+ pub intelligence_priority: ::std::option::Option,
+ #[serde(rename = "speedPriority", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub speed_priority: ::std::option::Option,
+}
+///MultiSelectEnumSchema
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/UntitledMultiSelectEnumSchema"
+/// },
+/// {
+/// "$ref": "#/$defs/TitledMultiSelectEnumSchema"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum MultiSelectEnumSchema {
+ UntitledMultiSelectEnumSchema(UntitledMultiSelectEnumSchema),
+ TitledMultiSelectEnumSchema(TitledMultiSelectEnumSchema),
+}
+impl ::std::convert::From for MultiSelectEnumSchema {
+ fn from(value: UntitledMultiSelectEnumSchema) -> Self {
+ Self::UntitledMultiSelectEnumSchema(value)
+ }
+}
+impl ::std::convert::From for MultiSelectEnumSchema {
+ fn from(value: TitledMultiSelectEnumSchema) -> Self {
+ Self::TitledMultiSelectEnumSchema(value)
+ }
+}
+///Notification
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "type": "object",
+/// "required": [
+/// "method"
+/// ],
+/// "properties": {
+/// "method": {
+/// "type": "string"
+/// },
+/// "params": {
+/// "type": "object",
+/// "additionalProperties": {}
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct Notification {
+ pub method: ::std::string::String,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub params: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///NotificationParams
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "type": "object",
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct NotificationParams {
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///NumberSchema
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "type": "object",
+/// "required": [
+/// "type"
+/// ],
+/// "properties": {
+/// "default": {
+/// "type": "integer"
+/// },
+/// "description": {
+/// "type": "string"
+/// },
+/// "maximum": {
+/// "type": "integer"
+/// },
+/// "minimum": {
+/// "type": "integer"
+/// },
+/// "title": {
+/// "type": "string"
+/// },
+/// "type": {
+/// "type": "string",
+/// "enum": [
+/// "integer",
+/// "number"
+/// ]
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct NumberSchema {
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub default: ::std::option::Option,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub description: ::std::option::Option<::std::string::String>,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub maximum: ::std::option::Option,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub minimum: ::std::option::Option,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub title: ::std::option::Option<::std::string::String>,
+ #[serde(rename = "type")]
+ pub type_: NumberSchemaType,
+}
+///NumberSchemaType
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "type": "string",
+/// "enum": [
+/// "integer",
+/// "number"
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+pub enum NumberSchemaType {
+ #[serde(rename = "integer")]
+ Integer,
+ #[serde(rename = "number")]
+ Number,
+}
+impl ::std::fmt::Display for NumberSchemaType {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ match *self {
+ Self::Integer => write!(f, "integer"),
+ Self::Number => write!(f, "number"),
+ }
+ }
+}
+///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct PaginatedMeta {
+ ///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.
+ #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub progress_token: ::std::option::Option,
+ #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///PaginatedRequest
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/PaginatedRequestParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct PaginatedRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::paginated_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ pub method: ::std::string::String,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub params: ::std::option::Option,
+}
+impl PaginatedRequest {
+ pub fn new(id: RequestId, method: ::std::string::String, params: ::std::option::Option) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method,
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+}
+///Common parameters for paginated requests.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Common parameters for paginated requests.",
+/// "type": "object",
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+/// },
+/// "cursor": {
+/// "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct PaginatedRequestParams {
+ /**An opaque token representing the current pagination position.
+ If provided, the server should return results starting after this cursor.*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub cursor: ::std::option::Option<::std::string::String>,
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option,
+}
+///PaginatedResult
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "type": "object",
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "nextCursor": {
+/// "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct PaginatedResult {
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ /**An opaque token representing the pagination position after the last returned result.
+ If present, there may be more results available.*/
+ #[serde(rename = "nextCursor", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub next_cursor: ::std::option::Option<::std::string::String>,
+}
+///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.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "ping"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/RequestParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct PingRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::ping_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::ping_request_method")]
+ method: ::std::string::String,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub params: ::std::option::Option,
+}
+impl PingRequest {
+ pub fn new(id: RequestId, params: ::std::option::Option) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "ping".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "ping"
+ pub fn method_value() -> ::std::string::String {
+ "ping".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "ping".to_string()
+ }
+}
+/**Restricted schema definitions that only allow primitive types
+without nested objects or arrays.*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Restricted schema definitions that only allow primitive types\nwithout nested objects or arrays.",
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/StringSchema"
+/// },
+/// {
+/// "$ref": "#/$defs/NumberSchema"
+/// },
+/// {
+/// "$ref": "#/$defs/BooleanSchema"
+/// },
+/// {
+/// "$ref": "#/$defs/UntitledSingleSelectEnumSchema"
+/// },
+/// {
+/// "$ref": "#/$defs/TitledSingleSelectEnumSchema"
+/// },
+/// {
+/// "$ref": "#/$defs/UntitledMultiSelectEnumSchema"
+/// },
+/// {
+/// "$ref": "#/$defs/TitledMultiSelectEnumSchema"
+/// },
+/// {
+/// "$ref": "#/$defs/LegacyTitledEnumSchema"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum PrimitiveSchemaDefinition {
+ StringSchema(StringSchema),
+ NumberSchema(NumberSchema),
+ BooleanSchema(BooleanSchema),
+ UntitledSingleSelectEnumSchema(UntitledSingleSelectEnumSchema),
+ TitledSingleSelectEnumSchema(TitledSingleSelectEnumSchema),
+ UntitledMultiSelectEnumSchema(UntitledMultiSelectEnumSchema),
+ TitledMultiSelectEnumSchema(TitledMultiSelectEnumSchema),
+ LegacyTitledEnumSchema(LegacyTitledEnumSchema),
+}
+impl ::std::convert::From for PrimitiveSchemaDefinition {
+ fn from(value: StringSchema) -> Self {
+ Self::StringSchema(value)
+ }
+}
+impl ::std::convert::From for PrimitiveSchemaDefinition {
+ fn from(value: NumberSchema) -> Self {
+ Self::NumberSchema(value)
+ }
+}
+impl ::std::convert::From for PrimitiveSchemaDefinition {
+ fn from(value: BooleanSchema) -> Self {
+ Self::BooleanSchema(value)
+ }
+}
+impl ::std::convert::From for PrimitiveSchemaDefinition {
+ fn from(value: UntitledSingleSelectEnumSchema) -> Self {
+ Self::UntitledSingleSelectEnumSchema(value)
+ }
+}
+impl ::std::convert::From for PrimitiveSchemaDefinition {
+ fn from(value: TitledSingleSelectEnumSchema) -> Self {
+ Self::TitledSingleSelectEnumSchema(value)
+ }
+}
+impl ::std::convert::From for PrimitiveSchemaDefinition {
+ fn from(value: UntitledMultiSelectEnumSchema) -> Self {
+ Self::UntitledMultiSelectEnumSchema(value)
+ }
+}
+impl ::std::convert::From for PrimitiveSchemaDefinition {
+ fn from(value: TitledMultiSelectEnumSchema) -> Self {
+ Self::TitledMultiSelectEnumSchema(value)
+ }
+}
+impl ::std::convert::From for PrimitiveSchemaDefinition {
+ fn from(value: LegacyTitledEnumSchema) -> Self {
+ Self::LegacyTitledEnumSchema(value)
+ }
+}
+///An out-of-band notification used to inform the receiver of a progress update for a long-running request.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "An out-of-band notification used to inform the receiver of a progress update for a long-running request.",
+/// "type": "object",
+/// "required": [
+/// "jsonrpc",
+/// "method",
+/// "params"
+/// ],
+/// "properties": {
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "notifications/progress"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/ProgressNotificationParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ProgressNotification {
+ #[serde(deserialize_with = "validate::progress_notification_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::progress_notification_method")]
+ method: ::std::string::String,
+ pub params: ProgressNotificationParams,
+}
+impl ProgressNotification {
+ pub fn new(params: ProgressNotificationParams) -> Self {
+ Self {
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "notifications/progress".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "notifications/progress"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/progress".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "notifications/progress".to_string()
+ }
+}
+///Parameters for a notifications/progress notification.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Parameters for a notifications/progress notification.",
+/// "type": "object",
+/// "required": [
+/// "progress",
+/// "progressToken"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "message": {
+/// "description": "An optional message describing the current progress.",
+/// "type": "string"
+/// },
+/// "progress": {
+/// "description": "The progress thus far. This should increase every time progress is made, even if the total is unknown.",
+/// "type": "number"
+/// },
+/// "progressToken": {
+/// "description": "The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.",
+/// "$ref": "#/$defs/ProgressToken"
+/// },
+/// "total": {
+/// "description": "Total number of items to process (or total progress required), if known.",
+/// "type": "number"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ProgressNotificationParams {
+ ///An optional message describing the current progress.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub message: ::std::option::Option<::std::string::String>,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ pub progress: f64,
+ ///The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
+ #[serde(rename = "progressToken")]
+ pub progress_token: ProgressToken,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub total: ::std::option::Option,
+}
+///A progress token, used to associate progress notifications with the original request.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A progress token, used to associate progress notifications with the original request.",
+/// "type": [
+/// "string",
+/// "integer"
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum ProgressToken {
+ String(::std::string::String),
+ Integer(i64),
+}
+impl ::std::convert::From for ProgressToken {
+ fn from(value: i64) -> Self {
+ Self::Integer(value)
+ }
+}
+///A prompt or prompt template that the server offers.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A prompt or prompt template that the server offers.",
+/// "type": "object",
+/// "required": [
+/// "name"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "arguments": {
+/// "description": "A list of arguments to use for templating the prompt.",
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/PromptArgument"
+/// }
+/// },
+/// "description": {
+/// "description": "An optional description of what this prompt provides",
+/// "type": "string"
+/// },
+/// "icons": {
+/// "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/Icon"
+/// }
+/// },
+/// "name": {
+/// "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
+/// "type": "string"
+/// },
+/// "title": {
+/// "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct Prompt {
+ ///A list of arguments to use for templating the prompt.
+ #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
+ pub arguments: ::std::vec::Vec,
+ ///An optional description of what this prompt provides
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub description: ::std::option::Option<::std::string::String>,
+ /**Optional set of sized icons that the client can display in a user interface.
+ Clients that support rendering icons MUST support at least the following MIME types:
+ - image/png - PNG images (safe, universal compatibility)
+ - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
+ Clients that support rendering icons SHOULD also support:
+ - image/svg+xml - SVG images (scalable but requires security precautions)
+ - image/webp - WebP images (modern, efficient format)*/
+ #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
+ pub icons: ::std::vec::Vec,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
+ pub name: ::std::string::String,
+ /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
+ even by those unfamiliar with domain-specific terminology.
+ If not provided, the name should be used for display (except for Tool,
+ where annotations.title should be given precedence over using name,
+ if present).*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub title: ::std::option::Option<::std::string::String>,
+}
+///Describes an argument that a prompt can accept.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Describes an argument that a prompt can accept.",
+/// "type": "object",
+/// "required": [
+/// "name"
+/// ],
+/// "properties": {
+/// "description": {
+/// "description": "A human-readable description of the argument.",
+/// "type": "string"
+/// },
+/// "name": {
+/// "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
+/// "type": "string"
+/// },
+/// "required": {
+/// "description": "Whether this argument must be provided.",
+/// "type": "boolean"
+/// },
+/// "title": {
+/// "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct PromptArgument {
+ ///A human-readable description of the argument.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub description: ::std::option::Option<::std::string::String>,
+ ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
+ pub name: ::std::string::String,
+ ///Whether this argument must be provided.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub required: ::std::option::Option,
+ /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
+ even by those unfamiliar with domain-specific terminology.
+ If not provided, the name should be used for display (except for Tool,
+ where annotations.title should be given precedence over using name,
+ if present).*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub title: ::std::option::Option<::std::string::String>,
+}
+///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.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.",
+/// "type": "object",
+/// "required": [
+/// "jsonrpc",
+/// "method"
+/// ],
+/// "properties": {
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "notifications/prompts/list_changed"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/NotificationParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct PromptListChangedNotification {
+ #[serde(deserialize_with = "validate::prompt_list_changed_notification_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::prompt_list_changed_notification_method")]
+ method: ::std::string::String,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub params: ::std::option::Option,
+}
+impl PromptListChangedNotification {
+ pub fn new(params: ::std::option::Option) -> Self {
+ Self {
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "notifications/prompts/list_changed".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "notifications/prompts/list_changed"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/prompts/list_changed".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "notifications/prompts/list_changed".to_string()
+ }
+}
+/**Describes a message returned as part of a prompt.
+This is similar to SamplingMessage, but also supports the embedding of
+resources from the MCP server.*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Describes a message returned as part of a prompt.\n\nThis is similar to SamplingMessage, but also supports the embedding of\nresources from the MCP server.",
+/// "type": "object",
+/// "required": [
+/// "content",
+/// "role"
+/// ],
+/// "properties": {
+/// "content": {
+/// "$ref": "#/$defs/ContentBlock"
+/// },
+/// "role": {
+/// "$ref": "#/$defs/Role"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct PromptMessage {
+ pub content: ContentBlock,
+ pub role: Role,
+}
+///Identifies a prompt.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Identifies a prompt.",
+/// "type": "object",
+/// "required": [
+/// "name",
+/// "type"
+/// ],
+/// "properties": {
+/// "name": {
+/// "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
+/// "type": "string"
+/// },
+/// "title": {
+/// "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
+/// "type": "string"
+/// },
+/// "type": {
+/// "type": "string",
+/// "const": "ref/prompt"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct PromptReference {
+ ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
+ pub name: ::std::string::String,
+ /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
+ even by those unfamiliar with domain-specific terminology.
+ If not provided, the name should be used for display (except for Tool,
+ where annotations.title should be given precedence over using name,
+ if present).*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub title: ::std::option::Option<::std::string::String>,
+ #[serde(rename = "type", deserialize_with = "validate::prompt_reference_type_")]
+ type_: ::std::string::String,
+}
+impl PromptReference {
+ pub fn new(name: ::std::string::String, title: ::std::option::Option<::std::string::String>) -> Self {
+ Self {
+ name,
+ title,
+ type_: "ref/prompt".to_string(),
+ }
+ }
+ pub fn type_(&self) -> &::std::string::String {
+ &self.type_
+ }
+ /// returns "ref/prompt"
+ pub fn type_value() -> ::std::string::String {
+ "ref/prompt".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
+ pub fn type_name() -> ::std::string::String {
+ "ref/prompt".to_string()
+ }
+}
+///ReadResourceContent
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/TextResourceContents"
+/// },
+/// {
+/// "$ref": "#/$defs/BlobResourceContents"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum ReadResourceContent {
+ TextResourceContents(TextResourceContents),
+ BlobResourceContents(BlobResourceContents),
+}
+impl ::std::convert::From for ReadResourceContent {
+ fn from(value: TextResourceContents) -> Self {
+ Self::TextResourceContents(value)
+ }
+}
+impl ::std::convert::From for ReadResourceContent {
+ fn from(value: BlobResourceContents) -> Self {
+ Self::BlobResourceContents(value)
+ }
+}
+///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ReadResourceMeta {
+ ///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.
+ #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub progress_token: ::std::option::Option,
+ #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///Sent from the client to the server, to read a specific resource URI.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Sent from the client to the server, to read a specific resource URI.",
+/// "type": "object",
+/// "required": [
+/// "id",
+/// "jsonrpc",
+/// "method",
+/// "params"
+/// ],
+/// "properties": {
+/// "id": {
+/// "$ref": "#/$defs/RequestId"
+/// },
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "resources/read"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/ReadResourceRequestParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ReadResourceRequest {
+ pub id: RequestId,
+ #[serde(deserialize_with = "validate::read_resource_request_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::read_resource_request_method")]
+ method: ::std::string::String,
+ pub params: ReadResourceRequestParams,
+}
+impl ReadResourceRequest {
+ pub fn new(id: RequestId, params: ReadResourceRequestParams) -> Self {
+ Self {
+ id,
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "resources/read".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "resources/read"
+ pub fn method_value() -> ::std::string::String {
+ "resources/read".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "resources/read".to_string()
+ }
+}
+///Parameters for a resources/read request.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Parameters for a resources/read request.",
+/// "type": "object",
+/// "required": [
+/// "uri"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+/// },
+/// "uri": {
+/// "description": "The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.",
+/// "type": "string",
+/// "format": "uri"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ReadResourceRequestParams {
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option,
+ ///The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.
+ pub uri: ::std::string::String,
+}
+///The server's response to a resources/read request from the client.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The server's response to a resources/read request from the client.",
+/// "type": "object",
+/// "required": [
+/// "contents"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "contents": {
+/// "type": "array",
+/// "items": {
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/TextResourceContents"
+/// },
+/// {
+/// "$ref": "#/$defs/BlobResourceContents"
+/// }
+/// ]
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ReadResourceResult {
+ pub contents: ::std::vec::Vec,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+/**Metadata for associating messages with a task.
+Include this in the _meta field under the key io.modelcontextprotocol/related-task.*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Metadata for associating messages with a task.\nInclude this in the _meta field under the key io.modelcontextprotocol/related-task.",
+/// "type": "object",
+/// "required": [
+/// "taskId"
+/// ],
+/// "properties": {
+/// "taskId": {
+/// "description": "The task identifier this message is associated with.",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct RelatedTaskMetadata {
+ ///The task identifier this message is associated with.
+ #[serde(rename = "taskId")]
+ pub task_id: ::std::string::String,
+}
+///Request
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "type": "object",
+/// "required": [
+/// "method"
+/// ],
+/// "properties": {
+/// "method": {
+/// "type": "string"
+/// },
+/// "params": {
+/// "type": "object",
+/// "additionalProperties": {}
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct Request {
+ pub method: ::std::string::String,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub params: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///A uniquely identifying ID for a request in JSON-RPC.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A uniquely identifying ID for a request in JSON-RPC.",
+/// "type": [
+/// "string",
+/// "integer"
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum RequestId {
+ String(::std::string::String),
+ Integer(i64),
+}
+impl ::std::convert::From for RequestId {
+ fn from(value: i64) -> Self {
+ Self::Integer(value)
+ }
+}
+///Common params for any request.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Common params for any request.",
+/// "type": "object",
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct RequestParams {
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option,
+}
+///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct RequestParamsMeta {
+ ///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.
+ #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub progress_token: ::std::option::Option,
+ #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///A known resource that the server is capable of reading.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A known resource that the server is capable of reading.",
+/// "type": "object",
+/// "required": [
+/// "name",
+/// "uri"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "annotations": {
+/// "description": "Optional annotations for the client.",
+/// "$ref": "#/$defs/Annotations"
+/// },
+/// "description": {
+/// "description": "A description of what this resource represents.\n\nThis can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.",
+/// "type": "string"
+/// },
+/// "icons": {
+/// "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/Icon"
+/// }
+/// },
+/// "mimeType": {
+/// "description": "The MIME type of this resource, if known.",
+/// "type": "string"
+/// },
+/// "name": {
+/// "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
+/// "type": "string"
+/// },
+/// "size": {
+/// "description": "The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.\n\nThis can be used by Hosts to display file sizes and estimate context window usage.",
+/// "type": "integer"
+/// },
+/// "title": {
+/// "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
+/// "type": "string"
+/// },
+/// "uri": {
+/// "description": "The URI of this resource.",
+/// "type": "string",
+/// "format": "uri"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct Resource {
+ ///Optional annotations for the client.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub annotations: ::std::option::Option,
+ /**A description of what this resource represents.
+ This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub description: ::std::option::Option<::std::string::String>,
+ /**Optional set of sized icons that the client can display in a user interface.
+ Clients that support rendering icons MUST support at least the following MIME types:
+ - image/png - PNG images (safe, universal compatibility)
+ - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
+ Clients that support rendering icons SHOULD also support:
+ - image/svg+xml - SVG images (scalable but requires security precautions)
+ - image/webp - WebP images (modern, efficient format)*/
+ #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
+ pub icons: ::std::vec::Vec,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ///The MIME type of this resource, if known.
+ #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub mime_type: ::std::option::Option<::std::string::String>,
+ ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
+ pub name: ::std::string::String,
+ /**The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
+ This can be used by Hosts to display file sizes and estimate context window usage.*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub size: ::std::option::Option,
+ /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
+ even by those unfamiliar with domain-specific terminology.
+ If not provided, the name should be used for display (except for Tool,
+ where annotations.title should be given precedence over using name,
+ if present).*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub title: ::std::option::Option<::std::string::String>,
+ ///The URI of this resource.
+ pub uri: ::std::string::String,
+}
+///The contents of a specific resource or sub-resource.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The contents of a specific resource or sub-resource.",
+/// "type": "object",
+/// "required": [
+/// "uri"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "mimeType": {
+/// "description": "The MIME type of this resource, if known.",
+/// "type": "string"
+/// },
+/// "uri": {
+/// "description": "The URI of this resource.",
+/// "type": "string",
+/// "format": "uri"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ResourceContents {
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ///The MIME type of this resource, if known.
+ #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub mime_type: ::std::option::Option<::std::string::String>,
+ ///The URI of this resource.
+ pub uri: ::std::string::String,
+}
+/**A resource that the server is capable of reading, included in a prompt or tool call result.
+Note: resource links returned by tools are not guaranteed to appear in the results of resources/list requests.*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A resource that the server is capable of reading, included in a prompt or tool call result.\n\nNote: resource links returned by tools are not guaranteed to appear in the results of resources/list requests.",
+/// "type": "object",
+/// "required": [
+/// "name",
+/// "type",
+/// "uri"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "annotations": {
+/// "description": "Optional annotations for the client.",
+/// "$ref": "#/$defs/Annotations"
+/// },
+/// "description": {
+/// "description": "A description of what this resource represents.\n\nThis can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.",
+/// "type": "string"
+/// },
+/// "icons": {
+/// "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/Icon"
+/// }
+/// },
+/// "mimeType": {
+/// "description": "The MIME type of this resource, if known.",
+/// "type": "string"
+/// },
+/// "name": {
+/// "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
+/// "type": "string"
+/// },
+/// "size": {
+/// "description": "The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.\n\nThis can be used by Hosts to display file sizes and estimate context window usage.",
+/// "type": "integer"
+/// },
+/// "title": {
+/// "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
+/// "type": "string"
+/// },
+/// "type": {
+/// "type": "string",
+/// "const": "resource_link"
+/// },
+/// "uri": {
+/// "description": "The URI of this resource.",
+/// "type": "string",
+/// "format": "uri"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ResourceLink {
+ ///Optional annotations for the client.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub annotations: ::std::option::Option,
+ /**A description of what this resource represents.
+ This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub description: ::std::option::Option<::std::string::String>,
+ /**Optional set of sized icons that the client can display in a user interface.
+ Clients that support rendering icons MUST support at least the following MIME types:
+ - image/png - PNG images (safe, universal compatibility)
+ - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
+ Clients that support rendering icons SHOULD also support:
+ - image/svg+xml - SVG images (scalable but requires security precautions)
+ - image/webp - WebP images (modern, efficient format)*/
+ #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
+ pub icons: ::std::vec::Vec,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ///The MIME type of this resource, if known.
+ #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub mime_type: ::std::option::Option<::std::string::String>,
+ ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
+ pub name: ::std::string::String,
+ /**The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
+ This can be used by Hosts to display file sizes and estimate context window usage.*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub size: ::std::option::Option,
+ /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
+ even by those unfamiliar with domain-specific terminology.
+ If not provided, the name should be used for display (except for Tool,
+ where annotations.title should be given precedence over using name,
+ if present).*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub title: ::std::option::Option<::std::string::String>,
+ #[serde(rename = "type", deserialize_with = "validate::resource_link_type_")]
+ type_: ::std::string::String,
+ ///The URI of this resource.
+ pub uri: ::std::string::String,
+}
+impl ResourceLink {
+ #[allow(clippy::too_many_arguments)]
+ pub fn new(
+ icons: ::std::vec::Vec,
+ name: ::std::string::String,
+ uri: ::std::string::String,
+ annotations: ::std::option::Option,
+ description: ::std::option::Option<::std::string::String>,
+ meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ mime_type: ::std::option::Option<::std::string::String>,
+ size: ::std::option::Option,
+ title: ::std::option::Option<::std::string::String>,
+ ) -> Self {
+ Self {
+ annotations,
+ description,
+ icons,
+ meta,
+ mime_type,
+ name,
+ size,
+ title,
+ type_: "resource_link".to_string(),
+ uri,
+ }
+ }
+ pub fn type_(&self) -> &::std::string::String {
+ &self.type_
+ }
+ /// returns "resource_link"
+ pub fn type_value() -> ::std::string::String {
+ "resource_link".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
+ pub fn type_name() -> ::std::string::String {
+ "resource_link".to_string()
+ }
+}
+///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.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.",
+/// "type": "object",
+/// "required": [
+/// "jsonrpc",
+/// "method"
+/// ],
+/// "properties": {
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "notifications/resources/list_changed"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/NotificationParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ResourceListChangedNotification {
+ #[serde(deserialize_with = "validate::resource_list_changed_notification_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::resource_list_changed_notification_method")]
+ method: ::std::string::String,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub params: ::std::option::Option,
+}
+impl ResourceListChangedNotification {
+ pub fn new(params: ::std::option::Option) -> Self {
+ Self {
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "notifications/resources/list_changed".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "notifications/resources/list_changed"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/resources/list_changed".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "notifications/resources/list_changed".to_string()
+ }
+}
+///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ResourceMeta {
+ ///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.
+ #[serde(rename = "progressToken", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub progress_token: ::std::option::Option,
+ #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///Common parameters when working with resources.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Common parameters when working with resources.",
+/// "type": "object",
+/// "required": [
+/// "uri"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "properties": {
+/// "progressToken": {
+/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
+/// "$ref": "#/$defs/ProgressToken"
+/// }
+/// },
+/// "additionalProperties": {}
+/// },
+/// "uri": {
+/// "description": "The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.",
+/// "type": "string",
+/// "format": "uri"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ResourceRequestParams {
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option,
+ ///The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.
+ pub uri: ::std::string::String,
+}
+///A template description for resources available on the server.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A template description for resources available on the server.",
+/// "type": "object",
+/// "required": [
+/// "name",
+/// "uriTemplate"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "annotations": {
+/// "description": "Optional annotations for the client.",
+/// "$ref": "#/$defs/Annotations"
+/// },
+/// "description": {
+/// "description": "A description of what this template is for.\n\nThis can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.",
+/// "type": "string"
+/// },
+/// "icons": {
+/// "description": "Optional set of sized icons that the client can display in a user interface.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)",
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/Icon"
+/// }
+/// },
+/// "mimeType": {
+/// "description": "The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.",
+/// "type": "string"
+/// },
+/// "name": {
+/// "description": "Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).",
+/// "type": "string"
+/// },
+/// "title": {
+/// "description": "Intended for UI and end-user contexts — optimized to be human-readable and easily understood,\neven by those unfamiliar with domain-specific terminology.\n\nIf not provided, the name should be used for display (except for Tool,\nwhere annotations.title should be given precedence over using name,\nif present).",
+/// "type": "string"
+/// },
+/// "uriTemplate": {
+/// "description": "A URI template (according to RFC 6570) that can be used to construct resource URIs.",
+/// "type": "string",
+/// "format": "uri-template"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ResourceTemplate {
+ ///Optional annotations for the client.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub annotations: ::std::option::Option,
+ /**A description of what this template is for.
+ This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub description: ::std::option::Option<::std::string::String>,
+ /**Optional set of sized icons that the client can display in a user interface.
+ Clients that support rendering icons MUST support at least the following MIME types:
+ - image/png - PNG images (safe, universal compatibility)
+ - image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)
+ Clients that support rendering icons SHOULD also support:
+ - image/svg+xml - SVG images (scalable but requires security precautions)
+ - image/webp - WebP images (modern, efficient format)*/
+ #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
+ pub icons: ::std::vec::Vec,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ///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.
+ #[serde(rename = "mimeType", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub mime_type: ::std::option::Option<::std::string::String>,
+ ///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
+ pub name: ::std::string::String,
+ /**Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
+ even by those unfamiliar with domain-specific terminology.
+ If not provided, the name should be used for display (except for Tool,
+ where annotations.title should be given precedence over using name,
+ if present).*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub title: ::std::option::Option<::std::string::String>,
+ ///A URI template (according to RFC 6570) that can be used to construct resource URIs.
+ #[serde(rename = "uriTemplate")]
+ pub uri_template: ::std::string::String,
+}
+///A reference to a resource or resource template definition.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A reference to a resource or resource template definition.",
+/// "type": "object",
+/// "required": [
+/// "type",
+/// "uri"
+/// ],
+/// "properties": {
+/// "type": {
+/// "type": "string",
+/// "const": "ref/resource"
+/// },
+/// "uri": {
+/// "description": "The URI or URI template of the resource.",
+/// "type": "string",
+/// "format": "uri-template"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ResourceTemplateReference {
+ #[serde(rename = "type", deserialize_with = "validate::resource_template_reference_type_")]
+ type_: ::std::string::String,
+ ///The URI or URI template of the resource.
+ pub uri: ::std::string::String,
+}
+impl ResourceTemplateReference {
+ pub fn new(uri: ::std::string::String) -> Self {
+ Self {
+ type_: "ref/resource".to_string(),
+ uri,
+ }
+ }
+ pub fn type_(&self) -> &::std::string::String {
+ &self.type_
+ }
+ /// returns "ref/resource"
+ pub fn type_value() -> ::std::string::String {
+ "ref/resource".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `type_value()` instead.")]
+ pub fn type_name() -> ::std::string::String {
+ "ref/resource".to_string()
+ }
+}
+///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.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.",
+/// "type": "object",
+/// "required": [
+/// "jsonrpc",
+/// "method",
+/// "params"
+/// ],
+/// "properties": {
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "notifications/resources/updated"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/ResourceUpdatedNotificationParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ResourceUpdatedNotification {
+ #[serde(deserialize_with = "validate::resource_updated_notification_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::resource_updated_notification_method")]
+ method: ::std::string::String,
+ pub params: ResourceUpdatedNotificationParams,
+}
+impl ResourceUpdatedNotification {
+ pub fn new(params: ResourceUpdatedNotificationParams) -> Self {
+ Self {
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "notifications/resources/updated".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "notifications/resources/updated"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/resources/updated".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "notifications/resources/updated".to_string()
+ }
+}
+///Parameters for a notifications/resources/updated notification.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Parameters for a notifications/resources/updated notification.",
+/// "type": "object",
+/// "required": [
+/// "uri"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "uri": {
+/// "description": "The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.",
+/// "type": "string",
+/// "format": "uri"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct ResourceUpdatedNotificationParams {
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ///The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
+ pub uri: ::std::string::String,
+}
+///Result
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "type": "object",
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// }
+/// },
+/// "additionalProperties": {}
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct Result {
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ #[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+}
+///The sender or recipient of messages and data in a conversation.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "The sender or recipient of messages and data in a conversation.",
+/// "type": "string",
+/// "enum": [
+/// "assistant",
+/// "user"
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+pub enum Role {
+ #[serde(rename = "assistant")]
+ Assistant,
+ #[serde(rename = "user")]
+ User,
+}
+impl ::std::fmt::Display for Role {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ match *self {
+ Self::Assistant => write!(f, "assistant"),
+ Self::User => write!(f, "user"),
+ }
+ }
+}
+///Represents a root directory or file that the server can operate on.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Represents a root directory or file that the server can operate on.",
+/// "type": "object",
+/// "required": [
+/// "uri"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "name": {
+/// "description": "An optional name for the root. This can be used to provide a human-readable\nidentifier for the root, which may be useful for display purposes or for\nreferencing the root in other parts of the application.",
+/// "type": "string"
+/// },
+/// "uri": {
+/// "description": "The URI identifying the root. This *must* start with file:// for now.\nThis restriction may be relaxed in future versions of the protocol to allow\nother URI schemes.",
+/// "type": "string",
+/// "format": "uri"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct Root {
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ /**An optional name for the root. This can be used to provide a human-readable
+ identifier for the root, which may be useful for display purposes or for
+ referencing the root in other parts of the application.*/
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub name: ::std::option::Option<::std::string::String>,
+ /**The URI identifying the root. This *must* start with file:// for now.
+ This restriction may be relaxed in future versions of the protocol to allow
+ other URI schemes.*/
+ pub uri: ::std::string::String,
+}
+/**A notification from the client to the server, informing it that the list of roots has changed.
+This notification should be sent whenever the client adds, removes, or modifies any root.
+The server should then request an updated list of roots using the ListRootsRequest.*/
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "A notification from the client to the server, informing it that the list of roots has changed.\nThis notification should be sent whenever the client adds, removes, or modifies any root.\nThe server should then request an updated list of roots using the ListRootsRequest.",
+/// "type": "object",
+/// "required": [
+/// "jsonrpc",
+/// "method"
+/// ],
+/// "properties": {
+/// "jsonrpc": {
+/// "type": "string",
+/// "const": "2.0"
+/// },
+/// "method": {
+/// "type": "string",
+/// "const": "notifications/roots/list_changed"
+/// },
+/// "params": {
+/// "$ref": "#/$defs/NotificationParams"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct RootsListChangedNotification {
+ #[serde(deserialize_with = "validate::roots_list_changed_notification_jsonrpc")]
+ jsonrpc: ::std::string::String,
+ #[serde(deserialize_with = "validate::roots_list_changed_notification_method")]
+ method: ::std::string::String,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub params: ::std::option::Option,
+}
+impl RootsListChangedNotification {
+ pub fn new(params: ::std::option::Option) -> Self {
+ Self {
+ jsonrpc: JSONRPC_VERSION.to_string(),
+ method: "notifications/roots/list_changed".to_string(),
+ params,
+ }
+ }
+ pub fn jsonrpc(&self) -> &::std::string::String {
+ &self.jsonrpc
+ }
+ pub fn method(&self) -> &::std::string::String {
+ &self.method
+ }
+ /// returns "notifications/roots/list_changed"
+ pub fn method_value() -> ::std::string::String {
+ "notifications/roots/list_changed".to_string()
+ }
+ #[deprecated(since = "0.8.0", note = "Use `method_value()` instead.")]
+ pub fn method_name() -> ::std::string::String {
+ "notifications/roots/list_changed".to_string()
+ }
+}
+///RpcError
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "type": "object",
+/// "required": [
+/// "code",
+/// "message"
+/// ],
+/// "properties": {
+/// "code": {
+/// "description": "The error type that occurred.",
+/// "type": "integer"
+/// },
+/// "data": {
+/// "description": "Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.)."
+/// },
+/// "message": {
+/// "description": "A short description of the error. The message SHOULD be limited to a concise single sentence.",
+/// "type": "string"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct RpcError {
+ ///The error type that occurred.
+ pub code: i64,
+ ///Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub data: ::std::option::Option<::serde_json::Value>,
+ ///A short description of the error. The message SHOULD be limited to a concise single sentence.
+ pub message: ::std::string::String,
+}
+///Describes a message issued to or received from an LLM API.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Describes a message issued to or received from an LLM API.",
+/// "type": "object",
+/// "required": [
+/// "content",
+/// "role"
+/// ],
+/// "properties": {
+/// "_meta": {
+/// "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
+/// "type": "object",
+/// "additionalProperties": {}
+/// },
+/// "content": {
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/TextContent"
+/// },
+/// {
+/// "$ref": "#/$defs/ImageContent"
+/// },
+/// {
+/// "$ref": "#/$defs/AudioContent"
+/// },
+/// {
+/// "$ref": "#/$defs/ToolUseContent"
+/// },
+/// {
+/// "$ref": "#/$defs/ToolResultContent"
+/// },
+/// {
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/SamplingMessageContentBlock"
+/// }
+/// }
+/// ]
+/// },
+/// "role": {
+/// "$ref": "#/$defs/Role"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+pub struct SamplingMessage {
+ pub content: SamplingMessageContent,
+ ///See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.
+ #[serde(rename = "_meta", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub meta: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ pub role: Role,
+}
+///SamplingMessageContent
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/TextContent"
+/// },
+/// {
+/// "$ref": "#/$defs/ImageContent"
+/// },
+/// {
+/// "$ref": "#/$defs/AudioContent"
+/// },
+/// {
+/// "$ref": "#/$defs/ToolUseContent"
+/// },
+/// {
+/// "$ref": "#/$defs/ToolResultContent"
+/// },
+/// {
+/// "type": "array",
+/// "items": {
+/// "$ref": "#/$defs/SamplingMessageContentBlock"
+/// }
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum SamplingMessageContent {
+ TextContent(TextContent),
+ ImageContent(ImageContent),
+ AudioContent(AudioContent),
+ ToolUseContent(ToolUseContent),
+ ToolResultContent(ToolResultContent),
+ SamplingMessageContentBlock(::std::vec::Vec),
+}
+impl ::std::convert::From for SamplingMessageContent {
+ fn from(value: TextContent) -> Self {
+ Self::TextContent(value)
+ }
+}
+impl ::std::convert::From for SamplingMessageContent {
+ fn from(value: ImageContent) -> Self {
+ Self::ImageContent(value)
+ }
+}
+impl ::std::convert::From for SamplingMessageContent {
+ fn from(value: AudioContent) -> Self {
+ Self::AudioContent(value)
+ }
+}
+impl ::std::convert::From for SamplingMessageContent {
+ fn from(value: ToolUseContent) -> Self {
+ Self::ToolUseContent(value)
+ }
+}
+impl ::std::convert::From for SamplingMessageContent {
+ fn from(value: ToolResultContent) -> Self {
+ Self::ToolResultContent(value)
+ }
+}
+impl ::std::convert::From<::std::vec::Vec> for SamplingMessageContent {
+ fn from(value: ::std::vec::Vec) -> Self {
+ Self::SamplingMessageContentBlock(value)
+ }
+}
+///SamplingMessageContentBlock
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/TextContent"
+/// },
+/// {
+/// "$ref": "#/$defs/ImageContent"
+/// },
+/// {
+/// "$ref": "#/$defs/AudioContent"
+/// },
+/// {
+/// "$ref": "#/$defs/ToolUseContent"
+/// },
+/// {
+/// "$ref": "#/$defs/ToolResultContent"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum SamplingMessageContentBlock {
+ TextContent(TextContent),
+ ImageContent(ImageContent),
+ AudioContent(AudioContent),
+ ToolUseContent(ToolUseContent),
+ ToolResultContent(ToolResultContent),
+}
+impl ::std::convert::From for SamplingMessageContentBlock {
+ fn from(value: TextContent) -> Self {
+ Self::TextContent(value)
+ }
+}
+impl ::std::convert::From for SamplingMessageContentBlock {
+ fn from(value: ImageContent) -> Self {
+ Self::ImageContent(value)
+ }
+}
+impl ::std::convert::From for SamplingMessageContentBlock {
+ fn from(value: AudioContent) -> Self {
+ Self::AudioContent(value)
+ }
+}
+impl ::std::convert::From for SamplingMessageContentBlock {
+ fn from(value: ToolUseContent) -> Self {
+ Self::ToolUseContent(value)
+ }
+}
+impl ::std::convert::From for SamplingMessageContentBlock {
+ fn from(value: ToolResultContent) -> Self {
+ Self::ToolResultContent(value)
+ }
+}
+///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.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.",
+/// "type": "object",
+/// "properties": {
+/// "completions": {
+/// "description": "Present if the server supports argument autocompletion suggestions.",
+/// "type": "object",
+/// "additionalProperties": true
+/// },
+/// "experimental": {
+/// "description": "Experimental, non-standard capabilities that the server supports.",
+/// "type": "object",
+/// "additionalProperties": {
+/// "type": "object",
+/// "additionalProperties": true
+/// }
+/// },
+/// "logging": {
+/// "description": "Present if the server supports sending log messages to the client.",
+/// "type": "object",
+/// "additionalProperties": true
+/// },
+/// "prompts": {
+/// "description": "Present if the server offers any prompt templates.",
+/// "type": "object",
+/// "properties": {
+/// "listChanged": {
+/// "description": "Whether this server supports notifications for changes to the prompt list.",
+/// "type": "boolean"
+/// }
+/// }
+/// },
+/// "resources": {
+/// "description": "Present if the server offers any resources to read.",
+/// "type": "object",
+/// "properties": {
+/// "listChanged": {
+/// "description": "Whether this server supports notifications for changes to the resource list.",
+/// "type": "boolean"
+/// },
+/// "subscribe": {
+/// "description": "Whether this server supports subscribing to resource updates.",
+/// "type": "boolean"
+/// }
+/// }
+/// },
+/// "tasks": {
+/// "description": "Present if the server supports task-augmented requests.",
+/// "type": "object",
+/// "properties": {
+/// "cancel": {
+/// "description": "Whether this server supports tasks/cancel.",
+/// "type": "object",
+/// "additionalProperties": true
+/// },
+/// "list": {
+/// "description": "Whether this server supports tasks/list.",
+/// "type": "object",
+/// "additionalProperties": true
+/// },
+/// "requests": {
+/// "description": "Specifies which request types can be augmented with tasks.",
+/// "type": "object",
+/// "properties": {
+/// "tools": {
+/// "description": "Task support for tool-related requests.",
+/// "type": "object",
+/// "properties": {
+/// "call": {
+/// "description": "Whether the server supports task-augmented tools/call requests.",
+/// "type": "object",
+/// "additionalProperties": true
+/// }
+/// }
+/// }
+/// }
+/// }
+/// }
+/// },
+/// "tools": {
+/// "description": "Present if the server offers any tools to call.",
+/// "type": "object",
+/// "properties": {
+/// "listChanged": {
+/// "description": "Whether this server supports notifications for changes to the tool list.",
+/// "type": "boolean"
+/// }
+/// }
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ServerCapabilities {
+ ///Present if the server supports argument autocompletion suggestions.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub completions: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ ///Experimental, non-standard capabilities that the server supports.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub experimental: ::std::option::Option<
+ ::std::collections::HashMap<::std::string::String, ::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ >,
+ ///Present if the server supports sending log messages to the client.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub logging: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub prompts: ::std::option::Option,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub resources: ::std::option::Option,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub tasks: ::std::option::Option,
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub tools: ::std::option::Option,
+}
+///Present if the server offers any prompt templates.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Present if the server offers any prompt templates.",
+/// "type": "object",
+/// "properties": {
+/// "listChanged": {
+/// "description": "Whether this server supports notifications for changes to the prompt list.",
+/// "type": "boolean"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ServerCapabilitiesPrompts {
+ ///Whether this server supports notifications for changes to the prompt list.
+ #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub list_changed: ::std::option::Option,
+}
+///Present if the server offers any resources to read.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Present if the server offers any resources to read.",
+/// "type": "object",
+/// "properties": {
+/// "listChanged": {
+/// "description": "Whether this server supports notifications for changes to the resource list.",
+/// "type": "boolean"
+/// },
+/// "subscribe": {
+/// "description": "Whether this server supports subscribing to resource updates.",
+/// "type": "boolean"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ServerCapabilitiesResources {
+ ///Whether this server supports notifications for changes to the resource list.
+ #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub list_changed: ::std::option::Option,
+ ///Whether this server supports subscribing to resource updates.
+ #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub subscribe: ::std::option::Option,
+}
+///Present if the server offers any tools to call.
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "description": "Present if the server offers any tools to call.",
+/// "type": "object",
+/// "properties": {
+/// "listChanged": {
+/// "description": "Whether this server supports notifications for changes to the tool list.",
+/// "type": "boolean"
+/// }
+/// }
+///}
+/// ```
+///
+#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, Default)]
+pub struct ServerCapabilitiesTools {
+ ///Whether this server supports notifications for changes to the tool list.
+ #[serde(rename = "listChanged", default, skip_serializing_if = "::std::option::Option::is_none")]
+ pub list_changed: ::std::option::Option,
+}
+///ServerNotification
+///
+/// JSON schema
+///
+/// ```json
+///{
+/// "anyOf": [
+/// {
+/// "$ref": "#/$defs/CancelledNotification"
+/// },
+/// {
+/// "$ref": "#/$defs/ProgressNotification"
+/// },
+/// {
+/// "$ref": "#/$defs/ResourceListChangedNotification"
+/// },
+/// {
+/// "$ref": "#/$defs/ResourceUpdatedNotification"
+/// },
+/// {
+/// "$ref": "#/$defs/PromptListChangedNotification"
+/// },
+/// {
+/// "$ref": "#/$defs/ToolListChangedNotification"
+/// },
+/// {
+/// "$ref": "#/$defs/TaskStatusNotification"
+/// },
+/// {
+/// "$ref": "#/$defs/LoggingMessageNotification"
+/// },
+/// {
+/// "$ref": "#/$defs/ElicitationCompleteNotification"
+/// }
+/// ]
+///}
+/// ```
+///
+#[derive(::serde::Serialize, Clone, Debug)]
+#[serde(untagged)]
+pub enum ServerNotification {
+ CancelledNotification(CancelledNotification),
+ ProgressNotification(ProgressNotification),
+ ResourceListChangedNotification(ResourceListChangedNotification),
+ ResourceUpdatedNotification(ResourceUpdatedNotification),
+ PromptListChangedNotification(PromptListChangedNotification),
+ ToolListChangedNotification(ToolListChangedNotification),
+ TaskStatusNotification(TaskStatusNotification),
+ LoggingMessageNotification(LoggingMessageNotification),
+ ElicitationCompleteNotification(ElicitationCompleteNotification),
+}
+impl ::std::convert::From for ServerNotification {
+ fn from(value: CancelledNotification) -> Self {
+ Self::CancelledNotification(value)
+ }
+}
+impl ::std::convert::From for ServerNotification {
+ fn from(value: ProgressNotification) -> Self {
+ Self::ProgressNotification(value)
+ }
+}
+impl ::std::convert::From for ServerNotification {
+ fn from(value: ResourceListChangedNotification) -> Self {
+ Self::ResourceListChangedNotification(value)
+ }
+}
+impl ::std::convert::From for ServerNotification {
+ fn from(value: ResourceUpdatedNotification) -> Self {
+ Self::ResourceUpdatedNotification(value)
+ }
+}
+impl ::std::convert::From for ServerNotification {
+ fn from(value: PromptListChangedNotification) -> Self {
+ Self::PromptListChangedNotification(value)
+ }
+}
+impl ::std::convert::From for ServerNotification {
+ fn from(value: ToolListChangedNotification) -> Self {
+ Self::ToolListChangedNotification(value)
+ }
+}
+impl ::std::convert::From for ServerNotification {
+ fn from(value: TaskStatusNotification) -> Self {
+ Self::TaskStatusNotification(value)
+ }
+}
+impl ::std::convert::From for ServerNotification {
+ fn from(value: LoggingMessageNotification) -> Self {
+ Self::LoggingMessageNotification(value)
+ }
+}
+impl ::std::convert::From for ServerNotification {
+ fn from(value: ElicitationCompleteNotification) -> Self {
+ Self::ElicitationCompleteNotification(value)
+ }
+}
+///ServerRequest
+///
+///