diff --git a/docs/legacy/concepts/sampling.mdx b/docs/legacy/concepts/sampling.mdx
index 01f1d40f3..3ea8c053f 100644
--- a/docs/legacy/concepts/sampling.mdx
+++ b/docs/legacy/concepts/sampling.mdx
@@ -33,14 +33,22 @@ Sampling requests use a standardized message format:
{
role: "user" | "assistant",
content: {
- type: "text" | "image",
+ type: "text" | "image" | "audio" | "resource" | "resource_link",
// For text:
text?: string,
- // For images:
+ // For images/audio:
data?: string, // base64 encoded
- mimeType?: string
+ mimeType?: string,
+
+ // For resources:
+ resource?: {
+ uri: string,
+ mimeType: string,
+ text?: string, // for text resources
+ blob?: string // for blob resources, base64 encoded
+ }
}
}
],
@@ -70,7 +78,9 @@ The `messages` array contains the conversation history to send to the LLM. Each
- `role`: Either "user" or "assistant"
- `content`: The message content, which can be:
- Text content with a `text` field
- - Image content with `data` (base64) and `mimeType` fields
+ - Image/audio content with `data` (base64) and `mimeType` fields
+ - An embedded [resource](/docs/concepts/resources)
+ - A [resource](/docs/concepts/resources) link
### Model preferences
diff --git a/docs/specification/draft/client/sampling.mdx b/docs/specification/draft/client/sampling.mdx
index 6410d54e3..859422bc1 100644
--- a/docs/specification/draft/client/sampling.mdx
+++ b/docs/specification/draft/client/sampling.mdx
@@ -167,6 +167,42 @@ Sampling messages can contain:
}
```
+#### Resource Links
+
+A tool **MAY** return links to [Resources](/specification/draft/server/resources), to provide additional context
+or data. In this case, the tool will return a URI that can be subscribed to or fetched by the client:
+
+```json
+{
+ "type": "resource_link",
+ "uri": "file:///project/src/main.rs",
+ "name": "main.rs",
+ "description": "Primary application entry point",
+ "mimeType": "text/x-rust"
+}
+```
+
+
Describes a message issued to or received from an LLM API.
The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.
See General fields: _meta for notes on _meta usage.
The name of the model that generated the message.
The reason why sampling stopped, if known.
The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.
See General fields: _meta for notes on _meta usage.
The name of the model that generated the message.
The reason why sampling stopped, if known.
Describes a message issued to or received from an LLM API.