Skip to main content
Glama
andreahaku

Expo iOS Development MCP Server

by andreahaku

simulator.screenshot

Capture screenshots from iOS Simulator during React Native/Expo development to document app states, debug UI issues, and create visual records.

Instructions

Take a screenshot of the booted simulator

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoName prefix for the screenshot file.screenshot

Implementation Reference

  • Core handler function that takes a screenshot of the booted simulator using simctl, handles errors, manages artifacts, and updates state.
    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.tool registration for 'simulator.screenshot', providing description, input schema, and thin wrapper handler calling takeScreenshot.
    server.tool(
      "simulator.screenshot",
      "Take a screenshot of the booted simulator",
      SimulatorScreenshotInputSchema.shape,
      async (args) => {
        try {
          const result = await takeScreenshot(args.name);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({ success: true, ...result }, null, 2),
              },
            ],
          };
        } catch (error) {
          return handleToolError(error);
        }
      }
    );
  • Zod input schema defining optional 'name' parameter with default 'screenshot'.
    export const SimulatorScreenshotInputSchema = z.object({
      name: z.string().optional().default("screenshot").describe("Name prefix for the screenshot file."),
    });
  • Helper usage of takeScreenshot in the toolExecutor switch for flow.run tool.
    case "simulator.screenshot":
      const screenshot = await takeScreenshot(input.name as string | undefined);
      return { success: true, result: screenshot };
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 states what the tool does but doesn't describe important behavioral aspects: where the screenshot is saved, what format it's in, whether it requires specific simulator states, or what happens if the simulator isn't booted. For a tool with no annotation coverage, this leaves significant behavioral gaps.

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 extremely concise - a single sentence that directly states the tool's purpose with zero wasted words. It's appropriately sized for a simple screenshot tool and front-loads the essential information.

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

Completeness3/5

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

Given the tool's simplicity (1 parameter, no output schema, no annotations), the description is minimally adequate but has clear gaps. It doesn't explain where screenshots are saved, what happens if the simulator isn't booted, or how this differs from 'ui.screenshot'. For a tool with no output schema and no annotations, more contextual information would be helpful.

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 input schema has 100% description coverage, with the single parameter 'name' clearly documented as 'Name prefix for the screenshot file.' The description doesn't add any parameter information beyond what the schema provides, which is acceptable given the high schema coverage. The baseline of 3 is appropriate when the schema does the heavy lifting.

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 ('Take a screenshot') and target ('of the booted simulator'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from 'ui.screenshot' in the sibling list, which appears to be a similar screenshot tool but for UI elements rather than the simulator itself.

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 minimal guidance - it implies the simulator must be booted (from 'booted simulator'), but doesn't explicitly state prerequisites or when to use this vs. alternatives like 'ui.screenshot'. No explicit when/when-not guidance or alternative recommendations are provided.

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