Skip to content

Commit 52aa02b

Browse files
committed
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.
1 parent b03fd43 commit 52aa02b

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

schema/schema.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,6 +998,30 @@
998998
],
999999
"type": "object"
10001000
},
1001+
"PromptListChangedNotification": {
1002+
"description": "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.",
1003+
"properties": {
1004+
"method": {
1005+
"const": "notifications/prompts/list_changed",
1006+
"type": "string"
1007+
},
1008+
"params": {
1009+
"additionalProperties": {},
1010+
"properties": {
1011+
"_meta": {
1012+
"additionalProperties": {},
1013+
"description": "This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.",
1014+
"type": "object"
1015+
}
1016+
},
1017+
"type": "object"
1018+
}
1019+
},
1020+
"required": [
1021+
"method"
1022+
],
1023+
"type": "object"
1024+
},
10011025
"PromptReference": {
10021026
"description": "Identifies a prompt.",
10031027
"properties": {
@@ -1337,6 +1361,9 @@
13371361
{
13381362
"$ref": "#/definitions/ResourceUpdatedNotification"
13391363
},
1364+
{
1365+
"$ref": "#/definitions/PromptListChangedNotification"
1366+
},
13401367
{
13411368
"$ref": "#/definitions/ToolListChangedNotification"
13421369
},

schema/schema.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,13 @@ export interface PromptArgument {
494494
required?: boolean;
495495
}
496496

497+
/**
498+
* 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.
499+
*/
500+
export interface PromptListChangedNotification extends Notification {
501+
method: "notifications/prompts/list_changed";
502+
}
503+
497504
/* Tools */
498505
/**
499506
* Sent from the client to request a list of tools the server has.
@@ -771,7 +778,8 @@ export type ServerNotification =
771778
| LoggingMessageNotification
772779
| ResourceUpdatedNotification
773780
| ResourceListChangedNotification
774-
| ToolListChangedNotification;
781+
| ToolListChangedNotification
782+
| PromptListChangedNotification;
775783

776784
export type ServerResult =
777785
| EmptyResult

0 commit comments

Comments
 (0)