Skip to content

feat: declare tool annotations so clients can tell a read from a proxy call - #158

Open
rajanaggarwal11 wants to merge 1 commit into
vercel:mainfrom
rajanaggarwal11:tool-annotations
Open

rajanaggarwal11 wants to merge 1 commit into
vercel:mainfrom
rajanaggarwal11:tool-annotations

Conversation

@rajanaggarwal11

Copy link
Copy Markdown

What

Every tool now carries MCP tool annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint), passed through in tools/list.

Tool readOnlyHint Why
nextjs_docs true reads the installed next package and its bundled docs
nextjs_index true discovery: probes local dev servers and lists their tools
browser_eval true despite the name, it only runs command -v agent-browser / --version and returns instructions — it never drives a browser
nextjs_call false, destructiveHint: true a proxy for whatever tool the dev server exposes; it cannot honestly claim less

Why

Without hints a client has to treat all four tools the same. Clients use readOnlyHint to decide whether to ask the human before a call, so today nextjs_docs gets the same treatment as nextjs_call — or, if a client is lenient, nextjs_call gets the same treatment as nextjs_docs. browser_eval is the interesting one: from the name alone a client (or a linter) assumes it evaluates something, and the hint is the only way to say it doesn't.

Found while running mcpcheck over the most-downloaded MCP servers on npm. Before:

 warn  missing-annotations
  ! browser_eval — declares neither readOnlyHint nor destructiveHint
  ! nextjs_call — declares neither readOnlyHint nor destructiveHint
  ! nextjs_docs — declares neither readOnlyHint nor destructiveHint
  ! nextjs_index — declares neither readOnlyHint nor destructiveHint

After:

mcpcheck · next-devtools-mcp 0.4.0 · 4 tools · node dist/index.js

✓ No problems found across 4 tools.

Tests

  • test/e2e/mcp-registration.test.ts asserts each tool's readOnlyHint and that every tool declares destructiveHint.
  • pnpm build && pnpm test && pnpm test:e2e pass locally (Node 24).
  • Changeset: patch.

…y call

Every tool now carries readOnlyHint / destructiveHint / idempotentHint /
openWorldHint, passed through in tools/list. nextjs_docs, nextjs_index
and browser_eval only read — browser_eval, despite its name, only probes
for the agent-browser CLI and returns instructions. nextjs_call proxies
whatever tool the dev server exposes, so it declares readOnlyHint: false
and destructiveHint: true rather than claim less than it can promise.

The e2e registration test asserts each tool's hints.
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