Skip to main content
Glama
jomon003

PlayMCP Browser Automation Server

by jomon003

mouseClick

Simulate mouse clicks at precise screen coordinates to automate browser interactions for web testing and scraping tasks.

Instructions

Click at specific coordinates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYes
yYes

Implementation Reference

  • The main handler function in PlaywrightController that executes the mouse click at the given (x, y) coordinates using the Playwright mouse API.
    async mouseClick(x: number, y: number): Promise<void> {
      try {
        if (!this.isInitialized() || !this.state.page) {
          throw new Error('Browser not initialized');
        }
        this.log('Clicking at coordinates', { x, y });
        await this.state.page.mouse.click(x, y);
        this.currentMousePosition = { x, y };
        this.log('Mouse click complete');
      } catch (error: any) {
        console.error('Mouse click error:', error);
        throw new BrowserError('Failed to click at coordinates', 'Check if coordinates are valid');
      }
    }
  • JSON Schema definition for the mouseClick tool, specifying required numeric x and y coordinates as input.
    const MOUSE_CLICK_TOOL: Tool = {
      name: "mouseClick",
      description: "Click at specific coordinates",
      inputSchema: {
        type: "object",
        properties: {
          x: { type: "number" },
          y: { type: "number" }
        },
        required: ["x", "y"]
      }
    };
  • src/server.ts:971-982 (registration)
    Registration in the MCP callTool request handler switch statement, which validates input and invokes the Playwright controller's mouseClick method.
    case 'mouseClick': {
      if (typeof args.x !== 'number' || typeof args.y !== 'number') {
        return {
          content: [{ type: "text", text: "X and Y coordinates are required" }],
          isError: true
        };
      }
      await playwrightController.mouseClick(args.x, args.y);
      return {
        content: [{ type: "text", text: "Mouse clicked successfully" }]
      };
    }
  • src/server.ts:550-550 (registration)
    Tool registration entry in the 'tools' dictionary passed to MCP Server capabilities for listTools and callTool discovery.
    mouseClick: MOUSE_CLICK_TOOL,
Behavior2/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. 'Click at specific coordinates' implies a UI interaction but doesn't specify which mouse button (e.g., left, right), whether it's a single or double click, if it requires a browser to be open, or what happens on failure (e.g., no response). This leaves critical behavioral traits undefined for a mutation tool.

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, efficient sentence ('Click at specific coordinates') that is front-loaded and wastes no words. Every part earns its place by conveying the core action and target without redundancy or fluff, making it highly concise and well-structured.

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 complexity (a UI interaction with 2 parameters), no annotations, no output schema, and low schema coverage, the description is incomplete. It lacks details on behavior (e.g., click type, error handling), parameter semantics (e.g., coordinate system), and usage context (e.g., browser state), making it inadequate for reliable agent invocation.

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?

The input schema has 2 parameters (x, y) with 0% description coverage, so the schema provides no semantic context. The description adds minimal meaning by implying coordinates are for clicking, but it doesn't explain the coordinate system (e.g., screen-relative, page-relative), units, or valid ranges. This partially compensates but leaves gaps, aligning with the baseline for low schema coverage.

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 'Click at specific coordinates' states a clear verb ('Click') and target ('at specific coordinates'), but it's vague about what exactly gets clicked (e.g., a mouse button, UI element) and doesn't distinguish from sibling tools like 'click' (which likely serves a similar purpose) or 'mouseDrag' (which involves dragging). It avoids tautology by not just restating the name.

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 mention prerequisites (e.g., requiring an open browser), exclusions, or compare to siblings like 'click' (which might be for elements) or 'mouseDrag' (for dragging actions), leaving the agent to infer usage from context 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/jomon003/PlayMCP'

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