Skip to main content
Glama

browser_hover_text

Hover over webpage elements by text content to identify interactive components during security testing for vulnerability detection.

Instructions

Hover an element on the page by its text content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesText content of the element to hover

Implementation Reference

  • The main handler logic for the 'browser_hover_text' tool. It uses Playwright's page.getByText to locate an element by text and calls hover() on it, with comprehensive error handling including retry for strict mode violations.
    case ToolName.BrowserHoverText:
      try {
        await page.getByText(args.text).hover();
        return {
          content: [{
            type: "text",
            text: `Hovered element with text: ${args.text}`,
          }],
          isError: false,
        };
      } catch (error) {
        if((error as Error).message.includes("strict mode violation")) {
            console.log("Strict mode violation, retrying on first element...");
            try {
                await page.getByText(args.text).first().hover();
                return {
                    content: [{
                        type: "text",
                        text: `Hovered element with text: ${args.text}`,
                    }],
                    isError: false,
                };
            } catch (error) {
                return {
                    content: [{
                        type: "text",
                        text: `Failed (twice) to hover element with text ${args.text}: ${(error as Error).message}`,
                    }],
                    isError: true,
                };
            }
        }
        return {
          content: [{
            type: "text",
            text: `Failed to hover element with text ${args.text}: ${(error as Error).message}`,
          }],
          isError: true,
        };
      }
  • index.ts:144-154 (registration)
    Registration of the 'browser_hover_text' tool in the TOOLS array, including its name (ToolName.BrowserHoverText), description, and input schema definition. This array is used by the ListToolsRequestSchema handler.
    {
      name: ToolName.BrowserHoverText,
      description: "Hover an element on the page by its text content",
      inputSchema: {
        type: "object",
        properties: {
          text: { type: "string", description: "Text content of the element to hover" },
        },
        required: ["text"],
      },
    },
  • Input schema for the 'browser_hover_text' tool, defining a required 'text' string parameter.
    inputSchema: {
      type: "object",
      properties: {
        text: { type: "string", description: "Text content of the element to hover" },
      },
      required: ["text"],
    },
  • Enum constant defining the tool name string 'browser_hover_text' used throughout the code.
    BrowserHoverText = "browser_hover_text",
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action but lacks details on what happens after hovering (e.g., whether it triggers events, waits for effects, or returns any feedback), potential errors (e.g., if text isn't found), or performance implications. This leaves significant gaps for a tool that interacts with a browser.

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 that efficiently conveys the core action without unnecessary words. It is front-loaded with the key information, making it easy to parse quickly.

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 complexity of browser interaction tools and the lack of annotations or output schema, the description is incomplete. It doesn't cover behavioral aspects like error handling, side effects, or what constitutes success, which are crucial for an agent to use the tool effectively in a dynamic environment like a browser.

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%, so the schema already documents the single parameter 'text' as 'Text content of the element to hover'. The description adds no additional meaning beyond this, such as explaining how text matching works (e.g., exact vs. partial, case sensitivity) or examples. Baseline 3 is appropriate when the schema handles parameter documentation.

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') and target ('an element on the page by its text content'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'browser_hover' (which likely hovers by selector rather than text) or 'browser_click_text' (which clicks rather than hovers), missing full sibling distinction.

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. For example, it doesn't specify when to prefer 'browser_hover_text' over 'browser_hover' or 'browser_click_text', nor does it mention prerequisites like requiring the page to be loaded or the element to be visible.

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/9olidity/MCP-Server-Pentest'

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