pub trait Tool:
Send
+ Sync
+ 'static {
// Required methods
fn name(&self) -> &'static str;
fn description(&self) -> &'static str;
fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Context,
args: Value,
) -> Pin<Box<dyn Future<Output = CallToolResult> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn input_schema(&self) -> Value { ... }
}Required Methods§
fn name(&self) -> &'static str
fn description(&self) -> &'static str
fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Context,
args: Value,
) -> Pin<Box<dyn Future<Output = CallToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Provided Methods§
Sourcefn input_schema(&self) -> Value
fn input_schema(&self) -> Value
JSON Schema for the tool’s arguments object.