Skip to main content
Glama
infiniV

Android UI Assist MCP Server

list_android_devices

Identify connected Android devices and emulators to enable UI analysis and testing workflows. This tool provides device listing for screenshot capture and management.

Instructions

List all connected Android devices and emulators

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/server.ts:50-54 (registration)
    Registration of the 'list_android_devices' tool in the ListToolsRequestHandler, including name, description, and input schema reference.
    {
      name: 'list_android_devices',
      description: 'List all connected Android devices and emulators',
      inputSchema: ListDevicesToolSchema,
    },
  • Tool dispatch handler for 'list_android_devices': parses input, calls listDevices method, and formats response as JSON text.
    case 'list_android_devices': {
      const input = ListDevicesInputSchema.parse(args);
      const result = await this.listDevices(input);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result),
          },
        ],
      };
    }
  • Private listDevices method: fetches devices using getConnectedDevices helper, maps fields, and validates output schema.
    private async listDevices(
      input: z.infer<typeof ListDevicesInputSchema>
    ): Promise<z.infer<typeof ListDevicesOutputSchema>> {
      const devices = getConnectedDevices();
    
      const result = {
        devices: devices.map(device => ({
          id: device.id,
          status: device.status,
          model: device.model,
          product: device.product,
          transportId: device.transportId,
          usb: device.usb,
          productString: device.productString,
        })),
      };
    
      return ListDevicesOutputSchema.parse(result);
    }
  • Output schema for list_android_devices tool defining the structure of the devices array.
    export const ListDevicesOutputSchema = z.object({
      devices: z
        .array(
          z.object({
            id: z.string().describe('Device ID'),
            status: z.string().describe('Device status'),
            model: z.string().optional().describe('Device model'),
            product: z.string().optional().describe('Product name'),
            transportId: z.string().optional().describe('Transport ID'),
            usb: z.string().optional().describe('USB information'),
            productString: z.string().optional().describe('Product string'),
          })
        )
        .describe('List of connected Android devices'),
    });
  • Core helper function getConnectedDevices: executes 'adb devices -l', parses output, handles errors.
    export function getConnectedDevices(): AndroidDevice[] {
      try {
        const output = executeADBCommand('devices -l');
        const devices = parseDeviceList(output);
    
        if (devices.length === 0) {
          throw new NoDevicesFoundError();
        }
    
        return devices;
      } catch (error) {
        if (error instanceof NoDevicesFoundError) {
          throw error;
        }
        throw new ADBCommandError('FAILED_TO_LIST_DEVICES', 'Failed to list connected devices', {
          originalError: error instanceof Error ? error.message : String(error),
        });
      }
    }
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 for behavioral disclosure. It mentions listing devices but doesn't describe what 'connected' means, whether this includes offline devices, how results are formatted, or any rate limits or permissions required. This leaves significant gaps in understanding the tool's behavior.

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 function without any fluff. It is front-loaded with the core action and resource, making it easy to parse and understand immediately.

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 lack of annotations and output schema, the description is incomplete for a tool that likely returns a list of devices. It doesn't explain the return format, what data is included for each device, or any error conditions, leaving the agent with insufficient context for proper use.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, and since there are none, it meets the baseline of 4 for not adding unnecessary information.

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 verb ('List') and resource ('all connected Android devices and emulators'), making the purpose immediately understandable. It doesn't differentiate from its sibling tool 'take_android_screenshot' which performs a different action, but the purpose is specific enough for this tool alone.

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 or any contextual prerequisites. It simply states what the tool does without indicating scenarios for its application or exclusions, leaving the agent to infer usage from the tool name 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/infiniV/Android-Ui-MCP'

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