Skip to main content
Glama
cploujoux

Puppeteer MCP Server

by cploujoux

puppeteer_hover

Simulate mouse hover action on a webpage element using a CSS selector. Enables precise interactions in browser automation tasks with Puppeteer MCP Server.

Instructions

Hover an element on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for element to hover

Implementation Reference

  • Implements the puppeteer_hover tool by waiting for the specified selector and hovering over the element using Puppeteer's page.hover method, with error handling.
    case "puppeteer_hover":
      try {
        await page.waitForSelector(args.selector);
        await page.hover(args.selector);
        return {
          content: [
            {
              type: "text",
              text: `Hovered ${args.selector}`,
            },
          ],
          isError: false,
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Failed to hover ${args.selector}: ${
                (error as Error).message
              }`,
            },
          ],
          isError: true,
        };
      }
  • Defines the tool metadata including name, description, and input schema requiring a 'selector' string for the puppeteer_hover tool.
    {
      name: "puppeteer_hover",
      description: "Hover an element on the page",
      inputSchema: {
        type: "object",
        properties: {
          selector: {
            type: "string",
            description: "CSS selector for element to hover",
          },
        },
        required: ["selector"],
      },
    },
  • index.ts:459-461 (registration)
    Registers the puppeteer_hover tool (along with others) by including it in the TOOLS array returned for list tools requests.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: TOOLS,
    }));

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries full burden. It only states the action without disclosing behavior like asynchronous execution, event side effects, or whether the hover is a one-time action.

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

Conciseness4/5

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

The description is a single concise sentence. It is front-loaded and wastes no words, but could benefit from slightly more detail without losing conciseness.

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 simplicity (1 param, no output schema), the description omits important context like return behavior (likely void) or side effects (e.g., triggering event listeners). Not complete for an agent.

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 coverage is 100% (selector described), so baseline is 3. The description adds no new meaning beyond the schema; it merely restates the action.

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 states the specific verb 'Hover' and resource 'an element on the page', clearly distinguishing it from sibling tools like click, fill, or navigate. However, it lacks nuance about what 'hover' entails, such as triggering mouseover events.

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 puppeteer_click for interactions or puppeteer_evaluate for custom actions. There is no mention of prerequisites or context.

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

Deploy Server

Other Tools

Related Tools