pub struct ScriptedTool { /* private fields */ }Expand description
A Tool that orchestrates multiple tools via bash scripts.
Each registered tool (defined by ToolDef + callback) becomes a bash builtin.
The LLM sends a bash script that can pipe, loop, branch, and compose these
builtins together with standard utilities like jq, grep, sed, etc.
Arguments are passed as --key value flags and parsed into typed JSON
per the tool’s input_schema.
Reusable — execute() can be called multiple times. Each call gets a fresh
Bash interpreter with the same set of tool builtins.
Create via ScriptedTool::builder.
Implementations§
Source§impl ScriptedTool
impl ScriptedTool
Sourcepub fn builder(name: impl Into<String>) -> ScriptedToolBuilder
pub fn builder(name: impl Into<String>) -> ScriptedToolBuilder
Create a builder with the given tool name.
Sourcepub fn take_last_execution_trace(&self) -> Option<ScriptedExecutionTrace>
pub fn take_last_execution_trace(&self) -> Option<ScriptedExecutionTrace>
Return and clear the trace from the most recent execute call.
Trait Implementations§
Source§impl Clone for ScriptedTool
impl Clone for ScriptedTool
Source§impl Tool for ScriptedTool
impl Tool for ScriptedTool
Source§fn display_name(&self) -> &str
fn display_name(&self) -> &str
Human-readable display name for UI.
Source§fn short_description(&self) -> &str
fn short_description(&self) -> &str
One-line description for tool listings
Source§fn description(&self) -> &str
fn description(&self) -> &str
Token-efficient description for LLMs.
Source§fn system_prompt(&self) -> String
fn system_prompt(&self) -> String
Condensed description for system prompts (token-efficient)
Source§fn input_schema(&self) -> Value
fn input_schema(&self) -> Value
JSON Schema for input validation
Source§fn output_schema(&self) -> Value
fn output_schema(&self) -> Value
JSON Schema for output structure
Source§fn execution(&self, args: Value) -> Result<ToolExecution, ToolError>
fn execution(&self, args: Value) -> Result<ToolExecution, ToolError>
Create a single-use execution.
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
req: ToolRequest,
) -> Pin<Box<dyn Future<Output = ToolResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
req: ToolRequest,
) -> Pin<Box<dyn Future<Output = ToolResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the tool
Source§fn execute_with_status<'life0, 'async_trait>(
&'life0 self,
req: ToolRequest,
status_callback: Box<dyn FnMut(ToolStatus) + Send>,
) -> Pin<Box<dyn Future<Output = ToolResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_with_status<'life0, 'async_trait>(
&'life0 self,
req: ToolRequest,
status_callback: Box<dyn FnMut(ToolStatus) + Send>,
) -> Pin<Box<dyn Future<Output = ToolResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute with status callbacks for progress tracking
Auto Trait Implementations§
impl !RefUnwindSafe for ScriptedTool
impl !UnwindSafe for ScriptedTool
impl Freeze for ScriptedTool
impl Send for ScriptedTool
impl Sync for ScriptedTool
impl Unpin for ScriptedTool
impl UnsafeUnpin for ScriptedTool
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