Skip to main content
Glama

get_booted_sim_id

Read-only

Identify the booted iOS simulator by retrieving its ID, enabling targeted control and automation.

Instructions

Get the ID of the currently booted iOS simulator

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for 'get_booted_sim_id'. Calls getBootedDevice() and returns the booted simulator's name and UUID.
    async () => {
      try {
        const { id, name } = await getBootedDevice();
    
        return {
          isError: false,
          content: [
            {
              type: "text",
              text: `Booted Simulator: "${name}". UUID: "${id}"`,
            },
          ],
        };
      } catch (error) {
        return {
          isError: true,
          content: [
            {
              type: "text",
              text: errorWithTroubleshooting(
                `Error: ${toError(error).message}`
              ),
            },
          ],
        };
      }
    }
  • src/index.ts:211-243 (registration)
    Registration of the 'get_booted_sim_id' tool on the MCP server, with conditional filtering and the tool's name and description.
    if (!isToolFiltered("get_booted_sim_id")) {
      server.tool(
        "get_booted_sim_id",
        "Get the ID of the currently booted iOS simulator",
        { title: "Get Booted Simulator ID", readOnlyHint: true, openWorldHint: true },
        async () => {
          try {
            const { id, name } = await getBootedDevice();
    
            return {
              isError: false,
              content: [
                {
                  type: "text",
                  text: `Booted Simulator: "${name}". UUID: "${id}"`,
                },
              ],
            };
          } catch (error) {
            return {
              isError: true,
              content: [
                {
                  type: "text",
                  text: errorWithTroubleshooting(
                    `Error: ${toError(error).message}`
                  ),
                },
              ],
            };
          }
        }
      );
  • getBootedDevice() helper function that runs 'xcrun simctl list devices' and parses the output to find the booted simulator's UUID and name.
    async function getBootedDevice() {
      const { stdout, stderr } = await run("xcrun", ["simctl", "list", "devices"]);
    
      if (stderr) throw new Error(stderr);
    
      // Parse the output to find booted device
      const lines = stdout.split("\n");
      for (const line of lines) {
        if (line.includes("Booted")) {
          // Extract the UUID - it's inside parentheses
          const match = line.match(/\(([-0-9A-F]+)\)/);
          if (match) {
            const deviceId = match[1];
            const deviceName = line.split("(")[0].trim();
            return {
              name: deviceName,
              id: deviceId,
            };
          }
        }
      }
    
      throw Error("No booted simulator found");
    }
  • getBootedDeviceId() helper that resolves a device ID; if none provided, calls getBootedDevice() to get the booted simulator.
    async function getBootedDeviceId(
      deviceId: string | undefined
    ): Promise<string> {
      // If deviceId not provided, get the currently booted simulator
      let actualDeviceId = deviceId;
      if (!actualDeviceId) {
        const { id } = await getBootedDevice();
        actualDeviceId = id;
      }
      if (!actualDeviceId) {
        throw new Error("No booted simulator found and no deviceId provided");
      }
      return actualDeviceId;
    }
  • Schema/input definition for the tool: no user-input parameters, only metadata fields title, readOnlyHint, openWorldHint.
    { title: "Get Booted Simulator ID", readOnlyHint: true, openWorldHint: true },
Behavior3/5

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

Annotations already provide readOnlyHint: true and openWorldHint: true. The description adds no behavioral context beyond stating the purpose. It does not mention what happens if no simulator is booted or any error conditions.

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 sentence with no wasted words. It front-loads the key information efficiently.

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?

Given the simplicity (no parameters, no output schema, no nested objects), the description is complete enough for the tool's purpose. It tells the agent what the tool does without requiring additional context.

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?

There are no parameters (schema coverage 100% trivially). The description does not need to explain parameters, and the baseline for 0 parameters is 4.

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 verb 'Get' and the specific resource 'ID of the currently booted iOS simulator'. It distinguishes itself from sibling tools like install_app, launch_app, and UI tools which perform different actions.

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?

The description implies usage when the simulator ID is needed, but does not provide explicit guidance on when to use or not use this tool, nor does it mention alternatives. With no parameters and a clear purpose, the implied usage is adequate.

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/joshuayoes/ios-simulator-mcp'

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