Tool Result • Rust AI Agent SDK
ToolResult: Result of a tool execution
ToolResult
Defined in the tools module.
Rust AI Agent SDK
Result of a tool execution
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%
graph LR
agent["Agent"] -- "uses" --> tool["Tool: ToolResult"]
tool -- "returns" --> result["Result"]
style tool fill:#189AB4,color:#fff
style agent fill:#8B0000,color:#fff
style result fill:#8B0000,color:#fffFields
| Name | Type | Description |
|---|---|---|
name | String | The tool name |
value | Value | The result value (JSON) |
success | bool | Whether the execution was successful |
error | Option<String> | Error message if failed |
Methods
success
fn success(name: impl Into<String>, value: Value) -> SelfCreate a successful result
Parameters:
| Name | Type |
|---|---|
name | impl Into<String> |
value | Value |
failure
fn failure(name: impl Into<String>, error: impl Into<String>) -> SelfCreate a failed result
Parameters:
| Name | Type |
|---|---|
name | impl Into<String> |
error | impl Into<String> |
Source
View on GitHubpraisonai/src/tools/mod.rs at line 27