Expand description
MCP protocol types and JSON-RPC implementation.
This crate provides:
- JSON-RPC 2.0 message types
- MCP-specific method types (tools, resources, prompts)
- Protocol version negotiation
- Message serialization/deserialization
MCP 2026-07-28 support is under implementation and remains unverified. Its core vocabulary is always available. Optional legacy, Tasks, and Apps wire surfaces require their matching crate features and are not aggregate conformance or release evidence.
§MCP Protocol Overview
MCP (Model Context Protocol) uses JSON-RPC 2.0 over various transports. The protocol defines:
- Tools: Executable functions the client can invoke
- Resources: Data sources the client can read
- Prompts: Template prompts for the client to use
§Wire Format
Protocol values serialize as JSON-RPC. Framing is transport-specific; the stdio transport uses newline-delimited JSON (NDJSON).
§Role in the System
fastmcp-protocol is the shared vocabulary for FastMCP:
- The server uses these types to validate and serialize responses.
- The client uses the same types to construct requests and parse replies.
- Transports carry these messages without needing to know business logic.
If you are integrating FastMCP with a custom runtime or embedding it into another system, depend on this crate to use FastMCP’s current JSON-RPC and MCP data models. The modernization disclaimer above still applies.
Re-exports§
pub use common_types::JsonInteger;pub use extensions::ClientExtensionDiscovery;pub use extensions::ExtensionDescriptor;pub use extensions::ExtensionDescriptorRegistry;pub use extensions::ExtensionDirection;pub use extensions::ExtensionDiscovery;pub use extensions::ExtensionFallbackPolicy;pub use extensions::ExtensionHttpEraDisposition;pub use extensions::ExtensionId;pub use extensions::ExtensionMethodDescriptor;pub use extensions::ExtensionNegotiationResolver;pub use extensions::ExtensionNotificationDescriptor;pub use extensions::ExtensionRegistryError;pub use extensions::ExtensionRegistryReceipt;pub use extensions::ExtensionRoutingHeaderDescriptor;pub use extensions::ExtensionSettings;pub use extensions::ExtensionSettingsCompatibilityResolver;pub use extensions::ExtensionSettingsResolution;pub use extensions::ExtensionSettingsSchema;pub use extensions::MAX_EXTENSION_DESCRIPTORS;pub use extensions::MAX_EXTENSION_ID_BYTES;pub use extensions::MAX_EXTENSION_REGISTRY_CANONICAL_BYTES;pub use extensions::MAX_EXTENSION_SETTINGS_ENTRIES;pub use extensions::MAX_EXTENSION_SETTINGS_KEY_BYTES;pub use extensions::MAX_EXTENSION_SETTINGS_NESTING;pub use extensions::MAX_EXTENSION_SETTINGS_VALUE_BYTES;pub use extensions::MAX_MCP_APPS_MIME_TYPE_BYTES;pub use extensions::MAX_MCP_APPS_MIME_TYPES;pub use extensions::MCP_APPS_ACTIVATION_PREDICATE_ID;pub use extensions::MCP_APPS_CLIENT_SETTINGS_SCHEMA_ID;pub use extensions::MCP_APPS_DOWNLOAD_FILE_METHOD;pub use extensions::MCP_APPS_HOST_CONTEXT_CHANGED_NOTIFICATION;pub use extensions::MCP_APPS_HTML_MIME_TYPE;pub use extensions::MCP_APPS_INITIALIZE_METHOD;pub use extensions::MCP_APPS_INITIALIZED_NOTIFICATION;pub use extensions::MCP_APPS_MESSAGE_METHOD;pub use extensions::MCP_APPS_NEGOTIATION_RESOLVER_ID;pub use extensions::MCP_APPS_OPEN_LINK_METHOD;pub use extensions::MCP_APPS_REQUEST_DISPLAY_MODE_METHOD;pub use extensions::MCP_APPS_REQUEST_TEARDOWN_NOTIFICATION;pub use extensions::MCP_APPS_RESOURCE_TEARDOWN_METHOD;pub use extensions::MCP_APPS_SANDBOX_PROXY_READY_NOTIFICATION;pub use extensions::MCP_APPS_SANDBOX_RESOURCE_READY_NOTIFICATION;pub use extensions::MCP_APPS_SERVER_SETTINGS_SCHEMA_ID;pub use extensions::MCP_APPS_SIZE_CHANGED_NOTIFICATION;pub use extensions::MCP_APPS_TOOL_CANCELLED_NOTIFICATION;pub use extensions::MCP_APPS_TOOL_INPUT_NOTIFICATION;pub use extensions::MCP_APPS_TOOL_INPUT_PARTIAL_NOTIFICATION;pub use extensions::MCP_APPS_TOOL_RESULT_NOTIFICATION;pub use extensions::MCP_APPS_UPDATE_MODEL_CONTEXT_METHOD;pub use extensions::McpAppsClientSettings;pub use extensions::McpAppsNegotiationResolver;pub use extensions::OFFICIAL_MCP_APPS_EXTENSION_ID;pub use extensions::RejectingExtensionNegotiationResolver;pub use extensions::ServerExtensionDiscovery;pub use extensions::StdioCorrelationDescriptor;pub use extensions::official_mcp_apps_descriptor;pub use extensions::official_mcp_apps_empty_server_settings;pub use extensions::official_mcp_apps_extension_id;pub use extensions::official_mcp_apps_negotiation_resolver;pub use extensions::register_official_mcp_apps_extension;pub use extensions::resolve_official_mcp_apps_settings;pub use methods::SERVER_DISCOVER;pub use protocol_version::FINAL_PROTOCOL_VERSION;pub use protocol_version::FinalHttpRequestMetadata;pub use protocol_version::FinalProtocolVersion;pub use protocol_version::FinalRequestAdmission;pub use protocol_version::HEADER_MISMATCH_ERROR_CODE;pub use protocol_version::HeaderMismatchError;pub use protocol_version::HeaderMismatchReason;pub use protocol_version::MAX_REQUIRED_CAPABILITIES_ERROR_DATA_BYTES;pub use protocol_version::MCP_METHOD_HEADER;pub use protocol_version::MCP_NAME_HEADER;pub use protocol_version::MCP_PROTOCOL_VERSION_HEADER;pub use protocol_version::MISSING_REQUIRED_CLIENT_CAPABILITY_ERROR_CODE;pub use protocol_version::MissingRequiredClientCapabilityError;pub use protocol_version::ProtocolVersionError;pub use protocol_version::RequestAdmissionError;pub use protocol_version::RequestVersionMetadata;pub use protocol_version::RequiredCapabilitiesError;pub use protocol_version::SUPPORTED_FINAL_PROTOCOL_VERSIONS;pub use protocol_version::UNSUPPORTED_PROTOCOL_VERSION_ERROR_CODE;pub use protocol_version::UnsupportedProtocolVersionError;pub use protocol_version::admit_final_http_request;pub use protocol_version::admit_final_request;pub use protocol_version::validate_final_protocol_version;pub use schema::AdmittedFinalFormSchema;pub use schema::AdmittedSchema;pub use schema::FinalCoreResultType;pub use schema::SchemaAdmissionError;pub use schema::ValidationError;pub use schema::ValidationResult;pub use schema::admit_final_form_schema;pub use schema::admit_final_schema;pub use schema::validate;pub use schema::validate_final_core_result;pub use schema::validate_strict;pub use server_discovery::DiscoveryCacheHints;pub use server_discovery::MAX_SERVER_INSTRUCTIONS_BYTES;pub use server_discovery::SERVER_DISCOVER_METHOD;pub use server_discovery::SERVER_DISCOVER_SERVER_INFO_META_KEY;pub use server_discovery::SERVER_DISCOVER_SUPPORTED_VERSIONS;pub use server_discovery::ServerBehavior;pub use server_discovery::ServerBehaviorRegistry;pub use server_discovery::ServerDiscoverCapabilities;pub use server_discovery::ServerDiscoverRequest;pub use server_discovery::ServerDiscoverResult;pub use server_discovery::ServerDiscoveryError;pub use server_discovery::ServerInstructionError;pub use server_discovery::ServerInstructions;pub use uri_template::MAX_URI_TEMPLATE_BYTES;pub use uri_template::MAX_URI_TEMPLATE_COMPOSITE_ITEMS;pub use uri_template::MAX_URI_TEMPLATE_EXPANSION_OUTPUT_BYTES;pub use uri_template::MAX_URI_TEMPLATE_EXPRESSIONS;pub use uri_template::MAX_URI_TEMPLATE_PARTS;pub use uri_template::MAX_URI_TEMPLATE_PREFIX_LENGTH;pub use uri_template::MAX_URI_TEMPLATE_VALUE_BYTES;pub use uri_template::MAX_URI_TEMPLATE_VARIABLE_NAME_BYTES;pub use uri_template::MAX_URI_TEMPLATE_VARIABLES_PER_EXPRESSION;pub use uri_template::ReversibleResourceTemplate;pub use uri_template::TemplateValue;pub use uri_template::TemplateValues;pub use uri_template::UriTemplate;pub use uri_template::UriTemplateError;pub use uri_template::UriTemplateExpansionLimits;pub use uri_template::UriTemplateExpression;pub use uri_template::UriTemplateModifier;pub use uri_template::UriTemplateOperator;pub use uri_template::UriTemplatePart;
Modules§
- common_
types - Final MCP common wire types kept separate while the legacy type surface is migrated.
- extensions
- Frozen, runtime-neutral extension negotiation and request admission.
- methods
- Canonical MCP JSON-RPC method names.
- protocol_
policy - Exact MCP protocol-version identity and immutable era-policy selection.
- protocol_
version - Final MCP protocol-version header validation.
- schema
- JSON Schema validation for MCP tool inputs.
- server_
discovery - Typed
server/discovervocabulary for the final MCP discovery surface. - uri_
template - Bounded RFC 6570 Level 4 URI-template parsing and expansion.
Structs§
- Cache
Ttl - A nonnegative final cache TTL that retains its exact JSON-integer spelling.
- Cacheable
Result - A complete-result composition with strict cache hints.
- Call
Tool Params - tools/call request params.
- Call
Tool Result - tools/call response result.
- Cancelled
Params - Cancelled notification params.
- Client
Capabilities - Client capabilities.
- Client
Info - Client information.
- Complete
Result - A typed core
completeresult with inert open siblings. - Completion
Values - Completion candidates returned by the legacy protocol era.
- Completions
Capability - Empty object advertised when
completion/completeis installed. - Core
Result Discriminator Policy - The default policy: only core discriminators are accepted locally.
- Create
Message Params - sampling/createMessage request params.
- Create
Message Result - sampling/createMessage response result.
- Elicit
Complete Notification Params - Elicitation complete notification params.
- Elicit
Request Form Params - Parameters for form mode elicitation requests.
- Elicit
Request UrlParams - Parameters for URL mode elicitation requests.
- Elicit
Result - elicitation/create response result.
- Elicitation
Capability - Elicitation capability.
- Elicitation
Required Error Data - Error data for URL elicitation required errors.
- Exact
Json Member - One JSON object member.
- Exact
Json Object - An ordered JSON object.
- Final
Base Metadata - Shared final component identity fields.
- Final
Call Tool Params - Final
tools/callrequest parameters. - Final
Call Tool Result - Final
tools/callresult payload using final common content blocks. - Final
Cancelled Notification Params - Exact final
notifications/cancelledparameters. - Final
Completion Argument - Final completion argument selector.
- Final
Completion Context - Optional final completion context.
- Final
Completion Params - Final
completion/completerequest parameters. - Final
Completion Result - Final
completion/completeresult payload. - Final
Completion Values - Completion candidates returned by the final protocol era.
- Final
Create Message Input Required Result - Exact final
sampling/createMessageinput-required result. - Final
Create Message Params - Exact final
sampling/createMessageparameters. - Final
Create Message Result - Exact final
sampling/createMessagecomplete payload. - Final
Embedded Create Message Params - Exact final parameters for an embedded sampling descriptor.
- Final
Embedded Elicitation Result - Exact elicitation response payload embedded in a Task input response map.
- Final
Embedded Form Elicitation Params - Form elicitation request parameters without an outer request envelope.
- Final
Embedded Roots List Params - Bounded generic metadata permitted on an embedded roots descriptor.
- Final
Embedded Roots List Result - Exact roots-list result payload embedded in a Task input response map.
- Final
Embedded UrlElicitation Params - URL elicitation request parameters without legacy elicitation identity.
- Final
Empty Notification Params - Exact optional parameter object for final catalog-change notifications.
- Final
Empty Params - Final empty request parameters, used by
server/discover. - Final
Empty Result - Empty final complete-result payload used by acknowledgement methods.
- Final
GetPrompt Params - Final
prompts/getrequest parameters. - Final
GetPrompt Result - Final
prompts/getresult payload. - Final
Input Responses - Typed, order-preserving client replies to server-issued final MRTR input requests.
- Final
List Params - Final pagination parameters shared by the core catalog methods.
- Final
List Prompts Result - Final
prompts/listresult payload. - Final
List Resource Templates Result - Final
resources/templates/listresult payload. - Final
List Resources Result - Final
resources/listresult payload. - Final
List Tools Result - Final
tools/listresult payload. - Final
LogMessage Params - Exact final
notifications/messageparameters. - Final
Progress Notification Params - Exact final
notifications/progressparameters. - Final
Prompt - Exact final
Promptmodel. - Final
Prompt Argument - Exact final prompt-argument model.
- Final
Prompt Message - One final prompt message using a final common content block.
- Final
Read Resource Params - Final
resources/readrequest parameters. - Final
Read Resource Result - Final
resources/readresult payload using final common resource content. - Final
Request Meta - Required final metadata carried in the
_metaobject of every request. - Final
Resource - Exact final
Resourcemodel. - Final
Resource Template - Exact final
ResourceTemplatemodel. - Final
Resource Updated Notification Params - Exact final
notifications/resources/updatedparameters. - Final
Result Metadata Seal - Server-owned final metadata retained across response middleware.
- Final
Sampling Message - A final sampling conversation message.
- Final
Subscriptions Acknowledged Notification Params - Final
notifications/subscriptions/acknowledgedparameters. - Final
Subscriptions Listen Params - Final
subscriptions/listenrequest parameters. - Final
Subscriptions Listen Result - Empty final
subscriptions/listenresult body. - Final
Tool - Exact final
Toolmodel. - Final
Tool Annotations - Final tool annotations, including the final display-title hint.
- Final
Tool Choice - Tool-selection controls for final sampling.
- Form
Elicitation Capability - Capability for form mode elicitation.
- GetPrompt
Params - prompts/get request params.
- GetPrompt
Result - prompts/get response result.
- Icon
- Icon metadata for visual representation of components.
- Initialize
Params - Initialize request params.
- Initialize
Result - Initialize response result.
- Input
Required Result - A typed core
input_requiredresult with inert open siblings. - Json
RpcError - JSON-RPC 2.0 error object.
- Json
RpcRequest - JSON-RPC 2.0 request.
- Json
RpcResponse - JSON-RPC 2.0 response.
- Json
RpcResponse Admission - One strictly admitted JSON-RPC response paired with the exact source JSON of its result member.
- Legacy
Completion Argument - Exact legacy completion argument selector.
- Legacy
Completion Params - Exact 2024-11-05
completion/completerequest parameters. - Legacy
Completion Result - Exact legacy
completion/completeresult payload. - Legacy
Empty Result - Empty exact-legacy result payload used by acknowledgement methods.
- Legacy
Opaque Metadata - Ordered opaque legacy metadata.
- Legacy
Prompt Message - Exact 2024-11-05 prompt messages carried in legacy results.
- List
Prompts Params - prompts/list request params.
- List
Prompts Result - prompts/list response result.
- List
Resource Templates Params - resources/templates/list request params.
- List
Resource Templates Result - resources/templates/list response result.
- List
Resources Params - resources/list request params.
- List
Resources Result - resources/list response result.
- List
Roots Params - roots/list request params.
- List
Roots Result - roots/list response result.
- List
Tools Params - tools/list request params.
- List
Tools Result - tools/list response result.
- LogMessage
Params - Log message notification params.
- Logging
Capability - Logging capability.
- McpApps
Resource Binding - A validated association between a tool’s nested Apps metadata and an HTML UI resource in the final catalog.
- McpApps
Resource Csp - Bounded CSP origins declared by an Apps resource.
- McpApps
Resource Metadata - Closed Apps rendering metadata attached to a
Resourceunder_meta.ui. - McpApps
Resource Permission - An empty-object Apps sandbox permission marker.
- McpApps
Resource Permissions - Optional sandbox permissions requested by an Apps resource.
- McpApps
Tool Metadata - Closed Apps metadata attached to a final
Toolunder_meta.ui. - McpApps
Tool Result - One validated Apps-side projection of a complete final
tools/callresult. - Metadata
View - Read-only view of optional result metadata.
- Model
Hint - A hint for model selection.
- Model
Preferences - Model preferences for sampling requests.
- Paginated
Result - A complete-result composition with a pagination cursor.
- Progress
Params - Progress notification params.
- Prompt
- Prompt definition.
- Prompt
Argument - Prompt argument definition.
- Prompt
Message - A message in a prompt.
- Prompts
Capability - Prompt capabilities.
- RawResult
Envelope - A raw result envelope for a non-core discriminator. It is diagnostic data, not an activated extension result.
- Read
Resource Params - resources/read request params.
- Read
Resource Result - resources/read response result.
- Request
Meta - Request metadata containing optional progress marker.
- Resource
- Resource definition.
- Resource
Content - Resource content in a message.
- Resource
Template - Resource template definition.
- Resource
Updated Notification Params - Resource updated notification params.
- Resources
Capability - Resource capabilities.
- Result
Decode Error - An error raised while admitting or decoding a result envelope.
- Result
Meta - Result metadata common to complete and input-required results.
- Root
- A root definition representing a filesystem location.
- Roots
Capability - Roots capability.
- Roots
List Changed Notification Params - Notification params for roots/list_changed.
- Sampling
Capability - Sampling capability.
- Sampling
Message - A message in a sampling conversation.
- Server
Capabilities - Server capabilities advertised during initialization.
- Server
Info - Server information.
- SetLog
Level Params - logging/setLevel request params.
- Subscribe
Resource Params - resources/subscribe request params.
- Subscription
Filter - Final notification categories selected for a subscription stream.
- TaskId
- Task identifier.
- Task
Info - Information about a background task.
- Task
Result - Task result payload.
- Task
Status Notification Params - Task status change notification params.
- Tasks
Capability - Task capability for server capabilities.
- Tool
- Tool definition.
- Tool
Annotations - Tool annotations for additional metadata.
- Tools
Capability - Tool capabilities.
- Typed
Complete Members - Guarded access to one selected complete composition’s declared members.
- Uncorrelated
Json RpcError Response - An error response that is deliberately uncorrelated and omits
id. - Unknown
Result Members - Bounded, inert open members retained after known-field consumption.
- Unsubscribe
Resource Params - resources/unsubscribe request params.
- UrlElicitation
Capability - Capability for URL mode elicitation.
Enums§
- Cache
Scope - Peer cache scope.
Publicis a wire value, not an authority grant. - Cache
TtlConversion Error - Failure while validating or converting a final cache TTL.
- Cancellation
Sender - Peer that originates a cancellation notification.
- Cancellation
Wire Codec Error - Stable refusal classes for
CancellationWireMessagecodec operations. - Cancellation
Wire Message - An era-selected
notifications/cancelledJSON-RPC notification. - Client
Ingress Failure Scope - Transport ownership for a client-ingress raw protocol failure.
- Client
Notification - The one notification a final client may originate.
- Content
- Content types used by the broader server and 2026 adapter surfaces.
- Core
Dispatch Error - Stable errors raised while selecting a typed core request or result.
- Core
Request - Public, era-aware dispatch for the currently supported core request set.
- Core
Result - Public, era-aware dispatch for core results.
- Correlation
Key - Canonical map/registry key for a JSON-RPC request ID.
- Decoded
Result - Core or deferred result decoded from a peer envelope.
- Elicit
Action - User action in response to an elicitation request.
- Elicit
Content Value - Content type for elicitation responses.
- Elicit
Mode - Elicitation mode.
- Elicit
Request Params - Parameters for elicitation requests (either form or URL mode).
- Exact
Json Value - A recursively bounded JSON value which preserves each number’s source
lexeme. This is the result codec’s exact-value boundary; it never uses an
f64or a fixed-width integer for an admitted JSON number. - Final
Arguments - Wire presence of an optional final request
argumentsmember. - Final
Completion Peer Diagnostic - Bounded peer conformance diagnostics specific to final completion values.
- Final
Completion Reference - Final reference accepted by
completion/complete. - Final
Core Request - Final core requests use final metadata and common vocabulary throughout.
- Final
Core Result - Final result dispatch for the currently supported core methods.
- Final
Embedded Elicitation Params - Exact final parameters for an embedded elicitation descriptor.
- Final
Embedded Input Kind - The selected final MRTR response kind for one Task map key.
- Final
Embedded Input Request - A final MRTR descriptor embedded in a Task, without a JSON-RPC envelope.
- Final
Embedded Input Response - A final MRTR result payload embedded in a Task, without a JSON-RPC envelope.
- Final
Input Required Result Type - Final input-required discriminator.
- Final
Input Response Correlation Error - Why a retry response map could not be correlated to a prior MRTR request.
- Final
Notification Error - Typed admission error for an MCP 2026-07-28 notification union.
- Final
Sampling Message Content - Exact final sampling-message content, preserving one block versus an array of blocks.
- Final
Tool Choice Mode - Tool-selection mode for final sampling.
- Include
Context - Context inclusion mode for sampling.
- Json
RpcAdmission Error - Admission failure for a complete strict JSON-RPC document.
- Json
RpcEndpoint Role - Immutable local endpoint role for raw JSON-RPC ingress disposition.
- Json
RpcMessage - A JSON-RPC message (request, response, or notification).
- Json
RpcMessage Direction - The direction attached by the local transport to a decoded message.
- Legacy
Completion Reference - Exact legacy reference accepted by
completion/complete. - Legacy
Content - Exact 2024-11-05 content blocks carried in legacy results.
- Legacy
Core Request - Legacy core requests remain exact uses of the existing message structs. They are never reinterpreted as final requests.
- Legacy
Core Result - Exact legacy response payloads, intentionally disjoint from final results.
- Legacy
Resource Content - Exact 2024-11-05 resource contents carried by legacy results.
- LogLevel
- Log level.
- McpApps
Display Mode - A Host-selected way to present an App View.
- McpApps
Lifecycle Error - Illegal transition in the pure Apps View lifecycle state machine.
- McpApps
Metadata Error - Metadata validation failures specific to the closed Apps
uimember. - McpApps
Resource Binding Error - A catalog resource did not satisfy one validated Apps binding.
- McpApps
Result Projection Error - Apps result projection failures.
- McpApps
Tool Visibility - A tool audience declared in nested MCP Apps metadata.
- McpApps
View Lifecycle - A View lifecycle phase. This pure protocol state machine does not send or
receive any
ui/*RPC message; a future bridge runtime owns that work. - Progress
Marker - Progress marker used to correlate progress notifications with requests.
- RawJson
Admission Error - A stable reason why raw JSON was rejected before typed decoding.
- RawJson
RpcDisposition - Role-aware disposition of a raw malformed JSON-RPC document.
- Request
Id - JSON-RPC request ID.
- Result
Decode Error Kind - Stable result-decoding failure categories.
- Result
Discriminator Decision - Result-discriminator decision made after raw structural admission.
- Result
Peer Diagnostic - Bounded diagnostics reserved for peer-result compatibility handling.
- Result
Peer Era - Protocol era used only for peer-ingress compatibility diagnostics.
- Role
- Role in prompt messages.
- Sampling
Content - Message content for sampling requests.
- Server
Notification - The eight notifications a final server may originate.
- Stop
Reason - Stop reason for sampling responses.
- Task
Status - Status of a background task.
Constants§
- FINAL_
CLIENT_ CAPABILITIES_ META_ KEY _metakey carrying the client capabilities on every final request.- FINAL_
CLIENT_ INFO_ META_ KEY _metakey carrying optional client identity on a final request.- FINAL_
LOG_ LEVEL_ META_ KEY _metakey carrying the client-selected logging floor on a final request.- FINAL_
PROTOCOL_ VERSION_ META_ KEY _metakey carrying the protocol version on every final request.- FINAL_
SERVER_ INFO_ META_ KEY _metakey carrying optional server identity on a final response.- FINAL_
SUBSCRIPTION_ ID_ META_ KEY _metakey correlating an event-stream subscription with its listen request.- JSONRPC_
VERSION - The JSON-RPC version string. Used as a static reference to avoid allocations.
- MAX_
CANCELLATION_ REASON_ BYTES - Historical cancellation-reason size used by earlier bounded profiles.
- MAX_
COMPLETION_ CONTEXT_ ARGUMENTS - Maximum number of previously resolved variables in one final completion context.
- MAX_
COMPLETION_ CONTEXT_ ARGUMENT_ BYTES - Maximum encoded JSON bytes occupied by one final completion-context argument map.
- MAX_
COMPLETION_ CONTEXT_ ARGUMENT_ KEY_ BYTES - Maximum UTF-8 bytes in one final completion-context variable name.
- MAX_
COMPLETION_ CONTEXT_ ARGUMENT_ VALUE_ BYTES - Maximum UTF-8 bytes in one final completion-context variable value.
- MAX_
COMPLETION_ VALUES - Maximum completion candidates allowed on the wire by either supported era.
- MAX_
FINAL_ COMPLETION_ VALUES_ BYTES - Maximum aggregate UTF-8 bytes in final completion candidates.
- MAX_
FINAL_ COMPLETION_ VALUE_ BYTES - Maximum UTF-8 bytes in one final completion candidate.
- MAX_
JSONRPC_ STRING_ ID_ ENCODED_ BYTES - Maximum encoded bytes in one JSON-RPC string ID, including quotes.
- MAX_
MCP_ APPS_ CSP_ DOMAINS_ PER_ DIRECTIVE - Maximum origins retained by one Apps CSP directive.
- MAX_
MCP_ APPS_ CSP_ DOMAIN_ BYTES - Maximum UTF-8 bytes retained for one Apps CSP origin or host-selected domain.
- MAX_
MCP_ APPS_ TOOL_ VISIBILITY_ ENTRIES - Maximum audience entries retained by one Apps tool visibility declaration.
- MAX_
MCP_ APPS_ UI_ METADATA_ MEMBERS - Maximum members in a closed nested MCP Apps tool
uimetadata object. - MAX_
RAW_ JSON_ AGGREGATE_ NUMBER_ BYTES - Maximum aggregate encoded number bytes in one admitted JSON document.
- MAX_
RAW_ JSON_ CONTAINER_ ENTRIES - Default maximum aggregate object members and array elements for raw JSON admission.
- MAX_
RAW_ JSON_ EXPONENT - Maximum absolute decimal exponent accepted by raw JSON admission.
- MAX_
RAW_ JSON_ NESTING_ DEPTH - Default maximum nesting depth for raw JSON admission.
- MAX_
RAW_ JSON_ NUMBER_ BYTES - Maximum encoded bytes in one JSON number token before typed decoding.
- MAX_
RESULT_ CONTAINER_ MEMBERS - Maximum members/elements accepted by one JSON object or array.
- MAX_
RESULT_ DEPTH - Maximum nesting depth accepted by the result codec.
- MAX_
RESULT_ ENCODED_ BYTES - Maximum encoded bytes accepted by the result codec.
- MAX_
RESULT_ NUMBER_ BYTES - Maximum source bytes in one JSON number lexeme.
- MAX_
RESULT_ STRING_ BYTES - Maximum decoded bytes in one JSON string or object key.
- MCP_
APPS_ DEPRECATED_ RESOURCE_ URI_ METADATA_ KEY - Deprecated flat metadata member that this final-only surface rejects.
- MCP_
APPS_ UI_ METADATA_ KEY - Nested
_metamember reserved by the MCP Apps protocol. - PROTOCOL_
VERSION - MCP protocol version.
Traits§
- Complete
Result Payload - Method-specific decoder for a selected core
completeresult composition. - Result
Discriminator Policy - Registry-agnostic policy seam for already-admitted non-core result types. No policy in this module owns a descriptor registry or activates extensions.
Functions§
- admit_
raw_ jsonrpc_ document - Admit one complete raw JSON-RPC document before any typed decoding.
- decode_
peer_ result - Decodes one peer result through the public result codec.
- decode_
peer_ result_ for_ era - Decodes one peer result using the protocol era selected for its request.
- decode_
strict_ jsonrpc_ message - Decode a complete JSON-RPC message only after raw-document admission.
- decode_
strict_ jsonrpc_ response - Strictly decodes one JSON-RPC response while retaining its exact result member source for the final result algebra.
- decode_
typed_ complete - Decodes a selected method-specific
completecomposition. - dispose_
raw_ jsonrpc_ failure - Convert a raw admission failure into an endpoint-safe disposition.
- encode_
complete_ result - Encodes one selected typed
completeresult through the final result algebra. Method dispatch supplies exactly the members it owns; every other admitted member remains an inertUnknownResultMemberssibling. - encode_
result - Re-emits a result without discarding or semantically rewriting any retained open member. Safe complete and input-required variants always emit their explicit core discriminator.
- exact_
json_ from_ serde - Converts an ordinary serde value into the result algebra’s bounded exact representation before it is attached to a locally authored result.
- exact_
json_ to_ serde - Converts one exact result value into a serde value for a selected typed method payload. Open result siblings remain exact and are never converted unless that payload explicitly owns their member name.
- parse_
exact_ json - Parses one bounded exact JSON value.
- project_
final_ core_ tools_ call_ result - Projects the complete
tools/callbranch while rejecting deferred Tasks and MRTR branches before any Apps result is produced.
Type Aliases§
- Elicit
Requested Schema - JSON Schema for elicitation requests.
- Final
Sampling Message Content Block - Final sampling-specific content block.
- Legacy
Metadata - Legacy 2024 metadata, retained exactly as an open JSON object.