docs: note about tools in sampling#1988
docs: note about tools in sampling#1988paoloricciuti wants to merge 2 commits intomodelcontextprotocol:mainfrom
Conversation
| <Note> | ||
| The tools specified in the sampling request don't necessarily need to be registered on the MCP server. | ||
| </Note> |
There was a problem hiding this comment.
I find that callouts like <Note> tend to accumulate over time, so I try to integrate information into the original text when possible.
What do you think about the following change instead (to line 40)? Would it adequately clarify the spec?
Before:
Servers can request that the client's LLM use tools during sampling by providing a
toolsarray and optionaltoolChoiceconfiguration in their sampling requests. This enables servers to implement agentic behaviors where the LLM can call tools, receive results, and continue the conversation - all within a single sampling request flow.
After:
Servers can request that the client's LLM use tools during sampling by providing a
toolsarray and optionaltoolChoiceconfiguration in their sampling requests. The tool definitions in thetoolsarray are scoped to the sampling request — they don't need to correspond to registered tools. This enables servers to implement agentic behaviors where the LLM can call specially designated tools, receive results, and continue the conversation - all within a single sampling request flow.
Diff:
index a88a4857..c698d184 100644
--- a/docs/specification/2025-11-25/client/sampling.mdx
+++ b/docs/specification/2025-11-25/client/sampling.mdx
@@ -37,7 +37,7 @@ Applications **SHOULD**:
## Tools in Sampling
-Servers can request that the client's LLM use tools during sampling by providing a `tools` array and optional `toolChoice` configuration in their sampling requests. This enables servers to implement agentic behaviors where the LLM can call tools, receive results, and continue the conversation - all within a single sampling request flow.
+Servers can request that the client's LLM use tools during sampling by providing a `tools` array and optional `toolChoice` configuration in their sampling requests. The tool definitions in the `tools` array are scoped to the sampling request — they don't need to correspond to registered tools. This enables servers to implement agentic behaviors where the LLM can call specially designated tools, receive results, and continue the conversation - all within a single sampling request flow.There was a problem hiding this comment.
@jonathanhefner want to submit that as a suggestion here for ease of merging? I think your proposal makes sense.
|
@jonathanhefner @paoloricciuti we also should make this change to the |
|
Raw suggestion, for reference: |
The `tools` array in a `sampling/createMessage` request defines tools specifically for that sampling request. They don't need to correspond to registered tools on the server. This was a source of confusion discussed in the community. Closes modelcontextprotocol#1988. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The `tools` array in a `sampling/createMessage` request defines tools specifically for that sampling request. They don't need to correspond to registered tools on the server. This was a source of confusion discussed in the community. Closes modelcontextprotocol#1988. Co-Authored-By: Paolo Ricciuti <[email protected]> Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The `tools` array in a `sampling/createMessage` request defines tools specifically for that sampling request. They don't need to correspond to registered tools on the server. This was a source of confusion discussed in the community. Closes modelcontextprotocol#1988. Co-Authored-By: Paolo Ricciuti <[email protected]> Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The `tools` array in a `sampling/createMessage` request defines tools specifically for that sampling request. They don't need to correspond to registered tools on the server. This was a source of confusion discussed in the community. Closes modelcontextprotocol#1988. Co-Authored-By: Paolo Ricciuti <[email protected]> Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This PR adds a small note to clarify that tools passed to the sampling request don't need to be registered.
Motivation and Context
We talked a bit in discord and, at least to me, it wasn't clear if the specification required the tool specified in the createMessage request to also be registered on the server.
How Has This Been Tested?
Not tested as is just a doc changes.
Breaking Changes
Nope just a docs change
Types of changes
Checklist
Additional context