Class RequestMeta
params._meta property.
Every v2 request is independently negotiated from its own _meta; no handshake or session state exists.
Negotiation and identity keys use the exact io.modelcontextprotocol/-prefixed wire names mandated by the
2026-07-28 schema; W3C trace-context keys (traceparent / tracestate / baggage)
are the schema's explicit exception and remain bare. Unrecognized metadata members round-trip losslessly, in
insertion order, through the "*" dynamic-property triplet (extraKeys(), get(String),
set(String, Object)).
The exact wire-key constants below are the single source of truth for negotiation/identity/trace metadata keys;
the 2026-07-28 adapter, its validation messages, and bean/adapter tests consume these constants rather
than repeating the literal strings.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringBare (unprefixed) W3C baggage key.static final StringExact wire key for the required client capability advertisement.static final StringExact wire key for the optional client implementation identity.static final StringExact wire key for the deprecated, accepted-but-ignored client log level.static final StringExact wire key for the required negotiated protocol version.static final StringExact wire key carrying the JSON-RPC id of thesubscriptions/listenrequest on every notification frame's_metaon that stream.static final StringBare (unprefixed) W3C trace-context parent key.static final StringBare (unprefixed) W3C trace-context state key. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExtension metadata member keyset.Extension metadata member getter.W3C baggage (bare key; not renamed under theio.modelcontextprotocol/prefix).Client capability advertisement.Client implementation identity.Deprecated client log level.Protocol version requested by the client.W3C trace-context parent (bare key; not renamed under theio.modelcontextprotocol/prefix).W3C trace-context state (bare key; not renamed under theio.modelcontextprotocol/prefix).Extension metadata member setter.setBaggage(String value) Sets the W3C baggage.Sets the client capability advertisement.setClientInfo(Implementation value) Sets the client implementation identity.setLogLevel(String value) Sets the deprecated client log level.setProtocolVersion(String value) Sets the protocol version.setTraceparent(String value) Sets the W3C trace-context parent.setTracestate(String value) Sets the W3C trace-context state.
-
Field Details
-
KEY_PROTOCOL_VERSION
Exact wire key for the required negotiated protocol version.- See Also:
-
KEY_CLIENT_INFO
Exact wire key for the optional client implementation identity.- See Also:
-
KEY_CLIENT_CAPABILITIES
Exact wire key for the required client capability advertisement.- See Also:
-
KEY_LOG_LEVEL
Exact wire key for the deprecated, accepted-but-ignored client log level.- See Also:
-
KEY_TRACEPARENT
Bare (unprefixed) W3C trace-context parent key.- See Also:
-
KEY_TRACESTATE
Bare (unprefixed) W3C trace-context state key.- See Also:
-
KEY_BAGGAGE
Bare (unprefixed) W3C baggage key.- See Also:
-
KEY_SUBSCRIPTION_ID
Exact wire key carrying the JSON-RPC id of thesubscriptions/listenrequest on every notification frame's_metaon that stream. The terminalSubscriptionsListenResultframe carriesResultMeta(not this type) instead but reuses the same wire key via its untypedset(String, Object)extension.- See Also:
-
-
Constructor Details
-
RequestMeta
public RequestMeta()
-
-
Method Details
-
getProtocolVersion
Protocol version requested by the client.- Returns:
- The protocol version, or
nullif not set.
-
setProtocolVersion
@BeanProp("io.modelcontextprotocol/protocolVersion") public RequestMeta setProtocolVersion(String value) Sets the protocol version.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
getClientInfo
Client implementation identity.Optional (the schema's
SHOULD, notMUST); validated only when present.- Returns:
- The client info, or
nullif not set.
-
setClientInfo
@BeanProp("io.modelcontextprotocol/clientInfo") public RequestMeta setClientInfo(Implementation value) Sets the client implementation identity.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
getClientCapabilities
@BeanProp("io.modelcontextprotocol/clientCapabilities") public ClientCapabilities getClientCapabilities()Client capability advertisement.- Returns:
- The client capabilities, or
nullif not set.
-
setClientCapabilities
@BeanProp("io.modelcontextprotocol/clientCapabilities") public RequestMeta setClientCapabilities(ClientCapabilities value) Sets the client capability advertisement.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
getLogLevel
Deprecated client log level.Accepted and parsed for backward compatibility, but otherwise ignored by the
2026-07-28adapter.- Returns:
- The log level, or
nullif not set.
-
setLogLevel
Sets the deprecated client log level.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
getTraceparent
W3C trace-context parent (bare key; not renamed under theio.modelcontextprotocol/prefix).- Returns:
- The traceparent value, or
nullif not set.
-
setTraceparent
Sets the W3C trace-context parent.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
getTracestate
W3C trace-context state (bare key; not renamed under theio.modelcontextprotocol/prefix).- Returns:
- The tracestate value, or
nullif not set.
-
setTracestate
Sets the W3C trace-context state.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
getBaggage
W3C baggage (bare key; not renamed under theio.modelcontextprotocol/prefix).- Returns:
- The baggage value, or
nullif not set.
-
setBaggage
Sets the W3C baggage.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
extraKeys
Extension metadata member keyset.Covers any metadata member other than the negotiation/identity/trace properties declared above. Preserves insertion order.
- Returns:
- All extension keys on this metadata object. Never
null .
-
get
Extension metadata member getter.- Parameters:
property- The property name. Must not benull .- Returns:
- The property value, or
null if the property does not exist or is not set.
-
set
Extension metadata member setter.The extension map is lazily initialized on first use and preserves insertion order across repeated calls.
- Parameters:
property- The property name. Must not benull .value- The new value for the property. Can benull (stored asnull ).- Returns:
- This object (for method chaining).
-