Skip to main content
Glama

playwright_hover

Simulate hovering over a specific web element using a CSS selector. This tool enables precise interaction with web pages for testing or automation purposes within a Playwright-based browser environment.

Instructions

Hover an element on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for element to hover

Implementation Reference

  • The core handler implementation for the 'playwright_hover' tool. It waits for the selector, hovers over the element using Playwright's page.hover, and returns a success message.
    export class HoverTool extends BrowserToolBase {
      /**
       * Execute the hover tool
       */
      async execute(args: any, context: ToolContext): Promise<ToolResponse> {
        return this.safeExecute(context, async (page) => {
          await page.waitForSelector(args.selector);
          await page.hover(args.selector);
          return createSuccessResponse(`Hovered ${args.selector}`);
        });
      }
    }
  • The input schema definition for the 'playwright_hover' tool, specifying the required 'selector' parameter.
      name: "playwright_hover",
      description: "Hover an element on the page",
      inputSchema: {
        type: "object",
        properties: {
          selector: { type: "string", description: "CSS selector for element to hover" },
        },
        required: ["selector"],
      },
    },
  • Registration and dispatch of the 'playwright_hover' tool in the main tool handler switch statement, calling the HoverTool's execute method.
    case "playwright_hover":
      return await hoverTool.execute(args, context);
  • src/tools.ts:458-458 (registration)
    The tool is listed in the BROWSER_TOOLS array, used to determine browser requirements.
    "playwright_hover",
  • Helper for code generation: handles 'playwright_hover' case in test code generator.
    case 'playwright_hover':
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the action without behavioral details. It doesn't disclose what 'hover' entails (e.g., mouse simulation, potential side effects like triggering CSS events), error handling, or performance implications, leaving significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with zero waste—'Hover an element on the page' is front-loaded and efficiently conveys the core action without unnecessary words, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a simple but action-oriented tool, the description is incomplete. It lacks details on what hovering does (e.g., UI interactions), success/failure states, or integration with other Playwright tools, making it inadequate for full contextual understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the selector parameter clearly documented in the schema. The description adds no additional meaning beyond implying the selector targets 'an element on the page', which is already covered. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Hover an element on the page' clearly states the action (hover) and target (an element), making the purpose immediately understandable. However, it doesn't distinguish this tool from its many sibling Playwright tools (like click, drag, etc.) beyond the specific action name, missing explicit differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like playwright_click or playwright_drag, nor does it mention prerequisites (e.g., requiring a page to be loaded). It's a standalone statement with no context for usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/executeautomation/mcp-playwright'

If you have feedback or need assistance with the MCP directory API, please join our Discord server