pub trait Tool:
Debug
+ Send
+ Sync
+ 'static {
// Required methods
fn descriptor(&self) -> ToolDescriptor;
fn call<'life0, 'async_trait>(
&'life0 self,
arguments: Value,
) -> Pin<Box<dyn Future<Output = Result<ToolOutput>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
One operation an external AI may invoke.
A tool wraps an application service, never a Tauri command: an operation that exists only as a command is not reachable from MCP, from a CLI or from a headless run. If writing a tool means duplicating logic, the logic is in the wrong place.
Required Methods§
fn descriptor(&self) -> ToolDescriptor
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".