Skip to content

feat: Add destructiveHint and openWorldHint tool annotations#715

Closed
bryankthompson wants to merge 2 commits intoChromeDevTools:mainfrom
bryankthompson:add-tool-annotations
Closed

feat: Add destructiveHint and openWorldHint tool annotations#715
bryankthompson wants to merge 2 commits intoChromeDevTools:mainfrom
bryankthompson:add-tool-annotations

Conversation

@bryankthompson
Copy link
Copy Markdown

Summary

This PR adds the missing MCP tool annotations (destructiveHint and openWorldHint) to all 26 tools in chrome-devtools-mcp.

Changes

  • Updated ToolDefinition.ts: Added optional destructiveHint and openWorldHint fields to the annotations interface
  • Added annotations to all 26 tools:
    • openWorldHint: true for all tools (browser automation inherently interacts with external websites)
    • destructiveHint: true for closePage, navigatePage, and evaluateScript (operations that can cause irreversible changes)
    • destructiveHint: false for 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

Category Tools destructiveHint
Navigation closePage, navigatePage true (irreversible)
Script evaluateScript true (can modify page state)
Input click, hover, fill, drag, fillForm, uploadFile, pressKey, handleDialog false
Debugging screenshot, takeSnapshot, listConsoleMessages, getConsoleMessage false
Network listNetworkRequests, getNetworkRequest N/A (readOnly)
Performance startTrace, stopTrace, analyzeInsight N/A (readOnly)
Other newPage, selectPage, listPages, resizePage, emulate, waitFor false or N/A

🤖 Generated with Claude Code

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Dec 29, 2025

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.

@bryankthompson bryankthompson changed the title Add destructiveHint and openWorldHint tool annotations feat: Add destructiveHint and openWorldHint tool annotations Dec 29, 2025
@bryankthompson bryankthompson force-pushed the add-tool-annotations branch 2 times, most recently from e00b306 to aaa3fb7 Compare December 29, 2025 14:54
@Thebigboss1978

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)
@OrKoN OrKoN force-pushed the add-tool-annotations branch from 2ed4f8a to d617b73 Compare January 7, 2026 15:29
@OrKoN
Copy link
Copy Markdown
Collaborator

OrKoN commented Jan 7, 2026

I am not sure I agree with the destructiveHint classification. click, hover, fill, drag, fillForm, uploadFile, pressKey can also trigger navigations and modify the page state. Also, closePage and navigatePage are reversible as they pages can be re-opened and navigated. I think in all cases the destructiveness depends on the payload and cannot be inferred on the tool level. WDYT @sebastianbenz @natorion ? I think openWorldHint can be added.

@sebastianbenz
Copy link
Copy Markdown
Collaborator

+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)
@bryankthompson
Copy link
Copy Markdown
Author

Thanks @OrKoN and @sebastianbenz for the thoughtful review!

You're right - the destructiveness of browser automation tools is entirely payload-dependent. A click on a "Delete Account" button is destructive, but a click on a "Read More" link is not. This can't be reliably inferred at the tool level.

I've updated the PR to:

  1. Remove all destructiveHint annotations - since destructiveness is context-dependent
  2. Keep openWorldHint: true on all tools - they all interact with external web content
  3. Keep readOnlyHint: true only for pure query tools (list_pages, select_page, list_console_messages, etc.)

This approach accurately reflects that these tools interact with unbounded external web resources without incorrectly triggering confirmation prompts.

@sebastianbenz
Copy link
Copy Markdown
Collaborator

Looking at the spec, it seems like openWorldHint is already true by default. Hence, I don't see much value in explicitly adding it here.

@natorion
Copy link
Copy Markdown
Contributor

natorion commented Jan 8, 2026

Looking at the spec, it seems like openWorldHint is already true by default. Hence, I don't see much value in explicitly adding it here.

I agree.

@bryankthompson
Copy link
Copy Markdown
Author

Thanks for the feedback @sebastianbenz @natorion - you're absolutely right that openWorldHint: true is redundant since that's the spec default.

However, I believe the PR still provides concrete value through readOnlyHint: true on genuinely read-only tools. Unlike openWorldHint, readOnlyHint defaults to false, so explicitly setting it enables MCP clients to auto-approve safe operations without user confirmation.

Proposed changes:

  • ❌ Remove all openWorldHint: true annotations (redundant)
  • ✅ Keep readOnlyHint: true on query-only tools (getPageInfo, getScreenshot, findElement, getConsoleMessages, etc.)
  • ✅ Keep title annotations for human-readable display

This focused approach addresses your concern about redundancy while still providing value for client implementations.

Would this revised scope be acceptable?

@sebastianbenz
Copy link
Copy Markdown
Collaborator

The read-only hints are already in the code base. Closing this PR for now. Thanks for flagging this nevertheless.

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.

5 participants