Skip to main content
Glama

hover_by_uid

Hover over webpage elements using unique identifiers from browser snapshots to inspect or interact with specific components during testing or automation.

Instructions

Hover over element by UID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uidYesElement UID from snapshot

Implementation Reference

  • MCP tool handler: validates input, gets Firefox instance via getFirefox(), calls firefox.hoverByUid(uid), handles errors with UID-specific messages, returns success/error 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);
      }
    }
  • Tool schema: defines name 'hover_by_uid', description, and inputSchema requiring 'uid' string from snapshot.
    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:132-132 (registration)
    Registers the handler function in the central toolHandlers Map for MCP server to route 'hover_by_uid' calls.
    ['hover_by_uid', tools.handleHoverByUid],
  • src/index.ts:176-176 (registration)
    Includes the tool schema in allTools array returned by listTools MCP request.
    tools.hoverByUidTool,
  • Core implementation: resolves UID to WebElement via snapshot callback, performs mouse hover using Selenium async actions, waits for event propagation.
    async hoverByUid(uid: string): Promise<void> {
      if (!this.resolveUid) {
        throw new Error('hoverByUid: resolveUid callback not set. Ensure snapshot is initialized.');
      }
      const el = await this.resolveUid(uid);
      await this.driver.actions({ async: true }).move({ origin: el }).perform();
    
      // Wait for events to propagate
      await this.waitForEventsAfterAction();
    }
Behavior1/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. The description only states the action without any information about side effects, performance characteristics, error conditions, or what happens after hovering (e.g., does it trigger UI events, is it synchronous). For a UI interaction tool with zero annotation coverage, this is a significant gap in behavioral transparency.

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 maximally concise with a single, clear sentence that communicates the core functionality. There's zero waste or redundancy, and the information is front-loaded. Every word earns its place in this minimal but complete statement of the tool's action.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete for a UI interaction tool. It doesn't explain what 'hover over' means in this context, what visual or behavioral effects to expect, error conditions, or relationship to other tools like 'take_snapshot' that might provide the UID. The description is too minimal for the complexity implied by interacting with UI elements.

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?

Schema description coverage is 100%, with the schema already documenting that 'uid' is a 'Element UID from snapshot'. The description adds no additional parameter information beyond what's in the schema. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, though the description doesn't compensate with any extra context about UID format or validation.

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 clearly states the action ('hover over') and target ('element by UID'), making the purpose immediately understandable. It distinguishes from siblings like 'click_by_uid' by specifying the hover action, though it doesn't explicitly contrast with other interaction tools. The description is specific enough to understand what the tool does without being tautological.

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. With siblings like 'click_by_uid', 'drag_by_uid_to_uid', and 'fill_by_uid', there's no indication of when hovering is appropriate versus clicking or other interactions. No context about prerequisites (e.g., needing a snapshot first) or typical use cases is provided.

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/mozilla/firefox-devtools-mcp'

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