Skip to content

Commit 161d471

Browse files
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

3 files changed

+686
-4
lines changed

integration-tests/src/end_to_end_scenarios.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ impl McpBackend for E2ETestBackend {
182182
logging: Some(LoggingCapability {
183183
level: Some("debug".to_string()),
184184
}),
185-
sampling: Some(SamplingCapability {}),
185+
sampling: Some(SamplingCapability::default()),
186186
..Default::default()
187187
},
188188
server_info: Implementation::new(format!("E2E Test Server: {}", self.name), "1.0.0"),

0 commit comments

Comments
 (0)