Skip to main content

Tool

Trait Tool 

Source
pub trait Tool: Send + Sync {
Show 27 methods // Required methods fn name(&self) -> &str; fn description(&self) -> &str; fn input_schema(&self) -> Value; fn permission_level(&self) -> PermissionLevel; fn execute<'life0, 'async_trait>( &'life0 self, input: Value, ) -> Pin<Box<dyn Future<Output = AppResult<String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided methods fn aliases(&self) -> &[&str] { ... } fn search_hint(&self) -> Option<&str> { ... } fn is_mcp(&self) -> bool { ... } fn is_lsp(&self) -> bool { ... } fn should_defer(&self) -> bool { ... } fn always_load(&self) -> bool { ... } fn is_read_only(&self, _input: &Value) -> bool { ... } fn is_destructive(&self, _input: &Value) -> bool { ... } fn is_concurrent_safe(&self, _input: &Value) -> bool { ... } fn is_enabled(&self) -> bool { ... } fn interrupt_behavior(&self) -> InterruptBehavior { ... } fn requires_user_interaction(&self) -> bool { ... } fn is_open_world(&self, _input: &Value) -> bool { ... } fn is_search_or_read_command(&self, _input: &Value) -> SearchReadInfo { ... } fn max_result_size_chars(&self) -> usize { ... } fn strict(&self) -> bool { ... } fn backfill_observable_input(&self, _input: &mut Value) { ... } fn validate_input<'life0, 'life1, 'async_trait>( &'life0 self, _input: &'life1 Value, ) -> Pin<Box<dyn Future<Output = ValidationResult> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn get_path(&self, _input: &Value) -> Option<String> { ... } fn user_facing_name(&self, _input: &Value) -> String { ... } fn get_tool_use_summary(&self, _input: &Value) -> Option<String> { ... } fn get_activity_description(&self, _input: &Value) -> Option<String> { ... }
}

Required Methods§

Source

fn name(&self) -> &str

Source

fn description(&self) -> &str

Source

fn input_schema(&self) -> Value

Source

fn permission_level(&self) -> PermissionLevel

Source

fn execute<'life0, 'async_trait>( &'life0 self, input: Value, ) -> Pin<Box<dyn Future<Output = AppResult<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn aliases(&self) -> &[&str]

Source

fn search_hint(&self) -> Option<&str>

Source

fn is_mcp(&self) -> bool

Source

fn is_lsp(&self) -> bool

Source

fn should_defer(&self) -> bool

Source

fn always_load(&self) -> bool

Source

fn is_read_only(&self, _input: &Value) -> bool

Source

fn is_destructive(&self, _input: &Value) -> bool

Source

fn is_concurrent_safe(&self, _input: &Value) -> bool

Source

fn is_enabled(&self) -> bool

Source

fn interrupt_behavior(&self) -> InterruptBehavior

Source

fn requires_user_interaction(&self) -> bool

Source

fn is_open_world(&self, _input: &Value) -> bool

Source

fn is_search_or_read_command(&self, _input: &Value) -> SearchReadInfo

Source

fn max_result_size_chars(&self) -> usize

Source

fn strict(&self) -> bool

Source

fn backfill_observable_input(&self, _input: &mut Value)

Source

fn validate_input<'life0, 'life1, 'async_trait>( &'life0 self, _input: &'life1 Value, ) -> Pin<Box<dyn Future<Output = ValidationResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_path(&self, _input: &Value) -> Option<String>

Source

fn user_facing_name(&self, _input: &Value) -> String

Source

fn get_tool_use_summary(&self, _input: &Value) -> Option<String>

Source

fn get_activity_description(&self, _input: &Value) -> Option<String>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§