Skip to content

Commit e1c16d2

Browse files
committed
Include Annotations for Content Block types and Resources in documentation
1 parent 1cfdf1e commit e1c16d2

File tree

6 files changed

+116
-4
lines changed

6 files changed

+116
-4
lines changed

docs/specification/2025-06-18/server/prompts.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ Messages in a prompt can contain:
186186
- `role`: Either "user" or "assistant" to indicate the speaker
187187
- `content`: One of the following content types:
188188

189+
<Note>
190+
All content types in prompt messages support optional [annotations](/specification/2025-06-18/server/resources#annotations) for metadata about audience, priority, and modification times.
191+
</Note>
192+
189193
#### Text Content
190194

191195
Text content represents plain text messages:

docs/specification/2025-06-18/server/resources.mdx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,36 @@ Resources can contain either text or binary data:
305305
}
306306
```
307307

308+
### Annotations
309+
310+
Resources, resource templates and content blocks support optional annotations that provide hints to clients about how to use or display the resource:
311+
312+
- **`audience`**: An array indicating the intended audience(s) for this resource. Valid values are `"user"` and `"assistant"`. For example, `["user", "assistant"]` indicates content useful for both.
313+
- **`priority`**: A number from 0 to 1 indicating the importance of this resource. A value of 1 means "most important" (effectively required), while 0 means "least important" (entirely optional).
314+
- **`lastModified`**: An ISO 8601 formatted timestamp indicating when the resource was last modified (e.g., `"2025-01-12T15:00:58Z"`).
315+
316+
Example resource with annotations:
317+
318+
```json
319+
{
320+
"uri": "file:///project/README.md",
321+
"name": "README.md",
322+
"title": "Project Documentation",
323+
"mimeType": "text/markdown",
324+
"annotations": {
325+
"audience": ["user"],
326+
"priority": 0.8,
327+
"lastModified": "2025-01-12T15:00:58Z"
328+
}
329+
}
330+
```
331+
332+
Clients can use these annotations to:
333+
334+
- Filter resources based on their intended audience
335+
- Prioritize which resources to include in context
336+
- Display modification times or sort by recency
337+
308338
## Common URI Schemes
309339

310340
The protocol defines several standard URI schemes. This list not

docs/specification/2025-06-18/server/tools.mdx

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ Tool results may contain [**structured**](#structured-content) or **unstructured
203203

204204
**Unstructured** content is returned in the `content` field of a result, and can contain multiple content items of different types:
205205

206+
<Note>
207+
All content types (text, image, audio, resource links, and embedded resources) support optional [annotations](resources#annotations) that provide metadata about audience, priority, and modification times. This is the same annotation format used by resources and prompts.
208+
</Note>
209+
206210
#### Text Content
207211

208212
```json
@@ -219,9 +223,16 @@ Tool results may contain [**structured**](#structured-content) or **unstructured
219223
"type": "image",
220224
"data": "base64-encoded-data",
221225
"mimeType": "image/png"
226+
"annotations": {
227+
"audience": ["user"],
228+
"priority": 0.9
229+
}
230+
222231
}
223232
```
224233

234+
This example demonstrates the use of an optional Annotation.
235+
225236
#### Audio Content
226237

227238
```json
@@ -243,10 +254,17 @@ or data. In this case, the tool will return a URI that can be subscribed to or f
243254
"uri": "file:///project/src/main.rs",
244255
"name": "main.rs",
245256
"description": "Primary application entry point",
246-
"mimeType": "text/x-rust"
257+
"mimeType": "text/x-rust",
258+
"annotations": {
259+
"audience": ["assistant"],
260+
"priority": 0.9
261+
}
247262
}
248263
```
249264

265+
Resource links support the same [Resource annotations](resources#annotations) as regular resources to help clients understand how to use them.
266+
267+
250268
<Info>
251269
Resource links returned by tools are not guaranteed to appear in the results
252270
of a `resources/list` request.
@@ -264,11 +282,19 @@ or data using a suitable [URI scheme](./resources#common-uri-schemes). Servers t
264282
"uri": "file:///project/src/main.rs",
265283
"title": "Project Rust Main File",
266284
"mimeType": "text/x-rust",
267-
"text": "fn main() {\n println!(\"Hello world!\");\n}"
285+
"text": "fn main() {\n println!(\"Hello world!\");\n}",
286+
"annotations": {
287+
"audience": ["user","assistant"],
288+
"priority": 0.7,
289+
"lastModified": "2025-05-03T14:30:00Z"
290+
}
291+
268292
}
269293
}
270294
```
271295

296+
Embedded resources support the same [Resource annotations](resources#annotations) as regular resources to help clients understand how to use them.
297+
272298
#### Structured Content
273299

274300
**Structured** content is returned as a JSON object in the `structuredContent` field of a result.

docs/specification/draft/server/prompts.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ Messages in a prompt can contain:
186186
- `role`: Either "user" or "assistant" to indicate the speaker
187187
- `content`: One of the following content types:
188188

189+
<Note>
190+
All content types in prompt messages support optional [annotations](/specification/2025-06-18/server/resources#annotations) for metadata about audience, priority, and modification times.
191+
</Note>
192+
189193
#### Text Content
190194

191195
Text content represents plain text messages:

docs/specification/draft/server/resources.mdx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,36 @@ Resources can contain either text or binary data:
305305
}
306306
```
307307

308+
### Annotations
309+
310+
Resources, resource templates and content blocks support optional annotations that provide hints to clients about how to use or display the resource:
311+
312+
- **`audience`**: An array indicating the intended audience(s) for this resource. Valid values are `"user"` and `"assistant"`. For example, `["user", "assistant"]` indicates content useful for both.
313+
- **`priority`**: A number from 0 to 1 indicating the importance of this resource. A value of 1 means "most important" (effectively required), while 0 means "least important" (entirely optional).
314+
- **`lastModified`**: An ISO 8601 formatted timestamp indicating when the resource was last modified (e.g., `"2025-01-12T15:00:58Z"`).
315+
316+
Example resource with annotations:
317+
318+
```json
319+
{
320+
"uri": "file:///project/README.md",
321+
"name": "README.md",
322+
"title": "Project Documentation",
323+
"mimeType": "text/markdown",
324+
"annotations": {
325+
"audience": ["user"],
326+
"priority": 0.8,
327+
"lastModified": "2025-01-12T15:00:58Z"
328+
}
329+
}
330+
```
331+
332+
Clients can use these annotations to:
333+
334+
- Filter resources based on their intended audience
335+
- Prioritize which resources to include in context
336+
- Display modification times or sort by recency
337+
308338
## Common URI Schemes
309339

310340
The protocol defines several standard URI schemes. This list not

docs/specification/draft/server/tools.mdx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ Tool results may contain [**structured**](#structured-content) or **unstructured
203203

204204
**Unstructured** content is returned in the `content` field of a result, and can contain multiple content items of different types:
205205

206+
<Note>
207+
All content types (text, image, audio, resource links, and embedded resources) support optional [annotations](resources#annotations) that provide metadata about audience, priority, and modification times. This is the same annotation format used by resources and prompts.
208+
</Note>
209+
206210
#### Text Content
207211

208212
```json
@@ -218,7 +222,11 @@ Tool results may contain [**structured**](#structured-content) or **unstructured
218222
{
219223
"type": "image",
220224
"data": "base64-encoded-data",
221-
"mimeType": "image/png"
225+
"mimeType": "image/png",
226+
"annotations": {
227+
"audience": ["user"],
228+
"priority": 0.9
229+
}
222230
}
223231
```
224232

@@ -247,6 +255,9 @@ or data. In this case, the tool will return a URI that can be subscribed to or f
247255
}
248256
```
249257

258+
Resource links support the same [Resource annotations](resources#annotations) as regular resources to help clients understand how to use them.
259+
260+
250261
<Info>
251262
Resource links returned by tools are not guaranteed to appear in the results
252263
of a `resources/list` request.
@@ -264,11 +275,18 @@ or data using a suitable [URI scheme](./resources#common-uri-schemes). Servers t
264275
"uri": "file:///project/src/main.rs",
265276
"title": "Project Rust Main File",
266277
"mimeType": "text/x-rust",
267-
"text": "fn main() {\n println!(\"Hello world!\");\n}"
278+
"text": "fn main() {\n println!(\"Hello world!\");\n}",
279+
"annotations": {
280+
"audience": ["user","assistant"],
281+
"priority": 0.7,
282+
"lastModified": "2025-05-03T14:30:00Z"
283+
}
268284
}
269285
}
270286
```
271287

288+
Embedded resources support the same [Resource annotations](resources#annotations) as regular resources to help clients understand how to use them.
289+
272290
#### Structured Content
273291

274292
**Structured** content is returned as a JSON object in the `structuredContent` field of a result.

0 commit comments

Comments
 (0)