pub trait Executable: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn description(&self) -> &str;
fn input_schema(&self) -> &str;
fn tool_type(&self) -> ToolType;
fn execute(
&self,
context: ToolContext,
input: HashMap<String, Value>,
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send>>;
// Provided methods
fn to_definition(&self) -> ToolDefinition { ... }
fn to_llm_tool(&self) -> LLMTool { ... }
fn display_config(&self) -> DisplayConfig { ... }
fn compact_summary(
&self,
_input: &HashMap<String, Value>,
_result: &str,
) -> String { ... }
}Expand description
Trait for executable tools.
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Get the tool description.
Sourcefn input_schema(&self) -> &str
fn input_schema(&self) -> &str
Get the input schema as JSON string.
Provided Methods§
Sourcefn to_definition(&self) -> ToolDefinition
fn to_definition(&self) -> ToolDefinition
Convert to LLM tool definition.
Sourcefn to_llm_tool(&self) -> LLMTool
fn to_llm_tool(&self) -> LLMTool
Convert to LLMTool for provider APIs.
Sourcefn display_config(&self) -> DisplayConfig
fn display_config(&self) -> DisplayConfig
Get display configuration for UI rendering.