Skip to main content

Module spec

Module spec 

Source
Expand description

Protocol types of the targeted revision. Protocol types for MCP specification revision 2026-07-28.

Generated from the official schema.json and schema.ts (commit 271ecc9accafdd9b83a3c869fa67c22953b2af80).

Modules§

error_codes
JSON-RPC error codes defined by the schema.
methods
Method names defined by the schema.

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
BooleanSchema
CacheableResult
A result that supports a time-to-live (TTL) hint for client-side caching.
CallToolRequest
Used by the client to invoke a tool provided by the server.
CallToolRequestParams
Parameters for a tools/call request.
CallToolResult
The result returned by the server for a CallToolRequesttools/call request.
CallToolResultResponse
A successful response from the server for a CallToolRequesttools/call request.
CancelledNotification
This notification is sent by the client to indicate that it is cancelling a request it previously issued.
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.
ClientCapabilitiesElicitation
Present if the client supports elicitation from the server.
ClientCapabilitiesRoots
Present if the client supports listing roots.
ClientCapabilitiesSampling
Present if the client supports sampling from an LLM.
ClientNotification
This notification is sent by the client to indicate that it is cancelling a request it previously issued.
CompleteRequest
A request from the client to the server, to ask for completion options.
CompleteRequestParams
Parameters for a completion/complete request.
CompleteRequestParamsArgument
The argument’s information
CompleteRequestParamsContext
Additional, optional context for completions
CompleteResult
The result returned by the server for a CompleteRequestcompletion/complete request.
CompleteResultCompletion
CompleteResultResponse
A successful response from the server for a CompleteRequestcompletion/complete request.
CreateMessageRequestDeprecated
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.
CreateMessageRequestParamsDeprecated
Parameters for a sampling/createMessage request.
CreateMessageResultDeprecated
The result returned by the client for a CreateMessageRequestsampling/createMessage request. 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.
DiscoverRequest
A request from the client asking the server to advertise its supported protocol versions, capabilities, and other metadata. Servers MUST implement server/discover. Clients MAY call it but are not required to — version negotiation can also happen inline via per-request _meta.
DiscoverResult
The result returned by the server for a DiscoverRequestserver/discover request.
DiscoverResultResponse
A successful response from the server for a DiscoverRequestserver/discover request.
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.
ElicitRequestFormParamsRequestedSchema
A restricted subset of JSON Schema. Only top-level properties are allowed, without nesting.
ElicitRequestUrlParams
The parameters for a request to elicit information from the user via a URL in the client.
ElicitResult
The result returned by the client for an ElicitRequestelicitation/create request.
EmbeddedResource
The contents of a resource, embedded into a prompt or tool call result.
Error
GetPromptRequest
Used by the client to get a prompt provided by the server.
GetPromptRequestParams
Parameters for a prompts/get request.
GetPromptResult
The result returned by the server for a GetPromptRequestprompts/get request.
GetPromptResultResponse
A successful response from the server for a GetPromptRequestprompts/get request.
HeaderMismatchError
Returned when a server rejects a request because the values in the HTTP headers do not match the corresponding values in the request body, or because required headers are missing or malformed. For HTTP, the response status code MUST be 400 Bad Request.
HeaderMismatchErrorObject
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.
InputRequiredResult
An InputRequiredResult sent by the server to indicate that additional input is needed before the request can be completed.
InputResponseRequestParams
InternalError
A JSON-RPC error indicating that an internal error occurred on the receiver. This error is returned when the receiver encounters an unexpected condition that prevents it from fulfilling the request.
InvalidParamsError
A JSON-RPC error indicating that the method parameters are invalid or malformed.
InvalidRequestError
A JSON-RPC error indicating that the request is not a valid request object. This error is returned when the message structure does not conform to the JSON-RPC 2.0 specification requirements for a request (e.g., missing required fields like jsonrpc or method, or using invalid types for these fields).
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 result returned by the server for a ListPromptsRequestprompts/list request.
ListPromptsResultResponse
A successful response from the server for a ListPromptsRequestprompts/list request.
ListResourceTemplatesRequest
Sent from the client to request a list of resource templates the server has.
ListResourceTemplatesResult
The result returned by the server for a ListResourceTemplatesRequestresources/templates/list request.
ListResourceTemplatesResultResponse
A successful response from the server for a ListResourceTemplatesRequestresources/templates/list request.
ListResourcesRequest
Sent from the client to request a list of resources the server has.
ListResourcesResult
The result returned by the server for a ListResourcesRequestresources/list request.
ListResourcesResultResponse
A successful response from the server for a ListResourcesRequestresources/list request.
ListRootsRequestDeprecated
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.
ListRootsRequestParams
ListRootsResultDeprecated
The result returned by the client for a ListRootsRequestroots/list request. 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.
ListToolsResult
The result returned by the server for a ListToolsRequesttools/list request.
ListToolsResultResponse
A successful response from the server for a ListToolsRequesttools/list request.
LoggingMessageNotificationDeprecated
JSONRPCNotification of a log message passed from server to client. The client opts in by setting "io.modelcontextprotocol/logLevel" in a request’s _meta.
LoggingMessageNotificationParamsDeprecated
Parameters for a notifications/message notification.
MethodNotFoundError
A JSON-RPC error indicating that the requested method does not exist or is not available.
MissingRequiredClientCapabilityError
Returned when processing a request requires a capability the client did not declare in clientCapabilities. For HTTP, the response status code MUST be 400 Bad Request.
MissingRequiredClientCapabilityErrorData
MissingRequiredClientCapabilityErrorObject
ModelHintDeprecated
Hints to use for model selection.
ModelPreferencesDeprecated
The server’s preferences for model selection, requested of the client during sampling.
Notification
NotificationMetaObject
Extends MetaObject with additional notification-specific fields. All key naming rules from MetaObject apply.
NotificationParams
Common params for any notification.
NumberSchema
PaginatedRequest
PaginatedRequestParams
Common params for paginated requests.
PaginatedResult
ParseError
A JSON-RPC error indicating that invalid JSON was received by the server. This error is returned when the server cannot parse the JSON text of a message.
ProgressNotification
An out-of-band notification used to inform the receiver of a progress update for a long-running request.
ProgressNotificationParams
Parameters for a ProgressNotificationnotifications/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 is only delivered on a SubscriptionsListenRequestsubscriptions/listen stream when the client requested it via the promptsListChanged filter field.
PromptMessage
Describes a message returned as part of a prompt.
PromptReference
Identifies a prompt.
ReadResourceRequest
Sent from the client to the server, to read a specific resource URI.
ReadResourceRequestParams
Parameters for a resources/read request.
ReadResourceResult
The result returned by the server for a ReadResourceRequestresources/read request.
ReadResourceResultResponse
A successful response from the server for a ReadResourceRequestresources/read request.
Request
RequestMetaObject
Extends MetaObject with additional request-specific fields. All key naming rules from MetaObject apply.
RequestParams
Common params for any request.
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.
ResourceListChangedNotification
An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This is only delivered on a SubscriptionsListenRequestsubscriptions/listen stream when the client requested it via the resourcesListChanged filter field.
ResourceRequestParams
Common params for resource-related requests.
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 is only sent for resources the client opted in to via the resourceSubscriptions field of a SubscriptionsListenRequestsubscriptions/listen request.
ResourceUpdatedNotificationParams
Parameters for a notifications/resources/updated notification.
Result
Common result fields.
ResultMetaObject
Extends MetaObject with additional result-specific fields. All key naming rules from MetaObject apply.
RootDeprecated
Represents a root directory or file that the server can operate on.
SamplingMessageDeprecated
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.
StringSchema
SubscriptionFilter
The set of notification types a client may opt in to on a SubscriptionsListenRequestsubscriptions/listen request.
SubscriptionsAcknowledgedNotification
Sent by the server to acknowledge that a SubscriptionsListenRequestsubscriptions/listen subscription has been established and to report which notification types it agreed to honor.
SubscriptionsAcknowledgedNotificationParams
Parameters for a SubscriptionsAcknowledgedNotificationnotifications/subscriptions/acknowledged notification.
SubscriptionsListenRequest
Sent from the client to open a long-lived channel for receiving notifications outside the context of a specific request. Replaces the previous HTTP GET endpoint and ensures consistent behavior between HTTP and STDIO.
SubscriptionsListenRequestParams
Parameters for a SubscriptionsListenRequestsubscriptions/listen request.
SubscriptionsListenResult
The response to a SubscriptionsListenRequestsubscriptions/listen request, signalling that the subscription has ended gracefully (for example, during server shutdown). Because the listen stream is long-lived, this result is sent only when the server tears the subscription down; an abrupt transport close carries no response. The result body is otherwise empty.
SubscriptionsListenResultMetaObject
Extends ResultMetaObject with the subscription-stream identifier carried by a SubscriptionsListenResult. All key naming rules from MetaObject apply.
SubscriptionsListenResultResponse
A successful response from the server for a SubscriptionsListenRequestsubscriptions/listen request, sent when the server tears the subscription down gracefully.
TextContent
Text provided to or from an LLM.
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
TitledSingleSelectEnumSchema
Schema for single-selection enumeration with display titles for each option.
TitledSingleSelectEnumSchemaOneOfItem
Tool
Definition for a tool the client can call.
ToolAnnotations
Additional properties describing a Tool to clients.
ToolChoiceDeprecated
Controls tool selection behavior for sampling requests.
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 is only delivered on a SubscriptionsListenRequestsubscriptions/listen stream when the client requested it via the toolsListChanged filter field.
ToolOutputSchema
An optional JSON Schema object defining the structure of the tool’s output returned in the structuredContent field of a CallToolResult. This can be any valid JSON Schema 2020-12.
ToolResultContentDeprecated
The result of a tool use, provided by the user back to the assistant.
ToolUseContentDeprecated
A request from the assistant to call a tool.
UnsupportedProtocolVersionError
Returned when the request’s protocol version is unknown to the server or unsupported (e.g., a known experimental or draft version the server has chosen not to implement). For HTTP, the response status code MUST be 400 Bad Request.
UnsupportedProtocolVersionErrorData
UnsupportedProtocolVersionErrorObject
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.

Enums§

ArrayType
The constant "array".
AudioType
The constant "audio".
BooleanType
The constant "boolean".
CacheScope
Indicates the intended scope of the cached response, analogous to HTTP Cache-Control: public vs Cache-Control: private.
CallToolResultResponseResult
ClientRequest
CompleteRequestParamsRef
CompletionCompleteMethod
The constant "completion/complete".
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
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.
ElicitResultContentValue
ElicitResultContentValueScalar
ElicitationCreateMethod
The constant "elicitation/create".
EmbeddedResourceResource
EnumSchema
FormMode
The constant "form".
GetPromptResultResponseResult
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.
ImageType
The constant "image".
InputRequest
InputResponse
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.
JsonRpcVersion
The constant "2.0".
LoggingLevelDeprecated
The severity of a log message.
MultiSelectEnumSchema
NotificationsCancelledMethod
The constant "notifications/cancelled".
NotificationsMessageMethod
The constant "notifications/message".
NotificationsProgressMethod
The constant "notifications/progress".
NotificationsPromptsListChangedMethod
The constant "notifications/prompts/list_changed".
NotificationsResourcesListChangedMethod
The constant "notifications/resources/list_changed".
NotificationsResourcesUpdatedMethod
The constant "notifications/resources/updated".
NotificationsSubscriptionsAcknowledgedMethod
The constant "notifications/subscriptions/acknowledged".
NotificationsToolsListChangedMethod
The constant "notifications/tools/list_changed".
NumberSchemaType
ObjectType
The constant "object".
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.
PromptsGetMethod
The constant "prompts/get".
PromptsListMethod
The constant "prompts/list".
ReadResourceResultContentsItem
ReadResourceResultResponseResult
RefPromptType
The constant "ref/prompt".
RefResourceType
The constant "ref/resource".
RequestId
A uniquely identifying ID for a request in JSON-RPC.
ResourceLinkType
The constant "resource_link".
ResourceType
The constant "resource".
ResourcesListMethod
The constant "resources/list".
ResourcesReadMethod
The constant "resources/read".
ResourcesTemplatesListMethod
The constant "resources/templates/list".
Role
The sender or recipient of messages and data in a conversation.
RootsListMethod
The constant "roots/list".
SamplingCreateMessageMethod
The constant "sampling/createMessage".
SamplingMessageContent
SamplingMessageContentBlockDeprecated
ServerDiscoverMethod
The constant "server/discover".
ServerNotification
SingleSelectEnumSchema
StringSchemaFormat
StringType
The constant "string".
SubscriptionsListenMethod
The constant "subscriptions/listen".
TextType
The constant "text".
ToolChoiceMode
Controls the tool use ability of the model:
ToolResultType
The constant "tool_result".
ToolUseType
The constant "tool_use".
ToolsCallMethod
The constant "tools/call".
ToolsListMethod
The constant "tools/list".
UrlMode
The constant "url".

Constants§

PROTOCOL_VERSION
The protocol revision these types describe.

Type Aliases§

Cursor
An opaque token used to represent a cursor for pagination.
EmptyResult
Common result fields.
InputRequests
A map of server-initiated requests that the client must fulfill. Keys are server-assigned identifiers; values are the request objects.
InputResponses
A map of client responses to server-initiated requests. Keys correspond to the keys in the InputRequests map; values are the client’s result for each request.
MetaObject
Represents the contents of a _meta field, which clients and servers use to attach additional metadata to their interactions.
ResultType
Indicates the type of a Result object, allowing the client to determine how to parse the response.