pub trait ErasedAsyncTool<Ctx>: Send + Sync {
// Required methods
fn name_str(&self) -> &str;
fn display_name(&self) -> &'static str;
fn description(&self) -> &'static str;
fn input_schema(&self) -> Value;
fn tier(&self) -> ToolTier;
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 ToolContext<Ctx>,
input: Value,
) -> Pin<Box<dyn Future<Output = Result<ToolOutcome>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn check_status_stream<'a>(
&'a self,
ctx: &'a ToolContext<Ctx>,
operation_id: &'a str,
) -> Pin<Box<dyn Stream<Item = ErasedToolStatus> + Send + 'a>>;
}Expand description
Type-erased async tool trait for registry storage.
This allows async tools with different Name and Stage associated types
to be stored in the same registry by erasing the type information.
Required Methods§
Sourcefn display_name(&self) -> &'static str
fn display_name(&self) -> &'static str
Get a human-friendly display name for the tool.
Sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
Get the tool description.
Sourcefn input_schema(&self) -> Value
fn input_schema(&self) -> Value
Get the JSON schema for tool inputs.
Sourcefn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 ToolContext<Ctx>,
input: Value,
) -> Pin<Box<dyn Future<Output = Result<ToolOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 ToolContext<Ctx>,
input: Value,
) -> Pin<Box<dyn Future<Output = Result<ToolOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the tool with the given input.
Sourcefn check_status_stream<'a>(
&'a self,
ctx: &'a ToolContext<Ctx>,
operation_id: &'a str,
) -> Pin<Box<dyn Stream<Item = ErasedToolStatus> + Send + 'a>>
fn check_status_stream<'a>( &'a self, ctx: &'a ToolContext<Ctx>, operation_id: &'a str, ) -> Pin<Box<dyn Stream<Item = ErasedToolStatus> + Send + 'a>>
Stream status updates for an in-progress operation (type-erased).