Skip to main content
Glama
andreahaku

Expo iOS Development MCP Server

by andreahaku

simulator.list_devices

Retrieve available iOS simulator devices and their current operational states for development and testing purposes.

Instructions

List all available iOS simulator devices and their states

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function `listDevices()` that runs `simctl list devices --json`, parses the JSON, structures devices and runtimes, and returns ListDevicesResult.
    export async function listDevices(): Promise<ListDevicesResult> {
      logger.info("simulator", "Listing available simulator devices");
    
      const result = await simctl(["list", "devices", "--json"]);
    
      if (result.exitCode !== 0) {
        const { code, message } = parseSimctlError(result.stderr);
        throw createError(code, message, { details: result.stderr });
      }
    
      try {
        const data = JSON.parse(result.stdout);
        const devices: SimulatorDevice[] = [];
        const runtimes: SimulatorRuntime[] = [];
    
        // Parse runtimes
        if (data.runtimes) {
          for (const runtime of data.runtimes) {
            runtimes.push({
              identifier: runtime.identifier,
              name: runtime.name,
              version: runtime.version,
            });
          }
        }
    
        // Parse devices grouped by runtime
        for (const [runtimeId, deviceList] of Object.entries(data.devices)) {
          const runtimeName = runtimeId.replace("com.apple.CoreSimulator.SimRuntime.", "");
    
          for (const device of deviceList as Array<Record<string, unknown>>) {
            devices.push({
              udid: device.udid as string,
              name: device.name as string,
              state: device.state as SimulatorDevice["state"],
              runtime: runtimeName,
              isAvailable: device.isAvailable as boolean,
            });
          }
        }
    
        logger.info("simulator", `Found ${devices.length} devices across ${runtimes.length} runtimes`);
    
        return { devices, runtimes };
      } catch (error) {
        throw createError("SIMCTL_FAILED", "Failed to parse device list", {
          details: error instanceof Error ? error.message : "Unknown error",
        });
      }
    }
  • Registers the MCP tool "simulator.list_devices" with empty input schema, handler that calls `listDevices()` and returns JSON stringified result.
    server.tool(
      "simulator.list_devices",
      "List all available iOS simulator devices and their states",
      {},
      async () => {
        try {
          const result = await listDevices();
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(result, null, 2),
              },
            ],
          };
        } catch (error) {
          return handleToolError(error);
        }
      }
    );
  • TypeScript interfaces defining the structure of SimulatorDevice, SimulatorRuntime, and ListDevicesResult used for type safety in the handler's input/output.
    export interface SimulatorDevice {
      udid: string;
      name: string;
      state: "Shutdown" | "Booted" | "Booting" | "ShuttingDown";
      runtime: string;
      isAvailable: boolean;
    }
    
    export interface SimulatorRuntime {
      identifier: string;
      name: string;
      version: string;
    }
    
    export interface ListDevicesResult {
      devices: SimulatorDevice[];
      runtimes: SimulatorRuntime[];
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it indicates this is a read operation (listing), it doesn't describe what 'states' means, whether the list includes offline/online devices, if there are permission requirements, or how results are formatted. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 communicates the core purpose without any wasted words. It's appropriately sized for a simple enumeration tool and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (no parameters, no output schema, no annotations), the description provides adequate basic information about what the tool does. However, without annotations or output schema, it should ideally provide more behavioral context about what 'states' includes and the format of returned data to be fully complete.

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 zero parameters with 100% schema description coverage, so the schema already fully documents the empty parameter set. The description appropriately doesn't add parameter information beyond what the schema provides, which is correct for a parameterless tool. Baseline for 0 parameters is 4.

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 verb ('List') and resource ('all available iOS simulator devices and their states'), making the purpose immediately understandable. It distinguishes this tool from siblings like simulator.boot or simulator.shutdown by focusing on enumeration rather than device control operations.

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 context (when you need to see available devices and their states) but doesn't explicitly state when to use this versus alternatives. No guidance is provided about prerequisites, timing considerations, or comparisons with other device-related tools in the sibling list.

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/andreahaku/expo_ios_development_mcp'

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