From 83232bd6658049be9b6f41377b1b37df2dd9b1b4 Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Thu, 3 Oct 2024 19:32:26 +0100 Subject: [PATCH] feat: add prompts/list_changed notification Add a notification type that servers can use to inform clients when their list of available prompts has changed, similar to the existing notifications for tools and resources. This allows clients to stay in sync with the server's prompt offerings without polling. --- schema/schema.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/schema/schema.ts b/schema/schema.ts index bc85a3b..b1fc350 100644 --- a/schema/schema.ts +++ b/schema/schema.ts @@ -494,6 +494,13 @@ export interface PromptArgument { required?: boolean; } +/** + * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client. + */ +export interface PromptListChangedNotification extends Notification { + method: "notifications/prompts/list_changed"; +} + /* Tools */ /** * Sent from the client to request a list of tools the server has. @@ -771,7 +778,8 @@ export type ServerNotification = | LoggingMessageNotification | ResourceUpdatedNotification | ResourceListChangedNotification - | ToolListChangedNotification; + | ToolListChangedNotification + | PromptListChangedNotification; export type ServerResult = | EmptyResult