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();
        }
      },
    });
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations indicate readOnlyHint=false, suggesting this may cause side effects, but the description doesn't clarify what those might be (e.g., triggering hover effects, tooltips, or state changes). It adds minimal behavioral context beyond the annotation, missing details like whether it waits for animations or handles errors if the element isn't hoverable.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single sentence 'Hover over the provided element', which is front-loaded and wastes no words. It efficiently conveys the core action without unnecessary elaboration, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (one parameter, no output schema) and annotations covering basic safety, the description is minimally adequate. However, it lacks details on expected outcomes (e.g., what happens after hovering) or error handling, which could be useful for an agent to understand the tool's behavior fully.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the input schema fully documents the 'uid' parameter. The description doesn't add any extra meaning about the parameter, such as how to obtain the uid or what constitutes a valid element, so it meets the baseline but doesn't enhance understanding beyond the structured data.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Hover over the provided element' clearly states the action (hover) and target (element), making the purpose immediately understandable. However, it doesn't differentiate this from similar UI interaction tools like 'click' or 'drag' among its siblings, which would require more specific context about when hovering is appropriate versus clicking.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'click' or 'drag', nor does it mention prerequisites such as needing an element to be visible or interactive. It simply states what the tool does without context for selection among sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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