ServerCapabilities

Trait ServerCapabilities 

Source
pub trait ServerCapabilities:
    Send
    + Sync
    + Debug {
    // Required methods
    fn create_message(
        &self,
        request: Value,
    ) -> BoxFuture<'_, Result<Value, Box<dyn Error + Send + Sync>>>;
    fn elicit(
        &self,
        request: Value,
    ) -> BoxFuture<'_, Result<Value, Box<dyn Error + Send + Sync>>>;
    fn list_roots(
        &self,
    ) -> BoxFuture<'_, Result<Value, Box<dyn Error + Send + Sync>>>;
}
Expand description

Trait for server-initiated requests (sampling, elicitation, roots) This provides a type-safe way for tools to make requests to clients

Required Methods§

Source

fn create_message( &self, request: Value, ) -> BoxFuture<'_, Result<Value, Box<dyn Error + Send + Sync>>>

Send a sampling/createMessage request to the client

Source

fn elicit( &self, request: Value, ) -> BoxFuture<'_, Result<Value, Box<dyn Error + Send + Sync>>>

Send an elicitation request to the client

Source

fn list_roots( &self, ) -> BoxFuture<'_, Result<Value, Box<dyn Error + Send + Sync>>>

List client’s root capabilities

Implementors§