Skip to main content
Glama
conorluddy

XC-MCP: XCode CLI wrapper

by conorluddy

simctl-get-details

Retrieve filtered simulator details from cached simctl-list data by specifying cache ID, detail type, device, runtime, or max devices. Optimizes Xcode CLI usage within MCP limits.

Instructions

Get detailed simulator information from cached simctl-list results with progressive disclosure

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cacheIdYesCache ID from previous simctl-list call
detailTypeYesType of details to retrieve
deviceTypeNoFilter by device type (iPhone, iPad, etc.)
maxDevicesNoMaximum number of devices to return
runtimeNoFilter by runtime version

Implementation Reference

  • Primary handler function that processes arguments, validates cache, parses simulator data, dispatches to formatters based on detailType, and returns formatted JSON response.
    export async function simctlGetDetailsTool(args: any) {
      const {
        cacheId,
        detailType,
        deviceType,
        runtime,
        maxDevices = 20,
      } = args as SimctlGetDetailsArgs;
    
      try {
        const cached = responseCache.get(cacheId);
        if (!cached) {
          throw new McpError(
            ErrorCode.InvalidParams,
            `Cache ID '${cacheId}' not found or expired. Use recent simctl-list result.`
          );
        }
    
        if (cached.tool !== 'simctl-list') {
          throw new McpError(
            ErrorCode.InvalidParams,
            `Cache ID '${cacheId}' is not from simctl-list tool.`
          );
        }
    
        const fullList: CachedSimulatorList = JSON.parse(cached.fullOutput);
    
        let responseData: any;
    
        switch (detailType) {
          case 'full-list':
            responseData = formatFullList(fullList, { deviceType, runtime, maxDevices });
            break;
          case 'devices-only':
            responseData = formatDevicesOnly(fullList, { deviceType, runtime, maxDevices });
            break;
          case 'runtimes-only':
            responseData = formatRuntimesOnly(fullList);
            break;
          case 'available-only':
            responseData = formatAvailableOnly(fullList, { deviceType, runtime, maxDevices });
            break;
          default:
            throw new McpError(ErrorCode.InvalidParams, `Unknown detailType: ${detailType}`);
        }
    
        return {
          content: [
            {
              type: 'text' as const,
              text: JSON.stringify(responseData, null, 2),
            },
          ],
        };
      } catch (error) {
        if (error instanceof McpError) {
          throw error;
        }
        throw new McpError(
          ErrorCode.InternalError,
          `simctl-get-details failed: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    }
  • Registers the 'simctl-get-details' tool with the MCP server in registerSimctlTools function, including schema, description, and error-handling wrapper around the handler.
    server.registerTool(
      'simctl-get-details',
      {
        description: getDescription(SIMCTL_GET_DETAILS_DOCS, SIMCTL_GET_DETAILS_DOCS_MINI),
        inputSchema: {
          cacheId: z.string(),
          detailType: z.enum(['full-list', 'devices-only', 'runtimes-only', 'available-only']),
          deviceType: z.string().optional(),
          runtime: z.string().optional(),
          maxDevices: z.number().default(20),
        },
        ...DEFER_LOADING_CONFIG,
      },
      async args => {
        try {
          await validateXcodeInstallation();
          return await simctlGetDetailsTool(args);
        } catch (error) {
          if (error instanceof McpError) throw error;
          throw new McpError(
            ErrorCode.InternalError,
            `Tool execution failed: ${error instanceof Error ? error.message : String(error)}`
          );
        }
      }
    );
  • Zod input schema defining validation for tool parameters: required cacheId and detailType, optional filters.
    inputSchema: {
      cacheId: z.string(),
      detailType: z.enum(['full-list', 'devices-only', 'runtimes-only', 'available-only']),
      deviceType: z.string().optional(),
      runtime: z.string().optional(),
      maxDevices: z.number().default(20),
    },
    ...DEFER_LOADING_CONFIG,
  • TypeScript interface for tool input arguments used in type casting within handler.
    interface SimctlGetDetailsArgs {
      cacheId: string;
      detailType: 'full-list' | 'devices-only' | 'runtimes-only' | 'available-only';
      deviceType?: string;
      runtime?: string;
      maxDevices?: number;
    }
  • Core helper function that applies deviceType and runtime filters to the full simulator list data.
    function applyFilters(
      fullList: CachedSimulatorList,
      filters: { deviceType?: string; runtime?: string; maxDevices?: number }
    ): CachedSimulatorList {
      const filtered: CachedSimulatorList = {
        devices: {},
        runtimes: fullList.runtimes,
        devicetypes: fullList.devicetypes,
        lastUpdated: fullList.lastUpdated,
        preferredByProject: fullList.preferredByProject,
      };
    
      // Filter device types if specified
      if (filters.deviceType) {
        filtered.devicetypes = fullList.devicetypes.filter(dt =>
          dt.name.toLowerCase().includes(filters.deviceType!.toLowerCase())
        );
      }
    
      // Filter runtimes if specified
      if (filters.runtime) {
        filtered.runtimes = fullList.runtimes.filter(
          rt =>
            rt.name.toLowerCase().includes(filters.runtime!.toLowerCase()) ||
            rt.version.includes(filters.runtime!)
        );
      }
    
      // Filter devices
      for (const [runtimeKey, devices] of Object.entries(fullList.devices)) {
        // Skip runtime if it doesn't match filter
        if (filters.runtime && !runtimeKey.toLowerCase().includes(filters.runtime.toLowerCase())) {
          continue;
        }
    
        const filteredDevices = devices.filter(device => {
          // Filter by device type
          if (
            filters.deviceType &&
            !device.name.toLowerCase().includes(filters.deviceType.toLowerCase())
          ) {
            return false;
          }
    
          return true;
        });
    
        if (filteredDevices.length > 0) {
          filtered.devices[runtimeKey] = filteredDevices;
        }
      }
    
      return filtered;
    }
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. It mentions 'progressive disclosure' which hints at some behavioral trait (possibly pagination or incremental loading), but doesn't explain what this means operationally. It doesn't disclose performance characteristics, error conditions, what happens with invalid cacheId, or the format/scope of returned details. For a tool with 5 parameters and no annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/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. 'progressive disclosure' could be considered slightly jargon-heavy, but overall the description is appropriately sized without wasted words. Every element serves a purpose: verb, resource, source, and behavioral hint.

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 5 parameters, no annotations, and no output schema, the description provides basic purpose but lacks sufficient context for confident tool selection and invocation. It doesn't explain what 'detailed simulator information' includes, how results differ from simctl-list, what 'progressive disclosure' means practically, or error handling. For a tool with moderate complexity and no structured safety/behavior annotations, this is minimally adequate but has clear gaps.

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?

Schema description coverage is 100%, so all parameters are documented in the schema itself. The description adds no specific parameter semantics beyond the general context of operating on cached results. It doesn't explain relationships between parameters (e.g., how deviceType and runtime interact) or provide examples. With complete schema coverage, baseline 3 is appropriate.

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 'Get' and resource 'detailed simulator information', specifying it operates on 'cached simctl-list results with progressive disclosure'. This distinguishes it from simctl-list (which presumably creates the cache) and other simulator tools like simctl-boot/shutdown. However, it doesn't explicitly differentiate from xcodebuild-get-details or other get-details tools in the sibling list.

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 ('from cached simctl-list results'), suggesting this tool should be used after simctl-list has been called to create a cache. However, it doesn't provide explicit when-to-use vs. when-not-to-use guidance, nor does it mention alternatives like calling simctl-list directly for fresh data or using other filtering approaches.

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

Related 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/conorluddy/xc-mcp'

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