Skip to main content
Glama
devskido

Playwright MCP Server

by devskido

playwright_hover

Simulate hover interactions on web elements using a CSS selector with browser automation. Enables precise testing, scraping, and debugging within real browser environments.

Instructions

Hover an element on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for element to hover

Implementation Reference

  • The HoverTool class containing the execute method that implements the core logic: waits for selector and performs page.hover using Playwright.
    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}`); }); } }
  • MCP tool definition including name, description, and input schema requiring a 'selector' parameter.
    { 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"], }, },
  • Switch case in handleToolCall that registers and dispatches to the hoverTool.execute handler.
    case "playwright_hover": return await hoverTool.execute(args, context);
  • BROWSER_TOOLS constant listing playwright_hover as a browser-requiring tool for conditional initialization.
    export const BROWSER_TOOLS = [ "playwright_navigate", "playwright_screenshot", "playwright_click", "playwright_iframe_click", "playwright_iframe_fill", "playwright_fill", "playwright_select", "playwright_hover", "playwright_evaluate", "playwright_console_logs", "playwright_close", "playwright_get_visible_text", "playwright_get_visible_html" ];
  • Codegen generator case that converts playwright_hover action to Playwright hover code snippet.
    case 'playwright_hover': return this.generateHoverStep(parameters);

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/devskido/customed-playwright'

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