Class ResultMeta
result._meta property.
Every successful v2 result carries server identity under the exact io.modelcontextprotocol/-prefixed
wire name mandated by the 2026-07-28 schema. W3C trace-context keys (traceparent /
tracestate / baggage) are the schema's explicit exception and remain bare; they are populated
only when an enabled tracer echoes the server span context. Unrecognized metadata members round-trip
losslessly, in insertion order, through the "*" dynamic-property triplet (extraKeys(),
get(String), set(String, Object)).
KEY_SERVER_INFO is the single source of truth for the result-identity wire key; the
2026-07-28 adapter and bean/adapter tests consume this constant rather than repeating the literal string.
The W3C trace-context keys are bare and therefore need no analogous constant: RequestMeta centralizes
RequestMeta.KEY_TRACEPARENT, RequestMeta.KEY_TRACESTATE, and RequestMeta.KEY_BAGGAGE
for the request side of the same carrier.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringExact wire key for the server implementation identity carried in successful result metadata. -
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).Server implementation identity.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.setServerInfo(Implementation value) Sets the server implementation identity.setTraceparent(String value) Sets the W3C trace-context parent.setTracestate(String value) Sets the W3C trace-context state.
-
Field Details
-
KEY_SERVER_INFO
Exact wire key for the server implementation identity carried in successful result metadata.- See Also:
-
-
Constructor Details
-
ResultMeta
public ResultMeta()
-
-
Method Details
-
getServerInfo
Server implementation identity.- Returns:
- The server info, or
nullif not set.
-
setServerInfo
@BeanProp("io.modelcontextprotocol/serverInfo") public ResultMeta setServerInfo(Implementation value) Sets the server implementation identity.- 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 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).
-