You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/spec/prompts.md
+21-1Lines changed: 21 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,10 @@ A Prompt in the Model Context Protocol (MCP) represents a pre-defined set of mes
47
47
48
48
Prompt Templates are prompts that can be dynamically generated or customized based on provided arguments. They allow servers to expose a flexible set of prompts that can be tailored to specific use cases. Clients can use these templates by providing the required arguments when retrieving the prompt.
49
49
50
+
### Embedded Resource Contents
51
+
52
+
Prompts can include embedded resource contents from the MCP server. This allows servers to provide context-rich prompts that incorporate relevant data or files directly into the prompt structure.
53
+
50
54
## Use Cases
51
55
52
56
Common use cases for prompts include providing standardized instructions for code reviews, data analysis tasks, or creative writing exercises. Here are examples of kinds of prompts that an MCP server could expose:
@@ -222,7 +226,7 @@ Example:
222
226
The server MUST respond with a `GetPromptResult` containing:
223
227
224
228
-`description`: An optional string describing the prompt
225
-
-`messages`: An array of `SamplingMessage` objects representing the prompt content
229
+
-`messages`: An array of `PromptMessage` objects representing the prompt content, which may include embedded resource contents
226
230
227
231
Example:
228
232
```json
@@ -245,6 +249,22 @@ Example:
245
249
"type": "text",
246
250
"text": "Certainly! I'd be happy to review the Python code snippet and provide feedback on its quality and potential improvements. Let's analyze it:"
"text": "I see you've also provided the contents of the requirements.txt file. This gives us additional context about the project environment. Let's consider these dependencies in our code review as well."
Copy file name to clipboardExpand all lines: schema/schema.json
+54-1Lines changed: 54 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -416,7 +416,7 @@
416
416
},
417
417
"messages": {
418
418
"items": {
419
-
"$ref": "#/definitions/SamplingMessage"
419
+
"$ref": "#/definitions/PromptMessage"
420
420
},
421
421
"type": "array"
422
422
}
@@ -1195,6 +1195,36 @@
1195
1195
],
1196
1196
"type": "object"
1197
1197
},
1198
+
"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.",
1200
+
"properties": {
1201
+
"content": {
1202
+
"anyOf": [
1203
+
{
1204
+
"$ref": "#/definitions/TextContent"
1205
+
},
1206
+
{
1207
+
"$ref": "#/definitions/ImageContent"
1208
+
},
1209
+
{
1210
+
"$ref": "#/definitions/PromptResourceContents"
1211
+
}
1212
+
]
1213
+
},
1214
+
"role": {
1215
+
"enum": [
1216
+
"assistant",
1217
+
"user"
1218
+
],
1219
+
"type": "string"
1220
+
}
1221
+
},
1222
+
"required": [
1223
+
"content",
1224
+
"role"
1225
+
],
1226
+
"type": "object"
1227
+
},
1198
1228
"PromptReference": {
1199
1229
"description": "Identifies a prompt.",
1200
1230
"properties": {
@@ -1213,6 +1243,29 @@
1213
1243
],
1214
1244
"type": "object"
1215
1245
},
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
+
},
1216
1269
"ReadResourceRequest": {
1217
1270
"description": "Sent from the client to the server, to read a specific resource URI.",
* 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.
0 commit comments