Skip to main content
Glama
andreahaku

Expo iOS Development MCP Server

by andreahaku

simulator.shutdown

Shut down an iOS simulator device to free system resources or prepare for development environment changes. Specify a device name or UDID, or use the currently booted device.

Instructions

Shut down an iOS simulator device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceNoDevice name or UDID. If not specified, shuts down the booted device.

Implementation Reference

  • Core handler function shutdownDevice that locates the simulator device, checks its state, calls simctl to shutdown, handles errors, and updates the global state manager.
    export async function shutdownDevice(nameOrUdid: string): Promise<void> {
      logger.info("simulator", `Shutting down simulator: ${nameOrUdid}`);
    
      const device = await findDevice(nameOrUdid);
    
      if (!device) {
        throw createError("SIM_NOT_FOUND", `Simulator not found: ${nameOrUdid}`, {
          details: "Use simulator.list_devices to see available simulators",
        });
      }
    
      if (device.state === "Shutdown") {
        logger.info("simulator", `Device ${device.name} is already shut down`);
        stateManager.updateSimulator({ state: "shutdown" });
        return;
      }
    
      const result = await simctl(["shutdown", device.udid]);
    
      if (result.exitCode !== 0) {
        const { code, message } = parseSimctlError(result.stderr);
        throw createError(code, message, { details: result.stderr });
      }
    
      stateManager.updateSimulator({ state: "shutdown", udid: undefined, deviceName: undefined });
      logger.info("simulator", `Device ${device.name} shut down successfully`);
    }
  • Zod schema defining the input for simulator.shutdown tool: optional 'device' string parameter.
    export const SimulatorShutdownInputSchema = z.object({
      device: z.string().optional().describe("Device name or UDID. If not specified, shuts down the booted device."),
    });
  • MCP server.tool registration for 'simulator.shutdown', providing description, input schema, and async handler wrapper that determines device (from args, state, or booted), calls shutdownDevice, and formats MCP response.
    server.tool(
      "simulator.shutdown",
      "Shut down an iOS simulator device",
      SimulatorShutdownInputSchema.shape,
      async (args) => {
        try {
          const device = args.device ?? stateManager.getSimulator().udid;
          if (!device) {
            const booted = await getBootedDevice();
            if (!booted) {
              return {
                content: [{ type: "text", text: JSON.stringify({ success: true, message: "No simulator is running" }) }],
              };
            }
            await shutdownDevice(booted.udid);
          } else {
            await shutdownDevice(device);
          }
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({ success: true, state: stateManager.getSimulator() }, null, 2),
              },
            ],
          };
        } catch (error) {
          return handleToolError(error);
        }
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Shut down') but doesn't clarify what this entails—whether it's a graceful shutdown, immediate termination, reversible, or has side effects (e.g., losing state). For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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, direct sentence with zero wasted words. It's front-loaded with the core action and resource, making it highly efficient and easy to parse. Every word earns its place.

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 (a mutation with potential side effects), lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral details, error conditions, or what happens post-shutdown (e.g., device state). For a tool that alters system state, more context is needed for safe and effective use.

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%, with the parameter 'device' fully documented in the schema (including default behavior if unspecified). The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline for high coverage without adding value.

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 ('Shut down') and target resource ('an iOS simulator device'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'simulator.erase' (which might also stop a device) or 'detox.session.stop' (which might involve simulator shutdown), so it doesn't reach the highest score.

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. It doesn't mention prerequisites (e.g., whether the device must be booted first), exclusions, or relationships to siblings like 'simulator.boot' or 'simulator.erase'. The agent must infer usage from 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