Skip to main content
Glama

Build and archive with Xcode

build_and_archive
Destructive

Build and archive an Xcode project into a signed .ipa using a scheme and ExportOptions.plist, with optional pre-build command for generated projects.

Instructions

Build, archive, and export a signed .ipa via xcodebuild (requires Xcode on this Mac). Needs a scheme and an ExportOptions.plist. Projects generated by xcodegen or tuist must be generated first: pass pre_build_command. Returns the .ipa this export produced. Pro feature.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project_path": "<project_path>",
      "scheme": "<scheme>",
      "export_options_plist": "<export_options_plist>"
    },
    "name": "build_and_archive"
  }
}

Input Schema

NameRequiredDescriptionDefault
schemeYesXcode scheme to build
workspaceNoSet true if project_path is a .xcworkspace
output_dirNoOutput directory (default ./build). Each export goes into its own export-<timestamp> folder inside it.
project_pathYesPath to .xcodeproj or .xcworkspace
configurationNoBuild configuration (default Release)
pre_build_commandNoCommand to run first in the project's folder, as an argument array without a shell, e.g. ["xcodegen","generate"] or ["tuist","generate","--no-open"]. Required for generated projects.
export_options_plistYesPath to ExportOptions.plist (method app-store-connect)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.12.1
    • changedInput schema / properties / output_dir / description
      Previous value: -"Output directory (default ./build)"New value: +"Output directory (default ./build). Each export goes into its own export-<timestamp> folder inside it."
    • addedInput schema / properties / pre_build_command
      Added value: +{
      +  "description": "Command to run first in the project's folder, as an argument array without a shell, e.g. [\"xcodegen\",\"generate\"] or [\"tuist\",\"generate\",\"--no-open\"]. Required for generated projects.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already flag readOnlyHint=false and destructiveHint=true, so the safety profile is known. The description adds genuinely useful context beyond that: host dependency on Xcode, entitlement gating ("Pro feature"), the returned artifact, and the pre-generation requirement for xcodegen/tuist projects. It omits build duration expectations and failure/partial-output behavior, which matter for a long destructive operation.

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?

Four compact sentences with the core action first, then prerequisites, then the returned artifact and gating. No filler; every sentence carries an operational fact.

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

Completeness4/5

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

For a 7-parameter destructive build tool with no output schema, the description covers requirements, environment, and the return value sufficiently to invoke it correctly. Remaining gaps are build duration and what happens to prior exports or on failure, though the schema notes per-timestamp folders.

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%, including the timestamped export subfolder behavior and the argument-array format for pre_build_command, so the schema carries the detail. The description only restates that a scheme and ExportOptions.plist are required and that pre_build_command is mandatory for generated projects, adding little beyond the schema.

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?

Names specific verbs and a concrete artifact: build, archive, and export a signed .ipa via xcodebuild. No sibling tool in the list performs Xcode builds or exports, so the resource is unambiguous and the agent can route to it directly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives real preconditions: Xcode must be installed on this Mac, a scheme and ExportOptions.plist are needed, and generated projects (xcodegen/tuist) must run pre_build_command first. It stops short of stating when NOT to use it or naming an alternative path, but the usage context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.