mcp-playwright icon indicating copy to clipboard operation
mcp-playwright copied to clipboard

feat: Add MCP tool annotations for improved AI understanding

Open bryankthompson opened this issue 11 months ago • 0 comments

Summary

Add MCP tool annotations to all 33 tools to help AI assistants make better decisions about tool usage and safety.

Annotations Added

Each tool now includes:

  • title - Human-readable tool name
  • readOnlyHint - true for read-only operations
  • destructiveHint - true for operations that modify state
  • openWorldHint - true for all tools (browser automation)

Tool Breakdown

Category Read-Only Destructive Non-Destructive Write
Code Generation (4) 1 1 2
Browser Interaction (18) 4 9 5
API Requests (5) 1 4 0
Response Monitoring (2) 2 0 0
Utility (4) 0 0 4
Total (33) 8 14 11

Examples

Read-only tools (readOnlyHint: true):

  • playwright_screenshot - captures page state without modifying
  • playwright_get_visible_text - reads page content
  • playwright_get - HTTP GET request

Destructive tools (destructiveHint: true):

  • playwright_click - modifies page state by triggering interactions
  • playwright_fill - modifies form values
  • playwright_delete - HTTP DELETE request
  • playwright_close - terminates browser session

Test Results

All 150 existing tests pass.

Motivation

Tool annotations are an MCP spec feature that helps AI assistants:

  1. Make better decisions about when to ask for confirmation
  2. Understand the impact of tool calls on external systems
  3. Prioritize read-only operations when exploring

🤖 Generated with Claude Code

bryankthompson avatar Dec 29 '25 19:12 bryankthompson