pub trait PromptListChangedHandler:
Send
+ Sync
+ Debug {
// Required method
fn handle_prompt_list_changed<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = HandlerResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Handler for prompt list changes
Per MCP 2025-06-18 specification, notifications/prompts/list_changed is
an optional notification from the server to the client, informing it that the
list of prompts it offers has changed.
§Examples
use turbomcp_client::handlers::{PromptListChangedHandler, HandlerResult};
use async_trait::async_trait;
#[derive(Debug)]
struct MyPromptListHandler;
#[async_trait]
impl PromptListChangedHandler for MyPromptListHandler {
async fn handle_prompt_list_changed(&self) -> HandlerResult<()> {
println!("Server's prompt list changed - refreshing...");
Ok(())
}
}Required Methods§
Sourcefn handle_prompt_list_changed<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = HandlerResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_prompt_list_changed<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = HandlerResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a prompt list changed notification
This method is called when the server’s available prompt list changes.
§Returns
Returns Ok(()) if the notification was processed successfully.