Annotate vMCP optimizer discovery tool - #6373
Open
Whxuan0701 wants to merge 1 commit into
Open
Conversation
Mark find_tool as a read-only, idempotent local discovery operation so MCP clients can make safer retry and tool-selection decisions. Keep call_tool unannotated because it proxies arbitrary backend side effects. Signed-off-by: XD <xd@XDdeMacBook-Pro.local>
Whxuan0701
requested review from
ChrisJBurns,
JAORMX,
amirejaz,
jerm-dro,
jhrozek and
tgrunnagle
as code owners
August 19, 2026 06:06
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
The vMCP optimizer exposes
find_toolas a local tool-discovery operation, but its MCP definition currently carries no behavioral hints. Clients cannot distinguish this safe discovery step from a tool that may mutate external state, which limits safe retry and tool-selection behavior in Agent workflows.find_tool: read-only, non-destructive, idempotent, and closed-world.call_toolunannotated because it can proxy arbitrary backend side effects.Part of #4357
Type of change
Test plan
task -t Taskfile.focused.yml test, using the repository's-raceand linker settings for./pkg/vmcp/session/optimizerdecand./pkg/vmcp/conversion)task test-e2e)task lint-fix)API Compatibility
v1beta1API.Changes
pkg/vmcp/session/optimizerdec/decorator.gofind_tool.pkg/vmcp/session/optimizerdec/decorator_test.gocall_toolcontract.Does this introduce a user-facing change?
Yes. MCP clients that consume tool annotations can now identify
find_toolas a safe, retryable local discovery operation.Special notes for reviewers
The annotation is deliberately limited to
find_tool.call_tooldispatches arbitrary backend tools, so asserting read-only or non-destructive behavior there would be incorrect.