Skip to content

docs: note about tools in sampling#1988

Closed
paoloricciuti wants to merge 2 commits intomodelcontextprotocol:mainfrom
paoloricciuti:patch-1
Closed

docs: note about tools in sampling#1988
paoloricciuti wants to merge 2 commits intomodelcontextprotocol:mainfrom
paoloricciuti:patch-1

Conversation

@paoloricciuti
Copy link
Contributor

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@paoloricciuti paoloricciuti requested a review from a team as a code owner December 17, 2025 13:39
Comment on lines +266 to +268
<Note>
The tools specified in the sampling request don't necessarily need to be registered on the MCP server.
</Note>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 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.

After:

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.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonathanhefner want to submit that as a suggestion here for ease of merging? I think your proposal makes sense.

@localden
Copy link
Contributor

@jonathanhefner @paoloricciuti we also should make this change to the draft version of the specification.

@localden localden added the documentation Improvements or additions to documentation label Jan 27, 2026
@localden
Copy link
Contributor

Raw suggestion, for reference:

<Note>
  The tools specified in the sampling request don't necessarily need to be registered on the MCP server.
</Note>

jonathanhefner added a commit to jonathanhefner/modelcontextprotocol that referenced this pull request Feb 6, 2026
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]>
jonathanhefner added a commit to jonathanhefner/modelcontextprotocol that referenced this pull request Feb 6, 2026
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]>
jonathanhefner added a commit to jonathanhefner/modelcontextprotocol that referenced this pull request Feb 6, 2026
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]>
jonathanhefner added a commit to jonathanhefner/modelcontextprotocol that referenced this pull request Feb 6, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants