mcp_types library
The MCP protocol types mcp_llm uses (generated from the specification
schemas; the same shapes mcp_client and mcp_server carry). Import this
next to package:mcp_llm/mcp_llm.dart to name the typed results of
McpClientBridge and friends; it is kept separate so that importing
mcp_llm beside mcp_client does not clash on names like Tool.
Classes
- 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
-
Annotated.annotations. - 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
- Revisions: 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25, 2026-07-28, ext-tasks/2026-07-28.
- BooleanSchema
- Revisions: 2025-06-18, 2025-11-25, 2026-07-28, ext-tasks/2026-07-28.
- CacheableResult
- A result that supports a time-to-live (TTL) hint for client-side caching.
- CacheableResultCacheScope
-
Values of
CacheableResult.cacheScope. - CallToolRequest
- Used by the client to invoke a tool provided by the server.
- CallToolRequestParams
-
Parameters for a
tools/callrequest. - CallToolResult
-
The result returned by the server for a
CallToolRequesttools/callrequest. - CallToolResultResponse
-
A successful response from the server for a
CallToolRequesttools/callrequest. - CancelledNotification
- This notification is sent by the client to indicate that it is cancelling a request it previously issued.
- CancelledNotificationParams
-
Parameters for a
notifications/cancellednotification. - CancelledTask
- Revisions: ext-tasks/2026-07-28.
- CancelTaskRequest
- Revisions: 2025-11-25, ext-tasks/2026-07-28.
- CancelTaskRequestParams
-
CancelTaskRequest.params. - CancelTaskResult
- Revisions: 2025-11-25, ext-tasks/2026-07-28.
- 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
-
ClientCapabilities.elicitation. - ClientCapabilitiesRoots
-
ClientCapabilities.roots. - ClientCapabilitiesSampling
-
ClientCapabilities.sampling. - ClientCapabilitiesTasks
-
ClientCapabilities.tasks. - ClientCapabilitiesTasksRequests
-
ClientCapabilitiesTasks.requests. - ClientCapabilitiesTasksRequestsElicitation
-
ClientCapabilitiesTasksRequests.elicitation. - ClientCapabilitiesTasksRequestsSampling
-
ClientCapabilitiesTasksRequests.sampling. - ClientNotification
- This notification is sent by the client to indicate that it is cancelling a request it previously issued.
- ClientRequest
- Revisions: 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25, 2026-07-28.
- CompletedTask
- Revisions: ext-tasks/2026-07-28.
- CompleteRequest
- A request from the client to the server, to ask for completion options.
- CompleteRequestParams
-
Parameters for a
completion/completerequest. - CompleteRequestParamsArgument
-
CompleteRequestParams.argument. - CompleteRequestParamsRef
- One of: PromptReference, ResourceTemplateReference.
- CompleteResult
-
The result returned by the server for a
CompleteRequestcompletion/completerequest. - CompleteResultCompletion
-
CompleteResult.completion. - CompleteResultResponse
-
A successful response from the server for a
CompleteRequestcompletion/completerequest. - ContentBlock
- Revisions: 2025-06-18, 2025-11-25, 2026-07-28, ext-tasks/2026-07-28.
- 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
-
Parameters for a
sampling/createMessagerequest. - CreateMessageRequestParamsIncludeContext
-
Values of
CreateMessageRequestParams.includeContext. - CreateMessageRequestParamsMeta
-
CreateMessageRequestParams._meta. - CreateMessageResult
-
The result returned by the client for a
CreateMessageRequestsampling/createMessagerequest. 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. - CreateTaskResult
- Revisions: 2025-11-25, ext-tasks/2026-07-28.
- DetailedTask
- Revisions: ext-tasks/2026-07-28.
- 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/discoverrequest. - DiscoverResultCacheScope
-
Values of
DiscoverResult.cacheScope. - DiscoverResultResponse
-
A successful response from the server for a
DiscoverRequestserver/discoverrequest. - ElicitationCompleteNotification
- An optional notification from the server to the client, informing it of a completion of a out-of-band elicitation request.
- ElicitationCompleteNotificationParams
-
ElicitationCompleteNotification.params. - 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.
- ElicitRequestFormParamsMeta
-
ElicitRequestFormParams._meta. - ElicitRequestParams
- The parameters for a request to elicit additional information from the user via the client.
- ElicitRequestURLParams
- The parameters for a request to elicit information from the user via a URL in the client.
- ElicitRequestURLParamsMeta
-
ElicitRequestURLParams._meta. - ElicitResult
-
The result returned by the client for an
ElicitRequestelicitation/createrequest. - ElicitResultAction
-
Values of
ElicitResult.action. - EmbeddedResource
- The contents of a resource, embedded into a prompt or tool call result.
- EnumSchema
- Revisions: 2025-06-18, 2025-11-25, 2026-07-28.
- ErrorObject
- Revisions: 2025-11-25, 2026-07-28, ext-tasks/2026-07-28.
- FailedTask
- Revisions: ext-tasks/2026-07-28.
- GetPromptRequest
- Used by the client to get a prompt provided by the server.
- GetPromptRequestParams
-
Parameters for a
prompts/getrequest. - GetPromptResult
-
The result returned by the server for a
GetPromptRequestprompts/getrequest. - GetPromptResultResponse
-
A successful response from the server for a
GetPromptRequestprompts/getrequest. - GetTaskPayloadRequest
- A request to retrieve the result of a completed task.
- GetTaskPayloadRequestParams
-
GetTaskPayloadRequest.params. - GetTaskPayloadResult
- The response to a tasks/result request. The structure matches the result type of the original request. For example, a tools/call task would return the CallToolResult structure.
- GetTaskRequest
- Revisions: 2025-11-25, ext-tasks/2026-07-28.
- GetTaskRequestParams
-
GetTaskRequest.params. - GetTaskResult
- Revisions: 2025-11-25, ext-tasks/2026-07-28.
- 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. - HeaderMismatchErrorError
-
HeaderMismatchError.error. - ImageContent
- An image provided to or from an LLM.
- Implementation
- Describes the MCP implementation.
- InitializedNotification
- This notification is sent from the client to the server after initialization has finished.
- InitializeRequest
- This request is sent from the client to the server when it first connects, asking it to begin initialization.
- InitializeRequestParams
-
Parameters for an
initializerequest. - InitializeRequestParamsMeta
-
InitializeRequestParams._meta. - InitializeResult
- After receiving an initialize request from the client, the server sends this response.
- InputRequest
- Revisions: 2026-07-28, ext-tasks/2026-07-28.
- InputRequiredResult
- An InputRequiredResult sent by the server to indicate that additional input is needed before the request can be completed.
- InputRequiredTask
- Revisions: ext-tasks/2026-07-28.
- InputResponseRequestParams
- Revisions: 2026-07-28.
- 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
jsonrpcormethod, 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.
- JSONRPCResponse
- A response to a request, containing either the result or error.
- JSONRPCResultResponse
- A successful (non-error) response to a request.
- JsonSchemaError
- One failed assertion.
- JsonSchemaLimits
- Bounds on one evaluation.
- JsonSchemaResult
- The outcome of JsonSchemaValidator.validate.
- JsonSchemaValidator
- Validates instances against one schema.
- LegacyTitledEnumSchema
-
Use
TitledSingleSelectEnumSchemainstead. 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/listrequest. - ListPromptsResultCacheScope
-
Values of
ListPromptsResult.cacheScope. - ListPromptsResultResponse
-
A successful response from the server for a
ListPromptsRequestprompts/listrequest. - ListResourcesRequest
- Sent from the client to request a list of resources the server has.
- ListResourcesResult
-
The result returned by the server for a
ListResourcesRequestresources/listrequest. - ListResourcesResultCacheScope
-
Values of
ListResourcesResult.cacheScope. - ListResourcesResultResponse
-
A successful response from the server for a
ListResourcesRequestresources/listrequest. - 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/listrequest. - ListResourceTemplatesResultCacheScope
-
Values of
ListResourceTemplatesResult.cacheScope. - ListResourceTemplatesResultResponse
-
A successful response from the server for a
ListResourceTemplatesRequestresources/templates/listrequest. - 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.
- ListRootsRequestParams
-
ListRootsRequest.params. - ListRootsResult
-
The result returned by the client for a
ListRootsRequestroots/listrequest. This result contains an array ofRootobjects, each representing a root directory or file that the server can operate on. - ListTasksRequest
- A request to retrieve a list of tasks.
- ListTasksResult
- The response to a tasks/list request.
- ListToolsRequest
- Sent from the client to request a list of tools the server has.
- ListToolsResult
-
The result returned by the server for a
ListToolsRequesttools/listrequest. - ListToolsResultCacheScope
-
Values of
ListToolsResult.cacheScope. - ListToolsResultResponse
-
A successful response from the server for a
ListToolsRequesttools/listrequest. - LoggingLevel
- The severity of a log message.
- LoggingMessageNotification
-
JSONRPCNotification of a log message passed from server to client. The client opts in by setting
"io.modelcontextprotocol/logLevel"in a request's_meta. - LoggingMessageNotificationParams
-
Parameters for a
notifications/messagenotification. - McpEnum
- Base of every generated string-valued enumeration. Values outside the schema's set are kept, so a newer peer's value is passed through rather than rejected.
- McpIcon
- An optionally-sized icon that can be displayed in a user interface.
- McpIcons
-
Base interface to add
iconsproperty. - McpIconTheme
-
Values of
McpIcon.theme. - McpJson
- A value that serialises to JSON.
- McpMethodSpec
- One MCP method as the schema defines it.
- McpNotification
- Revisions: 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25, 2026-07-28.
- McpObject
- Base of every generated object type.
- McpResult
- Common result fields.
- McpTaskRecord
- One task.
- McpTaskStatus
- Task statuses (identical in both specifications).
- McpTaskStore
- The receiver's tasks.
- 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 be400 Bad Request. - MissingRequiredClientCapabilityErrorError
-
MissingRequiredClientCapabilityError.error. - MissingRequiredClientCapabilityErrorErrorData
-
MissingRequiredClientCapabilityErrorError.data. - ModelHint
- Hints to use for model selection.
- ModelPreferences
- The server's preferences for model selection, requested of the client during sampling.
- MultiSelectEnumSchema
- Revisions: 2025-11-25, 2026-07-28.
- NotificationMetaObject
-
Extends
MetaObjectwith additional notification-specific fields. All key naming rules fromMetaObjectapply. - NotificationParams
- Common params for any notification.
- NumberSchema
- Revisions: 2025-06-18, 2025-11-25, 2026-07-28, ext-tasks/2026-07-28.
- NumberSchemaType
-
Values of
NumberSchema.type. - PaginatedRequest
- Revisions: 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25, 2026-07-28.
- PaginatedRequestParams
- Common params for paginated requests.
- PaginatedResult
- Revisions: 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25, 2026-07-28.
- 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.
- 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.
- PrimitiveSchemaDefinition
- Restricted schema definitions that only allow primitive types without nested objects or arrays.
- 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/progressnotification. - 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/listenstream when the client requested it via thepromptsListChangedfilter 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/readrequest. - ReadResourceResult
-
The result returned by the server for a
ReadResourceRequestresources/readrequest. - ReadResourceResultCacheScope
-
Values of
ReadResourceResult.cacheScope. - ReadResourceResultResponse
-
A successful response from the server for a
ReadResourceRequestresources/readrequest. - RelatedTaskMetadata
-
Metadata for associating messages with a task.
Include this in the
_metafield under the keyio.modelcontextprotocol/related-task. - Request
- Revisions: 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25, 2026-07-28.
- RequestMetaObject
-
Extends
MetaObjectwith additional request-specific fields. All key naming rules fromMetaObjectapply. - RequestParams
- Common params for any request.
- Resource
- A known resource that the server is capable of reading.
- ResourceContents
- One of: TextResourceContents, BlobResourceContents.
- 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/listenstream when the client requested it via theresourcesListChangedfilter field. - ResourceReference
- A reference to a resource or resource template definition.
- 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
resourceSubscriptionsfield of aSubscriptionsListenRequestsubscriptions/listenrequest. - ResourceUpdatedNotificationParams
-
Parameters for a
notifications/resources/updatednotification. - ResultMetaObject
-
Extends
MetaObjectwith additional result-specific fields. All key naming rules fromMetaObjectapply. - Role
- The sender or recipient of messages and data in a conversation.
- 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.
- SamplingMessage
- Describes a message issued to or received from an LLM API.
- SamplingMessageContentBlock
- Revisions: 2025-11-25, 2026-07-28, ext-tasks/2026-07-28.
- 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
-
ServerCapabilities.prompts. - ServerCapabilitiesResources
-
ServerCapabilities.resources. - ServerCapabilitiesTasks
-
ServerCapabilities.tasks. - ServerCapabilitiesTasksRequests
-
ServerCapabilitiesTasks.requests. - ServerCapabilitiesTasksRequestsTools
-
ServerCapabilitiesTasksRequests.tools. - ServerCapabilitiesTools
-
ServerCapabilities.tools. - ServerNotification
- Revisions: 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25, 2026-07-28.
- ServerRequest
- Revisions: 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25.
- SetLevelRequest
- A request from the client to the server, to enable or adjust logging.
- SetLevelRequestParams
-
Parameters for a
logging/setLevelrequest. - SetLevelRequestParamsMeta
-
SetLevelRequestParams._meta. - SingleSelectEnumSchema
- Revisions: 2025-11-25, 2026-07-28.
- StringSchema
- Revisions: 2025-06-18, 2025-11-25, 2026-07-28, ext-tasks/2026-07-28.
- StringSchemaFormat
-
Values of
StringSchema.format. - SubscribeRequest
- Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
- SubscribeRequestParams
-
Parameters for a
resources/subscriberequest. - SubscribeRequestParamsMeta
-
SubscribeRequestParams._meta. - SubscriptionFilter
-
The set of notification types a client may opt in to on a
SubscriptionsListenRequestsubscriptions/listenrequest. - SubscriptionsAcknowledgedNotification
-
Sent by the server to acknowledge that a
SubscriptionsListenRequestsubscriptions/listensubscription has been established and to report which notification types it agreed to honor. - SubscriptionsAcknowledgedNotificationParams
-
Parameters for a
SubscriptionsAcknowledgedNotificationnotifications/subscriptions/acknowledgednotification. - 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/listenrequest. - SubscriptionsListenResult
-
The response to a
SubscriptionsListenRequestsubscriptions/listenrequest, 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
ResultMetaObjectwith the subscription-stream identifier carried by aSubscriptionsListenResult. All key naming rules fromMetaObjectapply. - SubscriptionsListenResultResponse
-
A successful response from the server for a
SubscriptionsListenRequestsubscriptions/listenrequest, sent when the server tears the subscription down gracefully. - Task
- Revisions: 2025-11-25, ext-tasks/2026-07-28.
- TaskAugmentedRequestParams
- Common params for any task-augmented request.
- TaskAugmentedRequestParamsMeta
-
TaskAugmentedRequestParams._meta. - TaskMetadata
-
Metadata for augmenting a request with task execution.
Include this in the
taskfield of the request parameters. - TaskStatus
- Revisions: 2025-11-25, ext-tasks/2026-07-28.
- TaskStatusNotification
- Revisions: 2025-11-25, ext-tasks/2026-07-28.
- TaskStatusNotificationParams
- Revisions: 2025-11-25, ext-tasks/2026-07-28.
- TaskSubscriptionAcknowledgedNotifications
- Revisions: ext-tasks/2026-07-28.
- TaskSubscriptionNotifications
- Revisions: ext-tasks/2026-07-28.
- TextContent
- Text provided to or from an LLM.
- TextResourceContents
- Revisions: 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25, 2026-07-28, ext-tasks/2026-07-28.
- TitledMultiSelectEnumSchema
- Schema for multiple-selection enumeration with display titles for each option.
- TitledMultiSelectEnumSchemaItems
-
TitledMultiSelectEnumSchema.items. - TitledMultiSelectEnumSchemaItemsAnyOfItem
-
TitledMultiSelectEnumSchemaItems.anyOfItem. - TitledSingleSelectEnumSchema
- Schema for single-selection enumeration with display titles for each option.
- TitledSingleSelectEnumSchemaOneOfItem
-
TitledSingleSelectEnumSchema.oneOfItem. - Tool
- Definition for a tool the client can call.
- ToolAnnotations
-
Additional properties describing a
Toolto clients. - ToolChoice
- Controls tool selection behavior for sampling requests.
- ToolChoiceMode
-
Values of
ToolChoice.mode. - ToolExecution
- Execution-related properties for a tool.
- ToolExecutionTaskSupport
-
Values of
ToolExecution.taskSupport. - 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/listenstream when the client requested it via thetoolsListChangedfilter field. - ToolResultContent
- The result of a tool use, provided by the user back to the assistant.
- ToolUseContent
- A request from the assistant to call a tool.
- UnknownClientNotification
- A ClientNotification whose kind this revision set does not define, kept intact.
- UnknownClientRequest
- A ClientRequest whose kind this revision set does not define, kept intact.
- UnknownCompleteRequestParamsRef
- A CompleteRequestParamsRef whose kind this revision set does not define, kept intact.
- UnknownContentBlock
- A ContentBlock whose kind this revision set does not define, kept intact.
- UnknownElicitRequestParams
- A ElicitRequestParams whose kind this revision set does not define, kept intact.
- UnknownEnumSchema
- A EnumSchema whose kind this revision set does not define, kept intact.
- UnknownInputRequest
- A InputRequest whose kind this revision set does not define, kept intact.
- UnknownJSONRPCResponse
- A JSONRPCResponse whose kind this revision set does not define, kept intact.
- UnknownMultiSelectEnumSchema
- A MultiSelectEnumSchema whose kind this revision set does not define, kept intact.
- UnknownPrimitiveSchemaDefinition
- A PrimitiveSchemaDefinition whose kind this revision set does not define, kept intact.
- UnknownResourceContents
- A ResourceContents whose kind this revision set does not define, kept intact.
- UnknownSamplingMessageContentBlock
- A SamplingMessageContentBlock whose kind this revision set does not define, kept intact.
- UnknownServerNotification
- A ServerNotification whose kind this revision set does not define, kept intact.
- UnknownServerRequest
- A ServerRequest whose kind this revision set does not define, kept intact.
- UnknownSingleSelectEnumSchema
- A SingleSelectEnumSchema whose kind this revision set does not define, kept intact.
- UnsubscribeRequest
- Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
- UnsubscribeRequestParams
-
Parameters for a
resources/unsubscriberequest. - UnsubscribeRequestParamsMeta
-
UnsubscribeRequestParams._meta. - 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. - UnsupportedProtocolVersionErrorError
-
UnsupportedProtocolVersionError.error. - UnsupportedProtocolVersionErrorErrorData
-
UnsupportedProtocolVersionErrorError.data. - UntitledMultiSelectEnumSchema
- Schema for multiple-selection enumeration without display titles for options.
- UntitledMultiSelectEnumSchemaItems
-
UntitledMultiSelectEnumSchema.items. - UntitledSingleSelectEnumSchema
- Schema for single-selection enumeration without display titles for options.
- UpdateTaskRequest
- Revisions: ext-tasks/2026-07-28.
- UpdateTaskRequestParams
-
UpdateTaskRequest.params. - UpdateTaskResult
- Revisions: ext-tasks/2026-07-28.
- URLElicitationRequiredError
- An error response that indicates that the server requires the client to provide additional information via an elicitation request.
- URLElicitationRequiredErrorError
-
URLElicitationRequiredError.error. - URLElicitationRequiredErrorErrorData
-
URLElicitationRequiredErrorError.data. - WorkingTask
- Revisions: ext-tasks/2026-07-28.
Enums
- JsonSchemaDialect
- JSON Schema dialects this validator implements.
- McpDirection
- Direction of an MCP message.
- McpTaskFlavor
- Which task specification a task follows; it decides the wire shape.
Constants
- absent → const Object
-
Marker for "leave this key out" in constructors of properties whose schema
allows an explicit
null(wherenulland absent mean different things). -
mcpMethods
→ const List<
McpMethodSpec> - Every method in every supported source.
-
mcpSchemaUnionBranches
→ const Map<
String, List< String> > - Branches of every discriminated union, by schema name (for tests and tools).
Properties
Functions
-
$any(
Object? v, String path) → Object? - Reads any JSON value as is (copied).
-
$bool(
Object? v, String path) → bool - Reads a boolean.
-
$encode(
Object? v) → Object? - Encodes a typed value back to JSON.
-
$enum<
T> (T of(String)) → T Function(Object?, String) -
Reads an enumeration value with
of. -
$int(
Object? v, String path) → int -
Reads an integer (an integral
numis accepted). -
$list<
T> (T item(Object? value, String path)) → List< T> Function(Object?, String) -
Reads a list, converting each element with
item. -
$map<
T> (T item(Object? value, String path)) → Map< String, T> Function(Object?, String) -
Reads a map, converting each value with
item. -
$model<
T> (T fromJson(Map< String, Object?> )) → T Function(Object?, String) -
Reads a JSON object with
fromJson. -
$num(
Object? v, String path) → num - Reads a number.
-
$object(
Object? v, String path) → Map< String, Object?> - Reads a JSON object as a map (copied).
-
$oneOrList<
T> (T item(Object? value, String path)) → List< T> Function(Object?, String) - Reads one value or a list of them as a list.
-
$string(
Object? v, String path) → String - Reads a string.
-
decodeMcpHeaderValue(
String header) → String? - The value a header carries (sentinel decoded), or null when the header value has characters a header may not hold or a malformed sentinel.
-
elicitationRequestProblem(
Map params) → String? -
Why the params of an
elicitation/createrequest are not what their mode requires, or null (client/elicitation, 2025-11-25+): every request has amessage; form mode (or no mode) has arequestedSchemathat is a flat object of primitive properties; URL mode has a validurland anelicitationId. -
encodeMcpHeaderValue(
String value) → String -
A header value as Streamable HTTP carries it: as-is when it is plain
visible ASCII without surrounding whitespace, otherwise (or when it looks
like the sentinel)
=?base64?…?=of its UTF-8 bytes. -
isAbsoluteUri(
String value) → bool -
Whether
valueis an absolute URI under RFC 3986's generic syntax (scheme ":" hier-part …) — the check theuriformat uses. UnlikeUri.tryParse, it does not treatdata:(or any scheme) specially, sodata://configand other custom-scheme resource URIs are accepted. -
mcpMethodDefined(
String method, McpDirection direction, String revision, {Set< String> extensions = const {}}) → bool? -
Whether
methodis a protocol method ofrevisionindirection— defined by the core revision, or by an extension inextensions(ids such asio.modelcontextprotocol/tasks). Null when the method is not a protocol method of any supported revision (an application method). -
mcpParamHeaders(
Object? inputSchema) → ({List< McpParamHeader> headers, String? problem}) -
The
x-mcp-headerannotations ofinputSchema(2026-07-28 Streamable HTTP, custom headers from tool parameters), or the reason the tool definition is invalid: an empty or non-token name, a name repeated (case-insensitively), a parameter that is not integer / string / boolean, or one not reachable throughpropertiesalone. -
mcpParamHeaderValues(
List< McpParamHeader> headers, Map arguments) → Map<String, String> -
The
Mcp-Param-{name}values for a call witharguments(absent and null values omitted), encoded for the header; throws ArgumentError for a value of the wrong type or an integer outside the safe range. -
samplingMessagesProblem(
Object? messages) → String? -
Why the
messagesof asampling/createMessagerequest break the sampling rules, or null (specification, client/sampling: message content constraints, 2025-11-25+): -
uriTemplateMatches(
String template, String uri) → bool -
Whether
uriis an expansion of the RFC 6570 URI templatetemplate(resource templates:uriTemplate). Every operator is understood: simple{x}(unreserved characters only, so a/is not part of the value), reserved{+x}, fragment{#x}, label{.x}, path{/x}, path parameters{;x}, query{?x}and continuation{&x}; prefix (:n) and explode (*) modifiers are accepted. An undefined variable may expand to nothing. -
uriTemplateValid(
String template) → bool -
Whether
templateis a well-formed RFC 6570 URI template. -
uriTemplateVariables(
String template, String uri) → Map< String, String> ? -
The values of the simple and reserved variables of
templateinuri, or null when it does not match.
Typedefs
- ClientResult = McpResult
- Common result fields.
- Cursor = String
- An opaque token used to represent a cursor for pagination.
- EmptyResult = McpResult
- Common result fields.
-
InputRequests
= Map<
String, InputRequest> - A map of server-initiated requests that the client must fulfill. Keys are server-assigned identifiers; values are the request objects.
-
InputResponse
= Map<
String, Object?> - Revisions: 2026-07-28, ext-tasks/2026-07-28.
-
InputResponses
= Map<
String, Map< String, Object?> > -
A map of client responses to server-initiated requests.
Keys correspond to the keys in the
InputRequestsmap; values are the client's result for each request. -
JSONArray
= List<
Object?> - Revisions: 2026-07-28.
-
JSONObject
= Map<
String, Object?> - Revisions: 2026-07-28, ext-tasks/2026-07-28.
-
JSONRPCBatchRequest
= List<
Object?> - A JSON-RPC batch request, as described in https://www.jsonrpc.org/specification#batch.
-
JSONRPCBatchResponse
= List<
Object?> - A JSON-RPC batch response, as described in https://www.jsonrpc.org/specification#batch.
- JSONRPCError = JSONRPCErrorResponse
- Revisions: 2025-06-18.
-
JSONRPCMessage
= Map<
String, Object?> - Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.
- JSONValue = Object?
- Revisions: 2026-07-28, ext-tasks/2026-07-28.
-
McpParamHeader
= ({String name, List<
String> path, String type}) -
One
x-mcp-headerannotation of a tool'sinputSchema: the header name part, the property path to the value, and the property's type. -
MetaObject
= Map<
String, Object?> -
Represents the contents of a
_metafield, which clients and servers use to attach additional metadata to their interactions. - ProgressToken = Object
- A progress token, used to associate progress notifications with the original request.
- RequestId = Object
- A uniquely identifying ID for a request in JSON-RPC.
- ResultType = String
-
Indicates the type of a
Resultobject, allowing the client to determine how to parse the response. -
ServerResult
= Map<
String, Object?> - Revisions: 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25, 2026-07-28.
-
TasksExtensionCapability
= Map<
String, Object?> - Revisions: ext-tasks/2026-07-28.
Exceptions / Errors
- JsonSchemaException
- A schema that cannot be used: unsupported dialect, unresolvable reference, malformed keyword, or a limit exceeded while evaluating.