//! @generated by turbomcp-codegen from MCP 2026-07-28. DO NOT EDIT.
//!
//! Regenerate via `just codegen`. Normalization: allOf-flatten (F14).
//! Source schema path at generation time: ../reference/modelcontextprotocol/schema/draft/schema.json
#![allow(clippy::all)]
#![allow(clippy::pedantic)]
#![allow(missing_docs)]
#![allow(unused_imports)]
#[cfg(not(feature = "std"))]
use ::alloc::{
borrow::ToOwned,
boxed::Box,
format,
string::{String, ToString},
vec,
vec::Vec,
};
/// Error types.
pub mod error {
#[cfg(not(feature = "std"))]
#[allow(unused_imports)]
use ::alloc::{borrow::ToOwned, string::String};
/// Error from a `TryFrom` or `FromStr` implementation.
pub struct ConversionError(::alloc::borrow::Cow<'static, str>);
impl ::core::error::Error for ConversionError {}
impl ::core::fmt::Display for ConversionError {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
::core::fmt::Display::fmt(&self.0, f)
}
}
impl ::core::fmt::Debug for ConversionError {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
::core::fmt::Debug::fmt(&self.0, f)
}
}
impl From<&'static str> for ConversionError {
fn from(value: &'static str) -> Self {
Self(value.into())
}
}
impl From<String> for ConversionError {
fn from(value: String) -> Self {
Self(value.into())
}
}
}
///Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
///
/// <details><summary>JSON schema</summary>
///
/// ```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
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
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 = "::alloc::vec::Vec::is_empty")]
pub audience: ::alloc::vec::Vec<Role>,
/**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 = "::core::option::Option::is_none"
)]
pub last_modified: ::core::option::Option<::alloc::string::String>,
/**Describes how important this data is for operating the server.
A value of 1 means "most important," and indicates that the data is
effectively required, while 0 means "least important," and indicates that
the data is entirely optional.*/
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub priority: ::core::option::Option<f64>,
}
impl ::core::default::Default for Annotations {
fn default() -> Self {
Self {
audience: Default::default(),
last_modified: Default::default(),
priority: Default::default(),
}
}
}
///Audio provided to or from an LLM.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Audio provided to or from an LLM.",
/// "type": "object",
/// "required": [
/// "data",
/// "mimeType",
/// "type"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AudioContent {
///Optional annotations for the client.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub annotations: ::core::option::Option<Annotations>,
///The base64-encoded audio data.
pub data: ::alloc::string::String,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
///The MIME type of the audio. Different providers may support different audio types.
#[serde(rename = "mimeType")]
pub mime_type: ::alloc::string::String,
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
}
///Base interface for metadata with name (identifier) and title (display name) properties.
///
/// <details><summary>JSON schema</summary>
///
/// ```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 {@link Tool},\nwhere `annotations.title` should be given precedence over using `name`,\nif present).",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[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: ::alloc::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 {@link Tool},
where `annotations.title` should be given precedence over using `name`,
if present).*/
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub title: ::core::option::Option<::alloc::string::String>,
}
///`BlobResourceContents`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "blob",
/// "uri"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct BlobResourceContents {
///A base64-encoded string representing the binary data of the item.
pub blob: ::alloc::string::String,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
///The MIME type of this resource, if known.
#[serde(
rename = "mimeType",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub mime_type: ::core::option::Option<::alloc::string::String>,
///The URI of this resource.
pub uri: ::alloc::string::String,
}
///`BooleanSchema`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "default": {
/// "type": "boolean"
/// },
/// "description": {
/// "type": "string"
/// },
/// "title": {
/// "type": "string"
/// },
/// "type": {
/// "type": "string",
/// "const": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct BooleanSchema {
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub default: ::core::option::Option<bool>,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub description: ::core::option::Option<::alloc::string::String>,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub title: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
}
///A result that supports a time-to-live (TTL) hint for client-side caching.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A result that supports a time-to-live (TTL) hint for client-side caching.",
/// "type": "object",
/// "required": [
/// "cacheScope",
/// "resultType",
/// "ttlMs"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "cacheScope": {
/// "description": "Indicates the intended scope of the cached response, analogous to HTTP\n`Cache-Control: public` vs `Cache-Control: private`.\n\n- `\"public\"`: Any client or intermediary (e.g., shared gateway, proxy)\n MAY cache the response and serve it to any user.\n- `\"private\"`: Only the requesting user's client MAY cache the response.\n Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached\n copy to a different user.",
/// "type": "string",
/// "enum": [
/// "private",
/// "public"
/// ]
/// },
/// "resultType": {
/// "description": "Indicates the type of the result, which allows the client to determine\nhow to parse the result object.\n\nServers implementing this protocol version MUST include this field.\nFor backward compatibility, when a client receives a result from a\nserver implementing an earlier protocol version (which does not include\n`resultType`), the client MUST treat the absent field as `\"complete\"`.",
/// "type": "string"
/// },
/// "ttlMs": {
/// "description": "A hint from the server indicating how long (in milliseconds) the\nclient MAY cache this response before re-fetching. Semantics are\nanalogous to HTTP Cache-Control max-age.\n\n- If 0, The response SHOULD be considered immediately stale,\n The client MAY re-fetch every time the result is needed.\n- If positive, the client SHOULD consider the result fresh for this many\n milliseconds after receiving the response.",
/// "type": "integer",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CacheableResult {
/**Indicates the intended scope of the cached response, analogous to HTTP
`Cache-Control: public` vs `Cache-Control: private`.
- `"public"`: Any client or intermediary (e.g., shared gateway, proxy)
MAY cache the response and serve it to any user.
- `"private"`: Only the requesting user's client MAY cache the response.
Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached
copy to a different user.*/
#[serde(rename = "cacheScope")]
pub cache_scope: CacheableResultCacheScope,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
/**Indicates the type of the result, which allows the client to determine
how to parse the result object.
Servers implementing this protocol version MUST include this field.
For backward compatibility, when a client receives a result from a
server implementing an earlier protocol version (which does not include
`resultType`), the client MUST treat the absent field as `"complete"`.*/
#[serde(rename = "resultType")]
pub result_type: ::alloc::string::String,
/**A hint from the server indicating how long (in milliseconds) the
client MAY cache this response before re-fetching. Semantics are
analogous to HTTP Cache-Control max-age.
- If 0, The response SHOULD be considered immediately stale,
The client MAY re-fetch every time the result is needed.
- If positive, the client SHOULD consider the result fresh for this many
milliseconds after receiving the response.*/
#[serde(rename = "ttlMs")]
pub ttl_ms: u64,
}
/**Indicates the intended scope of the cached response, analogous to HTTP
`Cache-Control: public` vs `Cache-Control: private`.
- `"public"`: Any client or intermediary (e.g., shared gateway, proxy)
MAY cache the response and serve it to any user.
- `"private"`: Only the requesting user's client MAY cache the response.
Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached
copy to a different user.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Indicates the intended scope of the cached response, analogous to HTTP\n`Cache-Control: public` vs `Cache-Control: private`.\n\n- `\"public\"`: Any client or intermediary (e.g., shared gateway, proxy)\n MAY cache the response and serve it to any user.\n- `\"private\"`: Only the requesting user's client MAY cache the response.\n Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached\n copy to a different user.",
/// "type": "string",
/// "enum": [
/// "private",
/// "public"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum CacheableResultCacheScope {
#[serde(rename = "private")]
Private,
#[serde(rename = "public")]
Public,
}
impl ::core::fmt::Display for CacheableResultCacheScope {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match *self {
Self::Private => f.write_str("private"),
Self::Public => f.write_str("public"),
}
}
}
impl ::core::str::FromStr for CacheableResultCacheScope {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
match value {
"private" => Ok(Self::Private),
"public" => Ok(Self::Public),
_ => Err("invalid value".into()),
}
}
}
impl ::core::convert::TryFrom<&str> for CacheableResultCacheScope {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<&::alloc::string::String> for CacheableResultCacheScope {
type Error = self::error::ConversionError;
fn try_from(
value: &::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<::alloc::string::String> for CacheableResultCacheScope {
type Error = self::error::ConversionError;
fn try_from(
value: ::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Used by the client to invoke a tool provided by the server.
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CallToolRequest {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
pub params: CallToolRequestParams,
}
///Parameters for a `tools/call` request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for a `tools/call` request.",
/// "type": "object",
/// "required": [
/// "_meta",
/// "name"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/RequestMetaObject"
/// },
/// "arguments": {
/// "description": "Arguments to use for the tool call.",
/// "type": "object",
/// "additionalProperties": {}
/// },
/// "inputResponses": {
/// "$ref": "#/$defs/InputResponses"
/// },
/// "name": {
/// "description": "The name of the tool.",
/// "type": "string"
/// },
/// "requestState": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CallToolRequestParams {
///Arguments to use for the tool call.
#[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
pub arguments: ::serde_json::Map<::alloc::string::String, ::serde_json::Value>,
#[serde(
rename = "inputResponses",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub input_responses: ::core::option::Option<InputResponses>,
#[serde(rename = "_meta")]
pub meta: RequestMetaObject,
///The name of the tool.
pub name: ::alloc::string::String,
#[serde(
rename = "requestState",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub request_state: ::core::option::Option<::alloc::string::String>,
}
///The result returned by the server for a {@link CallToolRequesttools/call} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The result returned by the server for a {@link CallToolRequesttools/call} request.",
/// "type": "object",
/// "required": [
/// "content",
/// "resultType"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "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"
/// },
/// "resultType": {
/// "description": "Indicates the type of the result, which allows the client to determine\nhow to parse the result object.\n\nServers implementing this protocol version MUST include this field.\nFor backward compatibility, when a client receives a result from a\nserver implementing an earlier protocol version (which does not include\n`resultType`), the client MUST treat the absent field as `\"complete\"`.",
/// "type": "string"
/// },
/// "structuredContent": {
/// "description": "An optional JSON value that represents the structured result of the tool call.\n\nThis can be any JSON value (object, array, string, number, boolean, or null)\nthat conforms to the tool's outputSchema if one is defined."
/// }
/// }
///}
/// ```
/// </details>
#[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: ::alloc::vec::Vec<ContentBlock>,
/**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 = "::core::option::Option::is_none"
)]
pub is_error: ::core::option::Option<bool>,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
/**Indicates the type of the result, which allows the client to determine
how to parse the result object.
Servers implementing this protocol version MUST include this field.
For backward compatibility, when a client receives a result from a
server implementing an earlier protocol version (which does not include
`resultType`), the client MUST treat the absent field as `"complete"`.*/
#[serde(rename = "resultType")]
pub result_type: ::alloc::string::String,
/**An optional JSON value that represents the structured result of the tool call.
This can be any JSON value (object, array, string, number, boolean, or null)
that conforms to the tool's outputSchema if one is defined.*/
#[serde(
rename = "structuredContent",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub structured_content: ::core::option::Option<::serde_json::Value>,
}
///A successful response from the server for a {@link CallToolRequesttools/call} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A successful response from the server for a {@link CallToolRequesttools/call} request.",
/// "type": "object",
/// "required": [
/// "id",
/// "jsonrpc",
/// "result"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/$defs/RequestId"
/// },
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "result": {
/// "anyOf": [
/// {
/// "$ref": "#/$defs/InputRequiredResult"
/// },
/// {
/// "$ref": "#/$defs/CallToolResult"
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CallToolResultResponse {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub result: CallToolResultResponseResult,
}
///`CallToolResultResponseResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/InputRequiredResult"
/// },
/// {
/// "$ref": "#/$defs/CallToolResult"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum CallToolResultResponseResult {
InputRequiredResult(InputRequiredResult),
CallToolResult(CallToolResult),
}
impl ::core::convert::From<InputRequiredResult> for CallToolResultResponseResult {
fn from(value: InputRequiredResult) -> Self {
Self::InputRequiredResult(value)
}
}
impl ::core::convert::From<CallToolResult> for CallToolResultResponseResult {
fn from(value: CallToolResult) -> Self {
Self::CallToolResult(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.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```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.",
/// "type": "object",
/// "required": [
/// "jsonrpc",
/// "method",
/// "params"
/// ],
/// "properties": {
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "method": {
/// "type": "string",
/// "const": "notifications/cancelled"
/// },
/// "params": {
/// "$ref": "#/$defs/CancelledNotificationParams"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelledNotification {
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
pub params: CancelledNotificationParams,
}
///Parameters for a `notifications/cancelled` notification.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for a `notifications/cancelled` notification.",
/// "type": "object",
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "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.",
/// "$ref": "#/$defs/RequestId"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelledNotificationParams {
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
///An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub reason: ::core::option::Option<::alloc::string::String>,
/**The ID of the request to cancel.
This MUST correspond to the ID of a request previously issued in the same direction.*/
#[serde(
rename = "requestId",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub request_id: ::core::option::Option<RequestId>,
}
impl ::core::default::Default for CancelledNotificationParams {
fn default() -> Self {
Self {
meta: Default::default(),
reason: Default::default(),
request_id: Default::default(),
}
}
}
///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.
///
/// <details><summary>JSON schema</summary>
///
/// ```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": {
/// "$ref": "#/$defs/JSONObject"
/// },
/// "url": {
/// "$ref": "#/$defs/JSONObject"
/// }
/// }
/// },
/// "experimental": {
/// "description": "Experimental, non-standard capabilities that the client supports.",
/// "type": "object",
/// "additionalProperties": {
/// "$ref": "#/$defs/JSONObject"
/// }
/// },
/// "extensions": {
/// "description": "Optional MCP extensions that the client supports. Keys are extension identifiers\n(e.g., \"io.modelcontextprotocol/oauth-client-credentials\"), and values are\nper-extension settings objects. An empty object indicates support with no settings.",
/// "type": "object",
/// "additionalProperties": {
/// "$ref": "#/$defs/JSONObject"
/// }
/// },
/// "roots": {
/// "description": "Present if the client supports listing roots.",
/// "type": "object"
/// },
/// "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).",
/// "$ref": "#/$defs/JSONObject"
/// },
/// "tools": {
/// "description": "Whether the client supports tool use via `tools` and `toolChoice` parameters.",
/// "$ref": "#/$defs/JSONObject"
/// }
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ClientCapabilities {
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub elicitation: ::core::option::Option<ClientCapabilitiesElicitation>,
///Experimental, non-standard capabilities that the client supports.
#[serde(
default,
skip_serializing_if = ":: alloc :: collections :: BTreeMap::is_empty"
)]
pub experimental: ::alloc::collections::BTreeMap<::alloc::string::String, JsonObject>,
/**Optional MCP extensions that the client supports. Keys are extension identifiers
(e.g., "io.modelcontextprotocol/oauth-client-credentials"), and values are
per-extension settings objects. An empty object indicates support with no settings.*/
#[serde(
default,
skip_serializing_if = ":: alloc :: collections :: BTreeMap::is_empty"
)]
pub extensions: ::alloc::collections::BTreeMap<::alloc::string::String, JsonObject>,
///Present if the client supports listing roots.
#[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
pub roots: ::serde_json::Map<::alloc::string::String, ::serde_json::Value>,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub sampling: ::core::option::Option<ClientCapabilitiesSampling>,
}
impl ::core::default::Default for ClientCapabilities {
fn default() -> Self {
Self {
elicitation: Default::default(),
experimental: Default::default(),
extensions: Default::default(),
roots: Default::default(),
sampling: Default::default(),
}
}
}
///Present if the client supports elicitation from the server.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Present if the client supports elicitation from the server.",
/// "type": "object",
/// "properties": {
/// "form": {
/// "$ref": "#/$defs/JSONObject"
/// },
/// "url": {
/// "$ref": "#/$defs/JSONObject"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ClientCapabilitiesElicitation {
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub form: ::core::option::Option<JsonObject>,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub url: ::core::option::Option<JsonObject>,
}
impl ::core::default::Default for ClientCapabilitiesElicitation {
fn default() -> Self {
Self {
form: Default::default(),
url: Default::default(),
}
}
}
///Present if the client supports sampling from an LLM.
///
/// <details><summary>JSON schema</summary>
///
/// ```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).",
/// "$ref": "#/$defs/JSONObject"
/// },
/// "tools": {
/// "description": "Whether the client supports tool use via `tools` and `toolChoice` parameters.",
/// "$ref": "#/$defs/JSONObject"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ClientCapabilitiesSampling {
/**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 = "::core::option::Option::is_none")]
pub context: ::core::option::Option<JsonObject>,
///Whether the client supports tool use via `tools` and `toolChoice` parameters.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub tools: ::core::option::Option<JsonObject>,
}
impl ::core::default::Default for ClientCapabilitiesSampling {
fn default() -> Self {
Self {
context: Default::default(),
tools: Default::default(),
}
}
}
///`ClientNotification`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/CancelledNotification"
/// },
/// {
/// "$ref": "#/$defs/ProgressNotification"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum ClientNotification {
CancelledNotification(CancelledNotification),
ProgressNotification(ProgressNotification),
}
impl ::core::convert::From<CancelledNotification> for ClientNotification {
fn from(value: CancelledNotification) -> Self {
Self::CancelledNotification(value)
}
}
impl ::core::convert::From<ProgressNotification> for ClientNotification {
fn from(value: ProgressNotification) -> Self {
Self::ProgressNotification(value)
}
}
///`ClientRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/DiscoverRequest"
/// },
/// {
/// "$ref": "#/$defs/ListResourcesRequest"
/// },
/// {
/// "$ref": "#/$defs/ListResourceTemplatesRequest"
/// },
/// {
/// "$ref": "#/$defs/ReadResourceRequest"
/// },
/// {
/// "$ref": "#/$defs/SubscriptionsListenRequest"
/// },
/// {
/// "$ref": "#/$defs/ListPromptsRequest"
/// },
/// {
/// "$ref": "#/$defs/GetPromptRequest"
/// },
/// {
/// "$ref": "#/$defs/ListToolsRequest"
/// },
/// {
/// "$ref": "#/$defs/CallToolRequest"
/// },
/// {
/// "$ref": "#/$defs/CompleteRequest"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum ClientRequest {
DiscoverRequest(DiscoverRequest),
ListResourcesRequest(ListResourcesRequest),
ListResourceTemplatesRequest(ListResourceTemplatesRequest),
ReadResourceRequest(ReadResourceRequest),
SubscriptionsListenRequest(SubscriptionsListenRequest),
ListPromptsRequest(ListPromptsRequest),
GetPromptRequest(GetPromptRequest),
ListToolsRequest(ListToolsRequest),
CallToolRequest(CallToolRequest),
CompleteRequest(CompleteRequest),
}
impl ::core::convert::From<DiscoverRequest> for ClientRequest {
fn from(value: DiscoverRequest) -> Self {
Self::DiscoverRequest(value)
}
}
impl ::core::convert::From<ListResourcesRequest> for ClientRequest {
fn from(value: ListResourcesRequest) -> Self {
Self::ListResourcesRequest(value)
}
}
impl ::core::convert::From<ListResourceTemplatesRequest> for ClientRequest {
fn from(value: ListResourceTemplatesRequest) -> Self {
Self::ListResourceTemplatesRequest(value)
}
}
impl ::core::convert::From<ReadResourceRequest> for ClientRequest {
fn from(value: ReadResourceRequest) -> Self {
Self::ReadResourceRequest(value)
}
}
impl ::core::convert::From<SubscriptionsListenRequest> for ClientRequest {
fn from(value: SubscriptionsListenRequest) -> Self {
Self::SubscriptionsListenRequest(value)
}
}
impl ::core::convert::From<ListPromptsRequest> for ClientRequest {
fn from(value: ListPromptsRequest) -> Self {
Self::ListPromptsRequest(value)
}
}
impl ::core::convert::From<GetPromptRequest> for ClientRequest {
fn from(value: GetPromptRequest) -> Self {
Self::GetPromptRequest(value)
}
}
impl ::core::convert::From<ListToolsRequest> for ClientRequest {
fn from(value: ListToolsRequest) -> Self {
Self::ListToolsRequest(value)
}
}
impl ::core::convert::From<CallToolRequest> for ClientRequest {
fn from(value: CallToolRequest) -> Self {
Self::CallToolRequest(value)
}
}
impl ::core::convert::From<CompleteRequest> for ClientRequest {
fn from(value: CompleteRequest) -> Self {
Self::CompleteRequest(value)
}
}
///Common result fields.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Common result fields.",
/// "$ref": "#/$defs/Result"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct ClientResult(pub Result);
impl ::core::ops::Deref for ClientResult {
type Target = Result;
fn deref(&self) -> &Result {
&self.0
}
}
impl ::core::convert::From<ClientResult> for Result {
fn from(value: ClientResult) -> Self {
value.0
}
}
impl ::core::convert::From<Result> for ClientResult {
fn from(value: Result) -> Self {
Self(value)
}
}
///A request from the client to the server, to ask for completion options.
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CompleteRequest {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
pub params: CompleteRequestParams,
}
///Parameters for a `completion/complete` request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for a `completion/complete` request.",
/// "type": "object",
/// "required": [
/// "_meta",
/// "argument",
/// "ref"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/RequestMetaObject"
/// },
/// "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"
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CompleteRequestParams {
pub argument: CompleteRequestParamsArgument,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub context: ::core::option::Option<CompleteRequestParamsContext>,
#[serde(rename = "_meta")]
pub meta: RequestMetaObject,
#[serde(rename = "ref")]
pub ref_: CompleteRequestParamsRef,
}
///The argument's information
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CompleteRequestParamsArgument {
///The name of the argument
pub name: ::alloc::string::String,
///The value of the argument to use for completion matching.
pub value: ::alloc::string::String,
}
///Additional, optional context for completions
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CompleteRequestParamsContext {
///Previously-resolved variables in a URI template or prompt.
#[serde(
default,
skip_serializing_if = ":: alloc :: collections :: BTreeMap::is_empty"
)]
pub arguments: ::alloc::collections::BTreeMap<::alloc::string::String, ::alloc::string::String>,
}
impl ::core::default::Default for CompleteRequestParamsContext {
fn default() -> Self {
Self {
arguments: Default::default(),
}
}
}
///`CompleteRequestParamsRef`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/PromptReference"
/// },
/// {
/// "$ref": "#/$defs/ResourceTemplateReference"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum CompleteRequestParamsRef {
PromptReference(PromptReference),
ResourceTemplateReference(ResourceTemplateReference),
}
impl ::core::convert::From<PromptReference> for CompleteRequestParamsRef {
fn from(value: PromptReference) -> Self {
Self::PromptReference(value)
}
}
impl ::core::convert::From<ResourceTemplateReference> for CompleteRequestParamsRef {
fn from(value: ResourceTemplateReference) -> Self {
Self::ResourceTemplateReference(value)
}
}
///The result returned by the server for a {@link CompleteRequestcompletion/complete} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The result returned by the server for a {@link CompleteRequestcompletion/complete} request.",
/// "type": "object",
/// "required": [
/// "completion",
/// "resultType"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "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"
/// },
/// "maxItems": 100
/// }
/// }
/// },
/// "resultType": {
/// "description": "Indicates the type of the result, which allows the client to determine\nhow to parse the result object.\n\nServers implementing this protocol version MUST include this field.\nFor backward compatibility, when a client receives a result from a\nserver implementing an earlier protocol version (which does not include\n`resultType`), the client MUST treat the absent field as `\"complete\"`.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CompleteResult {
pub completion: CompleteResultCompletion,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
/**Indicates the type of the result, which allows the client to determine
how to parse the result object.
Servers implementing this protocol version MUST include this field.
For backward compatibility, when a client receives a result from a
server implementing an earlier protocol version (which does not include
`resultType`), the client MUST treat the absent field as `"complete"`.*/
#[serde(rename = "resultType")]
pub result_type: ::alloc::string::String,
}
///`CompleteResultCompletion`
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// },
/// "maxItems": 100
/// }
/// }
///}
/// ```
/// </details>
#[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 = "::core::option::Option::is_none"
)]
pub has_more: ::core::option::Option<bool>,
///The total number of completion options available. This can exceed the number of values actually sent in the response.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub total: ::core::option::Option<i64>,
///An array of completion values. Must not exceed 100 items.
pub values: ::alloc::vec::Vec<::alloc::string::String>,
}
///A successful response from the server for a {@link CompleteRequestcompletion/complete} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A successful response from the server for a {@link CompleteRequestcompletion/complete} request.",
/// "type": "object",
/// "required": [
/// "id",
/// "jsonrpc",
/// "result"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/$defs/RequestId"
/// },
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "result": {
/// "$ref": "#/$defs/CompleteResult"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CompleteResultResponse {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub result: CompleteResult,
}
///`ContentBlock`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/TextContent"
/// },
/// {
/// "$ref": "#/$defs/ImageContent"
/// },
/// {
/// "$ref": "#/$defs/AudioContent"
/// },
/// {
/// "$ref": "#/$defs/ResourceLink"
/// },
/// {
/// "$ref": "#/$defs/EmbeddedResource"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum ContentBlock {
TextContent(TextContent),
ImageContent(ImageContent),
AudioContent(AudioContent),
ResourceLink(ResourceLink),
EmbeddedResource(EmbeddedResource),
}
impl ::core::convert::From<TextContent> for ContentBlock {
fn from(value: TextContent) -> Self {
Self::TextContent(value)
}
}
impl ::core::convert::From<ImageContent> for ContentBlock {
fn from(value: ImageContent) -> Self {
Self::ImageContent(value)
}
}
impl ::core::convert::From<AudioContent> for ContentBlock {
fn from(value: AudioContent) -> Self {
Self::AudioContent(value)
}
}
impl ::core::convert::From<ResourceLink> for ContentBlock {
fn from(value: ResourceLink) -> Self {
Self::ResourceLink(value)
}
}
impl ::core::convert::From<EmbeddedResource> for ContentBlock {
fn from(value: EmbeddedResource) -> Self {
Self::EmbeddedResource(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.
///
/// <details><summary>JSON schema</summary>
///
/// ```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": [
/// "method",
/// "params"
/// ],
/// "properties": {
/// "method": {
/// "type": "string",
/// "const": "sampling/createMessage"
/// },
/// "params": {
/// "$ref": "#/$defs/CreateMessageRequestParams"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateMessageRequest {
pub method: ::alloc::string::String,
pub params: CreateMessageRequestParams,
}
///Parameters for a `sampling/createMessage` request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for a `sampling/createMessage` request.",
/// "type": "object",
/// "required": [
/// "maxTokens",
/// "messages"
/// ],
/// "properties": {
/// "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\"`. The values `\"thisServer\"` and `\"allServers\"` are deprecated (SEP-2596): servers SHOULD\nomit this field or use `\"none\"`, and SHOULD only use the deprecated values if the client declares\n{@link ClientCapabilities.sampling.context}.",
/// "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.",
/// "$ref": "#/$defs/JSONObject"
/// },
/// "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"
/// },
/// "temperature": {
/// "type": "number"
/// },
/// "toolChoice": {
/// "description": "Controls how the model uses tools.\nThe client MUST return an error if this field is provided but {@link 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 {@link ClientCapabilities.sampling.tools} is not declared.",
/// "type": "array",
/// "items": {
/// "$ref": "#/$defs/Tool"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[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"`. The values `"thisServer"` and `"allServers"` are deprecated (SEP-2596): servers SHOULD
omit this field or use `"none"`, and SHOULD only use the deprecated values if the client declares
{@link ClientCapabilities.sampling.context}.*/
#[serde(
rename = "includeContext",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub include_context: ::core::option::Option<CreateMessageRequestParamsIncludeContext>,
/**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: ::alloc::vec::Vec<SamplingMessage>,
///Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub metadata: ::core::option::Option<JsonObject>,
///The server's preferences for which model to select. The client MAY ignore these preferences.
#[serde(
rename = "modelPreferences",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub model_preferences: ::core::option::Option<ModelPreferences>,
#[serde(
rename = "stopSequences",
default,
skip_serializing_if = "::alloc::vec::Vec::is_empty"
)]
pub stop_sequences: ::alloc::vec::Vec<::alloc::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 = "::core::option::Option::is_none"
)]
pub system_prompt: ::core::option::Option<::alloc::string::String>,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub temperature: ::core::option::Option<f64>,
/**Controls how the model uses tools.
The client MUST return an error if this field is provided but {@link ClientCapabilities.sampling.tools} is not declared.
Default is `{ mode: "auto" }`.*/
#[serde(
rename = "toolChoice",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub tool_choice: ::core::option::Option<ToolChoice>,
/**Tools that the model may use during generation.
The client MUST return an error if this field is provided but {@link ClientCapabilities.sampling.tools} is not declared.*/
#[serde(default, skip_serializing_if = "::alloc::vec::Vec::is_empty")]
pub tools: ::alloc::vec::Vec<Tool>,
}
/**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"`. The values `"thisServer"` and `"allServers"` are deprecated (SEP-2596): servers SHOULD
omit this field or use `"none"`, and SHOULD only use the deprecated values if the client declares
{@link ClientCapabilities.sampling.context}.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```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\"`. The values `\"thisServer\"` and `\"allServers\"` are deprecated (SEP-2596): servers SHOULD\nomit this field or use `\"none\"`, and SHOULD only use the deprecated values if the client declares\n{@link ClientCapabilities.sampling.context}.",
/// "type": "string",
/// "enum": [
/// "allServers",
/// "none",
/// "thisServer"
/// ]
///}
/// ```
/// </details>
#[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 ::core::fmt::Display for CreateMessageRequestParamsIncludeContext {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match *self {
Self::AllServers => f.write_str("allServers"),
Self::None => f.write_str("none"),
Self::ThisServer => f.write_str("thisServer"),
}
}
}
impl ::core::str::FromStr for CreateMessageRequestParamsIncludeContext {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
match value {
"allServers" => Ok(Self::AllServers),
"none" => Ok(Self::None),
"thisServer" => Ok(Self::ThisServer),
_ => Err("invalid value".into()),
}
}
}
impl ::core::convert::TryFrom<&str> for CreateMessageRequestParamsIncludeContext {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<&::alloc::string::String>
for CreateMessageRequestParamsIncludeContext
{
type Error = self::error::ConversionError;
fn try_from(
value: &::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<::alloc::string::String>
for CreateMessageRequestParamsIncludeContext
{
type Error = self::error::ConversionError;
fn try_from(
value: ::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
/**The result returned by the client for a {@link CreateMessageRequestsampling/createMessage} request.
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.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The result returned by the client for a {@link CreateMessageRequestsampling/createMessage} request.\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": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateMessageResult {
pub content: CreateMessageResultContent,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
///The name of the model that generated the message.
pub model: ::alloc::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 = "::core::option::Option::is_none"
)]
pub stop_reason: ::core::option::Option<::alloc::string::String>,
}
///`CreateMessageResultContent`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/TextContent"
/// },
/// {
/// "$ref": "#/$defs/ImageContent"
/// },
/// {
/// "$ref": "#/$defs/AudioContent"
/// },
/// {
/// "$ref": "#/$defs/ToolUseContent"
/// },
/// {
/// "$ref": "#/$defs/ToolResultContent"
/// },
/// {
/// "type": "array",
/// "items": {
/// "$ref": "#/$defs/SamplingMessageContentBlock"
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum CreateMessageResultContent {
TextContent(TextContent),
ImageContent(ImageContent),
AudioContent(AudioContent),
ToolUseContent(ToolUseContent),
ToolResultContent(ToolResultContent),
Array(::alloc::vec::Vec<SamplingMessageContentBlock>),
}
impl ::core::convert::From<TextContent> for CreateMessageResultContent {
fn from(value: TextContent) -> Self {
Self::TextContent(value)
}
}
impl ::core::convert::From<ImageContent> for CreateMessageResultContent {
fn from(value: ImageContent) -> Self {
Self::ImageContent(value)
}
}
impl ::core::convert::From<AudioContent> for CreateMessageResultContent {
fn from(value: AudioContent) -> Self {
Self::AudioContent(value)
}
}
impl ::core::convert::From<ToolUseContent> for CreateMessageResultContent {
fn from(value: ToolUseContent) -> Self {
Self::ToolUseContent(value)
}
}
impl ::core::convert::From<ToolResultContent> for CreateMessageResultContent {
fn from(value: ToolResultContent) -> Self {
Self::ToolResultContent(value)
}
}
impl ::core::convert::From<::alloc::vec::Vec<SamplingMessageContentBlock>>
for CreateMessageResultContent
{
fn from(value: ::alloc::vec::Vec<SamplingMessageContentBlock>) -> Self {
Self::Array(value)
}
}
///An opaque token used to represent a cursor for pagination.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "An opaque token used to represent a cursor for pagination.",
/// "type": "string"
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct Cursor(pub ::alloc::string::String);
impl ::core::ops::Deref for Cursor {
type Target = ::alloc::string::String;
fn deref(&self) -> &::alloc::string::String {
&self.0
}
}
impl ::core::convert::From<Cursor> for ::alloc::string::String {
fn from(value: Cursor) -> Self {
value.0
}
}
impl ::core::convert::From<::alloc::string::String> for Cursor {
fn from(value: ::alloc::string::String) -> Self {
Self(value)
}
}
impl ::core::str::FromStr for Cursor {
type Err = ::core::convert::Infallible;
fn from_str(value: &str) -> ::core::result::Result<Self, Self::Err> {
Ok(Self(value.to_string()))
}
}
impl ::core::fmt::Display for Cursor {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
self.0.fmt(f)
}
}
/**A request from the client asking the server to advertise its supported
protocol versions, capabilities, and other metadata. Servers **MUST**
implement `server/discover`. Clients **MAY** call it but are not required
to — version negotiation can also happen inline via per-request `_meta`.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A request from the client asking the server to advertise its supported\nprotocol versions, capabilities, and other metadata. Servers **MUST**\nimplement `server/discover`. Clients **MAY** call it but are not required\nto — version negotiation can also happen inline via per-request `_meta`.",
/// "type": "object",
/// "required": [
/// "id",
/// "jsonrpc",
/// "method",
/// "params"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/$defs/RequestId"
/// },
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "method": {
/// "type": "string",
/// "const": "server/discover"
/// },
/// "params": {
/// "$ref": "#/$defs/RequestParams"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DiscoverRequest {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
pub params: RequestParams,
}
///The result returned by the server for a {@link DiscoverRequestserver/discover} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The result returned by the server for a {@link DiscoverRequestserver/discover} request.",
/// "type": "object",
/// "required": [
/// "capabilities",
/// "resultType",
/// "serverInfo",
/// "supportedVersions"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "capabilities": {
/// "description": "The capabilities of the server.",
/// "$ref": "#/$defs/ServerCapabilities"
/// },
/// "instructions": {
/// "description": "Natural-language guidance describing the server and its features.\n\nThis can be used by clients to improve an LLM's understanding of\navailable tools (e.g., by including it in a system prompt). It should\nfocus on information that helps the model use the server effectively\nand should not duplicate information already in tool descriptions.",
/// "type": "string"
/// },
/// "resultType": {
/// "description": "Indicates the type of the result, which allows the client to determine\nhow to parse the result object.\n\nServers implementing this protocol version MUST include this field.\nFor backward compatibility, when a client receives a result from a\nserver implementing an earlier protocol version (which does not include\n`resultType`), the client MUST treat the absent field as `\"complete\"`.",
/// "type": "string"
/// },
/// "serverInfo": {
/// "description": "Information about the server software implementation.",
/// "$ref": "#/$defs/Implementation"
/// },
/// "supportedVersions": {
/// "description": "MCP Protocol Versions this server supports. The client should choose a\nversion from this list for use in subsequent requests.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DiscoverResult {
///The capabilities of the server.
pub capabilities: ServerCapabilities,
/**Natural-language guidance describing the server and its features.
This can be used by clients to improve an LLM's understanding of
available tools (e.g., by including it in a system prompt). It should
focus on information that helps the model use the server effectively
and should not duplicate information already in tool descriptions.*/
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub instructions: ::core::option::Option<::alloc::string::String>,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
/**Indicates the type of the result, which allows the client to determine
how to parse the result object.
Servers implementing this protocol version MUST include this field.
For backward compatibility, when a client receives a result from a
server implementing an earlier protocol version (which does not include
`resultType`), the client MUST treat the absent field as `"complete"`.*/
#[serde(rename = "resultType")]
pub result_type: ::alloc::string::String,
///Information about the server software implementation.
#[serde(rename = "serverInfo")]
pub server_info: Implementation,
/**MCP Protocol Versions this server supports. The client should choose a
version from this list for use in subsequent requests.*/
#[serde(rename = "supportedVersions")]
pub supported_versions: ::alloc::vec::Vec<::alloc::string::String>,
}
///A successful response from the server for a {@link DiscoverRequestserver/discover} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A successful response from the server for a {@link DiscoverRequestserver/discover} request.",
/// "type": "object",
/// "required": [
/// "id",
/// "jsonrpc",
/// "result"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/$defs/RequestId"
/// },
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "result": {
/// "$ref": "#/$defs/DiscoverResult"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DiscoverResultResponse {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub result: DiscoverResult,
}
///A request from the server to elicit additional information from the user via the client.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A request from the server to elicit additional information from the user via the client.",
/// "type": "object",
/// "required": [
/// "method",
/// "params"
/// ],
/// "properties": {
/// "method": {
/// "type": "string",
/// "const": "elicitation/create"
/// },
/// "params": {
/// "$ref": "#/$defs/ElicitRequestParams"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ElicitRequest {
pub method: ::alloc::string::String,
pub params: ElicitRequestParams,
}
///The parameters for a request to elicit non-sensitive information from the user via a form in the client.
///
/// <details><summary>JSON schema</summary>
///
/// ```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": {
/// "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"
/// }
/// },
/// "additionalProperties": {}
/// }
/// }
///}
/// ```
/// </details>
#[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: ::alloc::string::String,
///The elicitation mode.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub mode: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "requestedSchema")]
pub requested_schema: ElicitRequestFormParamsRequestedSchema,
}
/**A restricted subset of JSON Schema.
Only top-level properties are allowed, without nesting.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// },
/// "additionalProperties": {}
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ElicitRequestFormParamsRequestedSchema {
pub properties:
::alloc::collections::BTreeMap<::alloc::string::String, PrimitiveSchemaDefinition>,
#[serde(default, skip_serializing_if = "::alloc::vec::Vec::is_empty")]
pub required: ::alloc::vec::Vec<::alloc::string::String>,
#[serde(
rename = "$schema",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub schema: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
#[serde(flatten)]
pub extra: ::serde_json::Map<::alloc::string::String, ::serde_json::Value>,
}
///The parameters for a request to elicit additional information from the user via the client.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The parameters for a request to elicit additional information from the user via the client.",
/// "anyOf": [
/// {
/// "$ref": "#/$defs/ElicitRequestFormParams"
/// },
/// {
/// "$ref": "#/$defs/ElicitRequestURLParams"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum ElicitRequestParams {
FormParams(ElicitRequestFormParams),
UrlParams(ElicitRequestUrlParams),
}
impl ::core::convert::From<ElicitRequestFormParams> for ElicitRequestParams {
fn from(value: ElicitRequestFormParams) -> Self {
Self::FormParams(value)
}
}
impl ::core::convert::From<ElicitRequestUrlParams> for ElicitRequestParams {
fn from(value: ElicitRequestUrlParams) -> Self {
Self::UrlParams(value)
}
}
///The parameters for a request to elicit information from the user via a URL in the client.
///
/// <details><summary>JSON schema</summary>
///
/// ```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": {
/// "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"
/// },
/// "url": {
/// "description": "The URL that the user should navigate to.",
/// "type": "string",
/// "format": "uri"
/// }
/// }
///}
/// ```
/// </details>
#[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: ::alloc::string::String,
///The message to present to the user explaining why the interaction is needed.
pub message: ::alloc::string::String,
///The elicitation mode.
pub mode: ::alloc::string::String,
///The URL that the user should navigate to.
pub url: ::alloc::string::String,
}
///The result returned by the client for an {@link ElicitRequestelicitation/create} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The result returned by the client for an {@link ElicitRequestelicitation/create} request.",
/// "type": "object",
/// "required": [
/// "action"
/// ],
/// "properties": {
/// "action": {
/// "description": "The user action in response to the elicitation.\n- `\"accept\"`: User submitted the form/confirmed the action\n- `\"decline\"`: User explicitly declined 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"
/// ]
/// }
/// ]
/// }
/// }
/// }
///}
/// ```
/// </details>
#[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 declined 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 = ":: alloc :: collections :: BTreeMap::is_empty"
)]
pub content: ::alloc::collections::BTreeMap<::alloc::string::String, ElicitResultContentValue>,
}
/**The user action in response to the elicitation.
- `"accept"`: User submitted the form/confirmed the action
- `"decline"`: User explicitly declined the action
- `"cancel"`: User dismissed without making an explicit choice*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The user action in response to the elicitation.\n- `\"accept\"`: User submitted the form/confirmed the action\n- `\"decline\"`: User explicitly declined the action\n- `\"cancel\"`: User dismissed without making an explicit choice",
/// "type": "string",
/// "enum": [
/// "accept",
/// "cancel",
/// "decline"
/// ]
///}
/// ```
/// </details>
#[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 ::core::fmt::Display for ElicitResultAction {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match *self {
Self::Accept => f.write_str("accept"),
Self::Cancel => f.write_str("cancel"),
Self::Decline => f.write_str("decline"),
}
}
}
impl ::core::str::FromStr for ElicitResultAction {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
match value {
"accept" => Ok(Self::Accept),
"cancel" => Ok(Self::Cancel),
"decline" => Ok(Self::Decline),
_ => Err("invalid value".into()),
}
}
}
impl ::core::convert::TryFrom<&str> for ElicitResultAction {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<&::alloc::string::String> for ElicitResultAction {
type Error = self::error::ConversionError;
fn try_from(
value: &::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<::alloc::string::String> for ElicitResultAction {
type Error = self::error::ConversionError;
fn try_from(
value: ::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`ElicitResultContentValue`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// {
/// "type": [
/// "string",
/// "integer",
/// "boolean"
/// ]
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum ElicitResultContentValue {
Variant0(::alloc::vec::Vec<::alloc::string::String>),
Variant1(ElicitResultContentValueVariant1),
}
impl ::core::convert::From<::alloc::vec::Vec<::alloc::string::String>>
for ElicitResultContentValue
{
fn from(value: ::alloc::vec::Vec<::alloc::string::String>) -> Self {
Self::Variant0(value)
}
}
impl ::core::convert::From<ElicitResultContentValueVariant1> for ElicitResultContentValue {
fn from(value: ElicitResultContentValueVariant1) -> Self {
Self::Variant1(value)
}
}
///`ElicitResultContentValueVariant1`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": [
/// "string",
/// "integer",
/// "boolean"
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum ElicitResultContentValueVariant1 {
Boolean(bool),
String(::alloc::string::String),
Integer(i64),
}
impl ::core::fmt::Display for ElicitResultContentValueVariant1 {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::Boolean(x) => x.fmt(f),
Self::String(x) => x.fmt(f),
Self::Integer(x) => x.fmt(f),
}
}
}
impl ::core::convert::From<bool> for ElicitResultContentValueVariant1 {
fn from(value: bool) -> Self {
Self::Boolean(value)
}
}
impl ::core::convert::From<i64> for ElicitResultContentValueVariant1 {
fn from(value: i64) -> Self {
Self::Integer(value)
}
}
///An optional notification from the server to the client, informing it of a completion of a out-of-band elicitation request.
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ElicitationCompleteNotification {
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
pub params: ElicitationCompleteNotificationParams,
}
///`ElicitationCompleteNotificationParams`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "elicitationId"
/// ],
/// "properties": {
/// "elicitationId": {
/// "description": "The ID of the elicitation that completed.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ElicitationCompleteNotificationParams {
///The ID of the elicitation that completed.
#[serde(rename = "elicitationId")]
pub elicitation_id: ::alloc::string::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.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```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": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "annotations": {
/// "description": "Optional annotations for the client.",
/// "$ref": "#/$defs/Annotations"
/// },
/// "resource": {
/// "anyOf": [
/// {
/// "$ref": "#/$defs/TextResourceContents"
/// },
/// {
/// "$ref": "#/$defs/BlobResourceContents"
/// }
/// ]
/// },
/// "type": {
/// "type": "string",
/// "const": "resource"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct EmbeddedResource {
///Optional annotations for the client.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub annotations: ::core::option::Option<Annotations>,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
pub resource: EmbeddedResourceResource,
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
}
///`EmbeddedResourceResource`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/TextResourceContents"
/// },
/// {
/// "$ref": "#/$defs/BlobResourceContents"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum EmbeddedResourceResource {
TextResourceContents(TextResourceContents),
BlobResourceContents(BlobResourceContents),
}
impl ::core::convert::From<TextResourceContents> for EmbeddedResourceResource {
fn from(value: TextResourceContents) -> Self {
Self::TextResourceContents(value)
}
}
impl ::core::convert::From<BlobResourceContents> for EmbeddedResourceResource {
fn from(value: BlobResourceContents) -> Self {
Self::BlobResourceContents(value)
}
}
///Common result fields.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Common result fields.",
/// "$ref": "#/$defs/Result"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct EmptyResult(pub Result);
impl ::core::ops::Deref for EmptyResult {
type Target = Result;
fn deref(&self) -> &Result {
&self.0
}
}
impl ::core::convert::From<EmptyResult> for Result {
fn from(value: EmptyResult) -> Self {
value.0
}
}
impl ::core::convert::From<Result> for EmptyResult {
fn from(value: Result) -> Self {
Self(value)
}
}
///`EnumSchema`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/UntitledSingleSelectEnumSchema"
/// },
/// {
/// "$ref": "#/$defs/TitledSingleSelectEnumSchema"
/// },
/// {
/// "$ref": "#/$defs/UntitledMultiSelectEnumSchema"
/// },
/// {
/// "$ref": "#/$defs/TitledMultiSelectEnumSchema"
/// },
/// {
/// "$ref": "#/$defs/LegacyTitledEnumSchema"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct EnumSchema {
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_0: ::core::option::Option<UntitledSingleSelectEnumSchema>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_1: ::core::option::Option<TitledSingleSelectEnumSchema>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_2: ::core::option::Option<UntitledMultiSelectEnumSchema>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_3: ::core::option::Option<TitledMultiSelectEnumSchema>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_4: ::core::option::Option<LegacyTitledEnumSchema>,
}
impl ::core::default::Default for EnumSchema {
fn default() -> Self {
Self {
subtype_0: Default::default(),
subtype_1: Default::default(),
subtype_2: Default::default(),
subtype_3: Default::default(),
subtype_4: Default::default(),
}
}
}
///`Error`
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Error {
///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 = "::core::option::Option::is_none")]
pub data: ::core::option::Option<::serde_json::Value>,
///A short description of the error. The message SHOULD be limited to a concise single sentence.
pub message: ::alloc::string::String,
}
///Used by the client to get a prompt provided by the server.
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetPromptRequest {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
pub params: GetPromptRequestParams,
}
///Parameters for a `prompts/get` request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for a `prompts/get` request.",
/// "type": "object",
/// "required": [
/// "_meta",
/// "name"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/RequestMetaObject"
/// },
/// "arguments": {
/// "description": "Arguments to use for templating the prompt.",
/// "type": "object",
/// "additionalProperties": {
/// "type": "string"
/// }
/// },
/// "inputResponses": {
/// "$ref": "#/$defs/InputResponses"
/// },
/// "name": {
/// "description": "The name of the prompt or prompt template.",
/// "type": "string"
/// },
/// "requestState": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetPromptRequestParams {
///Arguments to use for templating the prompt.
#[serde(
default,
skip_serializing_if = ":: alloc :: collections :: BTreeMap::is_empty"
)]
pub arguments: ::alloc::collections::BTreeMap<::alloc::string::String, ::alloc::string::String>,
#[serde(
rename = "inputResponses",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub input_responses: ::core::option::Option<InputResponses>,
#[serde(rename = "_meta")]
pub meta: RequestMetaObject,
///The name of the prompt or prompt template.
pub name: ::alloc::string::String,
#[serde(
rename = "requestState",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub request_state: ::core::option::Option<::alloc::string::String>,
}
///The result returned by the server for a {@link GetPromptRequestprompts/get} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The result returned by the server for a {@link GetPromptRequestprompts/get} request.",
/// "type": "object",
/// "required": [
/// "messages",
/// "resultType"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "description": {
/// "description": "An optional description for the prompt.",
/// "type": "string"
/// },
/// "messages": {
/// "type": "array",
/// "items": {
/// "$ref": "#/$defs/PromptMessage"
/// }
/// },
/// "resultType": {
/// "description": "Indicates the type of the result, which allows the client to determine\nhow to parse the result object.\n\nServers implementing this protocol version MUST include this field.\nFor backward compatibility, when a client receives a result from a\nserver implementing an earlier protocol version (which does not include\n`resultType`), the client MUST treat the absent field as `\"complete\"`.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetPromptResult {
///An optional description for the prompt.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub description: ::core::option::Option<::alloc::string::String>,
pub messages: ::alloc::vec::Vec<PromptMessage>,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
/**Indicates the type of the result, which allows the client to determine
how to parse the result object.
Servers implementing this protocol version MUST include this field.
For backward compatibility, when a client receives a result from a
server implementing an earlier protocol version (which does not include
`resultType`), the client MUST treat the absent field as `"complete"`.*/
#[serde(rename = "resultType")]
pub result_type: ::alloc::string::String,
}
///A successful response from the server for a {@link GetPromptRequestprompts/get} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A successful response from the server for a {@link GetPromptRequestprompts/get} request.",
/// "type": "object",
/// "required": [
/// "id",
/// "jsonrpc",
/// "result"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/$defs/RequestId"
/// },
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "result": {
/// "anyOf": [
/// {
/// "$ref": "#/$defs/InputRequiredResult"
/// },
/// {
/// "$ref": "#/$defs/GetPromptResult"
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetPromptResultResponse {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub result: GetPromptResultResponseResult,
}
///`GetPromptResultResponseResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/InputRequiredResult"
/// },
/// {
/// "$ref": "#/$defs/GetPromptResult"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum GetPromptResultResponseResult {
InputRequiredResult(InputRequiredResult),
GetPromptResult(GetPromptResult),
}
impl ::core::convert::From<InputRequiredResult> for GetPromptResultResponseResult {
fn from(value: InputRequiredResult) -> Self {
Self::InputRequiredResult(value)
}
}
impl ::core::convert::From<GetPromptResult> for GetPromptResultResponseResult {
fn from(value: GetPromptResult) -> Self {
Self::GetPromptResult(value)
}
}
///An optionally-sized icon that can be displayed in a user interface.
///
/// <details><summary>JSON schema</summary>
///
/// ```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\n`data:` URI with Base64-encoded image data.\n\nConsumers SHOULD take 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"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[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 = "::core::option::Option::is_none"
)]
pub mime_type: ::core::option::Option<::alloc::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 = "::alloc::vec::Vec::is_empty")]
pub sizes: ::alloc::vec::Vec<::alloc::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 take 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: ::alloc::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 = "::core::option::Option::is_none")]
pub theme: ::core::option::Option<IconTheme>,
}
/**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.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// ]
///}
/// ```
/// </details>
#[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 ::core::fmt::Display for IconTheme {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match *self {
Self::Dark => f.write_str("dark"),
Self::Light => f.write_str("light"),
}
}
}
impl ::core::str::FromStr for IconTheme {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
match value {
"dark" => Ok(Self::Dark),
"light" => Ok(Self::Light),
_ => Err("invalid value".into()),
}
}
}
impl ::core::convert::TryFrom<&str> for IconTheme {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<&::alloc::string::String> for IconTheme {
type Error = self::error::ConversionError;
fn try_from(
value: &::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<::alloc::string::String> for IconTheme {
type Error = self::error::ConversionError;
fn try_from(
value: ::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Base interface to add `icons` property.
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
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 = "::alloc::vec::Vec::is_empty")]
pub icons: ::alloc::vec::Vec<Icon>,
}
impl ::core::default::Default for Icons {
fn default() -> Self {
Self {
icons: Default::default(),
}
}
}
///An image provided to or from an LLM.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "An image provided to or from an LLM.",
/// "type": "object",
/// "required": [
/// "data",
/// "mimeType",
/// "type"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ImageContent {
///Optional annotations for the client.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub annotations: ::core::option::Option<Annotations>,
///The base64-encoded image data.
pub data: ::alloc::string::String,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
///The MIME type of the image. Different providers may support different image types.
#[serde(rename = "mimeType")]
pub mime_type: ::alloc::string::String,
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
}
///Describes the MCP implementation.
///
/// <details><summary>JSON schema</summary>
///
/// ```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 {@link Tool},\nwhere `annotations.title` should be given precedence over using `name`,\nif present).",
/// "type": "string"
/// },
/// "version": {
/// "description": "The version of this implementation.",
/// "type": "string"
/// },
/// "websiteUrl": {
/// "description": "An optional URL of the website for this implementation.",
/// "type": "string",
/// "format": "uri"
/// }
/// }
///}
/// ```
/// </details>
#[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 = "::core::option::Option::is_none")]
pub description: ::core::option::Option<::alloc::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 = "::alloc::vec::Vec::is_empty")]
pub icons: ::alloc::vec::Vec<Icon>,
///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
pub name: ::alloc::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 {@link Tool},
where `annotations.title` should be given precedence over using `name`,
if present).*/
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub title: ::core::option::Option<::alloc::string::String>,
///The version of this implementation.
pub version: ::alloc::string::String,
///An optional URL of the website for this implementation.
#[serde(
rename = "websiteUrl",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub website_url: ::core::option::Option<::alloc::string::String>,
}
///`InputRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/CreateMessageRequest"
/// },
/// {
/// "$ref": "#/$defs/ListRootsRequest"
/// },
/// {
/// "$ref": "#/$defs/ElicitRequest"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum InputRequest {
CreateMessageRequest(CreateMessageRequest),
ListRootsRequest(ListRootsRequest),
ElicitRequest(ElicitRequest),
}
impl ::core::convert::From<CreateMessageRequest> for InputRequest {
fn from(value: CreateMessageRequest) -> Self {
Self::CreateMessageRequest(value)
}
}
impl ::core::convert::From<ListRootsRequest> for InputRequest {
fn from(value: ListRootsRequest) -> Self {
Self::ListRootsRequest(value)
}
}
impl ::core::convert::From<ElicitRequest> for InputRequest {
fn from(value: ElicitRequest) -> Self {
Self::ElicitRequest(value)
}
}
/**A map of server-initiated requests that the client must fulfill.
Keys are server-assigned identifiers; values are the request objects.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A map of server-initiated requests that the client must fulfill.\nKeys are server-assigned identifiers; values are the request objects.",
/// "type": "object",
/// "additionalProperties": {
/// "$ref": "#/$defs/InputRequest"
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct InputRequests(pub ::alloc::collections::BTreeMap<::alloc::string::String, InputRequest>);
impl ::core::ops::Deref for InputRequests {
type Target = ::alloc::collections::BTreeMap<::alloc::string::String, InputRequest>;
fn deref(&self) -> &::alloc::collections::BTreeMap<::alloc::string::String, InputRequest> {
&self.0
}
}
impl ::core::convert::From<InputRequests>
for ::alloc::collections::BTreeMap<::alloc::string::String, InputRequest>
{
fn from(value: InputRequests) -> Self {
value.0
}
}
impl ::core::convert::From<::alloc::collections::BTreeMap<::alloc::string::String, InputRequest>>
for InputRequests
{
fn from(value: ::alloc::collections::BTreeMap<::alloc::string::String, InputRequest>) -> Self {
Self(value)
}
}
/**An InputRequiredResult sent by the server to indicate that additional input is needed
before the request can be completed.
At least one of `inputRequests` or `requestState` MUST be present.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "An InputRequiredResult sent by the server to indicate that additional input is needed\nbefore the request can be completed.\n\nAt least one of `inputRequests` or `requestState` MUST be present.",
/// "type": "object",
/// "required": [
/// "resultType"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "inputRequests": {
/// "$ref": "#/$defs/InputRequests"
/// },
/// "requestState": {
/// "type": "string"
/// },
/// "resultType": {
/// "description": "Indicates the type of the result, which allows the client to determine\nhow to parse the result object.\n\nServers implementing this protocol version MUST include this field.\nFor backward compatibility, when a client receives a result from a\nserver implementing an earlier protocol version (which does not include\n`resultType`), the client MUST treat the absent field as `\"complete\"`.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InputRequiredResult {
#[serde(
rename = "inputRequests",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub input_requests: ::core::option::Option<InputRequests>,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
#[serde(
rename = "requestState",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub request_state: ::core::option::Option<::alloc::string::String>,
/**Indicates the type of the result, which allows the client to determine
how to parse the result object.
Servers implementing this protocol version MUST include this field.
For backward compatibility, when a client receives a result from a
server implementing an earlier protocol version (which does not include
`resultType`), the client MUST treat the absent field as `"complete"`.*/
#[serde(rename = "resultType")]
pub result_type: ::alloc::string::String,
}
///`InputResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/CreateMessageResult"
/// },
/// {
/// "$ref": "#/$defs/ListRootsResult"
/// },
/// {
/// "$ref": "#/$defs/ElicitResult"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum InputResponse {
CreateMessageResult(CreateMessageResult),
ListRootsResult(ListRootsResult),
ElicitResult(ElicitResult),
}
impl ::core::convert::From<CreateMessageResult> for InputResponse {
fn from(value: CreateMessageResult) -> Self {
Self::CreateMessageResult(value)
}
}
impl ::core::convert::From<ListRootsResult> for InputResponse {
fn from(value: ListRootsResult) -> Self {
Self::ListRootsResult(value)
}
}
impl ::core::convert::From<ElicitResult> for InputResponse {
fn from(value: ElicitResult) -> Self {
Self::ElicitResult(value)
}
}
///`InputResponseRequestParams`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "_meta"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/RequestMetaObject"
/// },
/// "inputResponses": {
/// "$ref": "#/$defs/InputResponses"
/// },
/// "requestState": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InputResponseRequestParams {
#[serde(
rename = "inputResponses",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub input_responses: ::core::option::Option<InputResponses>,
#[serde(rename = "_meta")]
pub meta: RequestMetaObject,
#[serde(
rename = "requestState",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub request_state: ::core::option::Option<::alloc::string::String>,
}
/**A map of client responses to server-initiated requests.
Keys correspond to the keys in the {@link InputRequests} map;
values are the client's result for each request.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A map of client responses to server-initiated requests.\nKeys correspond to the keys in the {@link InputRequests} map;\nvalues are the client's result for each request.",
/// "type": "object",
/// "additionalProperties": {
/// "$ref": "#/$defs/InputResponse"
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct InputResponses(
pub ::alloc::collections::BTreeMap<::alloc::string::String, InputResponse>,
);
impl ::core::ops::Deref for InputResponses {
type Target = ::alloc::collections::BTreeMap<::alloc::string::String, InputResponse>;
fn deref(&self) -> &::alloc::collections::BTreeMap<::alloc::string::String, InputResponse> {
&self.0
}
}
impl ::core::convert::From<InputResponses>
for ::alloc::collections::BTreeMap<::alloc::string::String, InputResponse>
{
fn from(value: InputResponses) -> Self {
value.0
}
}
impl ::core::convert::From<::alloc::collections::BTreeMap<::alloc::string::String, InputResponse>>
for InputResponses
{
fn from(value: ::alloc::collections::BTreeMap<::alloc::string::String, InputResponse>) -> Self {
Self(value)
}
}
///A JSON-RPC error indicating that an internal error occurred on the receiver. This error is returned when the receiver encounters an unexpected condition that prevents it from fulfilling the request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A JSON-RPC error indicating that an internal error occurred on the receiver. This error is returned when the receiver encounters an unexpected condition that prevents it from fulfilling the request.",
/// "type": "object",
/// "required": [
/// "code",
/// "message"
/// ],
/// "properties": {
/// "code": {
/// "description": "The error type that occurred.",
/// "type": "integer",
/// "const": -32603
/// },
/// "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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InternalError {
///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 = "::core::option::Option::is_none")]
pub data: ::core::option::Option<::serde_json::Value>,
///A short description of the error. The message SHOULD be limited to a concise single sentence.
pub message: ::alloc::string::String,
}
/**A JSON-RPC error indicating that the method parameters are invalid or malformed.
In MCP, this error is returned in various contexts when request parameters fail validation:
- **Tools**: Unknown tool name or invalid tool arguments
- **Prompts**: Unknown prompt name or missing required arguments
- **Pagination**: Invalid or expired cursor values
- **Logging**: Invalid log level
- **Elicitation**: Server requests an elicitation mode not declared in client capabilities
- **Sampling**: Missing tool result or tool results mixed with other content*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A JSON-RPC error indicating that the method parameters are invalid or malformed.\n\nIn MCP, this error is returned in various contexts when request parameters fail validation:\n\n- **Tools**: Unknown tool name or invalid tool arguments\n- **Prompts**: Unknown prompt name or missing required arguments\n- **Pagination**: Invalid or expired cursor values\n- **Logging**: Invalid log level\n- **Elicitation**: Server requests an elicitation mode not declared in client capabilities\n- **Sampling**: Missing tool result or tool results mixed with other content",
/// "type": "object",
/// "required": [
/// "code",
/// "message"
/// ],
/// "properties": {
/// "code": {
/// "description": "The error type that occurred.",
/// "type": "integer",
/// "const": -32602
/// },
/// "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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InvalidParamsError {
///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 = "::core::option::Option::is_none")]
pub data: ::core::option::Option<::serde_json::Value>,
///A short description of the error. The message SHOULD be limited to a concise single sentence.
pub message: ::alloc::string::String,
}
///A JSON-RPC error indicating that the request is not a valid request object. This error is returned when the message structure does not conform to the JSON-RPC 2.0 specification requirements for a request (e.g., missing required fields like `jsonrpc` or `method`, or using invalid types for these fields).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A JSON-RPC error indicating that the request is not a valid request object. This error is returned when the message structure does not conform to the JSON-RPC 2.0 specification requirements for a request (e.g., missing required fields like `jsonrpc` or `method`, or using invalid types for these fields).",
/// "type": "object",
/// "required": [
/// "code",
/// "message"
/// ],
/// "properties": {
/// "code": {
/// "description": "The error type that occurred.",
/// "type": "integer",
/// "const": -32600
/// },
/// "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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InvalidRequestError {
///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 = "::core::option::Option::is_none")]
pub data: ::core::option::Option<::serde_json::Value>,
///A short description of the error. The message SHOULD be limited to a concise single sentence.
pub message: ::alloc::string::String,
}
///`JsonArray`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "array",
/// "items": {
/// "$ref": "#/$defs/JSONValue"
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct JsonArray(pub ::alloc::vec::Vec<JsonValue>);
impl ::core::ops::Deref for JsonArray {
type Target = ::alloc::vec::Vec<JsonValue>;
fn deref(&self) -> &::alloc::vec::Vec<JsonValue> {
&self.0
}
}
impl ::core::convert::From<JsonArray> for ::alloc::vec::Vec<JsonValue> {
fn from(value: JsonArray) -> Self {
value.0
}
}
impl ::core::convert::From<::alloc::vec::Vec<JsonValue>> for JsonArray {
fn from(value: ::alloc::vec::Vec<JsonValue>) -> Self {
Self(value)
}
}
///`JsonObject`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "additionalProperties": {
/// "$ref": "#/$defs/JSONValue"
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct JsonObject(pub ::alloc::collections::BTreeMap<::alloc::string::String, JsonValue>);
impl ::core::ops::Deref for JsonObject {
type Target = ::alloc::collections::BTreeMap<::alloc::string::String, JsonValue>;
fn deref(&self) -> &::alloc::collections::BTreeMap<::alloc::string::String, JsonValue> {
&self.0
}
}
impl ::core::convert::From<JsonObject>
for ::alloc::collections::BTreeMap<::alloc::string::String, JsonValue>
{
fn from(value: JsonObject) -> Self {
value.0
}
}
impl ::core::convert::From<::alloc::collections::BTreeMap<::alloc::string::String, JsonValue>>
for JsonObject
{
fn from(value: ::alloc::collections::BTreeMap<::alloc::string::String, JsonValue>) -> Self {
Self(value)
}
}
///`JsonValue`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/JSONObject"
/// },
/// {
/// "type": "array",
/// "items": {
/// "$ref": "#/$defs/JSONValue"
/// }
/// },
/// {
/// "type": [
/// "string",
/// "integer",
/// "boolean"
/// ]
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum JsonValue {
Variant0(JsonObject),
Variant1(::alloc::vec::Vec<JsonValue>),
Variant2(JsonValueVariant2),
}
impl ::core::convert::From<JsonObject> for JsonValue {
fn from(value: JsonObject) -> Self {
Self::Variant0(value)
}
}
impl ::core::convert::From<::alloc::vec::Vec<JsonValue>> for JsonValue {
fn from(value: ::alloc::vec::Vec<JsonValue>) -> Self {
Self::Variant1(value)
}
}
impl ::core::convert::From<JsonValueVariant2> for JsonValue {
fn from(value: JsonValueVariant2) -> Self {
Self::Variant2(value)
}
}
///`JsonValueVariant2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": [
/// "string",
/// "integer",
/// "boolean"
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum JsonValueVariant2 {
Boolean(bool),
String(::alloc::string::String),
Integer(i64),
}
impl ::core::fmt::Display for JsonValueVariant2 {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::Boolean(x) => x.fmt(f),
Self::String(x) => x.fmt(f),
Self::Integer(x) => x.fmt(f),
}
}
}
impl ::core::convert::From<bool> for JsonValueVariant2 {
fn from(value: bool) -> Self {
Self::Boolean(value)
}
}
impl ::core::convert::From<i64> for JsonValueVariant2 {
fn from(value: i64) -> Self {
Self::Integer(value)
}
}
///A response to a request that indicates an error occurred.
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct JsonrpcErrorResponse {
pub error: Error,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub id: ::core::option::Option<RequestId>,
pub jsonrpc: ::alloc::string::String,
}
///Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum JsonrpcMessage {
Request(JsonrpcRequest),
Notification(JsonrpcNotification),
ResultResponse(JsonrpcResultResponse),
ErrorResponse(JsonrpcErrorResponse),
}
impl ::core::convert::From<JsonrpcRequest> for JsonrpcMessage {
fn from(value: JsonrpcRequest) -> Self {
Self::Request(value)
}
}
impl ::core::convert::From<JsonrpcNotification> for JsonrpcMessage {
fn from(value: JsonrpcNotification) -> Self {
Self::Notification(value)
}
}
impl ::core::convert::From<JsonrpcResultResponse> for JsonrpcMessage {
fn from(value: JsonrpcResultResponse) -> Self {
Self::ResultResponse(value)
}
}
impl ::core::convert::From<JsonrpcErrorResponse> for JsonrpcMessage {
fn from(value: JsonrpcErrorResponse) -> Self {
Self::ErrorResponse(value)
}
}
///A notification which does not expect a response.
///
/// <details><summary>JSON schema</summary>
///
/// ```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": {}
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct JsonrpcNotification {
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
#[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
pub params: ::serde_json::Map<::alloc::string::String, ::serde_json::Value>,
}
///A request that expects a response.
///
/// <details><summary>JSON schema</summary>
///
/// ```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": {}
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct JsonrpcRequest {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
#[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
pub params: ::serde_json::Map<::alloc::string::String, ::serde_json::Value>,
}
///A response to a request, containing either the result or error.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A response to a request, containing either the result or error.",
/// "anyOf": [
/// {
/// "$ref": "#/$defs/JSONRPCResultResponse"
/// },
/// {
/// "$ref": "#/$defs/JSONRPCErrorResponse"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum JsonrpcResponse {
ResultResponse(JsonrpcResultResponse),
ErrorResponse(JsonrpcErrorResponse),
}
impl ::core::convert::From<JsonrpcResultResponse> for JsonrpcResponse {
fn from(value: JsonrpcResultResponse) -> Self {
Self::ResultResponse(value)
}
}
impl ::core::convert::From<JsonrpcErrorResponse> for JsonrpcResponse {
fn from(value: JsonrpcErrorResponse) -> Self {
Self::ErrorResponse(value)
}
}
///A successful (non-error) response to a request.
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct JsonrpcResultResponse {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub result: Result,
}
/**Use {@link TitledSingleSelectEnumSchema} instead.
This interface will be removed in a future version.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Use {@link 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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LegacyTitledEnumSchema {
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub default: ::core::option::Option<::alloc::string::String>,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub description: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "enum")]
pub enum_: ::alloc::vec::Vec<::alloc::string::String>,
/**(Legacy) Display names for enum values.
Non-standard according to JSON schema 2020-12.*/
#[serde(
rename = "enumNames",
default,
skip_serializing_if = "::alloc::vec::Vec::is_empty"
)]
pub enum_names: ::alloc::vec::Vec<::alloc::string::String>,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub title: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
}
///Sent from the client to request a list of prompts and prompt templates the server has.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Sent from the client to request a list of prompts and prompt templates the server has.",
/// "type": "object",
/// "required": [
/// "id",
/// "jsonrpc",
/// "method",
/// "params"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/$defs/RequestId"
/// },
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "method": {
/// "type": "string",
/// "const": "prompts/list"
/// },
/// "params": {
/// "$ref": "#/$defs/PaginatedRequestParams"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListPromptsRequest {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
pub params: PaginatedRequestParams,
}
///The result returned by the server for a {@link ListPromptsRequestprompts/list} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The result returned by the server for a {@link ListPromptsRequestprompts/list} request.",
/// "type": "object",
/// "required": [
/// "cacheScope",
/// "prompts",
/// "resultType",
/// "ttlMs"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "cacheScope": {
/// "description": "Indicates the intended scope of the cached response, analogous to HTTP\n`Cache-Control: public` vs `Cache-Control: private`.\n\n- `\"public\"`: Any client or intermediary (e.g., shared gateway, proxy)\n MAY cache the response and serve it to any user.\n- `\"private\"`: Only the requesting user's client MAY cache the response.\n Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached\n copy to a different user.",
/// "type": "string",
/// "enum": [
/// "private",
/// "public"
/// ]
/// },
/// "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"
/// }
/// },
/// "resultType": {
/// "description": "Indicates the type of the result, which allows the client to determine\nhow to parse the result object.\n\nServers implementing this protocol version MUST include this field.\nFor backward compatibility, when a client receives a result from a\nserver implementing an earlier protocol version (which does not include\n`resultType`), the client MUST treat the absent field as `\"complete\"`.",
/// "type": "string"
/// },
/// "ttlMs": {
/// "description": "A hint from the server indicating how long (in milliseconds) the\nclient MAY cache this response before re-fetching. Semantics are\nanalogous to HTTP Cache-Control max-age.\n\n- If 0, The response SHOULD be considered immediately stale,\n The client MAY re-fetch every time the result is needed.\n- If positive, the client SHOULD consider the result fresh for this many\n milliseconds after receiving the response.",
/// "type": "integer",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListPromptsResult {
/**Indicates the intended scope of the cached response, analogous to HTTP
`Cache-Control: public` vs `Cache-Control: private`.
- `"public"`: Any client or intermediary (e.g., shared gateway, proxy)
MAY cache the response and serve it to any user.
- `"private"`: Only the requesting user's client MAY cache the response.
Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached
copy to a different user.*/
#[serde(rename = "cacheScope")]
pub cache_scope: ListPromptsResultCacheScope,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
/**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 = "::core::option::Option::is_none"
)]
pub next_cursor: ::core::option::Option<::alloc::string::String>,
pub prompts: ::alloc::vec::Vec<Prompt>,
/**Indicates the type of the result, which allows the client to determine
how to parse the result object.
Servers implementing this protocol version MUST include this field.
For backward compatibility, when a client receives a result from a
server implementing an earlier protocol version (which does not include
`resultType`), the client MUST treat the absent field as `"complete"`.*/
#[serde(rename = "resultType")]
pub result_type: ::alloc::string::String,
/**A hint from the server indicating how long (in milliseconds) the
client MAY cache this response before re-fetching. Semantics are
analogous to HTTP Cache-Control max-age.
- If 0, The response SHOULD be considered immediately stale,
The client MAY re-fetch every time the result is needed.
- If positive, the client SHOULD consider the result fresh for this many
milliseconds after receiving the response.*/
#[serde(rename = "ttlMs")]
pub ttl_ms: u64,
}
/**Indicates the intended scope of the cached response, analogous to HTTP
`Cache-Control: public` vs `Cache-Control: private`.
- `"public"`: Any client or intermediary (e.g., shared gateway, proxy)
MAY cache the response and serve it to any user.
- `"private"`: Only the requesting user's client MAY cache the response.
Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached
copy to a different user.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Indicates the intended scope of the cached response, analogous to HTTP\n`Cache-Control: public` vs `Cache-Control: private`.\n\n- `\"public\"`: Any client or intermediary (e.g., shared gateway, proxy)\n MAY cache the response and serve it to any user.\n- `\"private\"`: Only the requesting user's client MAY cache the response.\n Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached\n copy to a different user.",
/// "type": "string",
/// "enum": [
/// "private",
/// "public"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ListPromptsResultCacheScope {
#[serde(rename = "private")]
Private,
#[serde(rename = "public")]
Public,
}
impl ::core::fmt::Display for ListPromptsResultCacheScope {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match *self {
Self::Private => f.write_str("private"),
Self::Public => f.write_str("public"),
}
}
}
impl ::core::str::FromStr for ListPromptsResultCacheScope {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
match value {
"private" => Ok(Self::Private),
"public" => Ok(Self::Public),
_ => Err("invalid value".into()),
}
}
}
impl ::core::convert::TryFrom<&str> for ListPromptsResultCacheScope {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<&::alloc::string::String> for ListPromptsResultCacheScope {
type Error = self::error::ConversionError;
fn try_from(
value: &::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<::alloc::string::String> for ListPromptsResultCacheScope {
type Error = self::error::ConversionError;
fn try_from(
value: ::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///A successful response from the server for a {@link ListPromptsRequestprompts/list} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A successful response from the server for a {@link ListPromptsRequestprompts/list} request.",
/// "type": "object",
/// "required": [
/// "id",
/// "jsonrpc",
/// "result"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/$defs/RequestId"
/// },
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "result": {
/// "$ref": "#/$defs/ListPromptsResult"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListPromptsResultResponse {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub result: ListPromptsResult,
}
///Sent from the client to request a list of resource templates the server has.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Sent from the client to request a list of resource templates the server has.",
/// "type": "object",
/// "required": [
/// "id",
/// "jsonrpc",
/// "method",
/// "params"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/$defs/RequestId"
/// },
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "method": {
/// "type": "string",
/// "const": "resources/templates/list"
/// },
/// "params": {
/// "$ref": "#/$defs/PaginatedRequestParams"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListResourceTemplatesRequest {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
pub params: PaginatedRequestParams,
}
///The result returned by the server for a {@link ListResourceTemplatesRequestresources/templates/list} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The result returned by the server for a {@link ListResourceTemplatesRequestresources/templates/list} request.",
/// "type": "object",
/// "required": [
/// "cacheScope",
/// "resourceTemplates",
/// "resultType",
/// "ttlMs"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "cacheScope": {
/// "description": "Indicates the intended scope of the cached response, analogous to HTTP\n`Cache-Control: public` vs `Cache-Control: private`.\n\n- `\"public\"`: Any client or intermediary (e.g., shared gateway, proxy)\n MAY cache the response and serve it to any user.\n- `\"private\"`: Only the requesting user's client MAY cache the response.\n Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached\n copy to a different user.",
/// "type": "string",
/// "enum": [
/// "private",
/// "public"
/// ]
/// },
/// "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"
/// }
/// },
/// "resultType": {
/// "description": "Indicates the type of the result, which allows the client to determine\nhow to parse the result object.\n\nServers implementing this protocol version MUST include this field.\nFor backward compatibility, when a client receives a result from a\nserver implementing an earlier protocol version (which does not include\n`resultType`), the client MUST treat the absent field as `\"complete\"`.",
/// "type": "string"
/// },
/// "ttlMs": {
/// "description": "A hint from the server indicating how long (in milliseconds) the\nclient MAY cache this response before re-fetching. Semantics are\nanalogous to HTTP Cache-Control max-age.\n\n- If 0, The response SHOULD be considered immediately stale,\n The client MAY re-fetch every time the result is needed.\n- If positive, the client SHOULD consider the result fresh for this many\n milliseconds after receiving the response.",
/// "type": "integer",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListResourceTemplatesResult {
/**Indicates the intended scope of the cached response, analogous to HTTP
`Cache-Control: public` vs `Cache-Control: private`.
- `"public"`: Any client or intermediary (e.g., shared gateway, proxy)
MAY cache the response and serve it to any user.
- `"private"`: Only the requesting user's client MAY cache the response.
Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached
copy to a different user.*/
#[serde(rename = "cacheScope")]
pub cache_scope: ListResourceTemplatesResultCacheScope,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
/**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 = "::core::option::Option::is_none"
)]
pub next_cursor: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "resourceTemplates")]
pub resource_templates: ::alloc::vec::Vec<ResourceTemplate>,
/**Indicates the type of the result, which allows the client to determine
how to parse the result object.
Servers implementing this protocol version MUST include this field.
For backward compatibility, when a client receives a result from a
server implementing an earlier protocol version (which does not include
`resultType`), the client MUST treat the absent field as `"complete"`.*/
#[serde(rename = "resultType")]
pub result_type: ::alloc::string::String,
/**A hint from the server indicating how long (in milliseconds) the
client MAY cache this response before re-fetching. Semantics are
analogous to HTTP Cache-Control max-age.
- If 0, The response SHOULD be considered immediately stale,
The client MAY re-fetch every time the result is needed.
- If positive, the client SHOULD consider the result fresh for this many
milliseconds after receiving the response.*/
#[serde(rename = "ttlMs")]
pub ttl_ms: u64,
}
/**Indicates the intended scope of the cached response, analogous to HTTP
`Cache-Control: public` vs `Cache-Control: private`.
- `"public"`: Any client or intermediary (e.g., shared gateway, proxy)
MAY cache the response and serve it to any user.
- `"private"`: Only the requesting user's client MAY cache the response.
Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached
copy to a different user.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Indicates the intended scope of the cached response, analogous to HTTP\n`Cache-Control: public` vs `Cache-Control: private`.\n\n- `\"public\"`: Any client or intermediary (e.g., shared gateway, proxy)\n MAY cache the response and serve it to any user.\n- `\"private\"`: Only the requesting user's client MAY cache the response.\n Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached\n copy to a different user.",
/// "type": "string",
/// "enum": [
/// "private",
/// "public"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ListResourceTemplatesResultCacheScope {
#[serde(rename = "private")]
Private,
#[serde(rename = "public")]
Public,
}
impl ::core::fmt::Display for ListResourceTemplatesResultCacheScope {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match *self {
Self::Private => f.write_str("private"),
Self::Public => f.write_str("public"),
}
}
}
impl ::core::str::FromStr for ListResourceTemplatesResultCacheScope {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
match value {
"private" => Ok(Self::Private),
"public" => Ok(Self::Public),
_ => Err("invalid value".into()),
}
}
}
impl ::core::convert::TryFrom<&str> for ListResourceTemplatesResultCacheScope {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<&::alloc::string::String> for ListResourceTemplatesResultCacheScope {
type Error = self::error::ConversionError;
fn try_from(
value: &::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<::alloc::string::String> for ListResourceTemplatesResultCacheScope {
type Error = self::error::ConversionError;
fn try_from(
value: ::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///A successful response from the server for a {@link ListResourceTemplatesRequestresources/templates/list} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A successful response from the server for a {@link ListResourceTemplatesRequestresources/templates/list} request.",
/// "type": "object",
/// "required": [
/// "id",
/// "jsonrpc",
/// "result"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/$defs/RequestId"
/// },
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "result": {
/// "$ref": "#/$defs/ListResourceTemplatesResult"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListResourceTemplatesResultResponse {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub result: ListResourceTemplatesResult,
}
///Sent from the client to request a list of resources the server has.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Sent from the client to request a list of resources the server has.",
/// "type": "object",
/// "required": [
/// "id",
/// "jsonrpc",
/// "method",
/// "params"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/$defs/RequestId"
/// },
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "method": {
/// "type": "string",
/// "const": "resources/list"
/// },
/// "params": {
/// "$ref": "#/$defs/PaginatedRequestParams"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListResourcesRequest {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
pub params: PaginatedRequestParams,
}
///The result returned by the server for a {@link ListResourcesRequestresources/list} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The result returned by the server for a {@link ListResourcesRequestresources/list} request.",
/// "type": "object",
/// "required": [
/// "cacheScope",
/// "resources",
/// "resultType",
/// "ttlMs"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "cacheScope": {
/// "description": "Indicates the intended scope of the cached response, analogous to HTTP\n`Cache-Control: public` vs `Cache-Control: private`.\n\n- `\"public\"`: Any client or intermediary (e.g., shared gateway, proxy)\n MAY cache the response and serve it to any user.\n- `\"private\"`: Only the requesting user's client MAY cache the response.\n Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached\n copy to a different user.",
/// "type": "string",
/// "enum": [
/// "private",
/// "public"
/// ]
/// },
/// "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"
/// }
/// },
/// "resultType": {
/// "description": "Indicates the type of the result, which allows the client to determine\nhow to parse the result object.\n\nServers implementing this protocol version MUST include this field.\nFor backward compatibility, when a client receives a result from a\nserver implementing an earlier protocol version (which does not include\n`resultType`), the client MUST treat the absent field as `\"complete\"`.",
/// "type": "string"
/// },
/// "ttlMs": {
/// "description": "A hint from the server indicating how long (in milliseconds) the\nclient MAY cache this response before re-fetching. Semantics are\nanalogous to HTTP Cache-Control max-age.\n\n- If 0, The response SHOULD be considered immediately stale,\n The client MAY re-fetch every time the result is needed.\n- If positive, the client SHOULD consider the result fresh for this many\n milliseconds after receiving the response.",
/// "type": "integer",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListResourcesResult {
/**Indicates the intended scope of the cached response, analogous to HTTP
`Cache-Control: public` vs `Cache-Control: private`.
- `"public"`: Any client or intermediary (e.g., shared gateway, proxy)
MAY cache the response and serve it to any user.
- `"private"`: Only the requesting user's client MAY cache the response.
Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached
copy to a different user.*/
#[serde(rename = "cacheScope")]
pub cache_scope: ListResourcesResultCacheScope,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
/**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 = "::core::option::Option::is_none"
)]
pub next_cursor: ::core::option::Option<::alloc::string::String>,
pub resources: ::alloc::vec::Vec<Resource>,
/**Indicates the type of the result, which allows the client to determine
how to parse the result object.
Servers implementing this protocol version MUST include this field.
For backward compatibility, when a client receives a result from a
server implementing an earlier protocol version (which does not include
`resultType`), the client MUST treat the absent field as `"complete"`.*/
#[serde(rename = "resultType")]
pub result_type: ::alloc::string::String,
/**A hint from the server indicating how long (in milliseconds) the
client MAY cache this response before re-fetching. Semantics are
analogous to HTTP Cache-Control max-age.
- If 0, The response SHOULD be considered immediately stale,
The client MAY re-fetch every time the result is needed.
- If positive, the client SHOULD consider the result fresh for this many
milliseconds after receiving the response.*/
#[serde(rename = "ttlMs")]
pub ttl_ms: u64,
}
/**Indicates the intended scope of the cached response, analogous to HTTP
`Cache-Control: public` vs `Cache-Control: private`.
- `"public"`: Any client or intermediary (e.g., shared gateway, proxy)
MAY cache the response and serve it to any user.
- `"private"`: Only the requesting user's client MAY cache the response.
Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached
copy to a different user.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Indicates the intended scope of the cached response, analogous to HTTP\n`Cache-Control: public` vs `Cache-Control: private`.\n\n- `\"public\"`: Any client or intermediary (e.g., shared gateway, proxy)\n MAY cache the response and serve it to any user.\n- `\"private\"`: Only the requesting user's client MAY cache the response.\n Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached\n copy to a different user.",
/// "type": "string",
/// "enum": [
/// "private",
/// "public"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ListResourcesResultCacheScope {
#[serde(rename = "private")]
Private,
#[serde(rename = "public")]
Public,
}
impl ::core::fmt::Display for ListResourcesResultCacheScope {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match *self {
Self::Private => f.write_str("private"),
Self::Public => f.write_str("public"),
}
}
}
impl ::core::str::FromStr for ListResourcesResultCacheScope {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
match value {
"private" => Ok(Self::Private),
"public" => Ok(Self::Public),
_ => Err("invalid value".into()),
}
}
}
impl ::core::convert::TryFrom<&str> for ListResourcesResultCacheScope {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<&::alloc::string::String> for ListResourcesResultCacheScope {
type Error = self::error::ConversionError;
fn try_from(
value: &::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<::alloc::string::String> for ListResourcesResultCacheScope {
type Error = self::error::ConversionError;
fn try_from(
value: ::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///A successful response from the server for a {@link ListResourcesRequestresources/list} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A successful response from the server for a {@link ListResourcesRequestresources/list} request.",
/// "type": "object",
/// "required": [
/// "id",
/// "jsonrpc",
/// "result"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/$defs/RequestId"
/// },
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "result": {
/// "$ref": "#/$defs/ListResourcesResult"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListResourcesResultResponse {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub result: ListResourcesResult,
}
/**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.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```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": [
/// "method"
/// ],
/// "properties": {
/// "method": {
/// "type": "string",
/// "const": "roots/list"
/// },
/// "params": {
/// "$ref": "#/$defs/RequestParams"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListRootsRequest {
pub method: ::alloc::string::String,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub params: ::core::option::Option<RequestParams>,
}
/**The result returned by the client for a {@link ListRootsRequestroots/list} request.
This result contains an array of {@link Root} objects, each representing a root directory
or file that the server can operate on.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The result returned by the client for a {@link ListRootsRequestroots/list} request.\nThis result contains an array of {@link Root} objects, each representing a root directory\nor file that the server can operate on.",
/// "type": "object",
/// "required": [
/// "roots"
/// ],
/// "properties": {
/// "roots": {
/// "type": "array",
/// "items": {
/// "$ref": "#/$defs/Root"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListRootsResult {
pub roots: ::alloc::vec::Vec<Root>,
}
///Sent from the client to request a list of tools the server has.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Sent from the client to request a list of tools the server has.",
/// "type": "object",
/// "required": [
/// "id",
/// "jsonrpc",
/// "method",
/// "params"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/$defs/RequestId"
/// },
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "method": {
/// "type": "string",
/// "const": "tools/list"
/// },
/// "params": {
/// "$ref": "#/$defs/PaginatedRequestParams"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListToolsRequest {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
pub params: PaginatedRequestParams,
}
///The result returned by the server for a {@link ListToolsRequesttools/list} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The result returned by the server for a {@link ListToolsRequesttools/list} request.",
/// "type": "object",
/// "required": [
/// "cacheScope",
/// "resultType",
/// "tools",
/// "ttlMs"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "cacheScope": {
/// "description": "Indicates the intended scope of the cached response, analogous to HTTP\n`Cache-Control: public` vs `Cache-Control: private`.\n\n- `\"public\"`: Any client or intermediary (e.g., shared gateway, proxy)\n MAY cache the response and serve it to any user.\n- `\"private\"`: Only the requesting user's client MAY cache the response.\n Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached\n copy to a different user.",
/// "type": "string",
/// "enum": [
/// "private",
/// "public"
/// ]
/// },
/// "nextCursor": {
/// "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
/// "type": "string"
/// },
/// "resultType": {
/// "description": "Indicates the type of the result, which allows the client to determine\nhow to parse the result object.\n\nServers implementing this protocol version MUST include this field.\nFor backward compatibility, when a client receives a result from a\nserver implementing an earlier protocol version (which does not include\n`resultType`), the client MUST treat the absent field as `\"complete\"`.",
/// "type": "string"
/// },
/// "tools": {
/// "type": "array",
/// "items": {
/// "$ref": "#/$defs/Tool"
/// }
/// },
/// "ttlMs": {
/// "description": "A hint from the server indicating how long (in milliseconds) the\nclient MAY cache this response before re-fetching. Semantics are\nanalogous to HTTP Cache-Control max-age.\n\n- If 0, The response SHOULD be considered immediately stale,\n The client MAY re-fetch every time the result is needed.\n- If positive, the client SHOULD consider the result fresh for this many\n milliseconds after receiving the response.",
/// "type": "integer",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListToolsResult {
/**Indicates the intended scope of the cached response, analogous to HTTP
`Cache-Control: public` vs `Cache-Control: private`.
- `"public"`: Any client or intermediary (e.g., shared gateway, proxy)
MAY cache the response and serve it to any user.
- `"private"`: Only the requesting user's client MAY cache the response.
Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached
copy to a different user.*/
#[serde(rename = "cacheScope")]
pub cache_scope: ListToolsResultCacheScope,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
/**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 = "::core::option::Option::is_none"
)]
pub next_cursor: ::core::option::Option<::alloc::string::String>,
/**Indicates the type of the result, which allows the client to determine
how to parse the result object.
Servers implementing this protocol version MUST include this field.
For backward compatibility, when a client receives a result from a
server implementing an earlier protocol version (which does not include
`resultType`), the client MUST treat the absent field as `"complete"`.*/
#[serde(rename = "resultType")]
pub result_type: ::alloc::string::String,
pub tools: ::alloc::vec::Vec<Tool>,
/**A hint from the server indicating how long (in milliseconds) the
client MAY cache this response before re-fetching. Semantics are
analogous to HTTP Cache-Control max-age.
- If 0, The response SHOULD be considered immediately stale,
The client MAY re-fetch every time the result is needed.
- If positive, the client SHOULD consider the result fresh for this many
milliseconds after receiving the response.*/
#[serde(rename = "ttlMs")]
pub ttl_ms: u64,
}
/**Indicates the intended scope of the cached response, analogous to HTTP
`Cache-Control: public` vs `Cache-Control: private`.
- `"public"`: Any client or intermediary (e.g., shared gateway, proxy)
MAY cache the response and serve it to any user.
- `"private"`: Only the requesting user's client MAY cache the response.
Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached
copy to a different user.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Indicates the intended scope of the cached response, analogous to HTTP\n`Cache-Control: public` vs `Cache-Control: private`.\n\n- `\"public\"`: Any client or intermediary (e.g., shared gateway, proxy)\n MAY cache the response and serve it to any user.\n- `\"private\"`: Only the requesting user's client MAY cache the response.\n Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached\n copy to a different user.",
/// "type": "string",
/// "enum": [
/// "private",
/// "public"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ListToolsResultCacheScope {
#[serde(rename = "private")]
Private,
#[serde(rename = "public")]
Public,
}
impl ::core::fmt::Display for ListToolsResultCacheScope {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match *self {
Self::Private => f.write_str("private"),
Self::Public => f.write_str("public"),
}
}
}
impl ::core::str::FromStr for ListToolsResultCacheScope {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
match value {
"private" => Ok(Self::Private),
"public" => Ok(Self::Public),
_ => Err("invalid value".into()),
}
}
}
impl ::core::convert::TryFrom<&str> for ListToolsResultCacheScope {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<&::alloc::string::String> for ListToolsResultCacheScope {
type Error = self::error::ConversionError;
fn try_from(
value: &::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<::alloc::string::String> for ListToolsResultCacheScope {
type Error = self::error::ConversionError;
fn try_from(
value: ::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///A successful response from the server for a {@link ListToolsRequesttools/list} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A successful response from the server for a {@link ListToolsRequesttools/list} request.",
/// "type": "object",
/// "required": [
/// "id",
/// "jsonrpc",
/// "result"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/$defs/RequestId"
/// },
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "result": {
/// "$ref": "#/$defs/ListToolsResult"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListToolsResultResponse {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub result: ListToolsResult,
}
/**The severity of a log message.
These map to syslog message severities, as specified in RFC-5424:
https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The severity of a log message.\n\nThese map to syslog message severities, as specified in RFC-5424:\nhttps://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1",
/// "type": "string",
/// "enum": [
/// "alert",
/// "critical",
/// "debug",
/// "emergency",
/// "error",
/// "info",
/// "notice",
/// "warning"
/// ]
///}
/// ```
/// </details>
#[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 ::core::fmt::Display for LoggingLevel {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match *self {
Self::Alert => f.write_str("alert"),
Self::Critical => f.write_str("critical"),
Self::Debug => f.write_str("debug"),
Self::Emergency => f.write_str("emergency"),
Self::Error => f.write_str("error"),
Self::Info => f.write_str("info"),
Self::Notice => f.write_str("notice"),
Self::Warning => f.write_str("warning"),
}
}
}
impl ::core::str::FromStr for LoggingLevel {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
match value {
"alert" => Ok(Self::Alert),
"critical" => Ok(Self::Critical),
"debug" => Ok(Self::Debug),
"emergency" => Ok(Self::Emergency),
"error" => Ok(Self::Error),
"info" => Ok(Self::Info),
"notice" => Ok(Self::Notice),
"warning" => Ok(Self::Warning),
_ => Err("invalid value".into()),
}
}
}
impl ::core::convert::TryFrom<&str> for LoggingLevel {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<&::alloc::string::String> for LoggingLevel {
type Error = self::error::ConversionError;
fn try_from(
value: &::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<::alloc::string::String> for LoggingLevel {
type Error = self::error::ConversionError;
fn try_from(
value: ::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///JSONRPCNotification of a log message passed from server to client. The client opts in by setting `"io.modelcontextprotocol/logLevel"` in a request's `_meta`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "JSONRPCNotification of a log message passed from server to client. The client opts in by setting `\"io.modelcontextprotocol/logLevel\"` in a request's `_meta`.",
/// "type": "object",
/// "required": [
/// "jsonrpc",
/// "method",
/// "params"
/// ],
/// "properties": {
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "method": {
/// "type": "string",
/// "const": "notifications/message"
/// },
/// "params": {
/// "$ref": "#/$defs/LoggingMessageNotificationParams"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LoggingMessageNotification {
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
pub params: LoggingMessageNotificationParams,
}
///Parameters for a `notifications/message` notification.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for a `notifications/message` notification.",
/// "type": "object",
/// "required": [
/// "data",
/// "level"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "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"
/// }
/// }
///}
/// ```
/// </details>
#[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 = "::core::option::Option::is_none")]
pub logger: ::core::option::Option<::alloc::string::String>,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
}
/**Represents the contents of a `_meta` field, which clients and servers use to attach additional metadata to their interactions.
Certain key names are reserved by MCP for protocol-level metadata; implementations MUST NOT make assumptions about values at these keys. Additionally, specific schema definitions may reserve particular names for purpose-specific metadata, as declared in those definitions.
Valid keys have two segments:
**Prefix:**
- Optional — if specified, MUST be a series of _labels_ separated by dots (`.`), followed by a slash (`/`).
- Labels MUST start with a letter and end with a letter or digit. Interior characters may be letters, digits, or hyphens (`-`).
- Implementations SHOULD use reverse DNS notation (e.g., `com.example/` rather than `example.com/`).
- Any prefix where the second label is `modelcontextprotocol` or `mcp` is **reserved** for MCP use. For example: `io.modelcontextprotocol/`, `dev.mcp/`, `org.modelcontextprotocol.api/`, and `com.mcp.tools/` are all reserved. However, `com.example.mcp/` is NOT reserved, as the second label is `example`.
**Name:**
- Unless empty, MUST start and end with an alphanumeric character (`[a-z0-9A-Z]`).
- Interior characters may be alphanumeric, hyphens (`-`), underscores (`_`), or dots (`.`).*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Represents the contents of a `_meta` field, which clients and servers use to attach additional metadata to their interactions.\n\nCertain key names are reserved by MCP for protocol-level metadata; implementations MUST NOT make assumptions about values at these keys. Additionally, specific schema definitions may reserve particular names for purpose-specific metadata, as declared in those definitions.\n\nValid keys have two segments:\n\n**Prefix:**\n- Optional — if specified, MUST be a series of _labels_ separated by dots (`.`), followed by a slash (`/`).\n- Labels MUST start with a letter and end with a letter or digit. Interior characters may be letters, digits, or hyphens (`-`).\n- Implementations SHOULD use reverse DNS notation (e.g., `com.example/` rather than `example.com/`).\n- Any prefix where the second label is `modelcontextprotocol` or `mcp` is **reserved** for MCP use. For example: `io.modelcontextprotocol/`, `dev.mcp/`, `org.modelcontextprotocol.api/`, and `com.mcp.tools/` are all reserved. However, `com.example.mcp/` is NOT reserved, as the second label is `example`.\n\n**Name:**\n- Unless empty, MUST start and end with an alphanumeric character (`[a-z0-9A-Z]`).\n- Interior characters may be alphanumeric, hyphens (`-`), underscores (`_`), or dots (`.`).",
/// "type": "object"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct MetaObject(pub ::serde_json::Map<::alloc::string::String, ::serde_json::Value>);
impl ::core::ops::Deref for MetaObject {
type Target = ::serde_json::Map<::alloc::string::String, ::serde_json::Value>;
fn deref(&self) -> &::serde_json::Map<::alloc::string::String, ::serde_json::Value> {
&self.0
}
}
impl ::core::convert::From<MetaObject>
for ::serde_json::Map<::alloc::string::String, ::serde_json::Value>
{
fn from(value: MetaObject) -> Self {
value.0
}
}
impl ::core::convert::From<::serde_json::Map<::alloc::string::String, ::serde_json::Value>>
for MetaObject
{
fn from(value: ::serde_json::Map<::alloc::string::String, ::serde_json::Value>) -> Self {
Self(value)
}
}
/**A JSON-RPC error indicating that the requested method does not exist or is not available.
In MCP, a server returns this error when a client invokes a method the server does not implement — either a genuinely unknown method, or one gated behind a server capability the server did not advertise (e.g., calling `prompts/list` when the `prompts` capability was not advertised).
A request that requires a client capability the client did not declare is signalled instead by {@link MissingRequiredClientCapabilityError} (`-32003`).*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A JSON-RPC error indicating that the requested method does not exist or is not available.\n\nIn MCP, a server returns this error when a client invokes a method the server does not implement — either a genuinely unknown method, or one gated behind a server capability the server did not advertise (e.g., calling `prompts/list` when the `prompts` capability was not advertised).\n\nA request that requires a client capability the client did not declare is signalled instead by {@link MissingRequiredClientCapabilityError} (`-32003`).",
/// "type": "object",
/// "required": [
/// "code",
/// "message"
/// ],
/// "properties": {
/// "code": {
/// "description": "The error type that occurred.",
/// "type": "integer",
/// "const": -32601
/// },
/// "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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MethodNotFoundError {
///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 = "::core::option::Option::is_none")]
pub data: ::core::option::Option<::serde_json::Value>,
///A short description of the error. The message SHOULD be limited to a concise single sentence.
pub message: ::alloc::string::String,
}
/**Returned when processing a request requires a capability the client did not
declare in `clientCapabilities`. For HTTP, the response status code MUST be
`400 Bad Request`.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Returned when processing a request requires a capability the client did not\ndeclare in `clientCapabilities`. For HTTP, the response status code MUST be\n`400 Bad Request`.",
/// "type": "object",
/// "required": [
/// "error",
/// "jsonrpc"
/// ],
/// "properties": {
/// "error": {
/// "type": "object",
/// "required": [
/// "code",
/// "data",
/// "message"
/// ],
/// "properties": {
/// "code": {
/// "type": "integer",
/// "const": -32003
/// },
/// "data": {
/// "type": "object",
/// "required": [
/// "requiredCapabilities"
/// ],
/// "properties": {
/// "requiredCapabilities": {
/// "description": "The capabilities the server requires from the client to process this request.",
/// "$ref": "#/$defs/ClientCapabilities"
/// }
/// }
/// },
/// "message": {
/// "description": "A short description of the error. The message SHOULD be limited to a concise single sentence.",
/// "type": "string"
/// }
/// }
/// },
/// "id": {
/// "$ref": "#/$defs/RequestId"
/// },
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MissingRequiredClientCapabilityError {
pub error: MissingRequiredClientCapabilityErrorError,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub id: ::core::option::Option<RequestId>,
pub jsonrpc: ::alloc::string::String,
}
///`MissingRequiredClientCapabilityErrorError`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "code",
/// "data",
/// "message"
/// ],
/// "properties": {
/// "code": {
/// "type": "integer",
/// "const": -32003
/// },
/// "data": {
/// "type": "object",
/// "required": [
/// "requiredCapabilities"
/// ],
/// "properties": {
/// "requiredCapabilities": {
/// "description": "The capabilities the server requires from the client to process this request.",
/// "$ref": "#/$defs/ClientCapabilities"
/// }
/// }
/// },
/// "message": {
/// "description": "A short description of the error. The message SHOULD be limited to a concise single sentence.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MissingRequiredClientCapabilityErrorError {
pub code: i64,
pub data: MissingRequiredClientCapabilityErrorErrorData,
///A short description of the error. The message SHOULD be limited to a concise single sentence.
pub message: ::alloc::string::String,
}
///`MissingRequiredClientCapabilityErrorErrorData`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "requiredCapabilities"
/// ],
/// "properties": {
/// "requiredCapabilities": {
/// "description": "The capabilities the server requires from the client to process this request.",
/// "$ref": "#/$defs/ClientCapabilities"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MissingRequiredClientCapabilityErrorErrorData {
///The capabilities the server requires from the client to process this request.
#[serde(rename = "requiredCapabilities")]
pub required_capabilities: ClientCapabilities,
}
/**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.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
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 = "::core::option::Option::is_none")]
pub name: ::core::option::Option<::alloc::string::String>,
}
impl ::core::default::Default for ModelHint {
fn default() -> Self {
Self {
name: Default::default(),
}
}
}
/**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.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```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
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ModelPreferences {
/**How much to prioritize cost when selecting a model. A value of 0 means cost
is not important, while a value of 1 means cost is the most important
factor.*/
#[serde(
rename = "costPriority",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub cost_priority: ::core::option::Option<f64>,
/**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 = "::alloc::vec::Vec::is_empty")]
pub hints: ::alloc::vec::Vec<ModelHint>,
/**How much to prioritize intelligence and capabilities when selecting a
model. A value of 0 means intelligence is not important, while a value of 1
means intelligence is the most important factor.*/
#[serde(
rename = "intelligencePriority",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub intelligence_priority: ::core::option::Option<f64>,
/**How much to prioritize sampling speed (latency) when selecting a model. A
value of 0 means speed is not important, while a value of 1 means speed is
the most important factor.*/
#[serde(
rename = "speedPriority",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub speed_priority: ::core::option::Option<f64>,
}
impl ::core::default::Default for ModelPreferences {
fn default() -> Self {
Self {
cost_priority: Default::default(),
hints: Default::default(),
intelligence_priority: Default::default(),
speed_priority: Default::default(),
}
}
}
///`MultiSelectEnumSchema`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/UntitledMultiSelectEnumSchema"
/// },
/// {
/// "$ref": "#/$defs/TitledMultiSelectEnumSchema"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MultiSelectEnumSchema {
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_0: ::core::option::Option<UntitledMultiSelectEnumSchema>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_1: ::core::option::Option<TitledMultiSelectEnumSchema>,
}
impl ::core::default::Default for MultiSelectEnumSchema {
fn default() -> Self {
Self {
subtype_0: Default::default(),
subtype_1: Default::default(),
}
}
}
///`Notification`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "method"
/// ],
/// "properties": {
/// "method": {
/// "type": "string"
/// },
/// "params": {
/// "type": "object",
/// "additionalProperties": {}
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Notification {
pub method: ::alloc::string::String,
#[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
pub params: ::serde_json::Map<::alloc::string::String, ::serde_json::Value>,
}
///Common params for any notification.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Common params for any notification.",
/// "type": "object",
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct NotificationParams {
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
}
impl ::core::default::Default for NotificationParams {
fn default() -> Self {
Self {
meta: Default::default(),
}
}
}
///`NumberSchema`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "default": {
/// "type": "number"
/// },
/// "description": {
/// "type": "string"
/// },
/// "maximum": {
/// "type": "number"
/// },
/// "minimum": {
/// "type": "number"
/// },
/// "title": {
/// "type": "string"
/// },
/// "type": {
/// "type": "string",
/// "enum": [
/// "integer",
/// "number"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct NumberSchema {
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub default: ::core::option::Option<f64>,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub description: ::core::option::Option<::alloc::string::String>,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub maximum: ::core::option::Option<f64>,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub minimum: ::core::option::Option<f64>,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub title: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "type")]
pub type_: NumberSchemaType,
}
///`NumberSchemaType`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "integer",
/// "number"
/// ]
///}
/// ```
/// </details>
#[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 ::core::fmt::Display for NumberSchemaType {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match *self {
Self::Integer => f.write_str("integer"),
Self::Number => f.write_str("number"),
}
}
}
impl ::core::str::FromStr for NumberSchemaType {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
match value {
"integer" => Ok(Self::Integer),
"number" => Ok(Self::Number),
_ => Err("invalid value".into()),
}
}
}
impl ::core::convert::TryFrom<&str> for NumberSchemaType {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<&::alloc::string::String> for NumberSchemaType {
type Error = self::error::ConversionError;
fn try_from(
value: &::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<::alloc::string::String> for NumberSchemaType {
type Error = self::error::ConversionError;
fn try_from(
value: ::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`PaginatedRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "jsonrpc",
/// "method",
/// "params"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/$defs/RequestId"
/// },
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "method": {
/// "type": "string"
/// },
/// "params": {
/// "$ref": "#/$defs/PaginatedRequestParams"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedRequest {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
pub params: PaginatedRequestParams,
}
///Common params for paginated requests.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Common params for paginated requests.",
/// "type": "object",
/// "required": [
/// "_meta"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/RequestMetaObject"
/// },
/// "cursor": {
/// "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
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 = "::core::option::Option::is_none")]
pub cursor: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "_meta")]
pub meta: RequestMetaObject,
}
///`PaginatedResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "resultType"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "nextCursor": {
/// "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.",
/// "type": "string"
/// },
/// "resultType": {
/// "description": "Indicates the type of the result, which allows the client to determine\nhow to parse the result object.\n\nServers implementing this protocol version MUST include this field.\nFor backward compatibility, when a client receives a result from a\nserver implementing an earlier protocol version (which does not include\n`resultType`), the client MUST treat the absent field as `\"complete\"`.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResult {
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
/**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 = "::core::option::Option::is_none"
)]
pub next_cursor: ::core::option::Option<::alloc::string::String>,
/**Indicates the type of the result, which allows the client to determine
how to parse the result object.
Servers implementing this protocol version MUST include this field.
For backward compatibility, when a client receives a result from a
server implementing an earlier protocol version (which does not include
`resultType`), the client MUST treat the absent field as `"complete"`.*/
#[serde(rename = "resultType")]
pub result_type: ::alloc::string::String,
}
///A JSON-RPC error indicating that invalid JSON was received by the server. This error is returned when the server cannot parse the JSON text of a message.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A JSON-RPC error indicating that invalid JSON was received by the server. This error is returned when the server cannot parse the JSON text of a message.",
/// "type": "object",
/// "required": [
/// "code",
/// "message"
/// ],
/// "properties": {
/// "code": {
/// "description": "The error type that occurred.",
/// "type": "integer",
/// "const": -32700
/// },
/// "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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ParseError {
///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 = "::core::option::Option::is_none")]
pub data: ::core::option::Option<::serde_json::Value>,
///A short description of the error. The message SHOULD be limited to a concise single sentence.
pub message: ::alloc::string::String,
}
/**Restricted schema definitions that only allow primitive types
without nested objects or arrays.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PrimitiveSchemaDefinition {
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_0: ::core::option::Option<StringSchema>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_1: ::core::option::Option<NumberSchema>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_2: ::core::option::Option<BooleanSchema>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_3: ::core::option::Option<UntitledSingleSelectEnumSchema>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_4: ::core::option::Option<TitledSingleSelectEnumSchema>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_5: ::core::option::Option<UntitledMultiSelectEnumSchema>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_6: ::core::option::Option<TitledMultiSelectEnumSchema>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_7: ::core::option::Option<LegacyTitledEnumSchema>,
}
impl ::core::default::Default for PrimitiveSchemaDefinition {
fn default() -> Self {
Self {
subtype_0: Default::default(),
subtype_1: Default::default(),
subtype_2: Default::default(),
subtype_3: Default::default(),
subtype_4: Default::default(),
subtype_5: Default::default(),
subtype_6: Default::default(),
subtype_7: Default::default(),
}
}
}
///An out-of-band notification used to inform the receiver of a progress update for a long-running request.
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ProgressNotification {
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
pub params: ProgressNotificationParams,
}
///Parameters for a {@link ProgressNotificationnotifications/progress} notification.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for a {@link ProgressNotificationnotifications/progress} notification.",
/// "type": "object",
/// "required": [
/// "progress",
/// "progressToken"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ProgressNotificationParams {
///An optional message describing the current progress.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub message: ::core::option::Option<::alloc::string::String>,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
///The progress thus far. This should increase every time progress is made, even if the total is unknown.
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,
///Total number of items to process (or total progress required), if known.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub total: ::core::option::Option<f64>,
}
///A progress token, used to associate progress notifications with the original request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A progress token, used to associate progress notifications with the original request.",
/// "type": [
/// "string",
/// "integer"
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum ProgressToken {
String(::alloc::string::String),
Integer(i64),
}
impl ::core::fmt::Display for ProgressToken {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::String(x) => x.fmt(f),
Self::Integer(x) => x.fmt(f),
}
}
}
impl ::core::convert::From<i64> for ProgressToken {
fn from(value: i64) -> Self {
Self::Integer(value)
}
}
///A prompt or prompt template that the server offers.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A prompt or prompt template that the server offers.",
/// "type": "object",
/// "required": [
/// "name"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "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 {@link Tool},\nwhere `annotations.title` should be given precedence over using `name`,\nif present).",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[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 = "::alloc::vec::Vec::is_empty")]
pub arguments: ::alloc::vec::Vec<PromptArgument>,
///An optional description of what this prompt provides
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub description: ::core::option::Option<::alloc::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 = "::alloc::vec::Vec::is_empty")]
pub icons: ::alloc::vec::Vec<Icon>,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
pub name: ::alloc::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 {@link Tool},
where `annotations.title` should be given precedence over using `name`,
if present).*/
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub title: ::core::option::Option<::alloc::string::String>,
}
///Describes an argument that a prompt can accept.
///
/// <details><summary>JSON schema</summary>
///
/// ```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 {@link Tool},\nwhere `annotations.title` should be given precedence over using `name`,\nif present).",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PromptArgument {
///A human-readable description of the argument.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub description: ::core::option::Option<::alloc::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: ::alloc::string::String,
///Whether this argument must be provided.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub required: ::core::option::Option<bool>,
/**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 {@link Tool},
where `annotations.title` should be given precedence over using `name`,
if present).*/
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub title: ::core::option::Option<::alloc::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.
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PromptListChangedNotification {
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub params: ::core::option::Option<NotificationParams>,
}
/**Describes a message returned as part of a prompt.
This is similar to {@link SamplingMessage}, but also supports the embedding of
resources from the MCP server.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Describes a message returned as part of a prompt.\n\nThis is similar to {@link 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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PromptMessage {
pub content: ContentBlock,
pub role: Role,
}
///Identifies a prompt.
///
/// <details><summary>JSON schema</summary>
///
/// ```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 {@link Tool},\nwhere `annotations.title` should be given precedence over using `name`,\nif present).",
/// "type": "string"
/// },
/// "type": {
/// "type": "string",
/// "const": "ref/prompt"
/// }
/// }
///}
/// ```
/// </details>
#[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: ::alloc::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 {@link Tool},
where `annotations.title` should be given precedence over using `name`,
if present).*/
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub title: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
}
///Sent from the client to the server, to read a specific resource URI.
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReadResourceRequest {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
pub params: ReadResourceRequestParams,
}
///Parameters for a `resources/read` request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for a `resources/read` request.",
/// "type": "object",
/// "required": [
/// "_meta",
/// "uri"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/RequestMetaObject"
/// },
/// "inputResponses": {
/// "$ref": "#/$defs/InputResponses"
/// },
/// "requestState": {
/// "type": "string"
/// },
/// "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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReadResourceRequestParams {
#[serde(
rename = "inputResponses",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub input_responses: ::core::option::Option<InputResponses>,
#[serde(rename = "_meta")]
pub meta: RequestMetaObject,
#[serde(
rename = "requestState",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub request_state: ::core::option::Option<::alloc::string::String>,
///The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.
pub uri: ::alloc::string::String,
}
///The result returned by the server for a {@link ReadResourceRequestresources/read} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The result returned by the server for a {@link ReadResourceRequestresources/read} request.",
/// "type": "object",
/// "required": [
/// "cacheScope",
/// "contents",
/// "resultType",
/// "ttlMs"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "cacheScope": {
/// "description": "Indicates the intended scope of the cached response, analogous to HTTP\n`Cache-Control: public` vs `Cache-Control: private`.\n\n- `\"public\"`: Any client or intermediary (e.g., shared gateway, proxy)\n MAY cache the response and serve it to any user.\n- `\"private\"`: Only the requesting user's client MAY cache the response.\n Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached\n copy to a different user.",
/// "type": "string",
/// "enum": [
/// "private",
/// "public"
/// ]
/// },
/// "contents": {
/// "type": "array",
/// "items": {
/// "anyOf": [
/// {
/// "$ref": "#/$defs/TextResourceContents"
/// },
/// {
/// "$ref": "#/$defs/BlobResourceContents"
/// }
/// ]
/// }
/// },
/// "resultType": {
/// "description": "Indicates the type of the result, which allows the client to determine\nhow to parse the result object.\n\nServers implementing this protocol version MUST include this field.\nFor backward compatibility, when a client receives a result from a\nserver implementing an earlier protocol version (which does not include\n`resultType`), the client MUST treat the absent field as `\"complete\"`.",
/// "type": "string"
/// },
/// "ttlMs": {
/// "description": "A hint from the server indicating how long (in milliseconds) the\nclient MAY cache this response before re-fetching. Semantics are\nanalogous to HTTP Cache-Control max-age.\n\n- If 0, The response SHOULD be considered immediately stale,\n The client MAY re-fetch every time the result is needed.\n- If positive, the client SHOULD consider the result fresh for this many\n milliseconds after receiving the response.",
/// "type": "integer",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReadResourceResult {
/**Indicates the intended scope of the cached response, analogous to HTTP
`Cache-Control: public` vs `Cache-Control: private`.
- `"public"`: Any client or intermediary (e.g., shared gateway, proxy)
MAY cache the response and serve it to any user.
- `"private"`: Only the requesting user's client MAY cache the response.
Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached
copy to a different user.*/
#[serde(rename = "cacheScope")]
pub cache_scope: ReadResourceResultCacheScope,
pub contents: ::alloc::vec::Vec<ReadResourceResultContentsItem>,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
/**Indicates the type of the result, which allows the client to determine
how to parse the result object.
Servers implementing this protocol version MUST include this field.
For backward compatibility, when a client receives a result from a
server implementing an earlier protocol version (which does not include
`resultType`), the client MUST treat the absent field as `"complete"`.*/
#[serde(rename = "resultType")]
pub result_type: ::alloc::string::String,
/**A hint from the server indicating how long (in milliseconds) the
client MAY cache this response before re-fetching. Semantics are
analogous to HTTP Cache-Control max-age.
- If 0, The response SHOULD be considered immediately stale,
The client MAY re-fetch every time the result is needed.
- If positive, the client SHOULD consider the result fresh for this many
milliseconds after receiving the response.*/
#[serde(rename = "ttlMs")]
pub ttl_ms: u64,
}
/**Indicates the intended scope of the cached response, analogous to HTTP
`Cache-Control: public` vs `Cache-Control: private`.
- `"public"`: Any client or intermediary (e.g., shared gateway, proxy)
MAY cache the response and serve it to any user.
- `"private"`: Only the requesting user's client MAY cache the response.
Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached
copy to a different user.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Indicates the intended scope of the cached response, analogous to HTTP\n`Cache-Control: public` vs `Cache-Control: private`.\n\n- `\"public\"`: Any client or intermediary (e.g., shared gateway, proxy)\n MAY cache the response and serve it to any user.\n- `\"private\"`: Only the requesting user's client MAY cache the response.\n Shared caches (e.g., multi-tenant gateways) MUST NOT serve a cached\n copy to a different user.",
/// "type": "string",
/// "enum": [
/// "private",
/// "public"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ReadResourceResultCacheScope {
#[serde(rename = "private")]
Private,
#[serde(rename = "public")]
Public,
}
impl ::core::fmt::Display for ReadResourceResultCacheScope {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match *self {
Self::Private => f.write_str("private"),
Self::Public => f.write_str("public"),
}
}
}
impl ::core::str::FromStr for ReadResourceResultCacheScope {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
match value {
"private" => Ok(Self::Private),
"public" => Ok(Self::Public),
_ => Err("invalid value".into()),
}
}
}
impl ::core::convert::TryFrom<&str> for ReadResourceResultCacheScope {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<&::alloc::string::String> for ReadResourceResultCacheScope {
type Error = self::error::ConversionError;
fn try_from(
value: &::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<::alloc::string::String> for ReadResourceResultCacheScope {
type Error = self::error::ConversionError;
fn try_from(
value: ::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`ReadResourceResultContentsItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/TextResourceContents"
/// },
/// {
/// "$ref": "#/$defs/BlobResourceContents"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum ReadResourceResultContentsItem {
TextResourceContents(TextResourceContents),
BlobResourceContents(BlobResourceContents),
}
impl ::core::convert::From<TextResourceContents> for ReadResourceResultContentsItem {
fn from(value: TextResourceContents) -> Self {
Self::TextResourceContents(value)
}
}
impl ::core::convert::From<BlobResourceContents> for ReadResourceResultContentsItem {
fn from(value: BlobResourceContents) -> Self {
Self::BlobResourceContents(value)
}
}
///A successful response from the server for a {@link ReadResourceRequestresources/read} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A successful response from the server for a {@link ReadResourceRequestresources/read} request.",
/// "type": "object",
/// "required": [
/// "id",
/// "jsonrpc",
/// "result"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/$defs/RequestId"
/// },
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "result": {
/// "anyOf": [
/// {
/// "$ref": "#/$defs/InputRequiredResult"
/// },
/// {
/// "$ref": "#/$defs/ReadResourceResult"
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReadResourceResultResponse {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub result: ReadResourceResultResponseResult,
}
///`ReadResourceResultResponseResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/InputRequiredResult"
/// },
/// {
/// "$ref": "#/$defs/ReadResourceResult"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum ReadResourceResultResponseResult {
InputRequiredResult(InputRequiredResult),
ReadResourceResult(ReadResourceResult),
}
impl ::core::convert::From<InputRequiredResult> for ReadResourceResultResponseResult {
fn from(value: InputRequiredResult) -> Self {
Self::InputRequiredResult(value)
}
}
impl ::core::convert::From<ReadResourceResult> for ReadResourceResultResponseResult {
fn from(value: ReadResourceResult) -> Self {
Self::ReadResourceResult(value)
}
}
///`Request`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "method"
/// ],
/// "properties": {
/// "method": {
/// "type": "string"
/// },
/// "params": {
/// "type": "object",
/// "additionalProperties": {}
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Request {
pub method: ::alloc::string::String,
#[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
pub params: ::serde_json::Map<::alloc::string::String, ::serde_json::Value>,
}
///A uniquely identifying ID for a request in JSON-RPC.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A uniquely identifying ID for a request in JSON-RPC.",
/// "type": [
/// "string",
/// "integer"
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum RequestId {
String(::alloc::string::String),
Integer(i64),
}
impl ::core::fmt::Display for RequestId {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::String(x) => x.fmt(f),
Self::Integer(x) => x.fmt(f),
}
}
}
impl ::core::convert::From<i64> for RequestId {
fn from(value: i64) -> Self {
Self::Integer(value)
}
}
///Extends {@link MetaObject} with additional request-specific fields. All key naming rules from `MetaObject` apply.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Extends {@link MetaObject} with additional request-specific fields. All key naming rules from `MetaObject` apply.",
/// "type": "object",
/// "required": [
/// "io.modelcontextprotocol/clientCapabilities",
/// "io.modelcontextprotocol/clientInfo",
/// "io.modelcontextprotocol/protocolVersion"
/// ],
/// "properties": {
/// "io.modelcontextprotocol/clientCapabilities": {
/// "description": "The client's capabilities for this specific request. Required.\n\nCapabilities are declared per-request rather than once at initialization;\nan empty object means the client supports no optional capabilities.\nServers MUST NOT infer capabilities from prior requests.",
/// "$ref": "#/$defs/ClientCapabilities"
/// },
/// "io.modelcontextprotocol/clientInfo": {
/// "description": "Identifies the client software making the request. Required.\n\nThe {@link Implementation} schema requires `name` and `version`; other\nfields are optional.",
/// "$ref": "#/$defs/Implementation"
/// },
/// "io.modelcontextprotocol/logLevel": {
/// "description": "The desired log level for this request. Optional.\n\nIf absent, the server MUST NOT send any {@link LoggingMessageNotificationnotifications/message}\nnotifications for this request. The client opts in to log messages by\nexplicitly setting a level. Replaces the former `logging/setLevel` RPC.",
/// "$ref": "#/$defs/LoggingLevel"
/// },
/// "io.modelcontextprotocol/protocolVersion": {
/// "description": "The MCP Protocol Version being used for this request. Required.\n\nFor the HTTP transport, this value MUST match the `MCP-Protocol-Version`\nheader; otherwise the server MUST return a `400 Bad Request`. If the\nserver does not support the requested version, it MUST return an\n{@link UnsupportedProtocolVersionError}.",
/// "type": "string"
/// },
/// "progressToken": {
/// "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by {@link ProgressNotificationnotifications/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": {}
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RequestMetaObject {
/**The client's capabilities for this specific request. Required.
Capabilities are declared per-request rather than once at initialization;
an empty object means the client supports no optional capabilities.
Servers MUST NOT infer capabilities from prior requests.*/
#[serde(rename = "io.modelcontextprotocol/clientCapabilities")]
pub io_modelcontextprotocol_client_capabilities: ClientCapabilities,
/**Identifies the client software making the request. Required.
The {@link Implementation} schema requires `name` and `version`; other
fields are optional.*/
#[serde(rename = "io.modelcontextprotocol/clientInfo")]
pub io_modelcontextprotocol_client_info: Implementation,
/**The desired log level for this request. Optional.
If absent, the server MUST NOT send any {@link LoggingMessageNotificationnotifications/message}
notifications for this request. The client opts in to log messages by
explicitly setting a level. Replaces the former `logging/setLevel` RPC.*/
#[serde(
rename = "io.modelcontextprotocol/logLevel",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub io_modelcontextprotocol_log_level: ::core::option::Option<LoggingLevel>,
/**The MCP Protocol Version being used for this request. Required.
For the HTTP transport, this value MUST match the `MCP-Protocol-Version`
header; otherwise the server MUST return a `400 Bad Request`. If the
server does not support the requested version, it MUST return an
{@link UnsupportedProtocolVersionError}.*/
#[serde(rename = "io.modelcontextprotocol/protocolVersion")]
pub io_modelcontextprotocol_protocol_version: ::alloc::string::String,
///If specified, the caller is requesting out-of-band progress notifications for this request (as represented by {@link ProgressNotificationnotifications/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 = "::core::option::Option::is_none"
)]
pub progress_token: ::core::option::Option<ProgressToken>,
#[serde(flatten)]
pub extra: ::serde_json::Map<::alloc::string::String, ::serde_json::Value>,
}
///Common params for any request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Common params for any request.",
/// "type": "object",
/// "required": [
/// "_meta"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/RequestMetaObject"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RequestParams {
#[serde(rename = "_meta")]
pub meta: RequestMetaObject,
}
///A known resource that the server is capable of reading.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A known resource that the server is capable of reading.",
/// "type": "object",
/// "required": [
/// "name",
/// "uri"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "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 {@link 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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Resource {
///Optional annotations for the client.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub annotations: ::core::option::Option<Annotations>,
/**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 = "::core::option::Option::is_none")]
pub description: ::core::option::Option<::alloc::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 = "::alloc::vec::Vec::is_empty")]
pub icons: ::alloc::vec::Vec<Icon>,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
///The MIME type of this resource, if known.
#[serde(
rename = "mimeType",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub mime_type: ::core::option::Option<::alloc::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: ::alloc::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 = "::core::option::Option::is_none")]
pub size: ::core::option::Option<i64>,
/**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 {@link Tool},
where `annotations.title` should be given precedence over using `name`,
if present).*/
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub title: ::core::option::Option<::alloc::string::String>,
///The URI of this resource.
pub uri: ::alloc::string::String,
}
///The contents of a specific resource or sub-resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The contents of a specific resource or sub-resource.",
/// "type": "object",
/// "required": [
/// "uri"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "mimeType": {
/// "description": "The MIME type of this resource, if known.",
/// "type": "string"
/// },
/// "uri": {
/// "description": "The URI of this resource.",
/// "type": "string",
/// "format": "uri"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ResourceContents {
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
///The MIME type of this resource, if known.
#[serde(
rename = "mimeType",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub mime_type: ::core::option::Option<::alloc::string::String>,
///The URI of this resource.
pub uri: ::alloc::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 {@link ListResourcesRequestresources/list} requests.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```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 {@link ListResourcesRequestresources/list} requests.",
/// "type": "object",
/// "required": [
/// "name",
/// "type",
/// "uri"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "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 {@link 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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ResourceLink {
///Optional annotations for the client.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub annotations: ::core::option::Option<Annotations>,
/**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 = "::core::option::Option::is_none")]
pub description: ::core::option::Option<::alloc::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 = "::alloc::vec::Vec::is_empty")]
pub icons: ::alloc::vec::Vec<Icon>,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
///The MIME type of this resource, if known.
#[serde(
rename = "mimeType",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub mime_type: ::core::option::Option<::alloc::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: ::alloc::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 = "::core::option::Option::is_none")]
pub size: ::core::option::Option<i64>,
/**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 {@link Tool},
where `annotations.title` should be given precedence over using `name`,
if present).*/
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub title: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
///The URI of this resource.
pub uri: ::alloc::string::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.
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ResourceListChangedNotification {
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub params: ::core::option::Option<NotificationParams>,
}
///Common params for resource-related requests.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Common params for resource-related requests.",
/// "type": "object",
/// "required": [
/// "_meta",
/// "uri"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/RequestMetaObject"
/// },
/// "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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ResourceRequestParams {
#[serde(rename = "_meta")]
pub meta: RequestMetaObject,
///The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.
pub uri: ::alloc::string::String,
}
///A template description for resources available on the server.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A template description for resources available on the server.",
/// "type": "object",
/// "required": [
/// "name",
/// "uriTemplate"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "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 {@link 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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ResourceTemplate {
///Optional annotations for the client.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub annotations: ::core::option::Option<Annotations>,
/**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 = "::core::option::Option::is_none")]
pub description: ::core::option::Option<::alloc::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 = "::alloc::vec::Vec::is_empty")]
pub icons: ::alloc::vec::Vec<Icon>,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
///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 = "::core::option::Option::is_none"
)]
pub mime_type: ::core::option::Option<::alloc::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: ::alloc::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 {@link Tool},
where `annotations.title` should be given precedence over using `name`,
if present).*/
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub title: ::core::option::Option<::alloc::string::String>,
///A URI template (according to RFC 6570) that can be used to construct resource URIs.
#[serde(rename = "uriTemplate")]
pub uri_template: ::alloc::string::String,
}
///A reference to a resource or resource template definition.
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ResourceTemplateReference {
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
///The URI or URI template of the resource.
pub uri: ::alloc::string::String,
}
///A notification from the server to the client, informing it that a resource has changed and may need to be read again. This is only sent for resources the client opted in to via the `resourceSubscriptions` field of a {@link SubscriptionsListenRequestsubscriptions/listen} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```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 is only sent for resources the client opted in to via the `resourceSubscriptions` field of a {@link SubscriptionsListenRequestsubscriptions/listen} 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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ResourceUpdatedNotification {
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
pub params: ResourceUpdatedNotificationParams,
}
///Parameters for a `notifications/resources/updated` notification.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for a `notifications/resources/updated` notification.",
/// "type": "object",
/// "required": [
/// "uri"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ResourceUpdatedNotificationParams {
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
///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: ::alloc::string::String,
}
///Common result fields.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Common result fields.",
/// "type": "object",
/// "required": [
/// "resultType"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "resultType": {
/// "description": "Indicates the type of the result, which allows the client to determine\nhow to parse the result object.\n\nServers implementing this protocol version MUST include this field.\nFor backward compatibility, when a client receives a result from a\nserver implementing an earlier protocol version (which does not include\n`resultType`), the client MUST treat the absent field as `\"complete\"`.",
/// "type": "string"
/// }
/// },
/// "additionalProperties": {}
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Result {
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
/**Indicates the type of the result, which allows the client to determine
how to parse the result object.
Servers implementing this protocol version MUST include this field.
For backward compatibility, when a client receives a result from a
server implementing an earlier protocol version (which does not include
`resultType`), the client MUST treat the absent field as `"complete"`.*/
#[serde(rename = "resultType")]
pub result_type: ::alloc::string::String,
#[serde(flatten)]
pub extra: ::serde_json::Map<::alloc::string::String, ::serde_json::Value>,
}
/**Indicates the type of a {@link Result} object, allowing the client to
determine how to parse the response.
complete - the request completed successfully and the result contains the final content.
input_required - the request requires additional input and the result contains an {@link InputRequiredResult} object with instructions for the client to provide additional input before retrying the original request.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Indicates the type of a {@link Result} object, allowing the client to\ndetermine how to parse the response.\n\ncomplete - the request completed successfully and the result contains the final content.\ninput_required - the request requires additional input and the result contains an {@link InputRequiredResult} object with instructions for the client to provide additional input before retrying the original request.",
/// "type": "string"
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct ResultType(pub ::alloc::string::String);
impl ::core::ops::Deref for ResultType {
type Target = ::alloc::string::String;
fn deref(&self) -> &::alloc::string::String {
&self.0
}
}
impl ::core::convert::From<ResultType> for ::alloc::string::String {
fn from(value: ResultType) -> Self {
value.0
}
}
impl ::core::convert::From<::alloc::string::String> for ResultType {
fn from(value: ::alloc::string::String) -> Self {
Self(value)
}
}
impl ::core::str::FromStr for ResultType {
type Err = ::core::convert::Infallible;
fn from_str(value: &str) -> ::core::result::Result<Self, Self::Err> {
Ok(Self(value.to_string()))
}
}
impl ::core::fmt::Display for ResultType {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
self.0.fmt(f)
}
}
///The sender or recipient of messages and data in a conversation.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The sender or recipient of messages and data in a conversation.",
/// "type": "string",
/// "enum": [
/// "assistant",
/// "user"
/// ]
///}
/// ```
/// </details>
#[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 ::core::fmt::Display for Role {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match *self {
Self::Assistant => f.write_str("assistant"),
Self::User => f.write_str("user"),
}
}
}
impl ::core::str::FromStr for Role {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
match value {
"assistant" => Ok(Self::Assistant),
"user" => Ok(Self::User),
_ => Err("invalid value".into()),
}
}
}
impl ::core::convert::TryFrom<&str> for Role {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<&::alloc::string::String> for Role {
type Error = self::error::ConversionError;
fn try_from(
value: &::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<::alloc::string::String> for Role {
type Error = self::error::ConversionError;
fn try_from(
value: ::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Represents a root directory or file that the server can operate on.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Represents a root directory or file that the server can operate on.",
/// "type": "object",
/// "required": [
/// "uri"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Root {
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
/**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 = "::core::option::Option::is_none")]
pub name: ::core::option::Option<::alloc::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: ::alloc::string::String,
}
///Describes a message issued to or received from an LLM API.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Describes a message issued to or received from an LLM API.",
/// "type": "object",
/// "required": [
/// "content",
/// "role"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SamplingMessage {
pub content: SamplingMessageContent,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
pub role: Role,
}
///`SamplingMessageContent`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/TextContent"
/// },
/// {
/// "$ref": "#/$defs/ImageContent"
/// },
/// {
/// "$ref": "#/$defs/AudioContent"
/// },
/// {
/// "$ref": "#/$defs/ToolUseContent"
/// },
/// {
/// "$ref": "#/$defs/ToolResultContent"
/// },
/// {
/// "type": "array",
/// "items": {
/// "$ref": "#/$defs/SamplingMessageContentBlock"
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum SamplingMessageContent {
TextContent(TextContent),
ImageContent(ImageContent),
AudioContent(AudioContent),
ToolUseContent(ToolUseContent),
ToolResultContent(ToolResultContent),
Array(::alloc::vec::Vec<SamplingMessageContentBlock>),
}
impl ::core::convert::From<TextContent> for SamplingMessageContent {
fn from(value: TextContent) -> Self {
Self::TextContent(value)
}
}
impl ::core::convert::From<ImageContent> for SamplingMessageContent {
fn from(value: ImageContent) -> Self {
Self::ImageContent(value)
}
}
impl ::core::convert::From<AudioContent> for SamplingMessageContent {
fn from(value: AudioContent) -> Self {
Self::AudioContent(value)
}
}
impl ::core::convert::From<ToolUseContent> for SamplingMessageContent {
fn from(value: ToolUseContent) -> Self {
Self::ToolUseContent(value)
}
}
impl ::core::convert::From<ToolResultContent> for SamplingMessageContent {
fn from(value: ToolResultContent) -> Self {
Self::ToolResultContent(value)
}
}
impl ::core::convert::From<::alloc::vec::Vec<SamplingMessageContentBlock>>
for SamplingMessageContent
{
fn from(value: ::alloc::vec::Vec<SamplingMessageContentBlock>) -> Self {
Self::Array(value)
}
}
///`SamplingMessageContentBlock`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/TextContent"
/// },
/// {
/// "$ref": "#/$defs/ImageContent"
/// },
/// {
/// "$ref": "#/$defs/AudioContent"
/// },
/// {
/// "$ref": "#/$defs/ToolUseContent"
/// },
/// {
/// "$ref": "#/$defs/ToolResultContent"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum SamplingMessageContentBlock {
TextContent(TextContent),
ImageContent(ImageContent),
AudioContent(AudioContent),
ToolUseContent(ToolUseContent),
ToolResultContent(ToolResultContent),
}
impl ::core::convert::From<TextContent> for SamplingMessageContentBlock {
fn from(value: TextContent) -> Self {
Self::TextContent(value)
}
}
impl ::core::convert::From<ImageContent> for SamplingMessageContentBlock {
fn from(value: ImageContent) -> Self {
Self::ImageContent(value)
}
}
impl ::core::convert::From<AudioContent> for SamplingMessageContentBlock {
fn from(value: AudioContent) -> Self {
Self::AudioContent(value)
}
}
impl ::core::convert::From<ToolUseContent> for SamplingMessageContentBlock {
fn from(value: ToolUseContent) -> Self {
Self::ToolUseContent(value)
}
}
impl ::core::convert::From<ToolResultContent> 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.
///
/// <details><summary>JSON schema</summary>
///
/// ```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.",
/// "$ref": "#/$defs/JSONObject"
/// },
/// "experimental": {
/// "description": "Experimental, non-standard capabilities that the server supports.",
/// "type": "object",
/// "additionalProperties": {
/// "$ref": "#/$defs/JSONObject"
/// }
/// },
/// "extensions": {
/// "description": "Optional MCP extensions that the server supports. Keys are extension identifiers\n(e.g., \"io.modelcontextprotocol/tasks\"), and values are per-extension settings\nobjects. An empty object indicates support with no settings.",
/// "type": "object",
/// "additionalProperties": {
/// "$ref": "#/$defs/JSONObject"
/// }
/// },
/// "logging": {
/// "description": "Present if the server supports sending log messages to the client.",
/// "$ref": "#/$defs/JSONObject"
/// },
/// "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"
/// }
/// }
/// },
/// "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"
/// }
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ServerCapabilities {
///Present if the server supports argument autocompletion suggestions.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub completions: ::core::option::Option<JsonObject>,
///Experimental, non-standard capabilities that the server supports.
#[serde(
default,
skip_serializing_if = ":: alloc :: collections :: BTreeMap::is_empty"
)]
pub experimental: ::alloc::collections::BTreeMap<::alloc::string::String, JsonObject>,
/**Optional MCP extensions that the server supports. Keys are extension identifiers
(e.g., "io.modelcontextprotocol/tasks"), and values are per-extension settings
objects. An empty object indicates support with no settings.*/
#[serde(
default,
skip_serializing_if = ":: alloc :: collections :: BTreeMap::is_empty"
)]
pub extensions: ::alloc::collections::BTreeMap<::alloc::string::String, JsonObject>,
///Present if the server supports sending log messages to the client.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub logging: ::core::option::Option<JsonObject>,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub prompts: ::core::option::Option<ServerCapabilitiesPrompts>,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub resources: ::core::option::Option<ServerCapabilitiesResources>,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub tools: ::core::option::Option<ServerCapabilitiesTools>,
}
impl ::core::default::Default for ServerCapabilities {
fn default() -> Self {
Self {
completions: Default::default(),
experimental: Default::default(),
extensions: Default::default(),
logging: Default::default(),
prompts: Default::default(),
resources: Default::default(),
tools: Default::default(),
}
}
}
///Present if the server offers any prompt templates.
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ServerCapabilitiesPrompts {
///Whether this server supports notifications for changes to the prompt list.
#[serde(
rename = "listChanged",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub list_changed: ::core::option::Option<bool>,
}
impl ::core::default::Default for ServerCapabilitiesPrompts {
fn default() -> Self {
Self {
list_changed: Default::default(),
}
}
}
///Present if the server offers any resources to read.
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ServerCapabilitiesResources {
///Whether this server supports notifications for changes to the resource list.
#[serde(
rename = "listChanged",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub list_changed: ::core::option::Option<bool>,
///Whether this server supports subscribing to resource updates.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub subscribe: ::core::option::Option<bool>,
}
impl ::core::default::Default for ServerCapabilitiesResources {
fn default() -> Self {
Self {
list_changed: Default::default(),
subscribe: Default::default(),
}
}
}
///Present if the server offers any tools to call.
///
/// <details><summary>JSON schema</summary>
///
/// ```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"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ServerCapabilitiesTools {
///Whether this server supports notifications for changes to the tool list.
#[serde(
rename = "listChanged",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub list_changed: ::core::option::Option<bool>,
}
impl ::core::default::Default for ServerCapabilitiesTools {
fn default() -> Self {
Self {
list_changed: Default::default(),
}
}
}
///`ServerNotification`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/CancelledNotification"
/// },
/// {
/// "$ref": "#/$defs/ProgressNotification"
/// },
/// {
/// "$ref": "#/$defs/ResourceListChangedNotification"
/// },
/// {
/// "$ref": "#/$defs/SubscriptionsAcknowledgedNotification"
/// },
/// {
/// "$ref": "#/$defs/ResourceUpdatedNotification"
/// },
/// {
/// "$ref": "#/$defs/PromptListChangedNotification"
/// },
/// {
/// "$ref": "#/$defs/ToolListChangedNotification"
/// },
/// {
/// "$ref": "#/$defs/LoggingMessageNotification"
/// },
/// {
/// "$ref": "#/$defs/ElicitationCompleteNotification"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum ServerNotification {
CancelledNotification(CancelledNotification),
ProgressNotification(ProgressNotification),
ResourceListChangedNotification(ResourceListChangedNotification),
SubscriptionsAcknowledgedNotification(SubscriptionsAcknowledgedNotification),
ResourceUpdatedNotification(ResourceUpdatedNotification),
PromptListChangedNotification(PromptListChangedNotification),
ToolListChangedNotification(ToolListChangedNotification),
LoggingMessageNotification(LoggingMessageNotification),
ElicitationCompleteNotification(ElicitationCompleteNotification),
}
impl ::core::convert::From<CancelledNotification> for ServerNotification {
fn from(value: CancelledNotification) -> Self {
Self::CancelledNotification(value)
}
}
impl ::core::convert::From<ProgressNotification> for ServerNotification {
fn from(value: ProgressNotification) -> Self {
Self::ProgressNotification(value)
}
}
impl ::core::convert::From<ResourceListChangedNotification> for ServerNotification {
fn from(value: ResourceListChangedNotification) -> Self {
Self::ResourceListChangedNotification(value)
}
}
impl ::core::convert::From<SubscriptionsAcknowledgedNotification> for ServerNotification {
fn from(value: SubscriptionsAcknowledgedNotification) -> Self {
Self::SubscriptionsAcknowledgedNotification(value)
}
}
impl ::core::convert::From<ResourceUpdatedNotification> for ServerNotification {
fn from(value: ResourceUpdatedNotification) -> Self {
Self::ResourceUpdatedNotification(value)
}
}
impl ::core::convert::From<PromptListChangedNotification> for ServerNotification {
fn from(value: PromptListChangedNotification) -> Self {
Self::PromptListChangedNotification(value)
}
}
impl ::core::convert::From<ToolListChangedNotification> for ServerNotification {
fn from(value: ToolListChangedNotification) -> Self {
Self::ToolListChangedNotification(value)
}
}
impl ::core::convert::From<LoggingMessageNotification> for ServerNotification {
fn from(value: LoggingMessageNotification) -> Self {
Self::LoggingMessageNotification(value)
}
}
impl ::core::convert::From<ElicitationCompleteNotification> for ServerNotification {
fn from(value: ElicitationCompleteNotification) -> Self {
Self::ElicitationCompleteNotification(value)
}
}
///`ServerResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/Result"
/// },
/// {
/// "$ref": "#/$defs/InputRequiredResult"
/// },
/// {
/// "$ref": "#/$defs/DiscoverResult"
/// },
/// {
/// "$ref": "#/$defs/ListResourcesResult"
/// },
/// {
/// "$ref": "#/$defs/ListResourceTemplatesResult"
/// },
/// {
/// "$ref": "#/$defs/ReadResourceResult"
/// },
/// {
/// "$ref": "#/$defs/ListPromptsResult"
/// },
/// {
/// "$ref": "#/$defs/GetPromptResult"
/// },
/// {
/// "$ref": "#/$defs/ListToolsResult"
/// },
/// {
/// "$ref": "#/$defs/CallToolResult"
/// },
/// {
/// "$ref": "#/$defs/CompleteResult"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ServerResult {
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_0: ::core::option::Option<Result>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_1: ::core::option::Option<InputRequiredResult>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_2: ::core::option::Option<DiscoverResult>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_3: ::core::option::Option<ListResourcesResult>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_4: ::core::option::Option<ListResourceTemplatesResult>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_5: ::core::option::Option<ReadResourceResult>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_6: ::core::option::Option<ListPromptsResult>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_7: ::core::option::Option<GetPromptResult>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_8: ::core::option::Option<ListToolsResult>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_9: ::core::option::Option<CallToolResult>,
#[serde(
flatten,
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub subtype_10: ::core::option::Option<CompleteResult>,
}
impl ::core::default::Default for ServerResult {
fn default() -> Self {
Self {
subtype_0: Default::default(),
subtype_1: Default::default(),
subtype_2: Default::default(),
subtype_3: Default::default(),
subtype_4: Default::default(),
subtype_5: Default::default(),
subtype_6: Default::default(),
subtype_7: Default::default(),
subtype_8: Default::default(),
subtype_9: Default::default(),
subtype_10: Default::default(),
}
}
}
///`SingleSelectEnumSchema`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "$ref": "#/$defs/UntitledSingleSelectEnumSchema"
/// },
/// {
/// "$ref": "#/$defs/TitledSingleSelectEnumSchema"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum SingleSelectEnumSchema {
UntitledSingleSelectEnumSchema(UntitledSingleSelectEnumSchema),
TitledSingleSelectEnumSchema(TitledSingleSelectEnumSchema),
}
impl ::core::convert::From<UntitledSingleSelectEnumSchema> for SingleSelectEnumSchema {
fn from(value: UntitledSingleSelectEnumSchema) -> Self {
Self::UntitledSingleSelectEnumSchema(value)
}
}
impl ::core::convert::From<TitledSingleSelectEnumSchema> for SingleSelectEnumSchema {
fn from(value: TitledSingleSelectEnumSchema) -> Self {
Self::TitledSingleSelectEnumSchema(value)
}
}
///`StringSchema`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "default": {
/// "type": "string"
/// },
/// "description": {
/// "type": "string"
/// },
/// "format": {
/// "type": "string",
/// "enum": [
/// "date",
/// "date-time",
/// "email",
/// "uri"
/// ]
/// },
/// "maxLength": {
/// "type": "integer"
/// },
/// "minLength": {
/// "type": "integer"
/// },
/// "title": {
/// "type": "string"
/// },
/// "type": {
/// "type": "string",
/// "const": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct StringSchema {
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub default: ::core::option::Option<::alloc::string::String>,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub description: ::core::option::Option<::alloc::string::String>,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub format: ::core::option::Option<StringSchemaFormat>,
#[serde(
rename = "maxLength",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub max_length: ::core::option::Option<i64>,
#[serde(
rename = "minLength",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub min_length: ::core::option::Option<i64>,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub title: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
}
///`StringSchemaFormat`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "date",
/// "date-time",
/// "email",
/// "uri"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum StringSchemaFormat {
#[serde(rename = "date")]
Date,
#[serde(rename = "date-time")]
DateTime,
#[serde(rename = "email")]
Email,
#[serde(rename = "uri")]
Uri,
}
impl ::core::fmt::Display for StringSchemaFormat {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match *self {
Self::Date => f.write_str("date"),
Self::DateTime => f.write_str("date-time"),
Self::Email => f.write_str("email"),
Self::Uri => f.write_str("uri"),
}
}
}
impl ::core::str::FromStr for StringSchemaFormat {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
match value {
"date" => Ok(Self::Date),
"date-time" => Ok(Self::DateTime),
"email" => Ok(Self::Email),
"uri" => Ok(Self::Uri),
_ => Err("invalid value".into()),
}
}
}
impl ::core::convert::TryFrom<&str> for StringSchemaFormat {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<&::alloc::string::String> for StringSchemaFormat {
type Error = self::error::ConversionError;
fn try_from(
value: &::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<::alloc::string::String> for StringSchemaFormat {
type Error = self::error::ConversionError;
fn try_from(
value: ::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
/**The set of notification types a client may opt in to on a
{@link SubscriptionsListenRequestsubscriptions/listen} request.
Each notification type is **opt-in**; the server **MUST NOT** send
notification types the client has not explicitly requested here.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The set of notification types a client may opt in to on a\n{@link SubscriptionsListenRequestsubscriptions/listen} request.\n\nEach notification type is **opt-in**; the server **MUST NOT** send\nnotification types the client has not explicitly requested here.",
/// "type": "object",
/// "properties": {
/// "promptsListChanged": {
/// "description": "If true, receive {@link PromptListChangedNotificationnotifications/prompts/list_changed}.",
/// "type": "boolean"
/// },
/// "resourceSubscriptions": {
/// "description": "Subscribe to {@link ResourceUpdatedNotificationnotifications/resources/updated} for these resource URIs.\nReplaces the former `resources/subscribe` RPC.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "resourcesListChanged": {
/// "description": "If true, receive {@link ResourceListChangedNotificationnotifications/resources/list_changed}.",
/// "type": "boolean"
/// },
/// "toolsListChanged": {
/// "description": "If true, receive {@link ToolListChangedNotificationnotifications/tools/list_changed}.",
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionFilter {
///If true, receive {@link PromptListChangedNotificationnotifications/prompts/list_changed}.
#[serde(
rename = "promptsListChanged",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub prompts_list_changed: ::core::option::Option<bool>,
/**Subscribe to {@link ResourceUpdatedNotificationnotifications/resources/updated} for these resource URIs.
Replaces the former `resources/subscribe` RPC.*/
#[serde(
rename = "resourceSubscriptions",
default,
skip_serializing_if = "::alloc::vec::Vec::is_empty"
)]
pub resource_subscriptions: ::alloc::vec::Vec<::alloc::string::String>,
///If true, receive {@link ResourceListChangedNotificationnotifications/resources/list_changed}.
#[serde(
rename = "resourcesListChanged",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub resources_list_changed: ::core::option::Option<bool>,
///If true, receive {@link ToolListChangedNotificationnotifications/tools/list_changed}.
#[serde(
rename = "toolsListChanged",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub tools_list_changed: ::core::option::Option<bool>,
}
impl ::core::default::Default for SubscriptionFilter {
fn default() -> Self {
Self {
prompts_list_changed: Default::default(),
resource_subscriptions: Default::default(),
resources_list_changed: Default::default(),
tools_list_changed: Default::default(),
}
}
}
/**Sent by the server as the first message on a
{@link SubscriptionsListenRequestsubscriptions/listen} stream to acknowledge
that the subscription has been established and to report which notification
types it agreed to honor.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Sent by the server as the first message on a\n{@link SubscriptionsListenRequestsubscriptions/listen} stream to acknowledge\nthat the subscription has been established and to report which notification\ntypes it agreed to honor.",
/// "type": "object",
/// "required": [
/// "jsonrpc",
/// "method",
/// "params"
/// ],
/// "properties": {
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "method": {
/// "type": "string",
/// "const": "notifications/subscriptions/acknowledged"
/// },
/// "params": {
/// "$ref": "#/$defs/SubscriptionsAcknowledgedNotificationParams"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionsAcknowledgedNotification {
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
pub params: SubscriptionsAcknowledgedNotificationParams,
}
///Parameters for a {@link SubscriptionsAcknowledgedNotificationnotifications/subscriptions/acknowledged} notification.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for a {@link SubscriptionsAcknowledgedNotificationnotifications/subscriptions/acknowledged} notification.",
/// "type": "object",
/// "required": [
/// "notifications"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "notifications": {
/// "description": "The subset of requested notification types the server agreed to honor.\nOnly includes notification types the server actually supports; if the\nclient requested an unsupported type (e.g., `promptsListChanged` when\nthe server has no prompts), it is omitted from this set.",
/// "$ref": "#/$defs/SubscriptionFilter"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionsAcknowledgedNotificationParams {
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
/**The subset of requested notification types the server agreed to honor.
Only includes notification types the server actually supports; if the
client requested an unsupported type (e.g., `promptsListChanged` when
the server has no prompts), it is omitted from this set.*/
pub notifications: SubscriptionFilter,
}
/**Sent from the client to open a long-lived channel for receiving notifications
outside the context of a specific request. Replaces the previous HTTP GET
endpoint and ensures consistent behavior between HTTP and STDIO.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Sent from the client to open a long-lived channel for receiving notifications\noutside the context of a specific request. Replaces the previous HTTP GET\nendpoint and ensures consistent behavior between HTTP and STDIO.",
/// "type": "object",
/// "required": [
/// "id",
/// "jsonrpc",
/// "method",
/// "params"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/$defs/RequestId"
/// },
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "method": {
/// "type": "string",
/// "const": "subscriptions/listen"
/// },
/// "params": {
/// "$ref": "#/$defs/SubscriptionsListenRequestParams"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionsListenRequest {
pub id: RequestId,
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
pub params: SubscriptionsListenRequestParams,
}
///Parameters for a {@link SubscriptionsListenRequestsubscriptions/listen} request.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for a {@link SubscriptionsListenRequestsubscriptions/listen} request.",
/// "type": "object",
/// "required": [
/// "_meta",
/// "notifications"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/RequestMetaObject"
/// },
/// "notifications": {
/// "description": "The notifications the client opts in to on this stream. The server\n**MUST NOT** send notification types the client has not explicitly\nrequested.",
/// "$ref": "#/$defs/SubscriptionFilter"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionsListenRequestParams {
#[serde(rename = "_meta")]
pub meta: RequestMetaObject,
/**The notifications the client opts in to on this stream. The server
**MUST NOT** send notification types the client has not explicitly
requested.*/
pub notifications: SubscriptionFilter,
}
///Text provided to or from an LLM.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Text provided to or from an LLM.",
/// "type": "object",
/// "required": [
/// "text",
/// "type"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "annotations": {
/// "description": "Optional annotations for the client.",
/// "$ref": "#/$defs/Annotations"
/// },
/// "text": {
/// "description": "The text content of the message.",
/// "type": "string"
/// },
/// "type": {
/// "type": "string",
/// "const": "text"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TextContent {
///Optional annotations for the client.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub annotations: ::core::option::Option<Annotations>,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
///The text content of the message.
pub text: ::alloc::string::String,
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
}
///`TextResourceContents`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "text",
/// "uri"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "mimeType": {
/// "description": "The MIME type of this resource, if known.",
/// "type": "string"
/// },
/// "text": {
/// "description": "The text of the item. This must only be set if the item can actually be represented as text (not binary data).",
/// "type": "string"
/// },
/// "uri": {
/// "description": "The URI of this resource.",
/// "type": "string",
/// "format": "uri"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TextResourceContents {
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
///The MIME type of this resource, if known.
#[serde(
rename = "mimeType",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub mime_type: ::core::option::Option<::alloc::string::String>,
///The text of the item. This must only be set if the item can actually be represented as text (not binary data).
pub text: ::alloc::string::String,
///The URI of this resource.
pub uri: ::alloc::string::String,
}
///Schema for multiple-selection enumeration with display titles for each option.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Schema for multiple-selection enumeration with display titles for each option.",
/// "type": "object",
/// "required": [
/// "items",
/// "type"
/// ],
/// "properties": {
/// "default": {
/// "description": "Optional default value.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "description": {
/// "description": "Optional description for the enum field.",
/// "type": "string"
/// },
/// "items": {
/// "description": "Schema for array items with enum options and display labels.",
/// "type": "object",
/// "required": [
/// "anyOf"
/// ],
/// "properties": {
/// "anyOf": {
/// "description": "Array of enum options with values and display labels.",
/// "type": "array",
/// "items": {
/// "type": "object",
/// "required": [
/// "const",
/// "title"
/// ],
/// "properties": {
/// "const": {
/// "description": "The constant enum value.",
/// "type": "string"
/// },
/// "title": {
/// "description": "Display title for this option.",
/// "type": "string"
/// }
/// }
/// }
/// }
/// }
/// },
/// "maxItems": {
/// "description": "Maximum number of items to select.",
/// "type": "integer"
/// },
/// "minItems": {
/// "description": "Minimum number of items to select.",
/// "type": "integer"
/// },
/// "title": {
/// "description": "Optional title for the enum field.",
/// "type": "string"
/// },
/// "type": {
/// "type": "string",
/// "const": "array"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TitledMultiSelectEnumSchema {
///Optional default value.
#[serde(default, skip_serializing_if = "::alloc::vec::Vec::is_empty")]
pub default: ::alloc::vec::Vec<::alloc::string::String>,
///Optional description for the enum field.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub description: ::core::option::Option<::alloc::string::String>,
pub items: TitledMultiSelectEnumSchemaItems,
///Maximum number of items to select.
#[serde(
rename = "maxItems",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub max_items: ::core::option::Option<i64>,
///Minimum number of items to select.
#[serde(
rename = "minItems",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub min_items: ::core::option::Option<i64>,
///Optional title for the enum field.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub title: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
}
///Schema for array items with enum options and display labels.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Schema for array items with enum options and display labels.",
/// "type": "object",
/// "required": [
/// "anyOf"
/// ],
/// "properties": {
/// "anyOf": {
/// "description": "Array of enum options with values and display labels.",
/// "type": "array",
/// "items": {
/// "type": "object",
/// "required": [
/// "const",
/// "title"
/// ],
/// "properties": {
/// "const": {
/// "description": "The constant enum value.",
/// "type": "string"
/// },
/// "title": {
/// "description": "Display title for this option.",
/// "type": "string"
/// }
/// }
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TitledMultiSelectEnumSchemaItems {
///Array of enum options with values and display labels.
#[serde(rename = "anyOf")]
pub any_of: ::alloc::vec::Vec<TitledMultiSelectEnumSchemaItemsAnyOfItem>,
}
///`TitledMultiSelectEnumSchemaItemsAnyOfItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "const",
/// "title"
/// ],
/// "properties": {
/// "const": {
/// "description": "The constant enum value.",
/// "type": "string"
/// },
/// "title": {
/// "description": "Display title for this option.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TitledMultiSelectEnumSchemaItemsAnyOfItem {
///The constant enum value.
#[serde(rename = "const")]
pub const_: ::alloc::string::String,
///Display title for this option.
pub title: ::alloc::string::String,
}
///Schema for single-selection enumeration with display titles for each option.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Schema for single-selection enumeration with display titles for each option.",
/// "type": "object",
/// "required": [
/// "oneOf",
/// "type"
/// ],
/// "properties": {
/// "default": {
/// "description": "Optional default value.",
/// "type": "string"
/// },
/// "description": {
/// "description": "Optional description for the enum field.",
/// "type": "string"
/// },
/// "oneOf": {
/// "description": "Array of enum options with values and display labels.",
/// "type": "array",
/// "items": {
/// "type": "object",
/// "required": [
/// "const",
/// "title"
/// ],
/// "properties": {
/// "const": {
/// "description": "The enum value.",
/// "type": "string"
/// },
/// "title": {
/// "description": "Display label for this option.",
/// "type": "string"
/// }
/// }
/// }
/// },
/// "title": {
/// "description": "Optional title for the enum field.",
/// "type": "string"
/// },
/// "type": {
/// "type": "string",
/// "const": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TitledSingleSelectEnumSchema {
///Optional default value.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub default: ::core::option::Option<::alloc::string::String>,
///Optional description for the enum field.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub description: ::core::option::Option<::alloc::string::String>,
///Array of enum options with values and display labels.
#[serde(rename = "oneOf")]
pub one_of: ::alloc::vec::Vec<TitledSingleSelectEnumSchemaOneOfItem>,
///Optional title for the enum field.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub title: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
}
///`TitledSingleSelectEnumSchemaOneOfItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "const",
/// "title"
/// ],
/// "properties": {
/// "const": {
/// "description": "The enum value.",
/// "type": "string"
/// },
/// "title": {
/// "description": "Display label for this option.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TitledSingleSelectEnumSchemaOneOfItem {
///The enum value.
#[serde(rename = "const")]
pub const_: ::alloc::string::String,
///Display label for this option.
pub title: ::alloc::string::String,
}
///Definition for a tool the client can call.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Definition for a tool the client can call.",
/// "type": "object",
/// "required": [
/// "inputSchema",
/// "name"
/// ],
/// "properties": {
/// "_meta": {
/// "$ref": "#/$defs/MetaObject"
/// },
/// "annotations": {
/// "description": "Optional additional tool information.\n\nDisplay name precedence order is: `title`, `annotations.title`, then `name`.",
/// "$ref": "#/$defs/ToolAnnotations"
/// },
/// "description": {
/// "description": "A human-readable description of the tool.\n\nThis can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a \"hint\" to the model.",
/// "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"
/// }
/// },
/// "inputSchema": {
/// "description": "A JSON Schema object defining the expected parameters for the tool.\n\nTool arguments are always JSON objects, so `type: \"object\"` is required at the root.\nBeyond that, any JSON Schema 2020-12 keyword may appear alongside `type` — including\ncomposition keywords (`oneOf`, `anyOf`, `allOf`, `not`), conditional keywords\n(`if`/`then`/`else`), reference keywords (`$ref`, `$defs`, `$anchor`), and any other\nstandard validation or annotation keywords.\n\nDefaults to JSON Schema 2020-12 when no explicit `$schema` is provided.",
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "$schema": {
/// "type": "string"
/// },
/// "type": {
/// "type": "string",
/// "const": "object"
/// }
/// },
/// "additionalProperties": {}
/// },
/// "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"
/// },
/// "outputSchema": {
/// "description": "An optional JSON Schema object defining the structure of the tool's output returned in\nthe structuredContent field of a {@link CallToolResult}. This can be any valid JSON Schema 2020-12.\n\nDefaults to JSON Schema 2020-12 when no explicit `$schema` is provided.",
/// "type": "object",
/// "properties": {
/// "$schema": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": {}
/// },
/// "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 {@link Tool},\nwhere `annotations.title` should be given precedence over using `name`,\nif present).",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Tool {
/**Optional additional tool information.
Display name precedence order is: `title`, `annotations.title`, then `name`.*/
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub annotations: ::core::option::Option<ToolAnnotations>,
/**A human-readable description of the tool.
This can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a "hint" to the model.*/
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub description: ::core::option::Option<::alloc::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 = "::alloc::vec::Vec::is_empty")]
pub icons: ::alloc::vec::Vec<Icon>,
#[serde(rename = "inputSchema")]
pub input_schema: ToolInputSchema,
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
///Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).
pub name: ::alloc::string::String,
#[serde(
rename = "outputSchema",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub output_schema: ::core::option::Option<ToolOutputSchema>,
/**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 {@link Tool},
where `annotations.title` should be given precedence over using `name`,
if present).*/
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub title: ::core::option::Option<::alloc::string::String>,
}
/**Additional properties describing a {@link Tool} to clients.
NOTE: all properties in `ToolAnnotations` are **hints**.
They are not guaranteed to provide a faithful description of
tool behavior (including descriptive properties like `title`).
Clients should never make tool use decisions based on `ToolAnnotations`
received from untrusted servers.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Additional properties describing a {@link Tool} to clients.\n\nNOTE: all properties in `ToolAnnotations` are **hints**.\nThey are not guaranteed to provide a faithful description of\ntool behavior (including descriptive properties like `title`).\n\nClients should never make tool use decisions based on `ToolAnnotations`\nreceived from untrusted servers.",
/// "type": "object",
/// "properties": {
/// "destructiveHint": {
/// "description": "If true, the tool may perform destructive updates to its environment.\nIf false, the tool performs only additive updates.\n\n(This property is meaningful only when `readOnlyHint == false`)\n\nDefault: true",
/// "type": "boolean"
/// },
/// "idempotentHint": {
/// "description": "If true, calling the tool repeatedly with the same arguments\nwill have no additional effect on its environment.\n\n(This property is meaningful only when `readOnlyHint == false`)\n\nDefault: false",
/// "type": "boolean"
/// },
/// "openWorldHint": {
/// "description": "If true, this tool may interact with an \"open world\" of external\nentities. If false, the tool's domain of interaction is closed.\nFor example, the world of a web search tool is open, whereas that\nof a memory tool is not.\n\nDefault: true",
/// "type": "boolean"
/// },
/// "readOnlyHint": {
/// "description": "If true, the tool does not modify its environment.\n\nDefault: false",
/// "type": "boolean"
/// },
/// "title": {
/// "description": "A human-readable title for the tool.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ToolAnnotations {
/**If true, the tool may perform destructive updates to its environment.
If false, the tool performs only additive updates.
(This property is meaningful only when `readOnlyHint == false`)
Default: true*/
#[serde(
rename = "destructiveHint",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub destructive_hint: ::core::option::Option<bool>,
/**If true, calling the tool repeatedly with the same arguments
will have no additional effect on its environment.
(This property is meaningful only when `readOnlyHint == false`)
Default: false*/
#[serde(
rename = "idempotentHint",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub idempotent_hint: ::core::option::Option<bool>,
/**If true, this tool may interact with an "open world" of external
entities. If false, the tool's domain of interaction is closed.
For example, the world of a web search tool is open, whereas that
of a memory tool is not.
Default: true*/
#[serde(
rename = "openWorldHint",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub open_world_hint: ::core::option::Option<bool>,
/**If true, the tool does not modify its environment.
Default: false*/
#[serde(
rename = "readOnlyHint",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub read_only_hint: ::core::option::Option<bool>,
///A human-readable title for the tool.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub title: ::core::option::Option<::alloc::string::String>,
}
impl ::core::default::Default for ToolAnnotations {
fn default() -> Self {
Self {
destructive_hint: Default::default(),
idempotent_hint: Default::default(),
open_world_hint: Default::default(),
read_only_hint: Default::default(),
title: Default::default(),
}
}
}
///Controls tool selection behavior for sampling requests.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Controls tool selection behavior for sampling requests.",
/// "type": "object",
/// "properties": {
/// "mode": {
/// "description": "Controls the tool use ability of the model:\n- `\"auto\"`: Model decides whether to use tools (default)\n- `\"required\"`: Model MUST use at least one tool before completing\n- `\"none\"`: Model MUST NOT use any tools",
/// "type": "string",
/// "enum": [
/// "auto",
/// "none",
/// "required"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ToolChoice {
/**Controls the tool use ability of the model:
- `"auto"`: Model decides whether to use tools (default)
- `"required"`: Model MUST use at least one tool before completing
- `"none"`: Model MUST NOT use any tools*/
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub mode: ::core::option::Option<ToolChoiceMode>,
}
impl ::core::default::Default for ToolChoice {
fn default() -> Self {
Self {
mode: Default::default(),
}
}
}
/**Controls the tool use ability of the model:
- `"auto"`: Model decides whether to use tools (default)
- `"required"`: Model MUST use at least one tool before completing
- `"none"`: Model MUST NOT use any tools*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Controls the tool use ability of the model:\n- `\"auto\"`: Model decides whether to use tools (default)\n- `\"required\"`: Model MUST use at least one tool before completing\n- `\"none\"`: Model MUST NOT use any tools",
/// "type": "string",
/// "enum": [
/// "auto",
/// "none",
/// "required"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ToolChoiceMode {
#[serde(rename = "auto")]
Auto,
#[serde(rename = "none")]
None,
#[serde(rename = "required")]
Required,
}
impl ::core::fmt::Display for ToolChoiceMode {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match *self {
Self::Auto => f.write_str("auto"),
Self::None => f.write_str("none"),
Self::Required => f.write_str("required"),
}
}
}
impl ::core::str::FromStr for ToolChoiceMode {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
match value {
"auto" => Ok(Self::Auto),
"none" => Ok(Self::None),
"required" => Ok(Self::Required),
_ => Err("invalid value".into()),
}
}
}
impl ::core::convert::TryFrom<&str> for ToolChoiceMode {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<&::alloc::string::String> for ToolChoiceMode {
type Error = self::error::ConversionError;
fn try_from(
value: &::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::core::convert::TryFrom<::alloc::string::String> for ToolChoiceMode {
type Error = self::error::ConversionError;
fn try_from(
value: ::alloc::string::String,
) -> ::core::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
/**A JSON Schema object defining the expected parameters for the tool.
Tool arguments are always JSON objects, so `type: "object"` is required at the root.
Beyond that, any JSON Schema 2020-12 keyword may appear alongside `type` — including
composition keywords (`oneOf`, `anyOf`, `allOf`, `not`), conditional keywords
(`if`/`then`/`else`), reference keywords (`$ref`, `$defs`, `$anchor`), and any other
standard validation or annotation keywords.
Defaults to JSON Schema 2020-12 when no explicit `$schema` is provided.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A JSON Schema object defining the expected parameters for the tool.\n\nTool arguments are always JSON objects, so `type: \"object\"` is required at the root.\nBeyond that, any JSON Schema 2020-12 keyword may appear alongside `type` — including\ncomposition keywords (`oneOf`, `anyOf`, `allOf`, `not`), conditional keywords\n(`if`/`then`/`else`), reference keywords (`$ref`, `$defs`, `$anchor`), and any other\nstandard validation or annotation keywords.\n\nDefaults to JSON Schema 2020-12 when no explicit `$schema` is provided.",
/// "type": "object",
/// "required": [
/// "type"
/// ],
/// "properties": {
/// "$schema": {
/// "type": "string"
/// },
/// "type": {
/// "type": "string",
/// "const": "object"
/// }
/// },
/// "additionalProperties": {}
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ToolInputSchema {
#[serde(
rename = "$schema",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub schema: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
#[serde(flatten)]
pub extra: ::serde_json::Map<::alloc::string::String, ::serde_json::Value>,
}
///An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.",
/// "type": "object",
/// "required": [
/// "jsonrpc",
/// "method"
/// ],
/// "properties": {
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// },
/// "method": {
/// "type": "string",
/// "const": "notifications/tools/list_changed"
/// },
/// "params": {
/// "$ref": "#/$defs/NotificationParams"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ToolListChangedNotification {
pub jsonrpc: ::alloc::string::String,
pub method: ::alloc::string::String,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub params: ::core::option::Option<NotificationParams>,
}
/**An optional JSON Schema object defining the structure of the tool's output returned in
the structuredContent field of a {@link CallToolResult}. This can be any valid JSON Schema 2020-12.
Defaults to JSON Schema 2020-12 when no explicit `$schema` is provided.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "An optional JSON Schema object defining the structure of the tool's output returned in\nthe structuredContent field of a {@link CallToolResult}. This can be any valid JSON Schema 2020-12.\n\nDefaults to JSON Schema 2020-12 when no explicit `$schema` is provided.",
/// "type": "object",
/// "properties": {
/// "$schema": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": {}
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ToolOutputSchema {
#[serde(
rename = "$schema",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub schema: ::core::option::Option<::alloc::string::String>,
#[serde(flatten)]
pub extra: ::serde_json::Map<::alloc::string::String, ::serde_json::Value>,
}
///The result of a tool use, provided by the user back to the assistant.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The result of a tool use, provided by the user back to the assistant.",
/// "type": "object",
/// "required": [
/// "content",
/// "toolUseId",
/// "type"
/// ],
/// "properties": {
/// "_meta": {
/// "description": "Optional metadata about the tool result. Clients SHOULD preserve this field when\nincluding tool results in subsequent sampling requests to enable caching optimizations.",
/// "$ref": "#/$defs/MetaObject"
/// },
/// "content": {
/// "description": "The unstructured result content of the tool use.\n\nThis has the same format as {@link CallToolResult.content} and can include text, images,\naudio, resource links, and embedded resources.",
/// "type": "array",
/// "items": {
/// "$ref": "#/$defs/ContentBlock"
/// }
/// },
/// "isError": {
/// "description": "Whether the tool use resulted in an error.\n\nIf true, the content typically describes the error that occurred.\nDefault: false",
/// "type": "boolean"
/// },
/// "structuredContent": {
/// "description": "An optional structured result value.\n\nThis can be any JSON value (object, array, string, number, boolean, or null).\nIf the tool defined an {@link Tool.outputSchema}, this SHOULD conform to that schema."
/// },
/// "toolUseId": {
/// "description": "The ID of the tool use this result corresponds to.\n\nThis MUST match the ID from a previous {@link ToolUseContent}.",
/// "type": "string"
/// },
/// "type": {
/// "type": "string",
/// "const": "tool_result"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ToolResultContent {
/**The unstructured result content of the tool use.
This has the same format as {@link CallToolResult.content} and can include text, images,
audio, resource links, and embedded resources.*/
pub content: ::alloc::vec::Vec<ContentBlock>,
/**Whether the tool use resulted in an error.
If true, the content typically describes the error that occurred.
Default: false*/
#[serde(
rename = "isError",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub is_error: ::core::option::Option<bool>,
/**Optional metadata about the tool result. Clients SHOULD preserve this field when
including tool results in subsequent sampling requests to enable caching optimizations.*/
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
/**An optional structured result value.
This can be any JSON value (object, array, string, number, boolean, or null).
If the tool defined an {@link Tool.outputSchema}, this SHOULD conform to that schema.*/
#[serde(
rename = "structuredContent",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub structured_content: ::core::option::Option<::serde_json::Value>,
/**The ID of the tool use this result corresponds to.
This MUST match the ID from a previous {@link ToolUseContent}.*/
#[serde(rename = "toolUseId")]
pub tool_use_id: ::alloc::string::String,
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
}
///A request from the assistant to call a tool.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A request from the assistant to call a tool.",
/// "type": "object",
/// "required": [
/// "id",
/// "input",
/// "name",
/// "type"
/// ],
/// "properties": {
/// "_meta": {
/// "description": "Optional metadata about the tool use. Clients SHOULD preserve this field when\nincluding tool uses in subsequent sampling requests to enable caching optimizations.",
/// "$ref": "#/$defs/MetaObject"
/// },
/// "id": {
/// "description": "A unique identifier for this tool use.\n\nThis ID is used to match tool results to their corresponding tool uses.",
/// "type": "string"
/// },
/// "input": {
/// "description": "The arguments to pass to the tool, conforming to the tool's input schema.",
/// "type": "object",
/// "additionalProperties": {}
/// },
/// "name": {
/// "description": "The name of the tool to call.",
/// "type": "string"
/// },
/// "type": {
/// "type": "string",
/// "const": "tool_use"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ToolUseContent {
/**A unique identifier for this tool use.
This ID is used to match tool results to their corresponding tool uses.*/
pub id: ::alloc::string::String,
///The arguments to pass to the tool, conforming to the tool's input schema.
pub input: ::serde_json::Map<::alloc::string::String, ::serde_json::Value>,
/**Optional metadata about the tool use. Clients SHOULD preserve this field when
including tool uses in subsequent sampling requests to enable caching optimizations.*/
#[serde(
rename = "_meta",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub meta: ::core::option::Option<MetaObject>,
///The name of the tool to call.
pub name: ::alloc::string::String,
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
}
/**Returned when the request's protocol version is unknown to the server or
unsupported (e.g., a known experimental or draft version the server has
chosen not to implement). For HTTP, the response status code MUST be
`400 Bad Request`.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Returned when the request's protocol version is unknown to the server or\nunsupported (e.g., a known experimental or draft version the server has\nchosen not to implement). For HTTP, the response status code MUST be\n`400 Bad Request`.",
/// "type": "object",
/// "required": [
/// "error",
/// "jsonrpc"
/// ],
/// "properties": {
/// "error": {
/// "type": "object",
/// "required": [
/// "code",
/// "data",
/// "message"
/// ],
/// "properties": {
/// "code": {
/// "type": "integer",
/// "const": -32004
/// },
/// "data": {
/// "type": "object",
/// "required": [
/// "requested",
/// "supported"
/// ],
/// "properties": {
/// "requested": {
/// "description": "The protocol version that was requested by the client.",
/// "type": "string"
/// },
/// "supported": {
/// "description": "Protocol versions the server supports. The client should choose a\nmutually supported version from this list and retry.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// }
/// },
/// "message": {
/// "description": "A short description of the error. The message SHOULD be limited to a concise single sentence.",
/// "type": "string"
/// }
/// }
/// },
/// "id": {
/// "$ref": "#/$defs/RequestId"
/// },
/// "jsonrpc": {
/// "type": "string",
/// "const": "2.0"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UnsupportedProtocolVersionError {
pub error: UnsupportedProtocolVersionErrorError,
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub id: ::core::option::Option<RequestId>,
pub jsonrpc: ::alloc::string::String,
}
///`UnsupportedProtocolVersionErrorError`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "code",
/// "data",
/// "message"
/// ],
/// "properties": {
/// "code": {
/// "type": "integer",
/// "const": -32004
/// },
/// "data": {
/// "type": "object",
/// "required": [
/// "requested",
/// "supported"
/// ],
/// "properties": {
/// "requested": {
/// "description": "The protocol version that was requested by the client.",
/// "type": "string"
/// },
/// "supported": {
/// "description": "Protocol versions the server supports. The client should choose a\nmutually supported version from this list and retry.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// }
/// },
/// "message": {
/// "description": "A short description of the error. The message SHOULD be limited to a concise single sentence.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UnsupportedProtocolVersionErrorError {
pub code: i64,
pub data: UnsupportedProtocolVersionErrorErrorData,
///A short description of the error. The message SHOULD be limited to a concise single sentence.
pub message: ::alloc::string::String,
}
///`UnsupportedProtocolVersionErrorErrorData`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "requested",
/// "supported"
/// ],
/// "properties": {
/// "requested": {
/// "description": "The protocol version that was requested by the client.",
/// "type": "string"
/// },
/// "supported": {
/// "description": "Protocol versions the server supports. The client should choose a\nmutually supported version from this list and retry.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UnsupportedProtocolVersionErrorErrorData {
///The protocol version that was requested by the client.
pub requested: ::alloc::string::String,
/**Protocol versions the server supports. The client should choose a
mutually supported version from this list and retry.*/
pub supported: ::alloc::vec::Vec<::alloc::string::String>,
}
///Schema for multiple-selection enumeration without display titles for options.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Schema for multiple-selection enumeration without display titles for options.",
/// "type": "object",
/// "required": [
/// "items",
/// "type"
/// ],
/// "properties": {
/// "default": {
/// "description": "Optional default value.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "description": {
/// "description": "Optional description for the enum field.",
/// "type": "string"
/// },
/// "items": {
/// "description": "Schema for the array items.",
/// "type": "object",
/// "required": [
/// "enum",
/// "type"
/// ],
/// "properties": {
/// "enum": {
/// "description": "Array of enum values to choose from.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "type": {
/// "type": "string",
/// "const": "string"
/// }
/// }
/// },
/// "maxItems": {
/// "description": "Maximum number of items to select.",
/// "type": "integer"
/// },
/// "minItems": {
/// "description": "Minimum number of items to select.",
/// "type": "integer"
/// },
/// "title": {
/// "description": "Optional title for the enum field.",
/// "type": "string"
/// },
/// "type": {
/// "type": "string",
/// "const": "array"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UntitledMultiSelectEnumSchema {
///Optional default value.
#[serde(default, skip_serializing_if = "::alloc::vec::Vec::is_empty")]
pub default: ::alloc::vec::Vec<::alloc::string::String>,
///Optional description for the enum field.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub description: ::core::option::Option<::alloc::string::String>,
pub items: UntitledMultiSelectEnumSchemaItems,
///Maximum number of items to select.
#[serde(
rename = "maxItems",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub max_items: ::core::option::Option<i64>,
///Minimum number of items to select.
#[serde(
rename = "minItems",
default,
skip_serializing_if = "::core::option::Option::is_none"
)]
pub min_items: ::core::option::Option<i64>,
///Optional title for the enum field.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub title: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
}
///Schema for the array items.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Schema for the array items.",
/// "type": "object",
/// "required": [
/// "enum",
/// "type"
/// ],
/// "properties": {
/// "enum": {
/// "description": "Array of enum values to choose from.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "type": {
/// "type": "string",
/// "const": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UntitledMultiSelectEnumSchemaItems {
///Array of enum values to choose from.
#[serde(rename = "enum")]
pub enum_: ::alloc::vec::Vec<::alloc::string::String>,
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
}
///Schema for single-selection enumeration without display titles for options.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Schema for single-selection enumeration without display titles for options.",
/// "type": "object",
/// "required": [
/// "enum",
/// "type"
/// ],
/// "properties": {
/// "default": {
/// "description": "Optional default value.",
/// "type": "string"
/// },
/// "description": {
/// "description": "Optional description for the enum field.",
/// "type": "string"
/// },
/// "enum": {
/// "description": "Array of enum values to choose from.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "title": {
/// "description": "Optional title for the enum field.",
/// "type": "string"
/// },
/// "type": {
/// "type": "string",
/// "const": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UntitledSingleSelectEnumSchema {
///Optional default value.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub default: ::core::option::Option<::alloc::string::String>,
///Optional description for the enum field.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub description: ::core::option::Option<::alloc::string::String>,
///Array of enum values to choose from.
#[serde(rename = "enum")]
pub enum_: ::alloc::vec::Vec<::alloc::string::String>,
///Optional title for the enum field.
#[serde(default, skip_serializing_if = "::core::option::Option::is_none")]
pub title: ::core::option::Option<::alloc::string::String>,
#[serde(rename = "type")]
pub type_: ::alloc::string::String,
}