browser_hover
Hover over specified elements on a web page using structured accessibility snapshots, enabling precise interaction without screenshots or visual models.
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:124-133 (handler)The handler function for the browser_hover tool. It sets the response to include a snapshot, resolves the element locator from parameters, adds the Playwright hover code to the response, and executes the hover action on the 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:116-122 (schema)Schema definition for the browser_hover tool, including name, title, description, input schema referencing elementSchema, and type.schema: { name: 'browser_hover', title: 'Hover mouse', description: 'Hover over element on page', inputSchema: elementSchema, type: 'readOnly', },
- src/tools/snapshot.ts:167-167 (registration)The browser_hover tool (hover) is registered by being included in the default export array of snapshot tools.hover,