ElicitationProvider

Trait ElicitationProvider 

Source
pub trait ElicitationProvider: Send + Sync {
    // Required method
    fn elicit<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: &'life1 ElicitCreateRequest,
    ) -> Pin<Box<dyn Future<Output = McpResult<ElicitResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn can_handle(&self, _request: &ElicitCreateRequest) -> bool { ... }
}
Expand description

Trait for custom elicitation UI implementations

This trait enables server implementations to provide custom user interfaces for collecting structured input from users via JSON Schema-defined forms.

Required Methods§

Source

fn elicit<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 ElicitCreateRequest, ) -> Pin<Box<dyn Future<Output = McpResult<ElicitResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Present an elicitation request to the user and return their response

Provided Methods§

Source

fn can_handle(&self, _request: &ElicitCreateRequest) -> bool

Check if this provider can handle a specific elicitation schema

Implementors§