Skip to main content
Glama

playwright_hover

Simulate mouse hover interactions on web elements using a CSS selector. Enables precise testing and automation in a real browser environment.

Instructions

Hover an element on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for element to hover

Implementation Reference

  • The execute method of HoverTool class implements the core logic for the playwright_hover tool: waits for the selector and hovers over the element using Playwright's page.hover.
    export class HoverTool extends BrowserToolBase { /** * Execute the hover tool */ async execute(args: any, context: ToolContext): Promise<ToolResponse> { return this.safeExecute(context, async (page) => { await page.waitForSelector(args.selector); await page.hover(args.selector); return createSuccessResponse(`Hovered ${args.selector}`); }); } }
  • Tool definition including name, description, and input schema requiring a CSS selector.
    name: "playwright_hover", description: "Hover an element on the page", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to hover" }, }, required: ["selector"], }, },
  • Dispatch case in handleToolCall switch statement that routes playwright_hover calls to the HoverTool instance.
    case "playwright_hover": return await hoverTool.execute(args, context);
  • src/tools.ts:412-412 (registration)
    Inclusion in BROWSER_TOOLS array used to conditionally launch browser for tools requiring it.
    "playwright_hover",
  • Import of HoverTool class used in toolHandler.ts.
    HoverTool,

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/pvinis/mcp-playwright-stealth'

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