Crate rust_mcp_schema

Source

Modules§

schema_utils
re-exports

Structs§

Annotated
Base for objects that include optional annotations for the client. The client can use annotations to inform how objects are used or displayed
AnnotatedAnnotations
AnnotatedAnnotations
BlobResourceContents
BlobResourceContents
CallToolRequest
Used by the client to invoke a tool provided by the server.
CallToolRequestParams
CallToolRequestParams
CallToolResult
The server’s response to a tool call. 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.
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
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.
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.
EmbeddedResourceAnnotations
EmbeddedResourceAnnotations
EmptyResult
EmptyResult
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.
ImageContentAnnotations
ImageContentAnnotations
Implementation
Describes the name and version of an MCP implementation.
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
JsonrpcRequestParamsMeta
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
ListRootsRequestParamsMeta
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
PaginatedRequest
PaginatedRequest
PaginatedRequestParams
PaginatedRequestParams
PaginatedResult
PaginatedResult
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
PingRequestParamsMeta
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
RequestParamsMeta
Resource
A known resource that the server is capable of reading.
ResourceAnnotations
ResourceAnnotations
ResourceContents
The contents of a specific resource or sub-resource.
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
ResourceReference
A reference to a resource or resource template definition.
ResourceTemplate
A template description for resources available on the server.
ResourceTemplateAnnotations
ResourceTemplateAnnotations
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
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.
TextContentAnnotations
TextContentAnnotations
TextResourceContents
TextResourceContents
Tool
Definition for a tool the client can call.
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
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§

CallToolResultContentItem
CallToolResultContentItem
ClientNotification
ClientNotification
ClientRequest
ClientRequest
ClientResult
ClientResult
CompleteRequestParamsRef
CompleteRequestParamsRef
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
EmbeddedResourceResource
EmbeddedResourceResource
JsonrpcMessage
JsonrpcMessage
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
ProgressToken
A progress token, used to associate progress notifications with the original request.
PromptMessageContent
PromptMessageContent
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

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