Skip to main content
Glama

list_devices

Retrieve a list of all connected Android devices with their current status and model details for device management and automation.

Instructions

List all connected Android devices with their status and model information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core implementation of device listing, which executes 'adb devices -l'.
    /**
     * List all connected devices.
     */
    async listDevices(): Promise<DeviceInfo[]> {
      const result = await adbExec(['devices', '-l']);
      const lines = result.stdout.split('\n').filter(l => l.trim() && !l.startsWith('List'));
    
      const devices: DeviceInfo[] = [];
      for (const line of lines) {
        const parts = line.trim().split(/\s+/);
        if (parts.length >= 2) {
          const id = parts[0];
          const status = parts[1];
    
          // Parse device properties from -l output
          const props: Record<string, string> = {};
          for (const part of parts.slice(2)) {
            const [key, value] = part.split(':');
            if (key && value) props[key] = value;
          }
    
          devices.push({
            id,
            status,
            model: props['model'],
          });
        }
      }
    
      return devices;
    }
  • Registration of the 'list_devices' tool in the MCP server.
    export function registerDeviceTools(server: McpServer): void {
      server.registerTool(
        'list_devices',
        {
          description: 'List all connected Android devices with their status and model information',
          inputSchema: {},
        },
        async () => {
          return await metrics.measure('list_devices', 'all', async () => {
            const devices = await deviceManager.listDevices();
            return {
              content: [{
                type: 'text' as const,
                text: JSON.stringify({ success: true, devices }, null, 2),
              }],
            };
          });
        }
      );
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses return content ('status and model information') but omits safety profile, error behavior (e.g., empty list vs error when no devices), performance characteristics, or prerequisites like ADB connection requirements.

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?

Single sentence with zero waste. Every clause earns its place: action ('List'), scope ('all connected'), resource ('Android devices'), and return value ('status and model information'). Front-loaded with the action verb.

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?

Given low complexity (no inputs) and lack of output schema, the description adequately covers the tool's purpose and hints at return content. It could be improved by explicitly stating it returns a collection/array format, but is sufficiently complete for a discovery tool.

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?

Tool has zero parameters and schema coverage is 100% (of empty schema). Per rubric, zero parameters establishes baseline of 4. No parameter semantic description is needed or expected.

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?

Description provides specific verb ('List'), clear resource ('connected Android devices'), and scope ('all'). The phrase 'all connected' effectively distinguishes this from sibling tools like get_device_info or get_device_state which likely operate on single devices.

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 through the scope 'all connected' (suggesting enumeration/discovery use case), but provides no explicit when-to-use guidance or named alternatives. It doesn't state when to prefer this over single-device query tools.

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/divineDev-dotcom/android_mcp'

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