pub struct ToolResult {
pub call_id: String,
pub tool_name: String,
pub output: Value,
pub content: Option<Vec<ToolContent>>,
pub is_error: bool,
}Expand description
Rich tool execution result with typed content.
This is the canonical result type returned by Tool::execute.
It includes both a legacy JSON output and optional MCP-style
typed content blocks for richer responses.
For the simplified kernel-level outcome, see ToolOutcome.
Fields§
§call_id: String§tool_name: String§output: ValueLegacy JSON output (always present for backward compatibility).
content: Option<Vec<ToolContent>>MCP-style typed content blocks (optional, alongside output).
is_error: boolWhether this result represents an error (MCP: isError).
Implementations§
Trait Implementations§
Source§impl Clone for ToolResult
impl Clone for ToolResult
Source§fn clone(&self) -> ToolResult
fn clone(&self) -> ToolResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToolResult
impl Debug for ToolResult
Source§impl<'de> Deserialize<'de> for ToolResult
impl<'de> Deserialize<'de> for ToolResult
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
Source§impl From<&ToolResult> for ToolOutcome
Convert a rich ToolResult to a simplified ToolOutcome for kernel boundaries.
impl From<&ToolResult> for ToolOutcome
Convert a rich ToolResult to a simplified ToolOutcome for kernel boundaries.
Source§fn from(result: &ToolResult) -> Self
fn from(result: &ToolResult) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ToolResult
impl PartialEq for ToolResult
Source§impl Serialize for ToolResult
impl Serialize for ToolResult
impl StructuralPartialEq for ToolResult
Auto Trait Implementations§
impl Freeze for ToolResult
impl RefUnwindSafe for ToolResult
impl Send for ToolResult
impl Sync for ToolResult
impl Unpin for ToolResult
impl UnsafeUnpin for ToolResult
impl UnwindSafe for ToolResult
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