feat(everything): add trigger-agentic-sampling tool #3163
+320
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds support for SEP-1577 (Sampling With Tools) to the Everything server by introducing a new
trigger-agentic-samplingtool that demonstrates the agentic sampling loop pattern.This tool:
tool_useresponses and executes tools locallysampling.toolscapabilityServer Details
Motivation and Context
Issue: #3040
SEP-1577 adds tool calling support to the MCP sampling API, enabling servers to provide tools that the LLM can use during sampling requests. This creates an "agentic loop" where:
sampling/createMessagewith atoolsarraystopReason: "toolUse", the server executes the toolsThe Everything server is a reference implementation that demonstrates all MCP features, so it should include this capability.
How Has This Been Tested?
sampling.toolscapability checktrigger-sampling-request,trigger-elicitation-request)(We can wait to merge until I've had a chance to add a screengrab if that's preferred.)
Breaking Changes
No
Types of changes
Checklist
Additional context
References
Implementation Notes
The tool includes simple local implementations of
echoandaddtools for demonstration purposes. In a production scenario, tools could likely be reused via:server.server.callTool()callsI thought about trying to re-use existing tools already defined in the everything server, but then decided to keep it self-contained instead.