pub trait PluginTool: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn description(&self) -> &str;
fn input_schema(&self) -> Value;
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Value,
ctx: &'life1 PluginToolContext,
) -> Pin<Box<dyn Future<Output = PluginResult<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
A tool provided by a plugin.
Similar to BuiltinTool but returns &str instead of &'static str
because plugin tool names are loaded at runtime. Uses PluginToolContext
instead of ToolContext to provide scoped KV storage and restrict access.
Required Methods§
Sourcefn name(&self) -> &str
fn name(&self) -> &str
Tool name (unique within the plugin).
The fully qualified name exposed to the LLM is
plugin:{plugin_id}:{tool_name}.
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Human-readable description for the LLM.
Sourcefn input_schema(&self) -> Value
fn input_schema(&self) -> Value
JSON schema for tool input parameters.
Sourcefn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Value,
ctx: &'life1 PluginToolContext,
) -> Pin<Box<dyn Future<Output = PluginResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Value,
ctx: &'life1 PluginToolContext,
) -> Pin<Box<dyn Future<Output = PluginResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the tool with the given arguments.