Skip to main content
Glama

build_ios_sim_id_proj

Builds an iOS app from a project file for a specific simulator by UUID. Requires project path, scheme, and simulator ID to compile and run tests on designated iOS simulators.

Instructions

Builds an iOS app from a project file for a specific simulator by UUID. IMPORTANT: Requires projectPath, scheme, and simulatorId. Example: build_ios_sim_id_proj({ projectPath: '/path/to/MyProject.xcodeproj', scheme: 'MyScheme', simulatorId: 'SIMULATOR_UUID' })

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesPath to the .xcodeproj file (Required)
schemeYesThe scheme to use (Required)
simulatorIdYesUUID of the simulator to use (obtained from listSimulators) (Required)
configurationNoBuild configuration (Debug, Release, etc.)
derivedDataPathNoPath where build products and other derived data will go
extraArgsNoAdditional xcodebuild arguments
useLatestOSNoWhether to use the latest OS version for the named simulator
preferXcodebuildNoIf true, prefers xcodebuild over the experimental incremental build system, useful for when incremental build system fails.

Implementation Reference

  • Core internal handler that executes the xcodebuild build command for iOS simulator targeting, shared across similar tools.
    async function _handleIOSSimulatorBuildLogic(params: {
      workspacePath?: string;
      projectPath?: string;
      scheme: string;
      configuration: string;
      simulatorName?: string;
      simulatorId?: string;
      useLatestOS: boolean;
      derivedDataPath?: string;
      extraArgs?: string[];
      preferXcodebuild?: boolean;
    }): Promise<ToolResponse> {
      log('info', `Starting iOS Simulator build for scheme ${params.scheme} (internal)`);
    
      return executeXcodeBuildCommand(
        {
          ...params,
        },
        {
          platform: XcodePlatform.iOSSimulator,
          simulatorName: params.simulatorName,
          simulatorId: params.simulatorId,
          useLatestOS: params.useLatestOS,
          logPrefix: 'iOS Simulator Build',
        },
        params.preferXcodebuild,
        'build',
      );
    }
  • Registers the 'build_ios_sim_id_proj' tool with name, description, input schema, validation, and delegation to core handler.
    export function registerIOSSimulatorBuildByIdProjectTool(server: McpServer): void {
      type Params = {
        projectPath: string;
        scheme: string;
        simulatorId: string;
        configuration?: string;
        derivedDataPath?: string;
        extraArgs?: string[];
        useLatestOS?: boolean;
        preferXcodebuild?: boolean;
      };
    
      registerTool<Params>(
        server,
        'build_ios_sim_id_proj',
        "Builds an iOS app from a project file for a specific simulator by UUID. IMPORTANT: Requires projectPath, scheme, and simulatorId. Example: build_ios_sim_id_proj({ projectPath: '/path/to/MyProject.xcodeproj', scheme: 'MyScheme', simulatorId: 'SIMULATOR_UUID' })",
        {
          projectPath: projectPathSchema,
          scheme: schemeSchema,
          simulatorId: simulatorIdSchema,
          configuration: configurationSchema,
          derivedDataPath: derivedDataPathSchema,
          extraArgs: extraArgsSchema,
          useLatestOS: useLatestOSSchema,
          preferXcodebuild: preferXcodebuildSchema,
        },
        async (params: Params) => {
          // Validate required parameters
          const projectValidation = validateRequiredParam('projectPath', params.projectPath);
          if (!projectValidation.isValid) return projectValidation.errorResponse!;
    
          const schemeValidation = validateRequiredParam('scheme', params.scheme);
          if (!schemeValidation.isValid) return schemeValidation.errorResponse!;
    
          const simulatorIdValidation = validateRequiredParam('simulatorId', params.simulatorId);
          if (!simulatorIdValidation.isValid) return simulatorIdValidation.errorResponse!;
    
          // Provide defaults
          return _handleIOSSimulatorBuildLogic({
            ...params,
            configuration: params.configuration ?? 'Debug',
            useLatestOS: params.useLatestOS ?? true, // May be ignored by xcodebuild
            preferXcodebuild: params.preferXcodebuild ?? false,
          });
        },
      );
    }
  • Zod schemas for common parameters used in the tool's input schema, including projectPath, scheme, simulatorId, etc.
    export const workspacePathSchema = z.string().describe('Path to the .xcworkspace file (Required)');
    export const projectPathSchema = z.string().describe('Path to the .xcodeproj file (Required)');
    export const schemeSchema = z.string().describe('The scheme to use (Required)');
    export const configurationSchema = z
      .string()
      .optional()
      .describe('Build configuration (Debug, Release, etc.)');
    export const derivedDataPathSchema = z
      .string()
      .optional()
      .describe('Path where build products and other derived data will go');
    export const extraArgsSchema = z
      .array(z.string())
      .optional()
      .describe('Additional xcodebuild arguments');
    export const simulatorNameSchema = z
      .string()
      .describe("Name of the simulator to use (e.g., 'iPhone 16') (Required)");
    export const simulatorIdSchema = z
      .string()
      .describe('UUID of the simulator to use (obtained from listSimulators) (Required)');
    export const useLatestOSSchema = z
      .boolean()
      .optional()
      .describe('Whether to use the latest OS version for the named simulator');
    export const appPathSchema = z
      .string()
      .describe('Path to the .app bundle (full path to the .app directory)');
    export const bundleIdSchema = z
      .string()
      .describe("Bundle identifier of the app (e.g., 'com.example.MyApp')");
    export const launchArgsSchema = z
      .array(z.string())
      .optional()
      .describe('Additional arguments to pass to the app');
    export const preferXcodebuildSchema = z
      .boolean()
      .optional()
      .describe(
        'If true, prefers xcodebuild over the experimental incremental build system, useful for when incremental build system fails.',
      );
  • Central registration entry that invokes registerIOSSimulatorBuildByIdProjectTool during server initialization if enabled.
    {
      register: registerIOSSimulatorBuildByIdProjectTool,
      groups: [ToolGroup.IOS_SIMULATOR_WORKFLOW],
      envVar: 'XCODEBUILDMCP_TOOL_IOS_SIMULATOR_BUILD_BY_ID_PROJECT',
    },
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 states the action ('Builds an iOS app') and required parameters, but doesn't describe what the build does (e.g., compiles code, generates artifacts), potential side effects (e.g., modifies files, requires Xcode installation), error conditions, or output format. For a build tool with zero annotation coverage, this is a significant gap in transparency.

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 appropriately sized with two sentences: one stating the purpose and requirements, and one providing an example. It's front-loaded with key information and avoids unnecessary details, though the example could be slightly more concise (e.g., by omitting the function call syntax). Overall, it's efficient with minimal waste.

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 complexity of a build tool with 8 parameters, no annotations, and no output schema, the description is incomplete. It lacks information on what the build process entails, success/failure indicators, output artifacts, dependencies (e.g., Xcode), or error handling. Without annotations or output schema, the description should provide more context to guide effective use.

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 the schema already documents all 8 parameters thoroughly. The description adds minimal value by naming the three required parameters in text and providing an example that shows their usage, but doesn't explain parameter meanings beyond what the schema provides. This meets the baseline of 3 when schema coverage is high.

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 'Builds an iOS app from a project file for a specific simulator by UUID,' which specifies the verb (builds), resource (iOS app), and target (simulator by UUID). However, it doesn't explicitly differentiate from siblings like 'build_ios_sim_name_proj' (which uses simulator name instead of UUID) or 'build_ios_dev_proj' (which builds for a device), leaving some ambiguity in sibling differentiation.

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 by stating 'Requires projectPath, scheme, and simulatorId' and providing an example, which suggests when to use it (for building with a specific simulator UUID). However, it doesn't explicitly mention when not to use it or name alternatives like 'build_ios_sim_name_proj' for simulator name-based builds, leaving usage context partially implied rather than fully explicit.

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