pub struct DiscoverTool { /* private fields */ }Expand description
A Tool that exposes only discover and help builtins for runtime
schema discovery. Returned by ScriptingToolSet::tools in
DiscoveryMode::WithDiscovery mode alongside the main script tool.
The LLM uses this tool to explore available commands before writing scripts for the main tool.
use bashkit::Tool;
use bashkit_scripted_tool::{ScriptingToolSet, ToolArgs, ToolDef};
let toolset = ScriptingToolSet::builder("api")
.tool_fn(
ToolDef::new("greet", "Greet someone").with_category("social"),
|_args: &ToolArgs| Ok("hello\n".to_string()),
)
.with_discovery()
.build();
let tools = toolset.tools();
assert_eq!(tools.len(), 2);
// Second tool is the DiscoverTool
let discover = &tools[1];
assert!(discover.name().ends_with("_discover"));Trait Implementations§
Source§impl Tool for DiscoverTool
impl Tool for DiscoverTool
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 DiscoverTool
impl !UnwindSafe for DiscoverTool
impl Freeze for DiscoverTool
impl Send for DiscoverTool
impl Sync for DiscoverTool
impl Unpin for DiscoverTool
impl UnsafeUnpin for DiscoverTool
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