Crate mcp_schema

Source

Structs§

Annotated
Allows attaching optional annotations and arbitrary extra fields.
Annotations
Contains optional annotation data such as audience or priority.
BlobResourceContents
Represents binary resource contents.
CallToolParams
Parameters for the tools/call method.
CallToolResult
A result from the tools/call method, potentially indicating an error.
CancelledNotificationParams
Represents parameters for a cancelled-notification, which can be sent by either side.
ClientCapabilities
Describes capabilities a client might support.
CompleteArgument
An argument for completion/complete (name + value).
CompleteParams
Parameters for completion/complete.
CompleteResult
A result from completion/complete.
CompletionData
Data returned in the completion field, containing possible completions.
CreateMessageParams
Parameters for the sampling/createMessage method.
CreateMessageResult
A result from sampling/createMessage.
EmbeddedResource
An embedded resource, which can contain a text or blob resource internally.
GetPromptParams
Parameters for prompts/get.
GetPromptResult
A result returned by prompts/get.
ImageContent
Represents image content, stored in base64.
Implementation
Represents the name and version of an MCP implementation.
InitializeParams
Parameters for initializing communication (client -> server).
InitializeResult
A result returned by the server after an initialize request.
JSONRPCError
A JSON-RPC error message, indicating that a request failed.
JSONRPCNotification
A generic JSON-RPC notification. Notifications do not carry an id.
JSONRPCRequest
A generic JSON-RPC request.
JSONRPCResponse
A generic JSON-RPC response.
ListPromptsResult
A result containing a list of prompts known to the server.
ListResourceTemplatesResult
A result containing a list of resource templates known to the server.
ListResourcesResult
A result containing a list of resources known to the server.
ListRootsParams
Parameters for roots/list.
ListRootsResult
A result listing root URIs from the client.
ListToolsResult
A result listing server-provided tools.
LoggingMessageParams
A notification with a log message from the server.
MCPNotificationParams
Parameters for an MCP notification, allowing additional arbitrary fields via flatten.
MCPRequestParams
Parameters for an MCP request, allowing additional arbitrary fields via flatten.
MCPResultBase
Base result type for MCP responses.
ModelHint
A hint to use when selecting a model (e.g., substring matches).
ModelPreferences
Preferences for selecting a model, including cost or speed priorities.
PaginatedParams
A structure for request parameters that may involve pagination.
PaginatedResult
Indicates that a result can include pagination metadata.
PingParams
Parameters for the ping method (client or server). Generally empty.
ProgressNotificationParams
Parameters for a progress notification, typically referencing a long-running request.
Prompt
A prompt object or prompt template.
PromptArgument
Arguments accepted by a prompt, potentially required.
PromptMessage
A message returned as part of a prompt result.
PromptsCapability
Indicates server support for prompt-related features.
RPCErrorDetail
Provides details about a JSON-RPC error, including an optional data field.
ReadResourceParams
Parameters for the resources/read method.
ReadResourceResult
A result from the resources/read method, containing resource contents.
RequestMeta
_meta field for MCP requests, optionally containing a progress token.
Resource
A resource object that the server can read, possibly with extra metadata.
ResourceTemplate
A resource template, which can be used to generate resource URIs.
ResourceUpdatedParams
Parameters for a notifications/resources/updated message.
ResourcesCapability
Indicates server support for resource-related features.
Root
Represents a root directory or file, typically starting with file://.
RootsCapability
Describes whether the client supports updated-list notifications for roots.
SamplingMessage
A sampling message (one item in CreateMessageParams).
ServerCapabilities
A set of capabilities the server may support.
SetLevelParams
Parameters for enabling or adjusting server-side logging.
SubscribeParams
Parameters for resources/subscribe.
TextContent
Represents text content in a prompt or message.
TextResourceContents
Represents textual resource contents.
Tool
Defines a tool that can be invoked by the client.
ToolInputSchema
Describes the schema for a tool’s input parameters.
ToolsCapability
Indicates server support for tool-related features.
UnsubscribeParams
Parameters for resources/unsubscribe.

Enums§

ClientNotification
A union of all possible client notifications.
ClientRequest
A union of all possible client requests. The method field identifies the variant.
LoggingLevel
Syslog-like logging severity levels.
ProgressToken
A progress token for associating progress notifications with a request. This can be either a string or a number.
PromptContent
Represents the content of a prompt message: text, image, or embedded resource.
ReferenceType
A reference to either a resource or a prompt.
RequestId
A request ID for JSON-RPC, which can be either a string or a number.
ResourceContents
Contents of a resource. May be text or binary data.
Role
A role in a conversation: either “user” or “assistant”.
SamplingContent
Represents a text or image message in sampling.
ServerNotification
A union of possible server notifications.
ServerRequest
A union of possible server requests.
ServerResult
A union of all possible server results.

Constants§

INTERNAL_ERROR
INVALID_PARAMS
INVALID_REQUEST
JSONRPC_VERSION
The JSON-RPC version string (always “2.0”).
LATEST_PROTOCOL_VERSION
The latest Model Context Protocol version.
METHOD_NOT_FOUND
PARSE_ERROR

Type Aliases§

Cursor
A cursor for pagination.
EmptyResult
Indicates success but carries no data.