hover-element
Simulate mouse hover over web page elements using CSS selectors to trigger interactive features or reveal hidden content during browser automation.
Instructions
Hover the element
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | The selector of the element to hover, find from the page source code |
Implementation Reference
- src/handlers/automation.ts:106-110 (handler)The main handler function for the 'hover-element' tool that performs the hover action on the specified element using Puppeteer.async hoverElement({ selector }: HoverElementParams) { browser.checkConnected(); await browser.pageInstance!.waitForSelector(selector); await browser.pageInstance!.hover(selector); return `Hovered element with selector: ${selector} successfully`;
- src/types/schemas.ts:196-198 (schema)Zod schema defining the input parameters (selector) for the 'hover-element' tool.hoverElementSchema: z.object({ selector: z.string().describe('The selector of the element to hover, find from the page source code') }).strict(),
- src/utils/toolRegister.ts:77-78 (registration)Registers the 'hover-element' tool with the MCP server, including name, description, schema, and wrapped handler.server.tool('hover-element', 'Hover the element', schemas.hoverElementSchema.shape, wrapHandler(automationHandlers.hoverElement));