Skip to main content
Glama
XC-MCP: XCode CLI wrapper

XC-MCP: XCode CLI wrapper

by conorluddy

Inspect App Sandbox Container

simctl-container
Read-onlyIdempotent

Inspect an iOS simulator app's data container: list files, read plist or text contents, inspect UserDefaults, and locate Core Data stores without handling raw CoreSimulator paths.

Instructions

simctl-container

App sandbox inspector — list files, read file contents, inspect UserDefaults, and locate Core Data stores inside an iOS simulator app's data container.

What it does

Resolves the app data container via xcrun simctl get_app_container, then performs semantic file operations within that sandbox without needing to know the raw CoreSimulator path.

Parameters

  • bundleId (string, required): App bundle identifier (e.g. com.example.MyApp)

  • mode (string, required): Operation — ls | cat | userdefaults | coredata-path

  • udid (string, optional): Simulator UDID. Defaults to booted device.

  • path (string, optional): Sub-path for ls (subdir) or file path for cat

  • depth (number, optional): Recursion depth for ls (default: 3)

Modes

ls

Lists files in the container (or a sub-path) up to depth levels deep. Returns entries with path, kind (file/dir/symlink), and sizeBytes. Path traversal outside the container root is rejected.

cat

Reads a file at path (relative to container root).

  • Attempts plist decode first (binary and XML plists via plutil)

  • Falls back to UTF-8 text, then binary detection

  • Returns contentType: plist | text | binary

  • Files > 8 KB (text/plist) are stored in responseCache; returns cacheId + resourceLink

export

Copies the data container to destination/BUNDLE_ID. Requires destination; refuses to overwrite an existing export.

userdefaults

Reads Library/Preferences/<bundleId>.plist and returns decoded key/value pairs. Handles both binary and XML plist formats via plutil.

coredata-path

Searches Library/Application Support/ and Documents/ recursively for .sqlite, .sqlite-wal, and .sqlite-shm files. Returns { path, absolutePath, sizeBytes, type } for each store found.

Returns

JSON response with { mode, bundleId, success, ... } plus mode-specific fields and guidance.

Examples

List container root

await simctlContainerTool({ bundleId: 'com.example.MyApp', mode: 'ls' })

List a sub-directory

await simctlContainerTool({ bundleId: 'com.example.MyApp', mode: 'ls', path: 'Library/Caches' })

Read a JSON config file

await simctlContainerTool({ bundleId: 'com.example.MyApp', mode: 'cat', path: 'Documents/config.json' })

Inspect UserDefaults

await simctlContainerTool({ bundleId: 'com.example.MyApp', mode: 'userdefaults' })

Find Core Data stores

await simctlContainerTool({ bundleId: 'com.example.MyApp', mode: 'coredata-path' })

Error Handling

  • bundleId required: Rejects empty or missing bundleId

  • mode required: Rejects unknown or missing mode

  • path required for cat: Rejects cat without a path

  • container not found: InternalError with install suggestion

  • path escapes container: InvalidRequest with clear message

  • plist unreadable: InternalError with path context

Notes

  • Keychain is explicitly out of scope

  • Binary plist decoding uses plutil -convert json (macOS built-in)

  • Large text/plist files (> 8 KB) are cached; retrieve via cacheId using the cache tool

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": {
      "bundleId": "<bundleId>",
      "mode": "<mode>"
    },
    "name": "simctl-container"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeYes
pathNo
udidNo
depthNo
bundleIdYes
destinationNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv5.0.0
    • addedInput schema / properties / destination
      Added value: +{
      +  "type": "string"
      +}
    • changedInput schema / properties / mode / enum
      Previous value: -[
      -  "ls",
      -  "cat",
      -  "userdefaults",
      -  "coredata-path"
      -]New value: +[
      +  "ls",
      +  "cat",
      +  "userdefaults",
      +  "coredata-path",
      +  "export"
      +]
  2. Addedv4.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond readOnlyHint/idempotentHint, the description discloses path-traversal rejection, plist-first decode order with text/binary fallback, the 8 KB threshold that diverts output to responseCache with a cacheId, and export's refusal to overwrite. It also enumerates concrete error cases with their error types, which is exactly the behavioral detail annotations cannot carry.

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?

Long, but front-loaded with a one-line purpose, then Parameters, per-mode behavior, returns, examples, and errors — appropriate structure for a five-mode tool. Some sections (five usage examples, restated error list) could be trimmed without losing information.

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

Completeness5/5

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

No output schema exists, yet the description explains the response envelope `{ mode, bundleId, success, ... }`, per-mode return fields, the cache fallback, and error semantics. For a multi-mode tool with six parameters, nothing an agent needs to invoke it correctly appears to be missing.

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

Parameters4/5

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

With 0% schema coverage the description must carry all meaning, and it documents bundleId, mode, udid, path, and depth with types and defaults, plus destination inside the export section. The one defect is that the Parameters list enumerates only four modes (`ls | cat | userdefaults | coredata-path`) while the schema enum and a later section include `export`, a small internal inconsistency.

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?

The opening line names a specific verb and resource: "App sandbox inspector — list files, read file contents, inspect UserDefaults, and locate Core Data stores inside an iOS simulator app's data container." It also states how it relates to the sibling simctl-get-app-container by resolving the container internally so the caller never needs the raw CoreSimulator path.

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?

Each of the five modes is documented with a clear use case (list, read, export, defaults, Core Data), and the Notes rule out Keychain as out of scope. It stops short of explicitly naming alternatives such as simctl-get-app-container for callers who only want the raw path, so it is strong context without formal when-not-to-use guidance.

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