Skip to main content
Glama
andreahaku

Expo iOS Development MCP Server

by andreahaku

ui.screenshot

Capture iOS Simulator screenshots to document UI states during React Native/Expo development, using simctl for reliable image capture.

Instructions

Take a screenshot of the current UI state (via simctl)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoName prefix for the screenshot file.screenshot

Implementation Reference

  • Core handler function that captures screenshot using simctl on the booted simulator, handles errors, manages state and artifacts, returns path and timestamp.
    export async function takeScreenshot(name: string = "screenshot"): Promise<ScreenshotResult> {
      logger.info("simulator", `Taking screenshot: ${name}`);
    
      // Check if simulator is booted
      if (!stateManager.isSimulatorReady()) {
        const bootedDevice = await getBootedDevice();
        if (!bootedDevice) {
          throw createError("SIM_NOT_BOOTED", "No simulator is currently booted", {
            details: "Boot a simulator first using simulator.boot",
          });
        }
        stateManager.updateSimulator({
          state: "booted",
          udid: bootedDevice.udid,
          deviceName: bootedDevice.name,
        });
      }
    
      const screenshotPath = await artifactManager.getScreenshotPath(name);
    
      // Use 'booted' to target the currently booted simulator
      const result = await simctl(["io", "booted", "screenshot", screenshotPath], {
        timeoutMs: 30000,
      });
    
      if (result.exitCode !== 0) {
        throw createError("SIMCTL_FAILED", "Failed to take screenshot", {
          details: result.stderr,
          evidence: [logger.formatForEvidence("simulator", 50)],
        });
      }
    
      const timestamp = new Date().toISOString();
    
      artifactManager.registerArtifact({
        type: "screenshot",
        path: screenshotPath,
        metadata: { name, captureMethod: "simctl" },
      });
    
      logger.info("simulator", `Screenshot saved to ${screenshotPath}`);
    
      return {
        path: screenshotPath,
        timestamp,
      };
    }
  • MCP server registration of the 'ui.screenshot' tool, including thin wrapper handler that calls takeScreenshot.
    server.tool(
      "ui.screenshot",
      "Take a screenshot of the current UI state (via simctl)",
      SimulatorScreenshotInputSchema.shape,
      async (args) => {
        try {
          const result = await takeScreenshot(args.name ?? "ui-screenshot");
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({ success: true, ...result }, null, 2),
              },
            ],
          };
        } catch (error) {
          return handleToolError(error);
        }
      }
    );
  • Zod input schema for screenshot tools: optional 'name' parameter with default 'screenshot'.
    export const SimulatorScreenshotInputSchema = z.object({
      name: z.string().optional().default("screenshot").describe("Name prefix for the screenshot file."),
    });
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the action ('Take a screenshot') but doesn't describe what happens after capture (e.g., where files are saved, format, permissions needed, or error conditions). For a tool that presumably creates files, this lack of behavioral context is a significant gap.

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?

The description is a single, efficient sentence that communicates the core purpose without unnecessary words. It's front-loaded with the main action and includes implementation detail only where relevant. Every word earns its place in this compact formulation.

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 tool's complexity (file creation with no output schema) and absence of annotations, the description is insufficient. It doesn't explain what the tool returns, where screenshots are saved, what format they're in, or error handling. For a tool that presumably produces output files, this leaves critical gaps for agent understanding.

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 has 100% description coverage for its single parameter, so the baseline is 3. The description adds no additional parameter information beyond what's in the schema (which already explains 'name' is a file prefix with default 'screenshot'). No syntax, format, or constraint details are provided in the description.

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 description clearly states the specific action ('Take a screenshot') and target resource ('current UI state'), with additional implementation detail ('via simctl') that distinguishes it from sibling tools like 'simulator.screenshot'. It uses a precise verb-noun structure that leaves no ambiguity about the tool's function.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'simulator.screenshot' or other UI interaction tools. It doesn't mention prerequisites (e.g., requires a running simulator), appropriate contexts, or limitations. The agent must infer usage from the tool name and context alone.

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/andreahaku/expo_ios_development_mcp'

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