Skip to main content
Glama

list_sims

Retrieve iOS simulator details and UUIDs to identify available testing environments for development workflows.

Instructions

Lists available iOS simulators with their UUIDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
enabledYes

Implementation Reference

  • Handler function that executes 'xcrun simctl list devices available --json', parses and formats available iOS simulators list with UUIDs, states, and suggests next steps.
    async (): Promise<ToolResponse> => {
      log('info', 'Starting xcrun simctl list devices request');
    
      try {
        const command = ['xcrun', 'simctl', 'list', 'devices', 'available', '--json'];
        const result = await executeCommand(command, 'List Simulators');
    
        if (!result.success) {
          return {
            content: [
              {
                type: 'text',
                text: `Failed to list simulators: ${result.error}`,
              },
            ],
          };
        }
    
        try {
          const simulatorsData = JSON.parse(result.output);
          let responseText = 'Available iOS Simulators:\n\n';
    
          for (const runtime in simulatorsData.devices) {
            const devices = simulatorsData.devices[runtime];
    
            if (devices.length === 0) continue;
    
            responseText += `${runtime}:\n`;
    
            for (const device of devices) {
              if (device.isAvailable) {
                responseText += `- ${device.name} (${device.udid})${device.state === 'Booted' ? ' [Booted]' : ''}\n`;
              }
            }
    
            responseText += '\n';
          }
    
          responseText += 'Next Steps:\n';
          responseText += "1. Boot a simulator: boot_sim({ simulatorUuid: 'UUID_FROM_ABOVE' })\n";
          responseText += '2. Open the simulator UI: open_sim({ enabled: true })\n';
          responseText +=
            "3. Build for simulator: build_ios_sim_id_proj({ scheme: 'YOUR_SCHEME', simulatorId: 'UUID_FROM_ABOVE' })\n"; // Example using project variant
          responseText +=
            "4. Get app path: get_sim_app_path_id_proj({ scheme: 'YOUR_SCHEME', platform: 'iOS Simulator', simulatorId: 'UUID_FROM_ABOVE' })"; // Example using project variant
    
          return {
            content: [
              {
                type: 'text',
                text: responseText,
              },
            ],
          };
        } catch {
          return {
            content: [
              {
                type: 'text',
                text: result.output,
              },
            ],
          };
        }
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        log('error', `Error listing simulators: ${errorMessage}`);
        return {
          content: [
            {
              type: 'text',
              text: `Failed to list simulators: ${errorMessage}`,
            },
          ],
        };
      }
    },
  • Zod input schema for the tool: optional 'enabled' boolean.
    {
      enabled: z.boolean(),
    },
  • Registration function that calls server.tool('list_sims') to register the tool with schema and inline handler.
    export function registerListSimulatorsTool(server: McpServer): void {
      server.tool(
        'list_sims',
        'Lists available iOS simulators with their UUIDs. ',
        {
          enabled: z.boolean(),
        },
        async (): Promise<ToolResponse> => {
          log('info', 'Starting xcrun simctl list devices request');
    
          try {
            const command = ['xcrun', 'simctl', 'list', 'devices', 'available', '--json'];
            const result = await executeCommand(command, 'List Simulators');
    
            if (!result.success) {
              return {
                content: [
                  {
                    type: 'text',
                    text: `Failed to list simulators: ${result.error}`,
                  },
                ],
              };
            }
    
            try {
              const simulatorsData = JSON.parse(result.output);
              let responseText = 'Available iOS Simulators:\n\n';
    
              for (const runtime in simulatorsData.devices) {
                const devices = simulatorsData.devices[runtime];
    
                if (devices.length === 0) continue;
    
                responseText += `${runtime}:\n`;
    
                for (const device of devices) {
                  if (device.isAvailable) {
                    responseText += `- ${device.name} (${device.udid})${device.state === 'Booted' ? ' [Booted]' : ''}\n`;
                  }
                }
    
                responseText += '\n';
              }
    
              responseText += 'Next Steps:\n';
              responseText += "1. Boot a simulator: boot_sim({ simulatorUuid: 'UUID_FROM_ABOVE' })\n";
              responseText += '2. Open the simulator UI: open_sim({ enabled: true })\n';
              responseText +=
                "3. Build for simulator: build_ios_sim_id_proj({ scheme: 'YOUR_SCHEME', simulatorId: 'UUID_FROM_ABOVE' })\n"; // Example using project variant
              responseText +=
                "4. Get app path: get_sim_app_path_id_proj({ scheme: 'YOUR_SCHEME', platform: 'iOS Simulator', simulatorId: 'UUID_FROM_ABOVE' })"; // Example using project variant
    
              return {
                content: [
                  {
                    type: 'text',
                    text: responseText,
                  },
                ],
              };
            } catch {
              return {
                content: [
                  {
                    type: 'text',
                    text: result.output,
                  },
                ],
              };
            }
          } catch (error) {
            const errorMessage = error instanceof Error ? error.message : String(error);
            log('error', `Error listing simulators: ${errorMessage}`);
            return {
              content: [
                {
                  type: 'text',
                  text: `Failed to list simulators: ${errorMessage}`,
                },
              ],
            };
          }
        },
      );
    }
  • Tool registration entry in the toolRegistrations array that conditionally registers registerListSimulatorsTool based on env var.
    {
      register: registerListSimulatorsTool,
      groups: [ToolGroup.SIMULATOR_MANAGEMENT, ToolGroup.PROJECT_DISCOVERY],
      envVar: 'XCODEBUILDMCP_TOOL_LIST_SIMULATORS',
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the output includes UUIDs but doesn't specify format (e.g., list, JSON), pagination, or error handling. For a read operation with no annotations, this leaves gaps in understanding how the tool behaves beyond basic listing.

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 front-loads the core purpose without unnecessary details. Every word contributes to understanding the tool's function, making it appropriately sized and well-structured for quick comprehension.

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 low complexity (one parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic action and output but lacks details on usage context, parameter meaning, and behavioral traits, leaving room for improvement in guiding the agent effectively.

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

Parameters3/5

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

The schema has 0% description coverage, but the description doesn't explain the single parameter 'enabled'. It implies filtering by availability but doesn't clarify what 'enabled' means (e.g., active simulators vs. installed ones). Since schema coverage is low, the description adds minimal value beyond the schema, meeting the baseline for partial compensation.

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 tool's purpose with a specific verb ('Lists') and resource ('available iOS simulators with their UUIDs'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'open_sim' or 'boot_sim', which might have overlapping functionality.

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, such as needing simulators to be installed or running, or compare it to sibling tools like 'discover_projs' that might list related resources, leaving the agent without context for selection.

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/SampsonKY/XcodeBuildMCP'

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