pub struct ToolResult {
pub tool_call_id: String,
pub content: String,
pub success: bool,
}Expand description
The outcome of executing a ToolCall.
§Important: failures are context, not errors
A ToolResult with success: false is not a Rust-level error —
it is domain data that gets appended to the conversation as an
AgentMessage::Tool entry so the model can observe the failure and
adjust its strategy (retry, fix arguments, use a different tool, etc.).
Infrastructure-level failures (e.g. the MCP process crashed) are
surfaced separately via anyhow::Error from crate::ports::ToolExecutorPort::execute
and then converted by the loop implementation into a ToolResult with
success: false and an appropriate content describing the outage.
Fields§
§tool_call_id: StringEchoes the ToolCall::id this result corresponds to.
content: StringHuman-readable output (or error message) from the tool execution.
success: boolWhether the tool completed successfully.
false here is not a loop error — see type-level docs above.
Trait Implementations§
Source§impl Clone for ToolResult
impl Clone for ToolResult
Source§fn clone(&self) -> ToolResult
fn clone(&self) -> ToolResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more