Skip to main content
Glama

android_list_emulators

List available Android emulators to manage virtual devices for development and testing.

Instructions

List available Android emulators

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for 'android_list_emulators' tool. Executes 'emulator -list-avds' to list available AVDs, parses the output, checks which are running using the global runningEmulators map, and returns structured data with emulator list, counts, and status.
    handler: async () => {
      const result = await processExecutor.execute('emulator', ['-list-avds']);
    
      if (result.exitCode !== 0) {
        throw new Error(`Emulator listing failed: ${result.stderr}`);
      }
    
      const emulators = result.stdout
        .split('\n')
        .map(line => line.trim())
        .filter(line => line.length > 0)
        .map(name => ({
          name,
          isRunning: runningEmulators.has(name),
          pid: runningEmulators.get(name) || null,
        }));
    
      return {
        success: true,
        data: {
          emulators,
          totalCount: emulators.length,
          runningCount: emulators.filter(e => e.isRunning).length,
        },
      };
    }
  • Registration of the 'android_list_emulators' tool within the createAndroidTools factory function. Defines name, description, empty inputSchema (no parameters required), and attaches the handler.
    tools.set('android_list_emulators', {
      name: 'android_list_emulators',
      description: 'List available Android emulators',
      inputSchema: {
        type: 'object',
        properties: {},
        required: []
      },
      handler: async () => {
        const result = await processExecutor.execute('emulator', ['-list-avds']);
    
        if (result.exitCode !== 0) {
          throw new Error(`Emulator listing failed: ${result.stderr}`);
        }
    
        const emulators = result.stdout
          .split('\n')
          .map(line => line.trim())
          .filter(line => line.length > 0)
          .map(name => ({
            name,
            isRunning: runningEmulators.has(name),
            pid: runningEmulators.get(name) || null,
          }));
    
        return {
          success: true,
          data: {
            emulators,
            totalCount: emulators.length,
            runningCount: emulators.filter(e => e.isRunning).length,
          },
        };
      }
    });
  • Global runningEmulators map used by the handler to determine if an emulator is running and its PID. Initialized and used within createAndroidTools.
     * Maps AVD names to process IDs.
     *
     * @type {Map<string, number>}
     */
    let runningEmulators: Map<string, number>;
  • Metadata registration in TOOL_REGISTRY for categorization, requirements (requires 'emulator' tool), performance expectations, and testing safety.
    'android_list_emulators': {
      name: 'android_list_emulators',
      category: ToolCategory.ESSENTIAL,
      platform: 'android',
      requiredTools: [RequiredTool.EMULATOR],
      description: 'List available Android emulators',
      safeForTesting: true,
      performance: { expectedDuration: 1000, timeout: 15000 }
    },
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 what the tool does but lacks behavioral details: it doesn't specify output format (e.g., list of names, statuses), whether it requires specific permissions or setup, if it's read-only (implied but not stated), or any rate limits. The description is minimal and doesn't add meaningful context beyond the basic action.

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 no wasted words. It's front-loaded with the core action ('List available Android emulators') and doesn't include unnecessary details. Every word earns its place, making it highly concise and well-structured for such a simple tool.

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 has no parameters and no output schema, the description is minimal but incomplete. It doesn't explain what 'available' means (e.g., installed, running), the return format, or any dependencies. For a tool in a context with many siblings (like Android/Flutter development), more detail would help the agent understand its role and output, but it lacks this contextual richness.

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, and schema description coverage is 100% (since there are no parameters to describe). The description doesn't need to add parameter information, so it meets the baseline of 4 for having no parameters. No additional semantics are required or provided.

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 ('Android emulators') with the qualifier 'available' indicating current status. It distinguishes from sibling tools like android_list_devices (which lists physical devices) and android_start_emulator (which starts one), though not explicitly. However, it doesn't fully differentiate from all siblings like flutter_list_devices which might overlap in concept.

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. It doesn't mention prerequisites (e.g., needing Android SDK setup), when it's appropriate (e.g., before starting an emulator), or contrast with siblings like android_list_devices or flutter_list_devices. Usage is implied by the name but not explicitly stated.

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/cristianoaredes/mcp-mobile-server'

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