Fix ToolAnnotations drop in routed mode; document SDK upgrade gate - #8567
Merged
Conversation
5 tasks
- Add Annotations: toolInfo.Annotations to &sdk.Tool{} in createFilteredServer
so readOnly/destructive hints are visible to clients on /mcp/{serverID}
- Add TestCreateFilteredServer_AnnotationsPropagated regression test using
sdk.NewInMemoryTransports() to verify end-to-end annotation propagation
- Add ## SDK Upgrade Process section to AGENTS.md documenting the two canary
tests (TestMaxRetriesSentinelCanary, TestArgumentValidationBypassCanary)
with run commands and guidance for investigating failures
Closes #8562
Copilot
AI
changed the title
[WIP] Review Go module github.com/modelcontextprotocol/go-sdk
Fix ToolAnnotations drop in routed mode; document SDK upgrade gate
Jul 3, 2026
lpcox
marked this pull request as ready for review
July 3, 2026 12:45
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an inconsistency between unified (/mcp) and routed (/mcp/{serverID}) mode by ensuring tool annotation hints (e.g., readOnly, destructive) are preserved when creating per-backend routed servers, and it documents the SDK upgrade gate via existing canary tests.
Changes:
- Propagate
ToolAnnotationswhen registering tools increateFilteredServer(routed mode). - Add a regression test that exercises routed mode end-to-end via in-memory client/server transports and asserts annotations survive
ListTools. - Document the SDK upgrade process and the two canary tests that must pass after bumping
github.com/modelcontextprotocol/go-sdk.
Show a summary per file
| File | Description |
|---|---|
| internal/server/routed.go | Ensures routed-mode tool registration includes Annotations so clients see readOnly/destructive hints. |
| internal/server/routed_test.go | Adds an integration-style regression test validating annotations are preserved through the routed server’s ListTools response. |
| AGENTS.md | Documents the SDK upgrade checklist and what to investigate if either canary test fails. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Low
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
createFilteredServersilently droppedToolAnnotationswhen building per-backend servers for/mcp/{serverID}, soreadOnly/destructivehints visible on the unified endpoint were invisible to routed-mode clients.Changes
internal/server/routed.go— addAnnotations: toolInfo.Annotationsto the&sdk.Tool{}increateFilteredServer:internal/server/routed_test.go— addTestCreateFilteredServer_AnnotationsPropagated: registers a tool withReadOnlyHint: trueand a non-nilDestructiveHintpointer, connects a real client viasdk.NewInMemoryTransports(), callsListTools, and asserts both annotation fields survive the round-trip.AGENTS.md— add## SDK Upgrade Processsection documenting the two existing canary tests (TestMaxRetriesSentinelCanary,TestArgumentValidationBypassCanary), what each guards, the exact commands to run before merging an SDK bump, and what to investigate if either fails.