SEP-1577: Sampling With Tools changedseps/1577--sampling-with-tools
Upstream edited this page at 2 Aug 2026 21:13 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 22 Oct 2026 20:37 UTC.
Upstream edited
Recorded here
Lines+12added
Lines−12removed
From line
11
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits4to this page, all time
The whole hunk
from line 11, old and new numbered
/
from line 11
1111> This SEP has reached Final status and is preserved as a historical record of
1212> the design as accepted. Changes made to the protocol after finalization are
1313> not reflected here. Refer to the [current
14> specification](/specification/latest) and its changelog for authoritative
14> specification](/specification/latest.md) and its changelog for authoritative
1515> requirements.
1616
1717| Field | Value |
from line 33
3333
3434## Motivation
3535
36* [Sampling](https://modelcontextprotocol.io/specification/2025-06-18/client/sampling) doesn't support tool calling, although it's a cornerstone of modern agentic behaviour. Without explicit support for it, MCP servers that use Sampling can either try and emulate tool calling w/ complex prompting / custom parsing of the outputs, or are limited to simpler, non-agentic requests. Adding support for tool calling could unlock many novel use cases in the MCP ecosystem.
36* [Sampling](https://modelcontextprotocol.io/specification/2025-06-18/client/sampling.md) doesn't support tool calling, although it's a cornerstone of modern agentic behaviour. Without explicit support for it, MCP servers that use Sampling can either try and emulate tool calling w/ complex prompting / custom parsing of the outputs, or are limited to simpler, non-agentic requests. Adding support for tool calling could unlock many novel use cases in the MCP ecosystem.
3737
38* Context inclusion is ambiguously defined (see [this doc](https://docs.google.com/document/d/1KUsloHpsjR4fdXdJuofb9jUuK0XWi88clbRm9sWE510/edit?tab=t.0#heading=h.edw7oyac2e87)): it makes it particularly tricky to fully implement sampling, which along with other precautions needed for sampling (unaffected by this SEP) may have contributed to [low adoption of the feature in clients](https://modelcontextprotocol.io/clients#feature-support-matrix) (feature was introduced in the MCP Nov 2024 spec).
38* Context inclusion is ambiguously defined (see [this doc](https://docs.google.com/document/d/1KUsloHpsjR4fdXdJuofb9jUuK0XWi88clbRm9sWE510/edit?tab=t.0#heading=h.edw7oyac2e87)): it makes it particularly tricky to fully implement sampling, which along with other precautions needed for sampling (unaffected by this SEP) may have contributed to [low adoption of the feature in clients](https://modelcontextprotocol.io/clients.md#feature-support-matrix) (feature was introduced in the MCP Nov 2024 spec).
3939
4040Please note some related work:
4141
from line 52
5252
5353### Overview
5454
55* Add traditional tool call support in [CreateMessageRequest](https://modelcontextprotocol.io/specification/2025-06-18/schema#createmessagerequest) w/ `tools` (w/ JSON schemas) & `toolChoice` params, requiring a server-side tool loop
55* Add traditional tool call support in [CreateMessageRequest](https://modelcontextprotocol.io/specification/2025-06-18/schema.md#createmessagerequest) w/ `tools` (w/ JSON schemas) & `toolChoice` params, requiring a server-side tool loop
5656 * Sampling may now yield ToolCallBlock responses
5757 * Server needs to call tools by itself
5858 * Server calls sampling again with ToolResultParamBlock to inject tool results
5959 * `toolChoice.mode` can be `“auto" | "required" | "none"` to allow common structured outputs use case (see below for possible follow up improvements)
6060 * Fenced by new capability (`sampling { tools {} }`)
61* Fix/update underspecified strings in [CreateMessageResult](https://modelcontextprotocol.io/specification/2025-06-18/schema#createmessageresult):
61* Fix/update underspecified strings in [CreateMessageResult](https://modelcontextprotocol.io/specification/2025-06-18/schema.md#createmessageresult):
6262 * `stopReason: “endTurn" | "stopSequence" | “toolUse" | “maxToken" | string` (explicit enums + open string for compat)
6363 * `role: “assistant”`
64* Soft-deprecate [CreateMessageRequest.params.includeContext](https://modelcontextprotocol.io/specification/2025-06-18/schema#createmessagerequest) != ‘none’ (now fenced by capability)
64* Soft-deprecate [CreateMessageRequest.params.includeContext](https://modelcontextprotocol.io/specification/2025-06-18/schema.md#createmessagerequest) != ‘none’ (now fenced by capability)
6565 * Incentivize context-free sampling implementation
6666
6767### Protocol changes
from line 76
7676
7777### Schema changes
7878
79* [ClientCapabilities](https://modelcontextprotocol.io/specification/2025-06-18/schema#clientcapabilities)
79* [ClientCapabilities](https://modelcontextprotocol.io/specification/2025-06-18/schema.md#clientcapabilities)
8080
8181 ```typescript theme={null}
8282 interface ClientCapabilities {
from line 88
8888 }
8989 ```
9090
91* [CreateMessageRequest](https://modelcontextprotocol.io/specification/2025-06-18/schema#createmessagerequest) (use existing [Tool](https://modelcontextprotocol.io/specification/2025-06-18/schema#tool))
91* [CreateMessageRequest](https://modelcontextprotocol.io/specification/2025-06-18/schema.md#createmessagerequest) (use existing [Tool](https://modelcontextprotocol.io/specification/2025-06-18/schema.md#tool))
9292
9393 ```typescript theme={null}
9494 interface CreateMessageRequest {
from line 122
122122 * Gemini API has no way to disable parallel tool calls atm (unlike OAI / Anthropic APIs). Removing this flag for now, to be reintroduced when Gemini has any way of supporting it. Otherwise clients would get unexpected multiple tool calls (or alternatively if implemented that way, unexpected failures / costly retry until a single tool call is emitted)
123123 * Gemini API's [Function calling modes](https://ai.google.dev/gemini-api/docs/function-calling?example=meeting#function_calling_modes) have an `ANY` value that should match the proposed `required`
124124
125* [SamplingMessage](https://modelcontextprotocol.io/specification/2025-06-18/schema#samplingmessage):
125* [SamplingMessage](https://modelcontextprotocol.io/specification/2025-06-18/schema.md#samplingmessage):
126126
127127 ```typescript theme={null}
128128 /*
from line 240
240240 * `function` role (similar to OAI's `tool` role)
241241 * No tool call id concept ([function calling](https://ai.google.dev/gemini-api/docs/function-calling?example=meeting#parallel_function_calling): Gemini requires tool results to be provided in the exact same order as the tool use parts. An implementation could generate the tool call ids and use them to reorder the tool results if needed.
242242
243* [CreateMessageResult](https://modelcontextprotocol.io/specification/2025-06-18/schema#createmessageresult)
243* [CreateMessageResult](https://modelcontextprotocol.io/specification/2025-06-18/schema.md#createmessageresult)
244244
245245 ```typescript theme={null}
246246 /*
from line 342
342342Pros:
343343
344344* Technically no spec change needed (if anything, mention this as a freedom clients have)
345* Possibly similar to what [CreateMessageRequest.params.includeContext](https://modelcontextprotocol.io/specification/2025-06-18/schema#createmessagerequest) = thisServer / allServers intended semantics may have meant
345* Possibly similar to what [CreateMessageRequest.params.includeContext](https://modelcontextprotocol.io/specification/2025-06-18/schema.md#createmessagerequest) = thisServer / allServers intended semantics may have meant
346346 * `CreateMessageRequest.params.allowImplicitToolCalls = “none” | “thisServer” | “allServers”`
347347 (assuming we wanted to give the server any control over this)
348348
No line in this hunk matches that.