Commit 161d471
committed
feat(protocol): implement MCP 2025-11-25 Phase 3 - Tool Calling in Sampling
Add complete sampling types with tool support:
- SamplingCapability with tools/context support
- CreateMessageRequestParam with tools, toolChoice, maxTokens
- CreateMessageResult with stop_reason
- ToolChoice and ToolChoiceMode (auto/required/none)
- Content::ToolUse for LLM tool invocation requests
- Content::ToolResult for returning tool execution results
- ToolResultContent for text/image results
- SamplingMessage, SamplingRole, SamplingContent
- ModelPreferences with hints and priorities
- ContextInclusion enum
- stop_reasons module with standard constants
Enables agentic workflows where servers request LLM sampling
with tools, and handle multi-turn tool use conversations.1 parent 9571588 commit 161d471
File tree
3 files changed
+686
-4
lines changed- integration-tests/src
- mcp-protocol/src
3 files changed
+686
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| |||
0 commit comments