Skip to main content
Glama
jomon003

PlayMCP Browser Automation Server

by jomon003

hover

Hover over web page elements to trigger interactive features, reveal hidden content, or prepare for further actions during browser automation.

Instructions

Hover over an element on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYes

Implementation Reference

  • Core handler function in PlaywrightController that locates the element using the provided selector and performs the hover action using Playwright's locator.hover() method, with error handling and logging.
    async hover(selector: string): Promise<void> {
      try {
        if (!this.isInitialized() || !this.state.page) {
          throw new Error('Browser not initialized');
        }
        this.log('Hovering over element', { selector });
        const locator = this.state.page.locator(selector);
        await locator.hover();
        this.log('Hover complete');
      } catch (error: any) {
        console.error('Hover error:', error);
        throw new BrowserError('Failed to hover over element', 'Check if the selector exists and is visible');
      }
    }
  • Defines the Tool object for 'hover' including name, description, and inputSchema requiring a 'selector' string parameter.
    const HOVER_TOOL: Tool = {
      name: "hover",
      description: "Hover over an element on the page",
      inputSchema: {
        type: "object",
        properties: {
          selector: { type: "string" }
        },
        required: ["selector"]
      }
    };
  • src/server.ts:536-536 (registration)
    Registers the HOVER_TOOL in the 'tools' object which is provided to the MCP Server capabilities.
    hover: HOVER_TOOL,
  • MCP request handler in the 'callTool' switch statement that validates the selector argument, calls the PlaywrightController.hover method, and returns success response.
    case 'hover': {
      if (!args.selector) {
        return {
          content: [{ type: "text", text: "Selector is required" }],
          isError: true
        };
      }
      await playwrightController.hover(args.selector as string);
      return {
        content: [{ type: "text", text: "Hover completed successfully" }]
      };
    }
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It fails to explain what 'hover' entails (e.g., does it trigger UI events, is it idempotent, what happens on errors), the need for browser context, or any side effects. This leaves critical behavioral traits unspecified, making it inadequate for safe tool invocation.

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 no wasted words, making it highly concise and front-loaded. Every part of the sentence contributes to the core action, though it could benefit from more detail without sacrificing brevity.

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 a browser interaction tool with no annotations, no output schema, and 1 undocumented parameter, the description is incomplete. It doesn't cover behavioral aspects, parameter details, or expected outcomes, making it insufficient for an AI agent to use the tool effectively without additional context.

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

Parameters2/5

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

The input schema has 1 parameter with 0% description coverage, and the tool description adds no information about the 'selector' parameter (e.g., what format it expects, examples like CSS selectors, or how it locates elements). With low schema coverage, the description fails to compensate, leaving the parameter's meaning unclear.

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

Purpose3/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 (an element), but it's vague about what 'hover' means in this context (e.g., mouse simulation, UI interaction) and doesn't distinguish it from sibling tools like 'mouseMove' or 'moveMouse'. It avoids tautology by not just restating the name, but lacks specificity.

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 such as 'mouseMove', 'moveMouse', or 'click'. It doesn't mention prerequisites (e.g., requires an open browser) or exclusions, leaving usage context implied at best. This lack of explicit direction reduces its utility for an AI agent.

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/jomon003/PlayMCP'

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