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
| Name | Required | Description | Default |
|---|---|---|---|
| element | Yes | Human-readable element description used to obtain permission to interact with the element | |
| ref | Yes | Exact target element reference from the page snapshot |
Implementation Reference
- src/tools/snapshot.ts:122-131 (handler)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(); }); },
- src/tools/snapshot.ts:114-120 (schema)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', },
- src/tools/snapshot.ts:39-42 (schema)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'), });
- src/tools/snapshot.ts:160-166 (registration)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, ];