feat: Add destructiveHint and openWorldHint tool annotations#715
feat: Add destructiveHint and openWorldHint tool annotations#715bryankthompson wants to merge 2 commits intoChromeDevTools:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
e00b306 to
aaa3fb7
Compare
This comment was marked as spam.
This comment was marked as spam.
This PR adds the missing MCP tool annotations to improve AI assistant understanding of tool capabilities: - openWorldHint: true for all 26 tools (browser automation = external interaction) - destructiveHint: true for closePage, navigatePage, evaluateScript (irreversible changes) - destructiveHint: false for all other write operations (reversible modifications) These annotations help AI assistants make better decisions about: - Which tools require user confirmation before execution - Which tools interact with external systems - Which operations may cause data loss 🤖 Generated with [Claude Code](https://claude.com/claude-code)
2ed4f8a to
d617b73
Compare
|
I am not sure I agree with the destructiveHint classification. |
|
+1 to Alex's comments about descructive hint. These steps are also not something where I would want to have a user confirmation. |
Address review feedback from @OrKoN and @sebastianbenz: - Remove all destructiveHint annotations since destructiveness is payload-dependent for browser automation tools - Keep openWorldHint: true on all tools (interact with external web) - Keep readOnlyHint for tools that only query state The destructiveness of browser automation tools cannot be reliably inferred at the tool level - a click on "Delete Account" is destructive, but a click on "Read More" is not. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
Thanks @OrKoN and @sebastianbenz for the thoughtful review! You're right - the destructiveness of browser automation tools is entirely payload-dependent. A I've updated the PR to:
This approach accurately reflects that these tools interact with unbounded external web resources without incorrectly triggering confirmation prompts. |
|
Looking at the spec, it seems like openWorldHint is already |
I agree. |
|
Thanks for the feedback @sebastianbenz @natorion - you're absolutely right that However, I believe the PR still provides concrete value through Proposed changes:
This focused approach addresses your concern about redundancy while still providing value for client implementations. Would this revised scope be acceptable? |
|
The read-only hints are already in the code base. Closing this PR for now. Thanks for flagging this nevertheless. |
Summary
This PR adds the missing MCP tool annotations (
destructiveHintandopenWorldHint) to all 26 tools in chrome-devtools-mcp.Changes
ToolDefinition.ts: Added optionaldestructiveHintandopenWorldHintfields to the annotations interfaceopenWorldHint: truefor all tools (browser automation inherently interacts with external websites)destructiveHint: trueforclosePage,navigatePage, andevaluateScript(operations that can cause irreversible changes)destructiveHint: falsefor other write operations (reversible modifications like click, fill, hover)Why These Annotations Matter
Per the MCP specification:
openWorldHint: Indicates tools that interact with an "open world" of external entities. All browser automation tools interact with external websites, so this is true for all tools.destructiveHint: Indicates tools that may perform irreversible updates. This helps AI assistants determine when to request user confirmation.Tools Summary
🤖 Generated with Claude Code