pub struct ToolResult {
pub tool_call_id: String,
pub output: String,
pub success: bool,
}Expand description
Result returned by a tool, attached as a role: "tool" message in the
conversation history.
This is the wire-format representation of a tool result — the version that
gets serialized into the LLM API request. It is distinct from
crate::tool::ToolResult, which is the richer, internal representation
used during tool execution (carrying sources, diffs, and interrupt state).
The conversion from crate::tool::ToolResult to this type happens in the
agent loop when building messages for the LLM provider.
Fields§
§tool_call_id: StringID of the tool call this result corresponds to. Must match the
id field of the original ToolCall so the LLM can pair them.
output: StringText output of the tool execution. For failures this contains the error message; for successes it contains the tool’s return value.
success: boolWhether the tool executed successfully (true) or failed (false).