Skip to main content

Module tools

Module tools 

Source

Structs§

RegisteredTool
TextToolSession
ToolEnvelopeFail
ToolEnvelopeOk

Enums§

SafeToolResult
Return type for safe_tool bodies. Use ok(...) / fail(...) to build an explicit envelope, or return Data(Value) to auto-wrap as {success:true, data:value}. From<ToolEnvelope> and From<Value> impls let bodies just return Ok(env.into()) / return Ok(value.into()).
ToolChunk
ToolEnvelope
ToolStep

Traits§

ToolSession

Functions§

execute_tools
fail
ok
read_file_tool
safe_tool
RegisteredTool::text equivalent that wraps the body in a structured envelope. The body returns either:
tool_fail
Build a coded tool-failure Error (parity with Node new ToolError(message, {code, hint})). Throwing this from a safe_tool body produces {success:false, code, error, hint?}; thrown from a classic tool() body, the catch site formats it via format_tool_error as JSON.
validate_tool_arguments

Type Aliases§

ToolFn