Skip to content

Commit ed35f71

Browse files
Merge pull request modelcontextprotocol#36 from modelcontextprotocol/justin/clarify-prompt-resources
Make clearer that resources embedded into prompts include text or binary
2 parents 60fee0d + c0c5080 commit ed35f71

File tree

2 files changed

+30
-28
lines changed

2 files changed

+30
-28
lines changed

schema/schema.json

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,30 @@
11711171
],
11721172
"type": "object"
11731173
},
1174+
"PromptEmbeddedResource": {
1175+
"description": "The contents of a resource, embedded into a prompt.\n\nIt is up to the client how best to render embedded resources for the benefit\nof the LLM and/or the user.",
1176+
"properties": {
1177+
"resource": {
1178+
"anyOf": [
1179+
{
1180+
"$ref": "#/definitions/TextResourceContents"
1181+
},
1182+
{
1183+
"$ref": "#/definitions/BlobResourceContents"
1184+
}
1185+
]
1186+
},
1187+
"type": {
1188+
"const": "resource",
1189+
"type": "string"
1190+
}
1191+
},
1192+
"required": [
1193+
"resource",
1194+
"type"
1195+
],
1196+
"type": "object"
1197+
},
11741198
"PromptListChangedNotification": {
11751199
"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.",
11761200
"properties": {
@@ -1196,7 +1220,7 @@
11961220
"type": "object"
11971221
},
11981222
"PromptMessage": {
1199-
"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.",
1223+
"description": "Describes a message returned as part of a prompt.\n\nThis is similar to `SamplingMessage`, but also supports the embedding of\nresources from the MCP server.",
12001224
"properties": {
12011225
"content": {
12021226
"anyOf": [
@@ -1207,7 +1231,7 @@
12071231
"$ref": "#/definitions/ImageContent"
12081232
},
12091233
{
1210-
"$ref": "#/definitions/PromptResourceContents"
1234+
"$ref": "#/definitions/PromptEmbeddedResource"
12111235
}
12121236
]
12131237
},
@@ -1243,29 +1267,6 @@
12431267
],
12441268
"type": "object"
12451269
},
1246-
"PromptResourceContents": {
1247-
"description": "The contents of a resource, embedded into a prompt.\n\nIt is up to the client how best to render embedded resources for the benefit\nof the LLM and/or the user.",
1248-
"properties": {
1249-
"mimeType": {
1250-
"description": "The MIME type of this resource, if known.",
1251-
"type": "string"
1252-
},
1253-
"type": {
1254-
"const": "resource",
1255-
"type": "string"
1256-
},
1257-
"uri": {
1258-
"description": "The URI of this resource.",
1259-
"format": "uri",
1260-
"type": "string"
1261-
}
1262-
},
1263-
"required": [
1264-
"type",
1265-
"uri"
1266-
],
1267-
"type": "object"
1268-
},
12691270
"ReadResourceRequest": {
12701271
"description": "Sent from the client to the server, to read a specific resource URI.",
12711272
"properties": {

schema/schema.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,11 @@ export interface PromptArgument {
558558
* Describes a message returned as part of a prompt.
559559
*
560560
* This is similar to `SamplingMessage`, but also supports the embedding of
561-
* resource contents from the MCP server.
561+
* resources from the MCP server.
562562
*/
563563
export interface PromptMessage {
564564
role: "user" | "assistant";
565-
content: TextContent | ImageContent | PromptResourceContents;
565+
content: TextContent | ImageContent | PromptEmbeddedResource;
566566
}
567567

568568
/**
@@ -571,8 +571,9 @@ export interface PromptMessage {
571571
* It is up to the client how best to render embedded resources for the benefit
572572
* of the LLM and/or the user.
573573
*/
574-
export interface PromptResourceContents extends ResourceContents {
574+
export interface PromptEmbeddedResource {
575575
type: "resource";
576+
resource: TextResourceContents | BlobResourceContents;
576577
}
577578

578579
/**

0 commit comments

Comments
 (0)