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/docs/concepts/prompts.mdx
+18-17Lines changed: 18 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,14 @@ Prompts enable servers to define reusable prompt templates and workflows that cl
7
7
8
8
<Note>
9
9
10
-
Prompts are designed to be **user-controlled**, meaning they are exposed from servers to clients with the intention of the user being able to explicitly select them for use.
10
+
Prompts are designed to be **user-controlled**, meaning they are exposed from servers to clients with the intention of the user being able to explicitly select them for use.
11
11
12
12
</Note>
13
13
14
14
## Overview
15
15
16
16
Prompts in MCP are predefined templates that can:
17
+
17
18
- Accept dynamic arguments
18
19
- Include context from resources
19
20
- Chain multiple interactions
@@ -45,7 +46,7 @@ Clients can discover available prompts through the `prompts/list` endpoint:
45
46
```typescript
46
47
// Request
47
48
{
48
-
method: "prompts/list"
49
+
method: "prompts/list";
49
50
}
50
51
51
52
// Response
@@ -58,19 +59,19 @@ Clients can discover available prompts through the `prompts/list` endpoint:
58
59
{
59
60
name: "language",
60
61
description: "Programming language",
61
-
required: true
62
-
}
63
-
]
64
-
}
65
-
]
62
+
required: true,
63
+
},
64
+
],
65
+
},
66
+
];
66
67
}
67
68
```
68
69
69
70
## Using prompts
70
71
71
72
To use a prompt, clients make a `prompts/get` request:
72
73
73
-
```typescript
74
+
````typescript
74
75
// Request
75
76
{
76
77
method: "prompts/get",
@@ -95,7 +96,7 @@ To use a prompt, clients make a `prompts/get` request:
95
96
}
96
97
]
97
98
}
98
-
```
99
+
````
99
100
100
101
## Dynamic prompts
101
102
@@ -171,25 +172,25 @@ const debugWorkflow = {
171
172
role: "user",
172
173
content: {
173
174
type: "text",
174
-
text: `Here's an error I'm seeing: ${error}`
175
-
}
175
+
text: `Here's an error I'm seeing: ${error}`,
176
+
},
176
177
},
177
178
{
178
179
role: "assistant",
179
180
content: {
180
181
type: "text",
181
-
text: "I'll help analyze this error. What have you tried so far?"
182
-
}
182
+
text: "I'll help analyze this error. What have you tried so far?",
183
+
},
183
184
},
184
185
{
185
186
role: "user",
186
187
content: {
187
188
type: "text",
188
-
text: "I've tried restarting the service, but the error persists."
189
-
}
190
-
}
189
+
text: "I've tried restarting the service, but the error persists.",
Copy file name to clipboardExpand all lines: docs/docs/concepts/resources.mdx
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,14 @@ Resources are a core primitive in the Model Context Protocol (MCP) that allow se
7
7
8
8
<Note>
9
9
10
-
Resources are designed to be **application-controlled**, meaning that the client application can decide how and when they should be used.
11
-
Different MCP clients may handle resources differently. For example:
12
-
- Claude Desktop currently requires users to explicitly select resources before they can be used
13
-
- Other clients might automatically select resources based on heuristics
14
-
- Some implementations may even allow the AI model itself to determine which resources to use
10
+
Resources are designed to be **application-controlled**, meaning that the client application can decide how and when they should be used.
11
+
Different MCP clients may handle resources differently. For example:
15
12
16
-
Server authors should be prepared to handle any of these interaction patterns when implementing resource support. In order to expose data to models automatically, server authors should use a **model-controlled** primitive such as [Tools](./tools).
13
+
- Claude Desktop currently requires users to explicitly select resources before they can be used
14
+
- Other clients might automatically select resources based on heuristics
15
+
- Some implementations may even allow the AI model itself to determine which resources to use
16
+
17
+
Server authors should be prepared to handle any of these interaction patterns when implementing resource support. In order to expose data to models automatically, server authors should use a **model-controlled** primitive such as [Tools](./tools).
17
18
18
19
</Note>
19
20
@@ -40,6 +41,7 @@ Resources are identified using URIs that follow this format:
40
41
```
41
42
42
43
For example:
44
+
43
45
-`file:///home/user/documents/report.pdf`
44
46
-`postgres://database/customers/schema`
45
47
-`screen://localhost/display1`
@@ -53,6 +55,7 @@ Resources can contain two types of content:
53
55
### Text resources
54
56
55
57
Text resources contain UTF-8 encoded text data. These are suitable for:
58
+
56
59
- Source code
57
60
- Configuration files
58
61
- Log files
@@ -62,6 +65,7 @@ Text resources contain UTF-8 encoded text data. These are suitable for:
62
65
### Binary resources
63
66
64
67
Binary resources contain raw binary data encoded in base64. These are suitable for:
68
+
65
69
- Images
66
70
- PDFs
67
71
- Audio files
@@ -122,7 +126,7 @@ The server responds with a list of resource contents:
122
126
123
127
<Tip>
124
128
125
-
Servers may return multiple resources in response to one `resources/read` request. This could be used, for example, to return a list of files inside a directory when the directory is read.
129
+
Servers may return multiple resources in response to one `resources/read` request. This could be used, for example, to return a list of files inside a directory when the directory is read.
Copy file name to clipboardExpand all lines: docs/docs/concepts/tools.mdx
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Tools are a powerful primitive in the Model Context Protocol (MCP) that enable s
7
7
8
8
<Note>
9
9
10
-
Tools are designed to be **model-controlled**, meaning that tools are exposed from servers to clients with the intention of the AI model being able to automatically invoke them (with a human in the loop to grant approval).
10
+
Tools are designed to be **model-controlled**, meaning that tools are exposed from servers to clients with the intention of the AI model being able to automatically invoke them (with a human in the loop to grant approval).
11
11
12
12
</Note>
13
13
@@ -336,13 +336,13 @@ Tool annotations serve several key purposes:
336
336
337
337
The MCP specification defines the following annotations for tools:
338
338
339
-
| Annotation | Type | Default | Description |
340
-
|------------|------|---------|-------------|
341
-
|`title`| string | - | A human-readable title for the tool, useful for UI display |
342
-
|`readOnlyHint`| boolean | false | If true, indicates the tool does not modify its environment |
343
-
|`destructiveHint`| boolean | true | If true, the tool may perform destructive updates (only meaningful when `readOnlyHint` is false) |
344
-
|`idempotentHint`| boolean | false | If true, calling the tool repeatedly with the same arguments has no additional effect (only meaningful when `readOnlyHint` is false) |
345
-
|`openWorldHint`| boolean | true | If true, the tool may interact with an "open world" of external entities |
|`title`| string | - | A human-readable title for the tool, useful for UI display|
342
+
|`readOnlyHint`| boolean | false | If true, indicates the tool does not modify its environment|
343
+
|`destructiveHint`| boolean | true | If true, the tool may perform destructive updates (only meaningful when `readOnlyHint` is false)|
344
+
|`idempotentHint`| boolean | false| If true, calling the tool repeatedly with the same arguments has no additional effect (only meaningful when `readOnlyHint` is false) |
345
+
|`openWorldHint`| boolean | true | If true, the tool may interact with an "open world" of external entities|
0 commit comments