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 ?? {}));

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