Crate rust_mcp_schema

Source

Modules§

mcp_2025_06_18
schema_utils
Latest MCP Protocol 2025_06_18

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
CallToolRequest
Used by the client to invoke a tool provided by the server.
CallToolRequestParams
CallToolRequestParams
CallToolResult
The server’s response to a tool call.
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.
CancelledNotificationParams
CancelledNotificationParams
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.
ClientCapabilitiesRoots
Present if the client supports listing roots.
CompleteRequest
A request from the client to the server, to ask for completion options.
CompleteRequestParams
CompleteRequestParams
CompleteRequestParamsArgument
The argument’s information
CompleteRequestParamsContext
Additional, optional context for completions
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
CreateMessageRequestParams
CreateMessageResult
The client’s response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.
Cursor
An opaque token used to represent a cursor for pagination.
ElicitRequest
A request from the server to elicit additional information from the user via the client.
ElicitRequestParams
ElicitRequestParams
ElicitRequestParamsRequestedSchema
A restricted subset of JSON Schema. Only top-level properties are allowed, without nesting.
ElicitResult
The client’s response to an 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
EnumSchema
EnumSchema
GetPromptRequest
Used by the client to get a prompt provided by the server.
GetPromptRequestParams
GetPromptRequestParams
GetPromptResult
The server’s response to a prompts/get request from the client.
ImageContent
An image provided to or from an LLM.
Implementation
Describes the name and version of an MCP implementation, with an optional title for UI representation.
InitializeRequest
This request is sent from the client to the server when it first connects, asking it to begin initialization.
InitializeRequestParams
InitializeRequestParams
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.
InitializedNotificationParams
InitializedNotificationParams
JsonrpcError
A response to a request that indicates an error occurred.
JsonrpcNotification
A notification which does not expect a response.
JsonrpcNotificationParams
JsonrpcNotificationParams
JsonrpcRequest
A request that expects a response.
JsonrpcRequestParams
JsonrpcRequestParams
JsonrpcRequestParamsMeta
See [specification/2025-06-18/basic/index#general-fields] for notes on _meta usage.
JsonrpcResponse
A successful (non-error) response to a request.
ListPromptsRequest
Sent from the client to request a list of prompts and prompt templates the server has.
ListPromptsRequestParams
ListPromptsRequestParams
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.
ListResourceTemplatesRequestParams
ListResourceTemplatesRequestParams
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.
ListResourcesRequestParams
ListResourcesRequestParams
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.
ListRootsRequestParams
ListRootsRequestParams
ListRootsRequestParamsMeta
See [specification/2025-06-18/basic/index#general-fields] for notes on _meta usage.
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.
ListToolsRequest
Sent from the client to request a list of tools the server has.
ListToolsRequestParams
ListToolsRequestParams
ListToolsResult
The server’s response to a tools/list request from the client.
LoggingMessageNotification
Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.
LoggingMessageNotificationParams
LoggingMessageNotificationParams
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
PaginatedRequest
PaginatedRequest
PaginatedRequestParams
PaginatedRequestParams
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.
PingRequestParams
PingRequestParams
PingRequestParamsMeta
See [specification/2025-06-18/basic/index#general-fields] for notes on _meta usage.
ProgressNotification
An out-of-band notification used to inform the receiver of a progress update for a long-running request.
ProgressNotificationParams
ProgressNotificationParams
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.
PromptListChangedNotificationParams
PromptListChangedNotificationParams
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.
ReadResourceRequest
Sent from the client to the server, to read a specific resource URI.
ReadResourceRequestParams
ReadResourceRequestParams
ReadResourceResult
The server’s response to a resources/read request from the client.
Request
Request
RequestParams
RequestParams
RequestParamsMeta
See [specification/2025-06-18/basic/index#general-fields] 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.
ResourceListChangedNotificationParams
ResourceListChangedNotificationParams
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
ResourceUpdatedNotificationParams
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.
RootsListChangedNotificationParams
RootsListChangedNotificationParams
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.
SetLevelRequest
A request from the client to the server, to enable or adjust logging.
SetLevelRequestParams
SetLevelRequestParams
StringSchema
StringSchema
SubscribeRequest
Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
SubscribeRequestParams
SubscribeRequestParams
TextContent
Text provided to or from an LLM.
TextResourceContents
TextResourceContents
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.
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.
ToolListChangedNotificationParams
ToolListChangedNotificationParams
ToolOutputSchema
An optional JSON Schema object defining the structure of the tool’s output returned in the structuredContent field of a CallToolResult.
UnsubscribeRequest
Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
UnsubscribeRequestParams
UnsubscribeRequestParams

Enums§

ClientNotification
ClientNotification
ClientRequest
ClientRequest
ClientResult
ClientResult
CompleteRequestParamsRef
CompleteRequestParamsRef
ContentBlock
ContentBlock
CreateMessageRequestParamsIncludeContext
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.
CreateMessageResultContent
CreateMessageResultContent
ElicitResultAction
The user action in response to the elicitation.
ElicitResultContentValue
ElicitResultContentValue
EmbeddedResourceResource
EmbeddedResourceResource
JsonrpcMessage
Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.
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
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
ReadResourceResultContentsItem
ReadResourceResultContentsItem
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
ServerNotification
ServerNotification
ServerRequest
ServerRequest
ServerResult
ServerResult
StringSchemaFormat
StringSchemaFormat

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

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.

Type Aliases§

JsonrpcErrorErrorDeprecated