puppeteer_hover
Simulate mouse hover on elements with CSS selectors to reveal or interact with hover-triggered content.
Instructions
Hover an element on the page
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector for element to hover |
Implementation Reference
- src/tools/handlers.ts:203-222 (handler)Handler function for puppeteer_hover: waits for the selector, then calls page.hover() to hover over the element. Returns success or error messages.
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, }; } - src/tools/definitions.ts:83-93 (schema)Schema definition for puppeteer_hover: defines the 'selector' input parameter (required string) and tool description.
{ 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"], }, }, - src/tools/definitions.ts:3-13 (registration)Tool registration: the TOOLS array is exported from definitions.ts and imported by server.ts to register all tools including puppeteer_hover.
export const TOOLS: Tool[] = [ { name: "puppeteer_connect_active_tab", description: "Connect to an existing Chrome instance with remote debugging enabled", inputSchema: { type: "object", properties: { targetUrl: { type: "string", description: "Optional URL of the target tab to connect to. If not provided, connects to the first available tab." },