Skip to main content

Module model

Module model 

Source
Expand description

Basic data types in MCP specification

Structs§

Annotations
Optional annotations for the client. The client can use annotations to inform how objects are used or displayed.
ArgumentInfo
ArrayTypeConst
AudioContent
Audio content with base64-encoded data (spec AudioContent).
BooleanSchema
Schema definition for boolean properties.
BooleanTypeConst
CallToolRequestMethod
CallToolRequestParams
Parameters for calling a tool provided by an MCP server.
CallToolResult
The result of a tool call operation.
CancelTaskMethod
CancelTaskParams
CancelledNotificationMethod
CancelledNotificationParam
ClientCapabilities
Builder
ClientCapabilitiesBuilder
ClientCapabilitiesBuilderState
CompleteRequestMethod
CompleteRequestParams
CompleteResult
CompletionContext
Context for completion requests providing previously resolved arguments.
CompletionInfo
ConstTitle
Schema definition for enum properties.
CreateMessageRequestMethod
CreateMessageRequestParamsDeprecated
Parameters for creating a message through LLM sampling.
CreateMessageResultDeprecated
Result of sampling/createMessage (SEP-1577). The result of a sampling/createMessage request containing the generated response.
CreateTaskResult
Result returned in lieu of a standard result to indicate the request will be processed asynchronously (spec CreateTaskResult, resultType: "task").
CustomNotification
A catch-all notification either side can use to send custom messages to its peer.
CustomRequest
A catch-all request either side can use to send custom messages to its peer.
CustomResult
A catch-all response either side can use for custom requests.
DetailedTask
A task with its status-specific payload inlined (spec DetailedTask).
DiscoverRequestMethod
DiscoverRequestParams
Parameters for DiscoverRequest.
DiscoverResult
The server’s response to a DiscoverRequest.
ElicitResult
The result returned by a client in response to an elicitation request.
ElicitationCapability
Elicitation allows servers to request interactive input from users during tool execution. This capability indicates that a client can handle elicitation requests and present appropriate UI to users for collecting the requested information.
ElicitationCreateRequestMethod
ElicitationResponseNotificationMethod
ElicitationSchema
Type-safe elicitation schema for requesting structured user input.
ElicitationSchemaBuilder
Fluent builder for constructing elicitation schemas.
EmbeddedResource
Embedded resource content (spec EmbeddedResource).
EmptyObject
This is commonly used for representing empty objects in MCP messages.
EnumSchemaBuilder
Builder for EnumSchema Allows to create various enum schema types (single/multi select, titled/untitled) with validation of provided parameters
EnumTypeConst
ErrorCode
Standard JSON-RPC error codes used throughout the MCP protocol.
ErrorData
Error information for JSON-RPC error responses.
Extensions
A type map of protocol extensions.
FormElicitationCapability
Capability for handling elicitation requests from servers. Elicitation allows servers to request interactive input from users during tool execution. This capability indicates that a client can handle elicitation requests and present appropriate UI to users for collecting the requested information.
GetPromptRequestMethod
GetPromptRequestParams
Parameters for retrieving a specific prompt
GetPromptResult
GetTaskMethod
GetTaskParams
GetTaskResult
Response to a tasks/get request (spec GetTaskResult = Result & DetailedTask).
Icon
A URL pointing to an icon resource or a base64-encoded data URI.
ImageContent
Image content with base64-encoded data (spec ImageContent).
Implementation
InitializeRequestParams
Parameters sent by a client when initializing a connection to an MCP server.
InitializeResult
The server’s response to an initialization request.
InitializeResultMethod
InitializedNotificationMethod
InputRequiredResult
A result indicating that additional input is needed before the request can be completed.
IntegerSchema
Schema definition for integer properties.
IntegerTypeConst
JsonContent
JsonRpcError
JsonRpcNotification
JsonRpcRequest
JsonRpcResponse
JsonRpcVersion2_0
LegacyEnumSchema
Legacy enum schema, keep for backward compatibility
ListPromptsRequestMethod
ListPromptsResult
ListResourceTemplatesRequestMethod
ListResourceTemplatesResult
ListResourcesRequestMethod
ListResourcesResult
ListRootsRequestMethod
ListRootsResultDeprecated
ListToolsRequestMethod
ListToolsResult
LoggingMessageNotificationMethod
LoggingMessageNotificationParamDeprecated
Parameters for a logging message notification
MetaObject
General-purpose _meta map (spec MetaObject).
ModelHintDeprecated
A hint suggesting a preferred model name or family.
ModelPreferencesDeprecated
Preferences for model selection and behavior in sampling requests.
MultiSelect
Marker type for multi-select enum builder
Notification
NotificationMetaObject
The _meta map carried by notifications (spec NotificationMetaObject).
NotificationNoParam
NumberSchema
Schema definition for number properties (floating-point).
NumberTypeConst
ObjectTypeConst
PaginatedRequestParams
PingRequestMethod
ProgressNotificationMethod
ProgressNotificationParam
ProgressToken
A token used to track the progress of long-running operations.
Prompt
A prompt or prompt template that the server offers (spec Prompt).
PromptArgument
Describes an argument that a prompt can accept (spec PromptArgument).
PromptListChangedNotificationMethod
PromptMessage
A message returned as part of a prompt (spec PromptMessage).
PromptReference
PromptsCapability
ProtocolVersion
Represents the MCP protocol version used for communication.
ReadResourceRequestMethod
ReadResourceRequestParams
Parameters for reading a specific resource
ReadResourceResult
Result containing the contents of a read resource
Request
Represents a JSON-RPC request with method, parameters, and extensions.
RequestMetaObject
The _meta map carried by requests (spec RequestMetaObject).
RequestNoParam
RequestOptionalParam
Resource
A known resource that the server is capable of reading (spec Resource).
ResourceListChangedNotificationMethod
ResourceTemplate
A template description for resources available on the server (spec ResourceTemplate).
ResourceTemplateReference
ResourceUpdatedNotificationMethod
ResourceUpdatedNotificationParam
Parameters for a resource update notification
ResourcesCapability
ResultType
Indicates the type of a result object, allowing the client to determine how to parse the response.
RootDeprecated
RootsCapabilities
Roots capability. Deprecated by SEP-2577; remains functional and will be removed in a future release. See https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577.
RootsListChangedNotificationMethod
SamplingCapability
Sampling capability with optional sub-capabilities (SEP-1577).
SamplingMessageDeprecated
A message in a sampling conversation, containing a role and content.
ServerCapabilities
Builder
ServerCapabilitiesBuilder
ServerCapabilitiesBuilderState
ServerPeerInfo
Information negotiated about a server peer.
SetLevelRequestMethod
SetLevelRequestParamsDeprecated
Parameters for setting the logging level
SingleSelect
Marker type for single-select enum builder
StringSchema
Schema definition for string properties.
StringTypeConst
SubscribeRequestMethod
SubscribeRequestParams
Parameters for subscribing to resource updates
SubscriptionFilter
Notification categories a client opts in to on a subscriptions/listen stream.
SubscriptionFilterBuilder
Builder for SubscriptionFilter.
SubscriptionsAcknowledgedNotificationMethod
SubscriptionsAcknowledgedNotificationParams
Parameters reporting the accepted subset of a subscription filter.
SubscriptionsListenRequestMethod
SubscriptionsListenRequestParams
Parameters for opening a long-lived notification subscription.
SubscriptionsListenResult
Final response indicating that a subscription ended gracefully.
SubscriptionsListenResultMeta
Metadata on the final result of a subscriptions/listen request.
Task
Operational metadata about ongoing work (spec Task, SEP-2663).
TaskAckResult
Empty acknowledgement for tasks/update and tasks/cancel (SEP-2663).
TaskStatusNotificationMethod
TaskStatusNotificationParams
Parameters for a task status notification (spec TaskStatusNotificationParams).
TextContent
Text content block (spec TextContent).
TitledItems
Items for titled multi-select options
TitledMultiSelectEnumSchema
Multi-select titled options
TitledSingleSelectEnumSchema
Titled single-select
Tool
A tool that can be used by a model.
ToolAnnotations
Additional properties describing a Tool to clients.
ToolChoiceDeprecated
Tool choice configuration (SEP-1577).
ToolListChangedNotificationMethod
ToolResultContentDeprecated
Tool execution result in user message (SEP-1577).
ToolUseContentDeprecated
Tool call request from assistant (SEP-1577).
ToolsCapability
UnsubscribeRequestMethod
UnsubscribeRequestParams
Parameters for unsubscribing from resource updates
UntitledItems
Items for untitled multi-select options
UntitledMultiSelectEnumSchema
Multi-select untitled options
UntitledSingleSelectEnumSchema
Untitled single-select
UpdateTaskMethod
UpdateTaskParams
Parameters for tasks/update (SEP-2663): deliver responses to outstanding in-task server-to-client requests surfaced via tasks/get inputRequests.
UrlElicitationCapability
Capability for URL mode elicitation.

Enums§

CacheScope
Scope describing who may cache cacheable list/read results (SEP-2549).
CallToolResponse
Result of a tools/call request, including the MRTR intermediate result.
ClientNotification
ClientRequest
ClientResult
ContentBlock
Unified content block union (spec ContentBlock).
ContextInclusion
Specifies how much context should be included in sampling requests.
ElicitRequestParams
Parameters for creating an elicitation request to gather user input.
ElicitationAction
Represents the possible actions a user can take in response to an elicitation request.
EnumSchema
Compliant with MCP 2025-06-18 specification for elicitation schemas. Enums must have string type for values and can optionally include human-readable names.
GetPromptResponse
Result of a prompts/get request, including the MRTR intermediate result.
IconTheme
Icon themes supported by the MCP specification
InputRequest
A server-initiated request that can appear inside InputRequests.
JsonRpcMessage
Represents any JSON-RPC message that can be sent or received.
LoggingLevelDeprecated
Logging levels supported by the MCP protocol
MultiSelectEnumSchema
Multi-select enum options
NumberOrString
A flexible identifier type that can be either a number or a string.
PrimitiveSchemaDefinition
Primitive schema definition for elicitation properties.
ReadResourceResponse
Result of a resources/read request, including the MRTR intermediate result.
Reference
ResourceContents
The contents of a specific resource or sub-resource.
Role
Represents the role of a participant in a conversation or message exchange.
SamplingContent
Single or array content wrapper (SEP-1577).
SamplingMessageContentBlockDeprecated
Content types for sampling messages (SEP-1577).
ServerNotification
ServerRequest
ServerResult
SingleSelectEnumSchema
Combined single-select
StringFormat
String format types allowed by the MCP specification.
TaskPayload
Status-specific payload carried alongside the base Task fields in a DetailedTask.
TaskStatus
Canonical task lifecycle status (SEP-2663).
ToolChoiceMode
Tool selection mode (SEP-1577).

Constants§

DEFAULT_MRTR_MAX_ROUNDS
Default maximum number of MRTR rounds a high-level client call will drive.
TASKS_EXTENSION_ID
Extension identifier for the MCP Tasks extension (SEP-2663).

Traits§

ConstString
GetExtensions
GetMeta
Access to the metadata carried by a message envelope’s Extensions.
IntoContents
Types that can be converted into a list of content blocks.
RequestParamsMeta
Trait for request params that contain the _meta field.

Functions§

object
unwrap the JsonObject under serde_json::Value

Type Aliases§

CallToolRequest
Request to call a specific tool
CancelTaskRequest
CancelledNotification
Cancellation
ClientConfig
A client’s own configuration: the protocol version, capabilities, and implementation identity it advertises to servers.
ClientInfoDeprecated
Deprecated alias for ClientConfig.
ClientJsonRpcMessage
CompleteRequest
CreateMessageRequestDeprecated
Cursor
DiscoverRequest
A request for the server’s supported protocol versions and capabilities.
ElicitRequest
Request type for creating an elicitation to gather user input
EmptyResult
Empty result
ExperimentalCapabilities
ExtensionCapabilities
MCP extension capabilities map.
GetPromptRequest
Request to get a specific prompt
GetTaskRequest
InitializeRequest
Initialization
InitializedNotification
This notification is sent from the client to the server after initialization has finished.
InputRequests
A map of server-initiated requests that the client must fulfill.
InputResponses
A map of client responses to server-initiated requests.
JsonObject
A JSON object type alias for convenient handling of JSON data.
ListPromptsRequest
Request to list all available prompts from a server
ListResourceTemplatesRequest
Request to list all available resource templates from a server
ListResourcesRequest
Request to list all available resources from a server
ListRootsRequestDeprecated
ListToolsRequest
Request to list all available tools from a server
LoggingMessageNotificationDeprecated
Notification containing a log message
PingRequest
ProgressNotification
PromptListChangedNotification
Notification sent when the list of available prompts changes
ReadResourceRequest
Request to read a specific resource
RequestId
Type alias for request identifiers used in JSON-RPC communication.
ResourceListChangedNotification
Notification sent when the list of available resources changes
ResourceUpdatedNotification
Notification sent when a subscribed resource is updated
RootsListChangedNotification
ServerConfig
A server’s own configuration: the protocol version, capabilities, implementation identity, and instructions it advertises to clients.
ServerInfoDeprecated
Deprecated alias for ServerConfig.
ServerJsonRpcMessage
SetLevelRequestDeprecated
Request to set the logging level
SubscribeRequestDeprecated
Request to subscribe to resource updates
SubscriptionsAcknowledgedNotification
First notification sent on an established subscription stream.
SubscriptionsListenRequest
Request that opens a long-lived notification subscription.
TaskStatusNotification
ToolListChangedNotification
Notification sent when the list of available tools changes
UnsubscribeRequestDeprecated
Request to unsubscribe from resource updates
UpdateTaskRequest