Skip to main content
Glama

adb_list_devices

List all connected Android devices to identify available targets for debugging, automation, or management tasks.

Instructions

List all connected Android devices

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for 'adb_list_devices' tool. Calls AdbClient.getDevices() and formats the response with success status and message.
    async listDevices() {
      try {
        const devices = await this.adbClient.getDevices();
        return {
          success: true,
          data: devices,
          message: `Found ${devices.length} device(s)`
        };
      } catch (error: any) {
        return {
          success: false,
          error: error.message,
          message: 'Failed to list devices'
        };
      }
    }
  • Core helper function that executes 'adb devices -l' command, parses the output, and returns structured list of AdbDevice objects.
    async getDevices(): Promise<AdbDevice[]> {
      const result = await this.executeCommand('devices -l');
      
      if (!result.success) {
        throw new Error(`Failed to get devices: ${result.error}`);
      }
    
      const devices: AdbDevice[] = [];
      const lines = result.output.split('\n').slice(1); // Skip header line
      
      for (const line of lines) {
        if (line.trim()) {
          const parts = line.split(/\s+/);
          if (parts.length >= 2) {
            const device: AdbDevice = {
              id: parts[0],
              status: parts[1] as AdbDevice['status']
            };
            
            // Parse additional info if available
            for (let i = 2; i < parts.length; i++) {
              const [key, value] = parts[i].split(':');
              if (key === 'model') device.model = value;
              if (key === 'product') device.product = value;
              if (key === 'transport') device.transport = value;
            }
            
            devices.push(device);
          }
        }
      }
    
      return devices;
    }
  • Tool schema definition including name, description, and empty input schema (no parameters required).
    {
      name: 'adb_list_devices',
      description: 'List all connected Android devices',
      inputSchema: {
        type: 'object',
        properties: {},
        required: [],
      },
    },
  • src/index.ts:433-434 (registration)
    Registration in the tool call switch statement that dispatches execution to the handler.
    case 'adb_list_devices':
      return await this.handleToolCall(this.deviceTools.listDevices());
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action but fails to disclose behavioral traits such as output format (e.g., list of device IDs), whether it includes emulators, error handling for no devices, or dependencies like ADB server status. This leaves critical operational context unspecified.

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 with zero wasted words. It is front-loaded with the core purpose and appropriately sized for a simple tool with no parameters.

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 low complexity (0 params, no annotations, no output schema), the description is incomplete. It lacks details on output format, error conditions, or dependencies, which are essential for an agent to use it correctly. The simplicity doesn't excuse missing basic behavioral context.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the absence of inputs. The description adds no parameter information, which is appropriate here. Baseline is 4 for zero parameters, as no compensation is needed.

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 specific action ('List') and target resource ('all connected Android devices'), distinguishing it from siblings like adb_get_device_info (which retrieves detailed info for a specific device) or adb_list_apps (which lists apps on a device). It precisely defines the tool's scope without ambiguity.

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

Usage Guidelines3/5

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

The description implies usage when needing to enumerate connected devices, but provides no explicit guidance on when to use this versus alternatives like adb_get_device_info or adb_set_default_device. It lacks any mention of prerequisites (e.g., ADB setup) or exclusions (e.g., not for listing emulators).

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