Repository navigation
feat: declare tool annotations so clients can tell a read from a proxy call - #158
Open
rajanaggarwal11 wants to merge 1 commit into
Open
rajanaggarwal11 wants to merge 1 commit into
rajanaggarwal11 wants to merge 1 commit into
Conversation
…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.
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.
What
Every tool now carries MCP tool annotations (
readOnlyHint,destructiveHint,idempotentHint,openWorldHint), passed through intools/list.readOnlyHintnextjs_docstruenextpackage and its bundled docsnextjs_indextruebrowser_evaltruecommand -v agent-browser/--versionand returns instructions — it never drives a browsernextjs_callfalse,destructiveHint: trueWhy
Without hints a client has to treat all four tools the same. Clients use
readOnlyHintto decide whether to ask the human before a call, so todaynextjs_docsgets the same treatment asnextjs_call— or, if a client is lenient,nextjs_callgets the same treatment asnextjs_docs.browser_evalis 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:
After:
Tests
test/e2e/mcp-registration.test.tsasserts each tool'sreadOnlyHintand that every tool declaresdestructiveHint.pnpm build && pnpm test && pnpm test:e2epass locally (Node 24).