Skip to main content
Glama

hover

Simulate mouse hover on webpage elements to trigger interactive states and inspect dynamic content behavior during browser automation and debugging.

Instructions

Hover over the provided element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uidYesThe uid of an element on the page from the page content snapshot

Implementation Reference

  • The handler function that performs the hover action on the element identified by the provided UID using the context's locator.
    handler: async (request, response, context) => { const uid = request.params.uid; const handle = await context.getElementByUid(uid); try { await context.waitForEventsAfterAction(async () => { await handle.asLocator().hover(); }); response.appendResponseLine(`Successfully hovered over the element`); response.setIncludeSnapshot(true); } finally { void handle.dispose(); } },
  • Zod schema defining the input parameter 'uid' for the hover tool.
    schema: { uid: z .string() .describe( 'The uid of an element on the page from the page content snapshot', ), },
  • The complete definition and export of the 'hover' tool using defineTool, which registers the tool's metadata, schema, and handler.
    export const hover = defineTool({ name: 'hover', description: `Hover over the provided element`, annotations: { category: ToolCategories.INPUT_AUTOMATION, readOnlyHint: false, }, schema: { uid: z .string() .describe( 'The uid of an element on the page from the page content snapshot', ), }, handler: async (request, response, context) => { const uid = request.params.uid; const handle = await context.getElementByUid(uid); try { await context.waitForEventsAfterAction(async () => { await handle.asLocator().hover(); }); response.appendResponseLine(`Successfully hovered over the element`); response.setIncludeSnapshot(true); } finally { void handle.dispose(); } }, });

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/SHAY5555-gif/chrome-devtools-mcp'

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