hover_by_uid
Hover over web elements using their unique identifier to trigger hover states for testing interactions, inspecting dynamic content, or verifying CSS effects in Firefox browser automation.
Instructions
Hover over an element identified by its UID. TIP: Take a fresh snapshot if the UID becomes stale.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | The UID of the element to hover over |
Implementation Reference
- src/tools/input.ts:171-191 (handler)The primary MCP tool handler for 'hover_by_uid'. Validates input, calls Firefox's hoverByUid method, handles errors with UID-specific messaging, and returns MCP response.export async function handleHoverByUid(args: unknown): Promise<McpToolResponse> { try { const { uid } = args as { uid: string }; if (!uid || typeof uid !== 'string') { throw new Error('uid parameter is required and must be a string'); } const { getFirefox } = await import('../index.js'); const firefox = await getFirefox(); try { await firefox.hoverByUid(uid); return successResponse(`✅ hover ${uid}`); } catch (error) { throw handleUidError(error as Error, uid); } } catch (error) { return errorResponse(error as Error); } }
- src/tools/input.ts:47-60 (schema)Tool schema definition with name, description, and input schema requiring a 'uid' string parameter.export const hoverByUidTool = { name: 'hover_by_uid', description: 'Hover over element by UID.', inputSchema: { type: 'object', properties: { uid: { type: 'string', description: 'Element UID from snapshot', }, }, required: ['uid'], }, };
- src/index.ts:130-136 (registration)Registration of the hover_by_uid handler in the main toolHandlers Map used by the MCP server.// Input ['click_by_uid', tools.handleClickByUid], ['hover_by_uid', tools.handleHoverByUid], ['fill_by_uid', tools.handleFillByUid], ['drag_by_uid_to_uid', tools.handleDragByUidToUid], ['fill_form_by_uid', tools.handleFillFormByUid], ['upload_file_by_uid', tools.handleUploadFileByUid],
- src/index.ts:175-180 (registration)Inclusion of hoverByUidTool schema in the allTools array returned by listTools MCP request.tools.clickByUidTool, tools.hoverByUidTool, tools.fillByUidTool, tools.dragByUidToUidTool, tools.fillFormByUidTool, tools.uploadFileByUidTool,
- src/tools/index.ts:48-62 (registration)Re-export of hoverByUidTool and handleHoverByUid from input.ts for central import in src/index.ts.// Input tools (UID-based interactions) export { clickByUidTool, hoverByUidTool, fillByUidTool, dragByUidToUidTool, fillFormByUidTool, uploadFileByUidTool, handleClickByUid, handleHoverByUid, handleFillByUid, handleDragByUidToUid, handleFillFormByUid, handleUploadFileByUid, } from './input.js';