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

XC-MCP: XCode CLI wrapper

by conorluddy

Simulator Screenshot/Video Capture

simctl-io

Captures screenshots or records video from iOS simulators, resizing images to tile-aligned dimensions for token efficiency and naming files semantically so AI agents can track UI state.

Instructions

simctl-io

Capture screenshots or record videos from iOS simulators with automatic optimization.

What it does

Captures simulator screen as optimized PNG images or records video with configurable codecs. Screenshots are automatically resized to tile-aligned dimensions for token efficiency and support semantic naming for AI agent reasoning.

Parameters

  • display (optional): simctl display identifier from simctl-duo state or simctl io enumerate. Inactive displays may capture black. Explicit display captures omit unverified coordinate transforms.

  • udid (string, optional): Simulator UDID (auto-detects booted device if omitted)

  • operation (string, required): "screenshot" or "video"

  • outputPath (string, optional): Custom file path (auto-generated if omitted)

  • codec (string, optional): Video codec - h264, hevc, or prores (default: h264)

  • size (string, optional): Screenshot size - half, full, quarter, thumb (default: half)

  • appName (string, optional): App name for semantic naming

  • screenName (string, optional): Screen/view name for semantic naming

  • state (string, optional): UI state for semantic naming

Screenshot Size Optimization

Screenshots are automatically optimized for token efficiency:

  • half (default): 256×512 pixels, 1 tile, 170 tokens (50% savings)

  • full: Native resolution, 2 tiles, 340 tokens

  • quarter: 128×256 pixels, 1 tile, 170 tokens

  • thumb: 128×128 pixels, 1 tile, 170 tokens

Semantic Naming (LLM Optimization)

Provide appName, screenName, and state to generate semantic filenames:

  • Format: {appName}_{screenName}_{state}_{date}.png

  • Example: MyApp_LoginScreen_Empty_2025-01-23.png

  • Enables AI agents to reason about screen context and track state progression

Returns

JSON response with:

  • File path and size information

  • Screenshot optimization metadata (dimensions, token count, savings)

  • Coordinate transform for mapping resized coordinates to device

  • Semantic metadata when provided

  • Guidance for viewing and using the capture

Examples

Capture optimized screenshot (default 256×512)

await simctlIoTool({
  udid: 'device-123',
  operation: 'screenshot'
})

Capture full-size screenshot

await simctlIoTool({
  udid: 'device-123',
  operation: 'screenshot',
  size: 'full'
})

Capture with semantic naming

await simctlIoTool({
  udid: 'device-123',
  operation: 'screenshot',
  appName: 'MyApp',
  screenName: 'LoginScreen',
  state: 'Empty'
})

Record video with custom codec

await simctlIoTool({
  udid: 'device-123',
  operation: 'video',
  codec: 'hevc'
})

Common Use Cases

  1. UI testing: Capture screenshots for visual regression testing

  2. Bug reporting: Record videos demonstrating issues

  3. Documentation: Create screenshots for app documentation

  4. State tracking: Use semantic naming to track UI state progression

  5. Token optimization: Use half/quarter sizes for LLM-based analysis

Coordinate Transform

When screenshots are resized (size ≠ 'full'), a coordinate transform is provided:

  • scaleX: Multiply screenshot X coordinates by this to get device coordinates

  • scaleY: Multiply screenshot Y coordinates by this to get device coordinates

  • guidance: Human-readable scaling instructions

This enables accurate element tapping even with optimized screenshots.

Important Notes

  • Auto-detection: If udid is omitted, automatically uses the booted device

  • Temp files: Screenshots saved to /tmp unless custom path specified

  • Video recording: Press Ctrl+C to stop video recording

  • Simulator must be booted: Operations require running simulator

  • File permissions: Ensure output path is writable

Error Handling

  • Simulator not booted: Indicates simulator must be booted first

  • Simulator not found: Validates simulator exists in cache

  • File path errors: Reports if output path is not writable

  • Invalid operation: Validates operation is "screenshot" or "video"

Next Steps After Capture

  1. View screenshot: open "<file-path>"

  2. Copy to clipboard: pbcopy < "<file-path>"

  3. Analyze with LLM: Use optimized size for token-efficient analysis

  4. Use coordinates: Apply transform to map screenshot coords to device

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": {
      "udid": "<udid>",
      "operation": "<operation>"
    },
    "name": "simctl-io"
  }
}

Input Schema

NameRequiredDescriptionDefault
sizeNo
udidYes
codecNo
stateNo
appNameNo
displayNo
operationYes
outputPathNo
screenNameNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv5.2.0
    • addedInput schema / properties / display
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
  2. Addedv1.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations are minimal and generic (readOnlyHint=false, destructiveHint=false), so the description carries real weight here and delivers: it discloses that files are written to /tmp by default, that video recording is stopped with Ctrl+C, that the simulator must be booted, and that it auto-detects the booted device. It even documents error cases and the returned coordinate transform. It loses a point for not warning that a custom outputPath may overwrite an existing file, which matters given destructiveHint=false.

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

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Headers and front-loading are strong, and the parameter block is scannable. But the document runs long and repeats itself: the size-optimization table, the semantic-naming section, the Common Use Cases list, and the Next Steps After Capture section overlap in what they convey, and the first `display` bullet is cryptically worded and oddly separated from the rest.

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 nine-parameter tool with no output schema, the definition is unusually complete: returns are described in bullet form, side effects and preconditions are covered, and examples span the main modes. The remaining gap is the required-vs-optional conflict on udid, which leaves the agent unsure about a parameter the schema marks mandatory.

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?

Schema coverage is 0%, so the description must compensate, and it largely does: all nine parameters are explained, including enum values for codec (h264/hevc/prores), size tiers with exact pixel dimensions, and the purpose of the semantic-naming trio. The deduction is for a real inconsistency, labeling udid as optional and describing auto-detection while the schema lists it as required, which will confuse an agent deciding whether to supply it.

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 states a specific verb and resource set: it captures simulator screenshots as optimized PNGs or records video with selectable codecs. That is far more concrete than the title alone. It stops short of 5 because it never distinguishes itself from the sibling `screenshot` tool, which an agent would reasonably consider an alternative for the same task.

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?

There is an implicit 'when' via the Common Use Cases list (UI testing, bug reporting, documentation, state tracking, token optimization), which is more than nothing. However, there are no explicit when-not conditions and no named alternative for the overlapping screenshot workflow, so the agent must infer selection.

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