Skip to main content
Glama

adb_click

Simulate screen taps at specified coordinates on Android devices to automate interactions for testing or remote control.

Instructions

Click at specific coordinates on the device screen

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX coordinate
yYesY coordinate
deviceIdNoDevice ID (optional)

Implementation Reference

  • Executes the adb_click tool logic using ADB shell 'input tap' command with validation for coordinates and device connection.
    async click(options: ClickOptions) {
      try {
        const { x, y, deviceId, duration = 100 } = options;
        
        if (x < 0 || y < 0) {
          return {
            success: false,
            error: 'Invalid coordinates',
            message: 'Coordinates must be positive numbers'
          };
        }
    
        const connected = await this.adbClient.isDeviceConnected(deviceId);
        if (!connected) {
          return {
            success: false,
            error: 'Device not connected',
            message: 'Cannot perform click - device is not connected'
          };
        }
    
        const command = `shell input tap ${x} ${y}`;
        const result = await this.adbClient.executeCommand(command, deviceId);
        
        if (!result.success) {
          return {
            success: false,
            error: result.error,
            message: 'Failed to perform click'
          };
        }
    
        return {
          success: true,
          data: { x, y, deviceId: deviceId || this.adbClient.getDefaultDevice() },
          message: `Clicked at coordinates (${x}, ${y})`
        };
      } catch (error: any) {
        return {
          success: false,
          error: error.message,
          message: 'Failed to perform click'
        };
      }
    }
  • MCP tool registration including name, description, and input schema for adb_click.
    {
      name: 'adb_click',
      description: 'Click at specific coordinates on the device screen',
      inputSchema: {
        type: 'object',
        properties: {
          x: {
            type: 'number',
            description: 'X coordinate',
          },
          y: {
            type: 'number',
            description: 'Y coordinate',
          },
          deviceId: {
            type: 'string',
            description: 'Device ID (optional)',
          },
        },
        required: ['x', 'y'],
      },
    },
  • src/index.ts:443-444 (registration)
    Switch case in CallToolRequest handler that routes adb_click calls to ScreenTools.click method.
    case 'adb_click':
      return await this.handleToolCall(this.screenTools.click(args as any));
  • TypeScript interface defining the options for the click operation, matching the tool's input schema.
    export interface ClickOptions {
      deviceId?: string;
      x: number;
      y: number;
      duration?: number;
    }
  • Instantiation of ScreenTools class, providing AdbClient dependency for tool execution.
    this.screenTools = new ScreenTools(this.adbClient);
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 doesn't mention important details like whether this requires device interaction permissions, if it's synchronous/asynchronous, potential side effects (e.g., triggering unintended UI elements), or error conditions. For a tool that performs device interaction, this is a significant gap.

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 that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to understand at a glance.

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 device interaction tool with no annotations and no output schema, the description is insufficient. It doesn't cover behavioral aspects like permissions, side effects, or return values, leaving significant gaps for an AI agent to understand how to use it correctly in context with sibling tools.

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 all three parameters (x, y, deviceId) adequately. The description doesn't add any additional meaning beyond what the schema provides, such as coordinate system details (e.g., pixel-based, relative to screen resolution) or deviceId usage context. Baseline 3 is appropriate when schema does the heavy lifting.

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 ('click') and target ('at specific coordinates on the device screen'), which distinguishes it from sibling tools like adb_swipe or adb_input_text. However, it doesn't explicitly differentiate from adb_press_key or other input methods, keeping it at 4 rather than 5.

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 like adb_swipe or adb_input_text, nor does it mention prerequisites such as needing an active device connection. It's a basic statement of function without contextual usage advice.

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/richard0913/adb-mcp'

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