puppeteer_hover
Simulate mouse hover on a webpage element using its CSS selector. Part of MCP Puppeteer Linux Server, enabling browser automation for web interaction and testing.
Instructions
Hover an element on the page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector for element to hover |
Implementation Reference
- index.ts:322-342 (handler)The handler function for the puppeteer_hover tool. It waits for the specified CSS selector to appear on the page, then hovers over the element using Puppeteer's page.hover() method. Returns a success message or an error if the operation fails.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, }; }
- index.ts:163-173 (schema)The input schema definition for the puppeteer_hover tool, specifying that a CSS selector string is required.{ 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:448-449 (registration)Registers the list of available tools, including puppeteer_hover via the TOOLS array.tools: TOOLS, }));