Skip to main content
Glama

browser_hover

Read-only

Hover over elements on web pages to trigger interactive behaviors like tooltips, dropdowns, or menu expansions for testing or automation purposes.

Instructions

Hover over element on page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
elementYesHuman-readable element description used to obtain permission to interact with the element
refYesExact target element reference from the page snapshot

Implementation Reference

  • The handler function for the 'browser_hover' tool. It resolves the element locator from the input parameters, adds the corresponding Playwright hover code to the response, sets the snapshot inclusion flag, and executes the hover action while waiting for completion.
    handle: async (tab, params, response) => {
      response.setIncludeSnapshot();
    
      const locator = await tab.refLocator(params);
      response.addCode(`await page.${await generateLocator(locator)}.hover();`);
    
      await tab.waitForCompletion(async () => {
        await locator.hover();
      });
    },
  • Schema definition for the 'browser_hover' tool, specifying the name, title, description, input schema (using shared elementSchema), and readOnly type.
    schema: {
      name: 'browser_hover',
      title: 'Hover mouse',
      description: 'Hover over element on page',
      inputSchema: elementSchema,
      type: 'readOnly',
    },
  • The complete definition and registration of the 'browser_hover' tool using defineTabTool, which includes the schema and handler.
    const hover = defineTabTool({
      capability: 'core',
      schema: {
        name: 'browser_hover',
        title: 'Hover mouse',
        description: 'Hover over element on page',
        inputSchema: elementSchema,
        type: 'readOnly',
      },
    
      handle: async (tab, params, response) => {
        response.setIncludeSnapshot();
    
        const locator = await tab.refLocator(params);
        response.addCode(`await page.${await generateLocator(locator)}.hover();`);
    
        await tab.waitForCompletion(async () => {
          await locator.hover();
        });
      },
    });
  • Shared Zod schema for element input parameters (element description and ref), used as inputSchema for browser_hover and other tools.
    export const elementSchema = z.object({
      element: z.string().describe('Human-readable element description used to obtain permission to interact with the element'),
      ref: z.string().describe('Exact target element reference from the page snapshot'),
    });
  • Export of the tool modules, including the browser_hover tool (as 'hover'), for higher-level registration.
    export default [
      snapshot,
      click,
      drag,
      hover,
      selectOption,
    ];
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=true, indicating a safe, non-destructive operation. The description adds minimal behavioral context beyond this, as 'hover' implies a transient interaction without permanent changes. It doesn't specify effects like triggering UI elements or timeouts, but annotations cover the safety profile adequately.

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 a single, direct sentence with zero wasted words, making it highly concise and front-loaded. It efficiently communicates the core action without unnecessary elaboration, which is ideal for a straightforward tool like this.

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 (simple hover action), 100% schema coverage, and annotations covering safety, the description is minimally adequate. However, it lacks output details (no schema provided) and doesn't explain potential side effects like UI changes, leaving some gaps in completeness for an interactive tool.

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 clear descriptions for both parameters: 'element' as a human-readable description for permission and 'ref' as an exact target reference. The description adds no additional parameter semantics beyond what the schema provides, such as examples or interaction details. Baseline 3 is appropriate given the comprehensive schema.

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 element on page' clearly states the action (hover) and target (element on page), making the purpose immediately understandable. It distinguishes from siblings like browser_click or browser_type by specifying a hover interaction rather than click or typing. However, it doesn't explicitly mention the mouse or cursor aspect, which the annotation title 'Hover mouse' covers.

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. It doesn't explain scenarios where hovering is appropriate (e.g., to trigger tooltips or dropdowns) or when to prefer other interactions like browser_click. Without such context, the agent must infer usage from the tool name alone.

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/maywzh/playwright-mcp'

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