Crate rust_mcp_schema

Crate rust_mcp_schema 

Source

Modules§

mcp_2025_11_25
schema_utils
Latest MCP Protocol 2025_11_25

Structs§

Annotations
Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
AudioContent
Audio provided to or from an LLM.
BaseMetadata
Base interface for metadata with name (identifier) and title (display name) properties.
BlobResourceContents
BlobResourceContents
BooleanSchema
BooleanSchema
CallToolMeta
See General fields: _meta for notes on _meta usage.
CallToolRequest
Used by the client to invoke a tool provided by the server.
CallToolRequestParams
Parameters for a tools/call request.
CallToolResult
The server’s response to a tool call.
CancelTaskParams
CancelTaskParams
CancelTaskRequest
A request to cancel a task.
CancelTaskResult
The response to a tasks/cancel request.
CancelledNotification
This notification can be sent by either side to indicate that it is cancelling a previously-issued request. The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished. This notification indicates that the result will be unused, so any associated processing SHOULD cease. A client MUST NOT attempt to cancel its initialize request. For task cancellation, use the tasks/cancel request instead of this notification.
CancelledNotificationParams
Parameters for a notifications/cancelled notification.
ClientCapabilities
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.
ClientElicitation
Present if the client supports elicitation from the server.
ClientRoots
Present if the client supports listing roots.
ClientSampling
Present if the client supports sampling from an LLM.
ClientTaskElicitation
Task support for elicitation-related requests.
ClientTaskRequest
Specifies which request types can be augmented with tasks.
ClientTaskSampling
Task support for sampling-related requests.
ClientTasks
Present if the client supports task-augmented requests.
CompleteRequest
A request from the client to the server, to ask for completion options.
CompleteRequestArgument
The argument’s information
CompleteRequestContext
Additional, optional context for completions
CompleteRequestMeta
See General fields: _meta for notes on _meta usage.
CompleteRequestParams
Parameters for a completion/complete request.
CompleteResult
The server’s response to a completion/complete request
CompleteResultCompletion
CompleteResultCompletion
CreateMessageRequest
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.
CreateMessageRequestParams
Parameters for a sampling/createMessage request.
CreateMessageResult
The client’s response to a sampling/createMessage request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.
CreateTaskResult
A response to a task-augmented request.
Cursor
An opaque token used to represent a cursor for pagination.
ElicitCompleteParams
ElicitCompleteParams
ElicitFormMeta
See General fields: _meta for notes on _meta usage.
ElicitFormSchema
A restricted subset of JSON Schema. Only top-level properties are allowed, without nesting.
ElicitRequest
A request from the server to elicit additional information from the user via the client.
ElicitRequestFormParams
The parameters for a request to elicit non-sensitive information from the user via a form in the client.
ElicitRequestUrlParams
The parameters for a request to elicit information from the user via a URL in the client.
ElicitResult
The client’s response to an elicitation request.
ElicitUrlMeta
See General fields: _meta for notes on _meta usage.
ElicitationCompleteNotification
An optional notification from the server to the client, informing it of a completion of a out-of-band elicitation request.
EmbeddedResource
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.
EmptyResult
EmptyResult
GetPromptMeta
See General fields: _meta for notes on _meta usage.
GetPromptRequest
Used by the client to get a prompt provided by the server.
GetPromptRequestParams
Parameters for a prompts/get request.
GetPromptResult
The server’s response to a prompts/get request from the client.
GetTaskParams
GetTaskParams
GetTaskPayloadParams
GetTaskPayloadParams
GetTaskPayloadRequest
A request to retrieve the result of a completed task.
GetTaskPayloadResult
The response to a tasks/result request. The structure matches the result type of the original request. For example, a tools/call task would return the CallToolResult structure.
GetTaskRequest
A request to retrieve the state of a task.
GetTaskResult
The response to a tasks/get request.
Icon
An optionally-sized icon that can be displayed in a user interface.
Icons
Base interface to add icons property.
ImageContent
An image provided to or from an LLM.
Implementation
Describes the MCP implementation.
InitializeMeta
See General fields: _meta for notes on _meta usage.
InitializeRequest
This request is sent from the client to the server when it first connects, asking it to begin initialization.
InitializeRequestParams
Parameters for an initialize request.
InitializeResult
After receiving an initialize request from the client, the server sends this response.
InitializedNotification
This notification is sent from the client to the server after initialization has finished.
JsonrpcErrorResponse
A response to a request that indicates an error occurred.
JsonrpcNotification
A notification which does not expect a response.
JsonrpcRequest
A request that expects a response.
JsonrpcResultResponse
A successful (non-error) response to a request.
LegacyTitledEnumSchema
Use TitledSingleSelectEnumSchema instead. This interface will be removed in a future version.
ListPromptsRequest
Sent from the client to request a list of prompts and prompt templates the server has.
ListPromptsResult
The server’s response to a prompts/list request from the client.
ListResourceTemplatesRequest
Sent from the client to request a list of resource templates the server has.
ListResourceTemplatesResult
The server’s response to a resources/templates/list request from the client.
ListResourcesRequest
Sent from the client to request a list of resources the server has.
ListResourcesResult
The server’s response to a resources/list request from the client.
ListRootsRequest
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.
ListRootsResult
The client’s response to a roots/list request from the server. This result contains an array of Root objects, each representing a root directory or file that the server can operate on.
ListTasksRequest
A request to retrieve a list of tasks.
ListTasksResult
The response to a tasks/list request.
ListToolsRequest
Sent from the client to request a list of tools the server has.
ListToolsResult
The server’s response to a tools/list request from the client.
LoggingMessageNotification
JSONRPCNotification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.
LoggingMessageNotificationParams
Parameters for a notifications/message notification.
MessageMeta
See General fields: _meta for notes on _meta usage.
ModelHint
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.
ModelPreferences
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.
Notification
Notification
NotificationParams
NotificationParams
NumberSchema
NumberSchema
PaginatedMeta
See General fields: _meta for notes on _meta usage.
PaginatedRequest
PaginatedRequest
PaginatedRequestParams
Common parameters for paginated requests.
PaginatedResult
PaginatedResult
ParseProtocolVersionError
PingRequest
A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.
ProgressNotification
An out-of-band notification used to inform the receiver of a progress update for a long-running request.
ProgressNotificationParams
Parameters for a notifications/progress notification.
Prompt
A prompt or prompt template that the server offers.
PromptArgument
Describes an argument that a prompt can accept.
PromptListChangedNotification
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.
PromptMessage
Describes a message returned as part of a prompt. This is similar to SamplingMessage, but also supports the embedding of resources from the MCP server.
PromptReference
Identifies a prompt.
ReadResourceMeta
See General fields: _meta for notes on _meta usage.
ReadResourceRequest
Sent from the client to the server, to read a specific resource URI.
ReadResourceRequestParams
Parameters for a resources/read request.
ReadResourceResult
The server’s response to a resources/read request from the client.
RelatedTaskMetadata
Metadata for associating messages with a task. Include this in the _meta field under the key io.modelcontextprotocol/related-task.
Request
Request
RequestParams
Common params for any request.
RequestParamsMeta
See General fields: _meta for notes on _meta usage.
Resource
A known resource that the server is capable of reading.
ResourceContents
The contents of a specific resource or sub-resource.
ResourceLink
A resource that the server is capable of reading, included in a prompt or tool call result. Note: resource links returned by tools are not guaranteed to appear in the results of resources/list requests.
ResourceListChangedNotification
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.
ResourceMeta
See General fields: _meta for notes on _meta usage.
ResourceRequestParams
Common parameters when working with resources.
ResourceTemplate
A template description for resources available on the server.
ResourceTemplateReference
A reference to a resource or resource template definition.
ResourceUpdatedNotification
A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.
ResourceUpdatedNotificationParams
Parameters for a notifications/resources/updated notification.
Result
Result
Root
Represents a root directory or file that the server can operate on.
RootsListChangedNotification
A notification from the client to the server, informing it that the list of roots has changed. This notification should be sent whenever the client adds, removes, or modifies any root. The server should then request an updated list of roots using the ListRootsRequest.
RpcError
RpcError
SamplingMessage
Describes a message issued to or received from an LLM API.
ServerCapabilities
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.
ServerCapabilitiesPrompts
Present if the server offers any prompt templates.
ServerCapabilitiesResources
Present if the server offers any resources to read.
ServerCapabilitiesTools
Present if the server offers any tools to call.
ServerTaskRequest
Specifies which request types can be augmented with tasks.
ServerTaskTools
Task support for tool-related requests.
ServerTasks
Present if the server supports task-augmented requests.
SetLevelMeta
See General fields: _meta for notes on _meta usage.
SetLevelRequest
A request from the client to the server, to enable or adjust logging.
SetLevelRequestParams
Parameters for a logging/setLevel request.
StringSchema
StringSchema
SubscribeMeta
See General fields: _meta for notes on _meta usage.
SubscribeRequest
Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
SubscribeRequestParams
Parameters for a resources/subscribe request.
Task
Data associated with a task.
TaskAugmentedMeta
See General fields: _meta for notes on _meta usage.
TaskAugmentedRequestParams
Common params for any task-augmented request.
TaskMetadata
Metadata for augmenting a request with task execution. Include this in the task field of the request parameters.
TaskStatusNotification
An optional notification from the receiver to the requestor, informing them that a task’s status has changed. Receivers are not required to send these notifications.
TaskStatusNotificationParams
Parameters for a notifications/tasks/status notification.
TextContent
Text provided to or from an LLM.
TextResourceContents
TextResourceContents
TitledMultiSelectEnumSchema
Schema for multiple-selection enumeration with display titles for each option.
TitledMultiSelectEnumSchemaItems
Schema for array items with enum options and display labels.
TitledMultiSelectEnumSchemaItemsAnyOfItem
TitledMultiSelectEnumSchemaItemsAnyOfItem
TitledSingleSelectEnumSchema
Schema for single-selection enumeration with display titles for each option.
TitledSingleSelectEnumSchemaOneOfItem
TitledSingleSelectEnumSchemaOneOfItem
Tool
Definition for a tool the client can call.
ToolAnnotations
Additional properties describing a 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.
ToolChoice
Controls tool selection behavior for sampling requests.
ToolExecution
Execution-related properties for a tool.
ToolInputSchema
A JSON Schema object defining the expected parameters for the tool.
ToolListChangedNotification
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.
ToolOutputSchema
An optional JSON Schema object defining the structure of the tool’s output returned in the structuredContent field of a CallToolResult. Defaults to JSON Schema 2020-12 when no explicit $schema is provided. Currently restricted to type: “object” at the root level.
ToolResultContent
The result of a tool use, provided by the user back to the assistant.
ToolUseContent
A request from the assistant to call a tool.
UnsubscribeMeta
See General fields: _meta for notes on _meta usage.
UnsubscribeRequest
Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
UnsubscribeRequestParams
Parameters for a resources/unsubscribe request.
UntitledMultiSelectEnumSchema
Schema for multiple-selection enumeration without display titles for options.
UntitledMultiSelectEnumSchemaItems
Schema for the array items.
UntitledSingleSelectEnumSchema
Schema for single-selection enumeration without display titles for options.
UrlElicitError
UrlElicitError
UrlElicitErrorData
UrlElicitErrorData
UrlElicitationRequiredError
An error response that indicates that the server requires the client to provide additional information via an elicitation request.

Enums§

ClientNotification
ClientNotification
ClientRequest
ClientRequest
ClientResult
ClientResult
CompleteRequestRef
CompleteRequestRef
ContentBlock
ContentBlock
CreateMessageContent
CreateMessageContent
ElicitRequestParams
The parameters for a request to elicit additional information from the user via the client.
ElicitResultAction
The user action in response to the elicitation.
ElicitResultContent
ElicitResultContent
ElicitResultContentPrimitive
ElicitResultContentPrimitive
EmbeddedResourceResource
EmbeddedResourceResource
EnumSchema
EnumSchema
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.
IncludeContext
A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. Default is “none”. Values “thisServer” and “allServers” are soft-deprecated. Servers SHOULD only use these values if the client declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.
JsonrpcMessage
Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.
JsonrpcResponse
A response to a request, containing either the result or error.
LoggingLevel
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
MultiSelectEnumSchema
MultiSelectEnumSchema
NumberSchemaType
NumberSchemaType
PrimitiveSchemaDefinition
Restricted schema definitions that only allow primitive types without nested objects or arrays.
ProgressToken
A progress token, used to associate progress notifications with the original request.
ProtocolVersion
ReadResourceContent
ReadResourceContent
RequestId
A uniquely identifying ID for a request in JSON-RPC.
Role
The sender or recipient of messages and data in a conversation.
SamplingMessageContent
SamplingMessageContent
SamplingMessageContentBlock
SamplingMessageContentBlock
ServerNotification
ServerNotification
ServerRequest
ServerRequest
ServerResult
ServerResult
SingleSelectEnumSchema
SingleSelectEnumSchema
StringSchemaFormat
StringSchemaFormat
TaskStatus
The status of a task.
ToolChoiceMode
Controls the tool use ability of the model:
ToolExecutionTaskSupport
Indicates whether this tool supports task-augmented execution. This allows clients to handle long-running operations through polling the task system.

Constants§

INTERNAL_ERROR
Internal error. Internal JSON-RPC error.
INVALID_PARAMS
Invalid param. Invalid method parameter(s).
INVALID_REQUEST
Invalid Request. The JSON sent is not a valid Request object.
JSONRPC_VERSION
JSON-RPC Version
LATEST_PROTOCOL_VERSION
MCP Protocol Version
METHOD_NOT_FOUND
Method not found. The method does not exist / is not available.
PARSE_ERROR
Parse error. Invalid JSON was received. An error occurred while parsing the JSON text.
URL_ELICITATION_REQUIRED
The server cannot proceed without additional client input.

Type Aliases§

ClientCapabilitiesRootsDeprecated
CompleteRequestParamsArgumentDeprecated
CompleteRequestParamsContextDeprecated
CompleteRequestParamsRefDeprecated
CreateMessageRequestParamsIncludeContextDeprecated
Deprecating the old auto-generated verbose names. These were renamed to clearer, shorter names in v0.8.0. The old names are deprecated but kept for backward-compatibility for a smooth migration period.
CreateMessageResultContentDeprecated
ElicitResultContentValueDeprecated
ReadResourceResultContentsItemDeprecated