Skip to main content

PromptHandler

Trait PromptHandler 

Source
pub trait PromptHandler: Send + Sync {
    // Required method
    fn get<'life0, 'async_trait>(
        &'life0 self,
        arguments: HashMap<String, Value>,
    ) -> Pin<Box<dyn Future<Output = McpResult<PromptResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for implementing prompt handlers

Required Methods§

Source

fn get<'life0, 'async_trait>( &'life0 self, arguments: HashMap<String, Value>, ) -> Pin<Box<dyn Future<Output = McpResult<PromptResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Generate prompt messages with the given arguments

§Arguments
  • arguments - Prompt arguments as key-value pairs
§Returns

Result containing the generated prompt messages or an error

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§