Skip to main content
Glama

browser_hover

Hover over web page elements to trigger interactive features like dropdown menus, tooltips, or hover effects during browser automation with Playwright MCP.

Instructions

Hover over element on page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
elementYesHuman-readable element description used to obtain permission to interact with the element
refYesExact target element reference from the page snapshot

Implementation Reference

  • The core handler function that executes the browser_hover tool. It derives a Playwright locator from the page snapshot using the provided ref and element description, then performs a hover action via locator.hover(). It also generates equivalent code snippet for the code execution mode.
    handle: async (context, params) => { const snapshot = context.currentTabOrDie().snapshotOrDie(); const locator = snapshot.refLocator(params); const code = [ `// Hover over ${params.element}`, `await page.${await generateLocator(locator)}.hover();` ]; return { code, action: () => locator.hover(), captureSnapshot: true, waitForNetwork: true, }; }, });
  • Zod input schema definition for elements used in browser_hover (and other interaction tools). Requires 'element' (human-readable description) and 'ref' (exact reference from page snapshot).
    const elementSchema = z.object({ element: z.string().describe('Human-readable element description used to obtain permission to interact with the element'), ref: z.string().describe('Exact target element reference from the page snapshot'), });
  • Tool schema for browser_hover, defining name, title, description, inputSchema (references elementSchema), and readOnly type.
    schema: { name: 'browser_hover', title: 'Hover mouse', description: 'Hover over element on page', inputSchema: elementSchema, type: 'readOnly', },
  • src/tools.ts:26-26 (registration)
    Imports the snapshot.js module which exports an array of tools including browser_hover.
    import snapshot from './tools/snapshot.js';
  • src/tools.ts:46-46 (registration)
    Registers browser_hover by spreading the snapshot tools array into the main snapshotTools export.
    ...snapshot,

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/manishamishraacc/mcp'

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