pub struct SessionMcpExecuteSamplingResult {
pub action: McpSamplingExecutionAction,
pub error: Option<String>,
pub result: Option<McpExecuteSamplingResult>,
}Expand description
Outcome of an MCP sampling execution: success result, failure error, or cancellation.
Experimental. This type is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases.
Fields§
§action: McpSamplingExecutionActionOutcome of the sampling inference. ‘success’ produced a response; ‘failure’ encountered an error (including agent-side rejection by content filter or criteria); ‘cancelled’ the caller cancelled this execution via cancelSamplingExecution.
error: Option<String>Error description, present when action=‘failure’.
result: Option<McpExecuteSamplingResult>MCP CreateMessageResult payload (with optional ‘tools’ extension), present when action=‘success’. Treated as opaque at the schema layer; consumers should construct/consume it per the MCP CreateMessageResult shape.
Trait Implementations§
Source§impl Clone for SessionMcpExecuteSamplingResult
impl Clone for SessionMcpExecuteSamplingResult
Source§fn clone(&self) -> SessionMcpExecuteSamplingResult
fn clone(&self) -> SessionMcpExecuteSamplingResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for SessionMcpExecuteSamplingResult
impl Default for SessionMcpExecuteSamplingResult
Source§fn default() -> SessionMcpExecuteSamplingResult
fn default() -> SessionMcpExecuteSamplingResult
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SessionMcpExecuteSamplingResult
impl<'de> Deserialize<'de> for SessionMcpExecuteSamplingResult
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SessionMcpExecuteSamplingResult
impl RefUnwindSafe for SessionMcpExecuteSamplingResult
impl Send for SessionMcpExecuteSamplingResult
impl Sync for SessionMcpExecuteSamplingResult
impl Unpin for SessionMcpExecuteSamplingResult
impl UnsafeUnpin for SessionMcpExecuteSamplingResult
impl UnwindSafe for SessionMcpExecuteSamplingResult
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
Mutably borrows from an owned value. Read more