Skip to main content
Glama
Angeluis001

Playwright MCP

by Angeluis001

browser_hover

Destructive

Hover over web page elements to trigger interactive features like dropdown menus or tooltips during browser automation testing with Playwright MCP.

Instructions

Hover over element on page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
elementYesHuman-readable element description used to obtain permission to interact with the element
refYesExact target element reference from the page snapshot

Implementation Reference

  • The handler function that executes the browser_hover tool logic: hovers over the element using the locator from the page snapshot.
    handle: async (context, params) => {
      const snapshot = context.currentTabOrDie().snapshotOrDie();
      const locator = snapshot.refLocator(params);
    
      const code = [
        `// Hover over ${params.element}`,
        `await page.${await generateLocator(locator)}.hover();`
      ];
    
      return {
        code,
        action: () => locator.hover(),
        captureSnapshot: true,
        waitForNetwork: true,
      };
    },
  • Schema definition for the browser_hover tool, specifying name, title, description, inputSchema (elementSchema), and type.
    schema: {
      name: 'browser_hover',
      title: 'Hover mouse',
      description: 'Hover over element on page',
      inputSchema: elementSchema,
      type: 'readOnly',
    },
  • Zod schema for element input, used by browser_hover and other interaction tools.
    const elementSchema = z.object({
      element: z.string().describe('Human-readable element description used to obtain permission to interact with the element'),
      ref: z.string().describe('Exact target element reference from the page snapshot'),
    });
  • Local registration: hover tool included in the default export array from snapshot.ts
    export default [
      snapshot,
      click,
      drag,
      hover,
      type,
      selectOption,
    ];
  • src/tools.ts:35-50 (registration)
    Global registration: snapshotTools array includes ...snapshot (which exports browser_hover), used by the MCP server.
    export const snapshotTools: Tool<any>[] = [
      ...common(true),
      ...console,
      ...dialogs(true),
      ...files(true),
      ...install,
      ...keyboard(true),
      ...navigate(true),
      ...network,
      ...pdf,
      ...screenshot,
      ...snapshot,
      ...tabs(true),
      ...testing,
      ...wait(true),
    ];
Behavior3/5

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

Annotations indicate this is a destructive (destructiveHint: true), non-read-only (readOnlyHint: false) operation with open-world characteristics (openWorldHint: true). The description 'Hover over element on page' aligns with these annotations by implying an interactive action that could trigger page changes, but it doesn't add significant behavioral context beyond what annotations provide, such as specific side effects or rate limits.

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 extremely concise at just four words ('Hover over element on page'), with zero wasted language. It's front-loaded and directly communicates the core action, making it highly efficient despite potential gaps in other dimensions.

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 the tool's complexity (interactive browser action with destructive hints), lack of output schema, and rich annotations, the description is insufficient. It doesn't explain what happens after hovering (e.g., triggering UI changes), potential errors, or integration with other browser tools, leaving significant gaps for agent 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?

With 100% schema description coverage, the input schema fully documents both parameters (element and ref). The description adds no additional parameter semantics, such as explaining the relationship between 'element' and 'ref' or providing usage examples. This meets the baseline for high schema coverage.

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 over element on page' clearly states the action (hover) and target (element on page), making the purpose immediately understandable. However, it doesn't differentiate this tool from its many sibling browser interaction tools (like browser_click or browser_press_key) beyond the specific hover action, which is why it doesn't reach a perfect score.

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 browser_click or browser_press_key. It doesn't mention any prerequisites, context requirements, or scenarios where hovering is specifically needed over other interactions, leaving the agent without usage direction.

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

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/Angeluis001/playwright-mcp'

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