Skip to main content
Glama

build_sim_id_proj

Build an app from a project file for a specific simulator by UUID using projectPath, scheme, and simulatorId. Supports build configuration, derived data path, and additional xcodebuild arguments.

Instructions

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

Input Schema

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

Implementation Reference

  • The core logic function (build_simLogic) that processes parameters and calls the simulator build handler. This executes the tool's main functionality using simulatorId or simulatorName with project/workspace path.
    export async function build_simLogic(
      params: BuildSimulatorParams,
      executor: CommandExecutor,
    ): Promise<ToolResponse> {
      // Provide defaults
      const processedParams: BuildSimulatorParams = {
        ...params,
        configuration: params.configuration ?? 'Debug',
        useLatestOS: params.useLatestOS ?? true, // May be ignored if simulatorId is provided
        preferXcodebuild: params.preferXcodebuild ?? false,
      };
    
      return _handleSimulatorBuildLogic(processedParams, executor);
    }
  • Zod schema (buildSimulatorSchema) defining input parameters including projectPath/workspacePath and simulatorId/simulatorName (mutually exclusive pairs), with refinements for validation.
    const buildSimulatorSchema = baseSchema
      .refine((val) => val.projectPath !== undefined || val.workspacePath !== undefined, {
        message: 'Either projectPath or workspacePath is required.',
      })
      .refine((val) => !(val.projectPath !== undefined && val.workspacePath !== undefined), {
        message: 'projectPath and workspacePath are mutually exclusive. Provide only one.',
      })
      .refine((val) => val.simulatorId !== undefined || val.simulatorName !== undefined, {
        message: 'Either simulatorId or simulatorName is required.',
      })
      .refine((val) => !(val.simulatorId !== undefined && val.simulatorName !== undefined), {
        message: 'simulatorId and simulatorName are mutually exclusive. Provide only one.',
      });
  • Tool registration exporting the 'build_sim' tool with name, description, schema, and session-aware handler.
    export default {
      name: 'build_sim',
      description: 'Builds an app for an iOS simulator.',
      schema: publicSchemaObject.shape, // MCP SDK compatibility (public inputs only)
      handler: createSessionAwareTool<BuildSimulatorParams>({
        internalSchema: buildSimulatorSchema as unknown as z.ZodType<BuildSimulatorParams>,
        logicFunction: build_simLogic,
        getExecutor: getDefaultCommandExecutor,
        requirements: [
          { allOf: ['scheme'], message: 'scheme is required' },
          { oneOf: ['projectPath', 'workspacePath'], message: 'Provide a project or workspace' },
          { oneOf: ['simulatorId', 'simulatorName'], message: 'Provide simulatorId or simulatorName' },
        ],
        exclusivePairs: [
          ['projectPath', 'workspacePath'],
          ['simulatorId', 'simulatorName'],
        ],
      }),
    };
  • Internal helper function that performs the actual xcodebuild execution for simulator build, handling simulatorId/project paths.
    async function _handleSimulatorBuildLogic(
      params: BuildSimulatorParams,
      executor: CommandExecutor = getDefaultCommandExecutor(),
    ): Promise<ToolResponse> {
      const projectType = params.projectPath ? 'project' : 'workspace';
      const filePath = params.projectPath ?? params.workspacePath;
    
      // Log warning if useLatestOS is provided with simulatorId
      if (params.simulatorId && params.useLatestOS !== undefined) {
        log(
          'warning',
          `useLatestOS parameter is ignored when using simulatorId (UUID implies exact device/OS)`,
        );
      }
    
      log(
        'info',
        `Starting iOS Simulator build for scheme ${params.scheme} from ${projectType}: ${filePath}`,
      );
    
      // Ensure configuration has a default value for SharedBuildParams compatibility
      const sharedBuildParams = {
        ...params,
        configuration: params.configuration ?? 'Debug',
      };
    
      // executeXcodeBuildCommand handles both simulatorId and simulatorName
      return executeXcodeBuildCommand(
        sharedBuildParams,
        {
          platform: XcodePlatform.iOSSimulator,
          simulatorName: params.simulatorName,
          simulatorId: params.simulatorId,
          useLatestOS: params.simulatorId ? false : params.useLatestOS, // Ignore useLatestOS with ID
          logPrefix: 'iOS Simulator Build',
        },
        params.preferXcodebuild ?? false,
        'build',
        executor,
      );
    }
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. It states the tool 'Builds an app' but doesn't disclose behavioral traits such as whether this is a read-only or destructive operation, what happens on failure, if it requires specific permissions, or any rate limits. The example adds some context but doesn't cover these critical aspects, making it insufficient for a mutation tool with zero annotation coverage.

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 another providing an example. It's front-loaded with key information and avoids unnecessary details, though the example could be slightly more concise by not repeating the tool name. Overall, it's efficient with little 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 (a build tool with 9 parameters, no annotations, and no output schema), the description is incomplete. It covers the basic purpose and required parameters but lacks crucial behavioral context (e.g., what the build does, error handling, output format) and doesn't leverage the rich schema to explain parameter nuances. For a tool of this nature, more guidance is needed to help the agent use it 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 description coverage is 100%, meaning all parameters are well-documented in the input schema itself. The description adds minimal value by listing the three required parameters in the text and providing an example, but it doesn't explain parameter interactions, defaults, or semantics beyond what the schema already provides. This meets the baseline of 3 for high schema coverage.

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 action ('Builds an app') and the resource ('from a project file for a specific simulator by UUID'), which is specific and actionable. However, it doesn't explicitly differentiate from sibling tools like 'build_sim_name_proj' or 'build_dev_proj', which might target different simulators or devices, leaving some ambiguity about when to choose this specific variant.

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 specifying required parameters (projectPath, scheme, simulatorId) and providing an example, which gives some context for when to use it. However, it lacks explicit guidance on when to choose this tool over alternatives like 'build_sim_name_proj' (which uses simulator name instead of UUID) or 'build_run_sim_id_proj' (which might also run the app), leaving the agent to infer based on parameter names and sibling tool names.

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

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