Skip to content

Commit 430ab13

Browse files
committed
Allow prompts to embed resources
1 parent 8be71ae commit 430ab13

File tree

2 files changed

+48
-6
lines changed

2 files changed

+48
-6
lines changed

schema/schema.json

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@
418418
},
419419
"messages": {
420420
"items": {
421-
"$ref": "#/definitions/SamplingMessage"
421+
"$ref": "#/definitions/PromptMessage"
422422
},
423423
"type": "array"
424424
}
@@ -1166,6 +1166,36 @@
11661166
],
11671167
"type": "object"
11681168
},
1169+
"PromptMessage": {
1170+
"description": "Describes a message returned as part of a prompt.\n\nThis is similar to `SamplingMessage`, but also supports the embedding of\nresource contents from the MCP server. The client MUST decide how to render\nembedded resources for the benefit of the LLM and/or the user.",
1171+
"properties": {
1172+
"content": {
1173+
"anyOf": [
1174+
{
1175+
"$ref": "#/definitions/ResourceContents"
1176+
},
1177+
{
1178+
"$ref": "#/definitions/TextContent"
1179+
},
1180+
{
1181+
"$ref": "#/definitions/ImageContent"
1182+
}
1183+
]
1184+
},
1185+
"role": {
1186+
"enum": [
1187+
"assistant",
1188+
"user"
1189+
],
1190+
"type": "string"
1191+
}
1192+
},
1193+
"required": [
1194+
"content",
1195+
"role"
1196+
],
1197+
"type": "object"
1198+
},
11691199
"PromptReference": {
11701200
"description": "Identifies a prompt.",
11711201
"properties": {

schema/schema.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,6 @@ export interface ClientCapabilities {
157157
* Experimental, non-standard capabilities that the client supports.
158158
*/
159159
experimental?: { [key: string]: object };
160-
/**
161-
* Present if the client supports sampling from an LLM.
162-
*/
163-
sampling?: object;
164160
/**
165161
* Present if the client supports listing roots.
166162
*/
@@ -170,6 +166,10 @@ export interface ClientCapabilities {
170166
*/
171167
listChanged?: boolean;
172168
};
169+
/**
170+
* Present if the client supports sampling from an LLM.
171+
*/
172+
sampling?: object;
173173
}
174174

175175
/**
@@ -515,7 +515,7 @@ export interface GetPromptResult extends Result {
515515
* An optional description for the prompt.
516516
*/
517517
description?: string;
518-
messages: SamplingMessage[];
518+
messages: PromptMessage[];
519519
}
520520

521521
/**
@@ -554,6 +554,18 @@ export interface PromptArgument {
554554
required?: boolean;
555555
}
556556

557+
/**
558+
* Describes a message returned as part of a prompt.
559+
*
560+
* This is similar to `SamplingMessage`, but also supports the embedding of
561+
* resource contents from the MCP server. The client MUST decide how to render
562+
* embedded resources for the benefit of the LLM and/or the user.
563+
*/
564+
export interface PromptMessage {
565+
role: "user" | "assistant";
566+
content: TextContent | ImageContent | ResourceContents;
567+
}
568+
557569
/**
558570
* 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.
559571
*/

0 commit comments

Comments
 (0)