Skip to main content
Glama

click

Destructive

Perform mouse clicks at specified screen coordinates with configurable button, click count, and modifier keys for macOS automation tasks.

Instructions

Click at the specified screen coordinates. Supports left/right/middle button, single/double/triple click, and modifier keys. Do not narrate visual observations or coordinate calculations. Brief task progress updates are acceptable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX coordinate in screen pixels (may be negative for secondary displays)
yYesY coordinate in screen pixels (may be negative for secondary displays)
buttonYesMouse button to click (default: left)left
click_countYesNumber of clicks: 1 (single), 2 (double), or 3 (triple)
modifiersNoModifier keys to hold during click

Implementation Reference

  • The implementation of the `click` tool handler. It parses the arguments using `ClickInputSchema`, executes the click using `runInputHelper`, and formats the response.
    async function handleClick(
      args: Record<string, unknown>,
    ): Promise<CallToolResult> {
      const parsed = ClickInputSchema.parse(args);
    
      const result = await runInputHelper("click", {
        x: parsed.x,
        y: parsed.y,
        button: parsed.button,
        count: parsed.click_count,
        ...(parsed.modifiers && parsed.modifiers.length > 0
          ? { modifiers: parsed.modifiers }
          : {}),
      });
    
      const response: Record<string, unknown> = {
        clicked: { x: parsed.x, y: parsed.y },
        button: parsed.button,
        click_count: parsed.click_count,
        modifiers: parsed.modifiers ?? [],
      };
      if (typeof result.warning === "string") {
        response.warning = result.warning;
      }
    
      return {
        content: [{ type: "text" as const, text: JSON.stringify(response) }],
      };
    }
  • Input validation schema for the `click` tool.
    const ClickInputSchema = z.object({
      x: z
        .number()
        .int()
        .describe(
          "X coordinate in screen pixels (may be negative for secondary displays)",
        ),
      y: z
        .number()
        .int()
        .describe(
          "Y coordinate in screen pixels (may be negative for secondary displays)",
        ),
      button: z
        .enum(MOUSE_BUTTONS)
        .default("left")
        .describe("Mouse button to click (default: left)"),
      click_count: z
        .number()
        .int()
        .min(1)
        .max(3)
        .default(1)
        .describe("Number of clicks: 1 (single), 2 (double), or 3 (triple)"),
      modifiers: z
        .array(z.enum(CLICK_MODIFIERS))
        .optional()
        .describe("Modifier keys to hold during click"),
    });
  • Registration of the `click` tool definition within `mouseToolDefinitions`.
    {
      name: "click",
      description: `Click at the specified screen coordinates. Supports left/right/middle button, single/double/triple click, and modifier keys. ${SILENT_HINT}`,
      inputSchema: zodToToolInputSchema(ClickInputSchema),
      annotations: {
        readOnlyHint: false,
        destructiveHint: true,
      },
    },
Behavior4/5

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

The annotations indicate destructiveHint=true and readOnlyHint=false, which the description aligns with by describing a click action. The description adds valuable behavioral context beyond annotations: it specifies what not to do (narrate observations/calculations) and what's acceptable (brief progress updates), providing important usage constraints that aren't captured in the structured annotations.

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 perfectly concise with two sentences that each serve distinct purposes: the first explains the tool's capabilities, the second provides critical behavioral guidance. There's zero wasted language, and the most important information (what the tool does) is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive action tool with comprehensive schema coverage but no output schema, the description provides good context about the action and behavioral constraints. It could be more complete by mentioning potential side effects or error conditions, but given the annotations cover the destructive nature and the schema documents parameters thoroughly, this is reasonably complete.

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?

With 100% schema description coverage, the input schema already provides comprehensive parameter documentation. The description mentions the parameter capabilities ('Supports left/right/middle button, single/double/triple click, and modifier keys') but doesn't add significant semantic meaning beyond what's already in the schema descriptions. This meets the baseline for high schema coverage.

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

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Click at the specified screen coordinates' with specific capabilities like button selection, click count, and modifier keys. It distinguishes from siblings like 'move_mouse', 'drag', or 'press_key' by focusing specifically on clicking actions at coordinates.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool (clicking at coordinates with various options) and includes explicit behavioral guidance: 'Do not narrate visual observations or coordinate calculations. Brief task progress updates are acceptable.' However, it doesn't explicitly state when NOT to use it or name specific alternative tools for related actions.

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/antbotlab/mac-use-mcp'

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