Skip to content

Annotate vMCP optimizer discovery tool - #6373

Open
Whxuan0701 wants to merge 1 commit into
stacklok:mainfrom
Whxuan0701:pr/vmcp-find-tool-annotations
Open

Annotate vMCP optimizer discovery tool#6373
Whxuan0701 wants to merge 1 commit into
stacklok:mainfrom
Whxuan0701:pr/vmcp-find-tool-annotations

Conversation

@Whxuan0701

@Whxuan0701 Whxuan0701 commented Aug 19, 2026

Copy link
Copy Markdown

Summary

The vMCP optimizer exposes find_tool as 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.

  • Add MCP annotations to find_tool: read-only, non-destructive, idempotent, and closed-world.
  • Leave call_tool unannotated because it can proxy arbitrary backend side effects.

Part of #4357

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

  • Unit tests (task -t Taskfile.focused.yml test, using the repository's -race and linker settings for ./pkg/vmcp/session/optimizerdec and ./pkg/vmcp/conversion)
  • E2E tests (task test-e2e)
  • Linting (task lint-fix)
  • Manual testing (describe below)

API Compatibility

  • This PR does not break the v1beta1 API.

Changes

File Change
pkg/vmcp/session/optimizerdec/decorator.go Add behavioral annotations to find_tool.
pkg/vmcp/session/optimizerdec/decorator_test.go Assert the discovery tool annotations and preserve the unannotated call_tool contract.

Does this introduce a user-facing change?

Yes. MCP clients that consume tool annotations can now identify find_tool as a safe, retryable local discovery operation.

Special notes for reviewers

The annotation is deliberately limited to find_tool. call_tool dispatches arbitrary backend tools, so asserting read-only or non-destructive behavior there would be incorrect.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant