hover-element
Simulate hover actions on webpage elements by specifying their selectors using the AdsPower LocalAPI MCP Server for enhanced browser automation.
Instructions
Hover the element
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | The selector of the element to hover, find from the page source code |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"selector": {
"description": "The selector of the element to hover, find from the page source code",
"type": "string"
}
},
"required": [
"selector"
],
"type": "object"
}
Implementation Reference
- src/handlers/automation.ts:106-110 (handler)The main handler function for the 'hover-element' tool. It waits for the selector, hovers over the element using Puppeteer, and returns a success message.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 for the 'hover-element' tool: a required 'selector' string.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, providing name, description, input schema, and wrapped handler reference.server.tool('hover-element', 'Hover the element', schemas.hoverElementSchema.shape, wrapHandler(automationHandlers.hoverElement));