pilot_hover
Hover over webpage elements using CSS selectors or element references to trigger interactive features or inspect dynamic content.
Instructions
Hover over an element by @ref or CSS selector.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | Element ref (@e3) or CSS selector |
Implementation Reference
- src/tools/interaction.ts:65-85 (handler)The handler for the 'pilot_hover' tool, implemented within the `registerInteractionTools` function. It resolves the element reference and performs the hover action using Playwright.
server.tool( 'pilot_hover', 'Hover over an element by @ref or CSS selector.', { ref: z.string().describe('Element ref (@e3) or CSS selector') }, async ({ ref }) => { await bm.ensureBrowser(); try { const resolved = await bm.resolveRef(ref); if ('locator' in resolved) { await resolved.locator.hover({ timeout: 5000 }); } else { await bm.getPage().hover(resolved.selector, { timeout: 5000 }); } bm.resetFailures(); return { content: [{ type: 'text' as const, text: `Hovered ${ref}` }] }; } catch (err) { bm.incrementFailures(); return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true }; } } ); - src/tools/register.ts:40-40 (registration)Registration of 'pilot_hover' as part of the 'standard' toolset.
'pilot_hover', 'pilot_select_option', 'pilot_scroll', 'pilot_drag',