Skip to main content
Glama

browser_hover

Hover over specific web page elements using structured accessibility snapshots to interact with them programmatically, enabling precise control without visual models or screenshots.

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

  • Executes the hover action by resolving the element locator from params, generating Playwright hover code, and performing the hover on the current tab.
    handle: async (tab, params, response) => { response.setIncludeSnapshot(); const locator = await tab.refLocator(params); response.addCode(`await page.${await generateLocator(locator)}.hover();`); await tab.waitForCompletion(async () => { await locator.hover(); }); },
  • Tool schema defining the name, title, description, input schema (elementSchema), and type for browser_hover.
    schema: { name: 'browser_hover', title: 'Hover mouse', description: 'Hover over element on page', inputSchema: elementSchema, type: 'readOnly', },
  • Zod schema for input parameters used by browser_hover and other element-interaction tools.
    export 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'), });
  • Export of the hover tool (among others) from snapshot module for inclusion in central tools registry.
    export default [ snapshot, click, drag, hover, selectOption, ];
  • src/tools.ts:36-52 (registration)
    Central registration of all tools by spreading exports from individual modules, including snapshot which provides browser_hover.
    export const allTools: Tool<any>[] = [ ...common, ...console, ...dialogs, ...evaluate, ...files, ...install, ...keyboard, ...navigate, ...network, ...mouse, ...pdf, ...screenshot, ...snapshot, ...tabs, ...wait, ];

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

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