Skip to main content
Glama

set_sim_appearance

Change the visual theme of an iOS simulator by switching between dark and light appearance modes using the simulator's UUID.

Instructions

Sets the appearance mode (dark/light) of an iOS simulator.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
simulatorUuidYesUUID of the simulator to use (obtained from list_simulators)
modeYesThe appearance mode to set (either "dark" or "light")

Implementation Reference

  • Registers the 'set_sim_appearance' tool with the MCP server, defining its description, input schema, and handler function.
    export function registerSetSimulatorAppearanceTool(server: McpServer): void {
      server.tool(
        'set_sim_appearance',
        'Sets the appearance mode (dark/light) of an iOS simulator.',
        {
          simulatorUuid: z
            .string()
            .describe('UUID of the simulator to use (obtained from list_simulators)'),
          mode: z
            .enum(['dark', 'light'])
            .describe('The appearance mode to set (either "dark" or "light")'),
        },
        async (params: { simulatorUuid: string; mode: 'dark' | 'light' }): Promise<ToolResponse> => {
          log('info', `Setting simulator ${params.simulatorUuid} appearance to ${params.mode} mode`);
    
          return executeSimctlCommandAndRespond(
            params,
            ['ui', params.simulatorUuid, 'appearance', params.mode],
            'Set Simulator Appearance',
            `Successfully set simulator ${params.simulatorUuid} appearance to ${params.mode} mode`,
            'Failed to set simulator appearance',
            'set simulator appearance',
          );
        },
      );
    }
  • The handler function for 'set_sim_appearance' that logs the action and delegates to executeSimctlCommandAndRespond to run 'xcrun simctl ui <uuid> appearance <mode>'.
    async (params: { simulatorUuid: string; mode: 'dark' | 'light' }): Promise<ToolResponse> => {
      log('info', `Setting simulator ${params.simulatorUuid} appearance to ${params.mode} mode`);
    
      return executeSimctlCommandAndRespond(
        params,
        ['ui', params.simulatorUuid, 'appearance', params.mode],
        'Set Simulator Appearance',
        `Successfully set simulator ${params.simulatorUuid} appearance to ${params.mode} mode`,
        'Failed to set simulator appearance',
        'set simulator appearance',
      );
    },
  • Zod schema defining the input parameters: simulatorUuid (string) and mode (enum: 'dark' | 'light').
      simulatorUuid: z
        .string()
        .describe('UUID of the simulator to use (obtained from list_simulators)'),
      mode: z
        .enum(['dark', 'light'])
        .describe('The appearance mode to set (either "dark" or "light")'),
    },
  • Shared helper function that performs validation, executes simctl commands via executeCommand, handles success/error responses, and logging. Used by set_sim_appearance handler.
    async function executeSimctlCommandAndRespond(
      params: { simulatorUuid: string; [key: string]: unknown },
      simctlSubCommand: string[],
      operationDescriptionForXcodeCommand: string,
      successMessage: string,
      failureMessagePrefix: string,
      operationLogContext: string,
      extraValidation?: () => ToolResponse | null,
    ): Promise<ToolResponse> {
      const simulatorUuidValidation = validateRequiredParam(
        'simulatorUuid',
        params.simulatorUuid as string,
      );
      if (!simulatorUuidValidation.isValid) {
        return simulatorUuidValidation.errorResponse!;
      }
    
      if (extraValidation) {
        const validationResult = extraValidation();
        if (validationResult) {
          return validationResult;
        }
      }
    
      try {
        const command = ['xcrun', 'simctl', ...simctlSubCommand];
        const result = await executeCommand(command, operationDescriptionForXcodeCommand);
    
        if (!result.success) {
          const fullFailureMessage = `${failureMessagePrefix}: ${result.error}`;
          log(
            'error',
            `${fullFailureMessage} (operation: ${operationLogContext}, simulator: ${params.simulatorUuid})`,
          );
          return {
            content: [{ type: 'text', text: fullFailureMessage }],
          };
        }
    
        log(
          'info',
          `${successMessage} (operation: ${operationLogContext}, simulator: ${params.simulatorUuid})`,
        );
        return {
          content: [{ type: 'text', text: successMessage }],
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        const fullFailureMessage = `${failureMessagePrefix}: ${errorMessage}`;
        log(
          'error',
          `Error during ${operationLogContext} for simulator ${params.simulatorUuid}: ${errorMessage}`,
        );
        return {
          content: [{ type: 'text', text: fullFailureMessage }],
        };
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Sets', implying a mutation/write operation, but doesn't disclose behavioral traits like required permissions, whether changes are persistent, error conditions, or side effects. For a mutation tool with zero annotation coverage, this is a significant gap in transparency beyond the basic action.

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 with zero waste. It front-loads the core action and target, using minimal words to convey essential information. Every word earns its place, making it highly concise and well-structured for quick understanding.

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 2 parameters with full schema coverage and no output schema, the description is minimally complete for a simple mutation tool. However, with no annotations and a write operation, it lacks context on permissions, side effects, or error handling. It's adequate but leaves gaps in behavioral understanding that could hinder safe invocation.

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 both parameters well-documented in the schema (including enum values for 'mode' and source for 'simulatorUuid'). The description adds no additional parameter semantics beyond what the schema provides, such as format details or usage examples. Baseline 3 is appropriate when 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 ('Sets') and the target resource ('appearance mode of an iOS simulator'), specifying the exact values ('dark/light'). It distinguishes from siblings like 'set_network_condition' or 'set_simulator_location' by focusing on appearance, but doesn't explicitly contrast with them. The purpose is specific and unambiguous, though not explicitly differentiated from all siblings.

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 needing to change simulator appearance, but provides no explicit guidance on when to use this tool versus alternatives (e.g., other 'set_' tools) or prerequisites. It mentions the 'simulatorUuid' parameter comes from 'list_simulators', which is helpful context, but lacks clear when/when-not rules or named alternatives for related tasks.

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/SampsonKY/XcodeBuildMCP'

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