Skip to main content
Glama

puppeteer_hover

Simulate mouse hover interactions on web elements using CSS selectors for automated browser testing and interaction scenarios.

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 logic within the handleToolCall switch statement: waits for the CSS selector, hovers over the element using Puppeteer, returns success message or catches and reports errors.
    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.message}`,
          }],
          isError: true,
        };
      }
  • Defines the input schema, name, and description for the puppeteer_hover tool in the TOOLS array.
    {
      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:447-449 (registration)
    Registers the puppeteer_hover tool (among others in TOOLS) by handling ListToolsRequestSchema.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: TOOLS,
    }));
  • index.ts:451-451 (registration)
    Registers the call handler for all tools, including puppeteer_hover, dispatching to handleToolCall based on name.
    server.setRequestHandler(CallToolRequestSchema, async (request) => handleToolCall(request.params.name, request.params.arguments ?? {}));
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe behavioral traits such as whether it waits for the element to be visible, handles errors if the selector doesn't exist, or triggers page events. For a browser automation tool with zero annotation coverage, this is a significant gap in transparency.

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, efficient sentence with zero waste. It's front-loaded with the core action and target, making it easy to parse. Every word earns its place, achieving maximum clarity in minimal space.

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 complexity of browser automation and the lack of annotations or output schema, the description is incomplete. It doesn't explain what happens after hovering (e.g., whether it returns a value or triggers side effects), error handling, or interaction with page state. For a tool with no structured behavioral data, more context is needed.

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?

The input schema has 100% description coverage, with the 'selector' parameter clearly documented as a CSS selector. The description doesn't add any meaning beyond what the schema provides, such as examples or constraints on selector syntax. Baseline score of 3 is appropriate since 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 clearly states the action ('hover') and target ('an element on the page'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from its siblings like 'puppeteer_click' or 'puppeteer_select', which also interact with page elements. The purpose is clear but lacks sibling 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. It doesn't mention scenarios where hovering is appropriate (e.g., triggering dropdowns or tooltips) versus when clicking or other interactions might be better. There's no context about prerequisites or exclusions, leaving usage entirely implicit.

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/PhialsBasement/MCP-Puppeteer-Linux'

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