Learning resourcesReviewed · Model Context Protocol

SEP-1577: Sampling With Tools

SEP-1577 is a design document for developers connecting AI assistants to tools, but it preserves a historical protocol design and is not the current specification. It explains Model Context Protocol (MCP) sampling requests that let a model choose tools while the server handles execution and sends results back.

Researched 13 Nov 2026

In short.

SEP-1577 is a design document for developers building tool-using MCP integrations, but its historical text must be checked against the current specification before implementation. Its design adds tools and toolChoice to sampling/createMessage, introduces tool-use and tool-result message blocks, and places the repeated execution loop on the server. It also discourages implicit context inclusion and describes compatibility constraints for content arrays. Current client support, working dependency versions, runtime behavior and operating costs are not established by this page.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete selected page at [https://modelcontextprotocol.io/seps/1577--sampling-with-tools.md], including its historical-record notice, schemas, compatibility discussion and out-of-scope follow-ups. Linked specifications, changelog, documentation index, pull request, SDK example and provider documentation are excluded. No code was executed. Current support, conformance, performance, implementation safeguards, costs and redistribution rights remain unverified.

The overview

Identity

SEP-1577, Sampling With Tools, is a Final Standards Track proposal for the Model Context Protocol, authored by Olivier Chafik and created on 2025-09-30. The complete document is available at [https://modelcontextprotocol.io/seps/1577--sampling-with-tools.md].

Its opening notice says the accepted design is preserved as a historical record. It directs implementers to the current specification and its changelog for authoritative requirements.

Assessment

The document is useful for understanding why MCP sampling needed explicit tool calling and how that design handles messages, capabilities and execution responsibility. It gives developers enough detail to reason about an adapter or server loop, while its historical status and internal naming inconsistencies make the current specification essential for implementation.

Final status establishes acceptance of the design. The page does not establish adoption by particular clients, implementation quality or successful operation.

Users

The main audience is MCP server developers, client implementers and developers translating between model-provider tool formats. In this context, sampling means a server asking a client to obtain a model response; this proposal lets that response request tool execution.

Beginners can use the motivation and examples to understand the repeated request-and-result cycle. Implementing it requires familiarity with JSON schemas, message roles, capability negotiation and the distinction between requesting a tool call and executing one.

Capabilities

The proposed tools field supplies tool definitions with JSON schemas. toolChoice.mode supports auto, required and none, allowing model-selected tool use, required tool use or prohibited tool use respectively. The page describes supplying one tool with required mode as a workaround for obtaining structured output through that tool's input schema.

Assistant responses can contain tool_use blocks, and subsequent user messages can contain tool_result blocks. Multiple content blocks support parallel tool requests. The design also specifies assistant-only result roles and named stop reasons, while retaining an open string for compatibility.

Using it

Requirements

A client must advertise sampling.tools for requests using tools or toolChoice; the proposal requires an error when that capability is missing. The server must implement tool execution and follow-up sampling requests, including matching each tool request with its result.

The page introduces sampling.context for non-none context inclusion and discourages includeContext values thisServer and allServers. Its explicit requirement to reject unsupported context inclusion is struck out, so that crossed-out rule should not be treated as an active requirement.

The compatibility discussion prohibits array-valued CreateMessageResult.content before the November 2025 specification version. It also warns that SDK type changes can require existing code to distinguish a single content block from an array. Current SDK compatibility is unknown.

Mechanism

The server sends sampling/createMessage with conversation messages, tool definitions and an optional tool-choice mode. The client obtains an assistant response that may identify tools to call, with a name, identifier and input object for each call.

The server executes the requested tools and sends their results in another sampling request. The proposed result schema associates each result with a toolUseId. Tool-result messages must contain only tool-result content, and parallel calls must all receive results together. Repeating this cycle lets the server coordinate a multi-step task using model responses obtained through the client.

Setup

The page provides interface sketches and links to a TypeScript server example, but it does not provide a complete installation guide, a verified dependency set or a current client compatibility list.

For implementation, first compare the design with the current specification, confirm that the intended client advertises sampling.tools, and establish the SDK's actual message types. The server then needs tool definitions, execution handlers, result matching and logic for deciding whether to request another model response.

Example

The page uses a London weather question to compare provider message formats. Applied conceptually to its MCP schema, a server supplies a get_weather tool, the model returns a tool_use block with an identifier such as call_1, and the server obtains the weather result. It then sends a user message containing a tool_result block whose toolUseId matches call_1 and requests the next response.

This illustrates the server's responsibility for connecting model requests to actual functions. No weather lookup, code example or end-to-end integration was executed.

Assessment & evidence

Limitations

Streaming, cache controls, dedicated JSON-schema output formatting and client-managed tool loops appear as possible follow-ups outside this SEP's scope. The disable_parallel_tool_use option was removed from the proposal, so the page does not provide that control for enforcing serial tool requests.

The protocol prose uses tool_result_id when describing result matching, while the proposed schema uses toolUseId. This inconsistency requires resolution against the authoritative schema before implementation.

The page does not establish a complete approval interface, permission model or token-budget mechanism. Its follow-up discussion warns that broader cross-server tool delegation could expose private data through mistaken authorization; those delegation ideas are not established capabilities of this SEP.

Reasoning

The stated motivation is to replace tool-use emulation through complex prompts and custom output parsing with explicit protocol support. Making context inclusion optional is also intended to reduce client implementation complexity.

The design places execution and conversation bookkeeping on the server. A practical implication is that explicit message types can simplify interpreting model requests while leaving the server responsible for coordinating tool calls and repeated sampling. The document supplies design rationale, without measurements showing reduced complexity, latency or failure rates.

Alternatives

The page describes sampling without native tool support as an alternative that either limits tasks to simpler requests or requires prompt-based emulation and custom parsing. That approach avoids depending on this proposed extension but leaves tool interpretation to application code.

It also compares OpenAI, Anthropic and Gemini tool-message conventions. Those historical comparisons explain adapter requirements, including differences in roles and call identifiers; they do not establish current provider behavior or recommend a provider. For present MCP implementation requirements, the document points to [https://modelcontextprotocol.io/specification/latest.md], whose contents were outside the assessed material.

Evidence

The supporting material is the complete SEP-1577 page at [https://modelcontextprotocol.io/seps/1577--sampling-with-tools.md]. It contains the accepted design, proposed TypeScript interfaces, provider-format illustrations, compatibility notes and possible follow-ups.

The page links to a pull request, specifications, provider documentation and a TypeScript implementation example. Those linked materials were not included. No execution was performed, and runtime conformance, performance and deployment behavior remain untested.

Access & freshness

Costs

Operating cost is unknown. The document says server-managed loops use the client's tokens, but supplies no prices, token totals, billing arrangements or spending limits. Because the described loop makes repeated model requests, additional usage is a practical consideration; its amount and cost are not measured.

Rights

The selected page contains no explicit license or redistribution grant. Permission to redistribute the document or reuse code from its linked implementation is therefore unknown from this evidence. The linked code's license was not assessed.

Freshness

The document gives a creation date of 2025-09-30 and was captured on 2026-11-13. Its last substantive update date is unknown. The capture date does not establish that its requirements describe the protocol as of that date.

The Final-status notice explicitly says later protocol changes are not reflected in this historical record. Current requirements and any changes since acceptance must be established from the current specification and changelog.

Actions

Use the document to understand the design, then consult [https://modelcontextprotocol.io/specification/latest.md] before implementing it. Confirm support in the intended client and SDK, resolve the result-identifier naming difference, and verify the applicable content-array rules.

Before relying on an integration, validate single and parallel tool calls, result matching, tool-choice modes and unsupported-capability errors. Establish user supervision, execution permissions and usage limits in the chosen implementation. These are recommended validation steps; no successful results are established here.

Evidence for this report

selected-page.txtselected · checked 2026-11-13