Skip to main content

ElicitPlugin

Trait ElicitPlugin 

Source
pub trait ElicitPlugin:
    Send
    + Sync
    + 'static {
    // Required methods
    fn name(&self) -> &'static str;
    fn list_tools(&self) -> Vec<Tool>;
    fn call_tool<'a>(
        &'a self,
        params: CallToolRequestParams,
        ctx: RequestContext<RoleServer>,
    ) -> BoxFuture<'a, Result<CallToolResult, ErrorData>>;
}
Expand description

Type-erased interface for a shadow-crate tool plugin.

§Object Safety

This trait is object-safe: all async methods return BoxFuture.

Prefer implementing DescriptorPlugin over this trait directly unless you need custom dispatch logic.

Required Methods§

Source

fn name(&self) -> &'static str

Human-readable plugin name, used as the namespace prefix.

E.g. "http" produces tools named http__get, http__post, etc.

Source

fn list_tools(&self) -> Vec<Tool>

List all tools provided by this plugin (without namespace prefix).

Source

fn call_tool<'a>( &'a self, params: CallToolRequestParams, ctx: RequestContext<RoleServer>, ) -> BoxFuture<'a, Result<CallToolResult, ErrorData>>

Dispatch a tool call to this plugin.

params.name will already have the namespace prefix stripped by PluginRegistry before this is called.

Implementors§