Skip to main content
Glama
AdsPower

AdsPower LocalAPI MCP Server

Official

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

NameRequiredDescriptionDefault
selectorYesThe 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

  • 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`;
  • 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(),
  • 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));

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/AdsPower/local-api-mcp-typescript'

If you have feedback or need assistance with the MCP directory API, please join our Discord server