Skip to content

Commit 0f8aeb8

Browse files
Merge branch 'main' into feat/tasks
2 parents 87e8d42 + 7ed65b0 commit 0f8aeb8

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

docs/specification/draft/client/sampling.mdx

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,9 @@ Applications **SHOULD**:
3737

3838
## Tools in Sampling
3939

40-
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.
40+
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.
4141

42-
**Key capabilities:**
43-
44-
- Servers define tools with JSON schemas for inputs and outputs
45-
- The LLM decides when and how to use tools (subject to `toolChoice` constraints)
46-
- Multiple tools can be used in parallel
47-
- Tool results are provided back to the LLM to inform subsequent responses
48-
49-
Clients **MUST** declare support for tool use via the `sampling.tools` capability to receive tool-enabled sampling requests. Servers **SHOULD NOT** send tool-enabled sampling requests to Clients that have not declared support for tool use via the `sampling.tools` capability.
50-
51-
<Info>
52-
Tool use in sampling uses the same `Tool` type as regular MCP tool calls,
53-
ensuring consistency across the protocol.
54-
</Info>
42+
Clients **MUST** declare support for tool use via the `sampling.tools` capability to receive tool-enabled sampling requests. Servers **MUST NOT** send tool-enabled sampling requests to Clients that have not declared support for tool use via the `sampling.tools` capability.
5543

5644
## Capabilities
5745

@@ -441,7 +429,7 @@ This constraint ensures compatibility with provider APIs that use dedicated role
441429

442430
### Tool Use and Result Balance
443431

444-
When using tool use in sampling, messages **MUST** be properly balanced: every assistant message containing `ToolUseContent` blocks must be followed by a user message that consists entirely of `ToolResultContent` blocks, with each tool use (e.g. with `id: $id`) matched by a corresponding tool result (with `toolUseId: $id`), before any other message.
432+
When using tool use in sampling, every assistant message containing `ToolUseContent` blocks **MUST** be followed by a user message that consists entirely of `ToolResultContent` blocks, with each tool use (e.g. with `id: $id`) matched by a corresponding tool result (with `toolUseId: $id`), before any other message.
445433

446434
This requirement ensures:
447435

0 commit comments

Comments
 (0)