Skip to main content

RequestMetaObject

Struct RequestMetaObject 

Source
pub struct RequestMetaObject {
    pub client_capabilities: ClientCapabilities,
    pub client_info: Option<Implementation>,
    pub log_level: Option<LoggingLevel>,
    pub protocol_version: String,
    pub progress_token: Option<ProgressToken>,
    pub extra: Option<Map<String, Value>>,
}
Expand description

Latest MCP Protocol 2026_07_28 Extends {@link MetaObject} with additional request-specific fields. All key naming rules from MetaObject apply.

JSON schema
{
 "description": "Extends {@link MetaObject} with additional request-specific fields. All key naming rules from MetaObject apply.",
 "type": "object",
 "required": [
   "io.modelcontextprotocol/clientCapabilities",
   "io.modelcontextprotocol/protocolVersion"
 ],
 "properties": {
   "io.modelcontextprotocol/clientCapabilities": {
     "description": "The client's capabilities for this specific request. Required.\n\nCapabilities are declared per-request rather than once at initialization;\nan empty object means the client supports no optional capabilities.\nServers MUST NOT infer capabilities from prior requests.",
     "$ref": "#/$defs/ClientCapabilities"
   },
   "io.modelcontextprotocol/clientInfo": {
     "description": "Identifies the client software making the request. Clients SHOULD\ninclude this field on every request unless specifically configured not\nto do so.\n\nThe {@link Implementation} schema requires name and version; other\nfields are optional.\n\nThe value is self-reported by the client and is not verified by the\nprotocol. It is intended for display, logging, and debugging. Servers\nSHOULD NOT use it to change their behavior, and SHOULD NOT rely on it for\nsecurity decisions.",
     "$ref": "#/$defs/Implementation"
   },
   "io.modelcontextprotocol/logLevel": {
     "description": "The desired log level for this request. Optional.\n\nIf absent, the server MUST NOT send any {@link LoggingMessageNotificationnotifications/message}\nnotifications for this request. The client opts in to log messages by\nexplicitly setting a level. Replaces the former logging/setLevel RPC.",
     "$ref": "#/$defs/LoggingLevel"
   },
   "io.modelcontextprotocol/protocolVersion": {
     "description": "The MCP Protocol Version being used for this request. Required.\n\nFor the HTTP transport, this value MUST match the MCP-Protocol-Version\nheader; otherwise the server MUST return a 400 Bad Request. If the\nserver does not support the requested version, it MUST return an\n{@link UnsupportedProtocolVersionError}.",
     "type": "string"
   },
   "progressToken": {
     "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by {@link ProgressNotificationnotifications/progress}). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.",
     "$ref": "#/$defs/ProgressToken"
   }
 },
 "additionalProperties": {}
}

Fields§

§client_capabilities: ClientCapabilities

The client’s capabilities for this specific request. Required. Capabilities are declared per-request rather than once at initialization; an empty object means the client supports no optional capabilities. Servers MUST NOT infer capabilities from prior requests.

§client_info: Option<Implementation>

Identifies the client software making the request. Clients SHOULD include this field on every request unless specifically configured not to do so. The {@link Implementation} schema requires name and version; other fields are optional. The value is self-reported by the client and is not verified by the protocol. It is intended for display, logging, and debugging. Servers SHOULD NOT use it to change their behavior, and SHOULD NOT rely on it for security decisions.

§log_level: Option<LoggingLevel>

The desired log level for this request. Optional. If absent, the server MUST NOT send any {@link LoggingMessageNotificationnotifications/message} notifications for this request. The client opts in to log messages by explicitly setting a level. Replaces the former logging/setLevel RPC.

§protocol_version: String

The MCP Protocol Version being used for this request. Required. For the HTTP transport, this value MUST match the MCP-Protocol-Version header; otherwise the server MUST return a 400 Bad Request. If the server does not support the requested version, it MUST return an {@link UnsupportedProtocolVersionError}.

§progress_token: Option<ProgressToken>

If specified, the caller is requesting out-of-band progress notifications for this request (as represented by {@link ProgressNotificationnotifications/progress}). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.

§extra: Option<Map<String, Value>>

Implementations§

Source§

impl RequestMetaObject

Source

pub fn new<T: Into<String>>( protocol_version: T, client_capabilities: ClientCapabilities, ) -> Self

Creates the connection-level _meta required on every 2026-07-28 request, with the two mandatory fields: protocol version and client capabilities.

Source

pub fn with_client_info(self, client_info: Implementation) -> Self

Source

pub fn with_log_level(self, log_level: LoggingLevel) -> Self

Source

pub fn with_progress_token(self, progress_token: ProgressToken) -> Self

Source

pub fn traceparent(&self) -> Option<&str>

Returns the W3C traceparent value, if present.

Source

pub fn with_traceparent(self, traceparent: impl Into<String>) -> Self

Sets the W3C traceparent value.

Source

pub fn tracestate(&self) -> Option<&str>

Returns the W3C tracestate value, if present.

Source

pub fn with_tracestate(self, tracestate: impl Into<String>) -> Self

Sets the W3C tracestate value.

Source

pub fn baggage(&self) -> Option<&str>

Returns the W3C baggage value, if present.

Source

pub fn with_baggage(self, baggage: impl Into<String>) -> Self

Sets the W3C baggage value.

Trait Implementations§

Source§

impl Clone for RequestMetaObject

Source§

fn clone(&self) -> RequestMetaObject

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RequestMetaObject

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RequestMetaObject

Source§

fn default() -> RequestMetaObject

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for RequestMetaObject

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for RequestMetaObject

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.