Fix retrieve_tools annotations/call_with defaulting to call_tool_read#307
Merged
Fix retrieve_tools annotations/call_with defaulting to call_tool_read#307
Conversation
…ol_read (#306) Root cause: handleRetrieveTools split result.Tool.Name on ":" expecting "server:tool" format, but tool names from upstream discovery are bare (e.g. "delete_records" not "server:delete_records"). The split always produced 1 part, falling through to the default call_tool_read. Additionally, lookupToolAnnotations compared StateView tool names (which may be in "server:tool" format) against bare tool names, causing annotation lookups to always fail even when the split worked. Fix: Use result.Tool.ServerName directly instead of parsing from Name, and handle both name formats in lookupToolAnnotations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deploying mcpproxy-docs with
|
| Latest commit: |
66e823d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1f43fb5c.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://fix-retrieve-tools-annotatio.mcpproxy-docs.pages.dev |
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 22152817793 --repo smart-mcp-proxy/mcpproxy-go
|
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.
Summary
Fixes #306 —
retrieve_toolsalways returnedcall_with: "call_tool_read"regardless of tool annotations (destructiveHint, readOnlyHint).Root cause: Two bugs in the annotation lookup path:
handleRetrieveToolssplitresult.Tool.Nameon:expecting"server:tool"format, but tool names from upstream discovery are bare (e.g."delete_records"not"server:delete_records"). The split always produced 1 part, falling through to thecall_tool_readdefault.lookupToolAnnotationscompared StateView tool names (which may include server prefix) against bare tool names, causing lookups to fail even when the split worked.Fix:
result.Tool.ServerNamedirectly instead of parsing fromName"tool"and"server:tool"name formats inlookupToolAnnotationsTest plan
TestAnnotationLookupNameMatching— verifies name matching with both formatsTestRetrieveToolsCallWithAnnotations— verifies split + DeriveCallWith logicTestE2E_RetrieveToolsAnnotationsAndCallWith— full round-trip with mock upstream server providing destructive/write/read-only tools, verifies correctcall_withandannotationsin search results🤖 Generated with Claude Code