Skip to main content
Glama

browser_hover

Hover over a web page element by providing its CSS selector. Simulate mouse hover interactions to trigger tooltips, dropdowns, or dynamic content changes.

Instructions

Hover over an element on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for element to hover over

Implementation Reference

  • Main handler function for 'browser_hover'. Uses Playwright's page.waitForSelector() and page.hover() to hover over an element identified by a CSS selector. Returns success or error messages.
    async function handleBrowserHover(page: Page, args: any): Promise<{ toolResult: CallToolResult }> {
      try {
        await page.waitForSelector(args.selector);
        await page.hover(args.selector);
        return {
          toolResult: {
            content: [{
              type: "text",
              text: `Hovered over element: ${args.selector}`,
            }],
            isError: false,
          },
        };
      } catch (error) {
        return {
          toolResult: {
            content: [{
              type: "text",
              text: `Hover failed on ${args.selector}: ${(error as Error).message}`,
            }],
            isError: true,
          },
        };
      }
    }
  • Schema/definition for 'browser_hover' tool. Defines the name, description, and inputSchema requiring a 'selector' (CSS selector string). Registered as part of the tool list.
    {
      name: "browser_hover",
      description: "Hover over an element on the page",
      inputSchema: {
        type: "object",
        properties: {
          selector: { type: "string", description: "CSS selector for element to hover over" }
        },
        required: ["selector"]
      }
    },
  • Dispatch/case statement in executeToolCall that routes 'browser_hover' to handleBrowserHover handler.
    case "browser_hover":
      return await handleBrowserHover(activePage!, args);
  • src/tools.ts:9-9 (registration)
    List of browser tool names (BROWSER_TOOLS) including 'browser_hover' to identify it as a browser tool.
    "browser_hover",
Behavior2/5

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

With no annotations, the description must disclose behavioral traits. It only states 'hover over an element' without explaining whether it triggers JavaScript events, waits for any transitions, or is safe. Essential behavioral context is missing.

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

Conciseness4/5

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

The description is very concise at 6 words and front-loaded. It is not verbose, but the brevity may sacrifice necessary detail. It earns its place but could be slightly more informative.

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 tool's simplicity (1 parameter, no output schema), the description is incomplete. It does not mention the return value (likely void or success), side effects, or behavior after hovering. Sibling tools suggest a sequence of actions, but this tool's role is under-described.

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 coverage is 100% with a single parameter 'selector' described as 'CSS selector for element to hover over'. The description adds no additional meaning beyond what the schema already provides, so it meets the baseline but does not enhance understanding.

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 an element on the page' clearly states the action (hover) and target (element on page). It differentiates from siblings like browser_click and browser_fill. However, it could be more specific about the effect (e.g., triggering hover state) but is not a tautology.

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?

No guidance is provided on when to use this tool versus alternatives like browser_click or browser_evaluate. The description lacks any context about prerequisites, typical scenarios, or exclusions.

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/imprvhub/mcp-browser-agent'

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