#[non_exhaustive]pub struct MessageMcpRequest {
pub server_id: McpServerAcpId,
pub request_id: McpRequestId,
pub method: String,
pub params: Option<Map<String, Value>>,
pub session_id: Option<SessionId>,
pub tool_call_id: Option<ToolCallId>,
pub meta: Option<Meta>,
}unstable_mcp_over_acp and unstable_protocol_v2 only.Expand description
UNSTABLE
Request parameters for mcp/message, sent from consumer to provider.
sessionId and toolCallId name the session and tool call the request was
sent for. Both are optional. The provider can use sessionId to choose
which session the request runs for, and toolCallId to show the request
with the tool call that the Agent reports. Neither field grants
permission to run the request.
See RFD: MCP-over-ACP
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.server_id: McpServerAcpIdThe declared ACP MCP server receiving this request.
request_id: McpRequestIdThe caller-generated identifier for the inner MCP request.
method: StringThe inner MCP method name.
params: Option<Map<String, Value>>Optional inner MCP params. Null is equivalent to omission.
session_id: Option<SessionId>The session whose work caused this request. It is the sessionId the
Agent uses on session/update for that work. For a child session’s work,
that is the child’s ID.
Optional. Omitted and null are equivalent and mean the Agent supplied
no session. The Agent SHOULD include it when it knows the session, and
MUST NOT send another session’s ID when it does not. A provider that
needs the session to run the request MAY reject a request without it.
tool_call_id: Option<ToolCallId>The tool call in that session that this request is part of. It is the
toolCallId the Agent uses to report the call in session/update. The
Agent SHOULD report the tool call before it sends the request.
Optional. Omitted and null are equivalent and mean the Agent supplied
no tool call. The Agent MUST NOT send it without sessionId. More than
one request can name the same tool call.
meta: Option<Meta>The _meta property is reserved by ACP to allow Clients and Agents to attach additional
metadata to their interactions. Omitted and null are equivalent and mean no metadata.
Implementations MUST NOT assign meaning to keys they do not recognize.
This is ACP metadata, not the inner MCP message’s _meta.
See protocol docs: Extensibility
Implementations§
Source§impl MessageMcpRequest
impl MessageMcpRequest
Sourcepub fn new(
server_id: impl Into<McpServerAcpId>,
request_id: impl Into<McpRequestId>,
method: impl Into<String>,
) -> Self
pub fn new( server_id: impl Into<McpServerAcpId>, request_id: impl Into<McpRequestId>, method: impl Into<String>, ) -> Self
Builds MessageMcpRequest with required fields set.
Sourcepub fn params(self, params: impl IntoOption<Map<String, Value>>) -> Self
pub fn params(self, params: impl IntoOption<Map<String, Value>>) -> Self
Sets optional inner MCP params.
Sourcepub fn session_id(self, session_id: impl IntoOption<SessionId>) -> Self
pub fn session_id(self, session_id: impl IntoOption<SessionId>) -> Self
Sets or clears the session whose work caused this request.
Sourcepub fn tool_call_id(self, tool_call_id: impl IntoOption<ToolCallId>) -> Self
pub fn tool_call_id(self, tool_call_id: impl IntoOption<ToolCallId>) -> Self
Sets or clears the tool call this request is part of. The Agent MUST
NOT send it without sessionId.
Sourcepub fn meta(self, meta: impl IntoOption<Meta>) -> Self
pub fn meta(self, meta: impl IntoOption<Meta>) -> Self
Sets optional ACP extension metadata.
Trait Implementations§
Source§impl Clone for MessageMcpRequest
impl Clone for MessageMcpRequest
Source§impl Debug for MessageMcpRequest
impl Debug for MessageMcpRequest
Source§impl<'de> Deserialize<'de> for MessageMcpRequest
impl<'de> Deserialize<'de> for MessageMcpRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for MessageMcpRequest
Source§impl JsonSchema for MessageMcpRequest
impl JsonSchema for MessageMcpRequest
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for MessageMcpRequest
impl PartialEq for MessageMcpRequest
Source§impl Serialize for MessageMcpRequest
impl Serialize for MessageMcpRequest
impl StructuralPartialEq for MessageMcpRequest
Auto Trait Implementations§
impl Forget for MessageMcpRequest
impl Freeze for MessageMcpRequest
impl Move for MessageMcpRequest
impl RefUnwindSafe for MessageMcpRequest
impl Send for MessageMcpRequest
impl Sync for MessageMcpRequest
impl Unpin for MessageMcpRequest
impl UnsafeUnpin for MessageMcpRequest
impl UnwindSafe for MessageMcpRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.