Skip to main content
Glama

set_sim_appearance

Set the appearance mode (dark or light) of an iOS simulator using its UUID. Manage simulator visuals with ease for testing and development purposes.

Instructions

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

Input Schema

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

Implementation Reference

  • The core handler function `set_sim_appearanceLogic` that logs the operation and calls the helper to execute the `xcrun simctl ui <simulatorId> appearance <mode>` command.
    export async function set_sim_appearanceLogic(
      params: SetSimAppearanceParams,
      executor: CommandExecutor,
    ): Promise<ToolResponse> {
      log('info', `Setting simulator ${params.simulatorId} appearance to ${params.mode} mode`);
    
      return executeSimctlCommandAndRespond(
        params,
        ['ui', params.simulatorId, 'appearance', params.mode],
        'Set Simulator Appearance',
        `Successfully set simulator ${params.simulatorId} appearance to ${params.mode} mode`,
        'Failed to set simulator appearance',
        'set simulator appearance',
        undefined,
        executor,
      );
    }
  • Zod schema defining the input parameters: simulatorId (UUID) and mode (dark or light).
    const setSimAppearanceSchema = z.object({
      simulatorId: z
        .string()
        .uuid()
        .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")'),
    });
  • Registers the tool with name 'set_sim_appearance', its description, public schema (omitting simulatorId), and a session-aware handler wrapping the logic function.
    export default {
      name: 'set_sim_appearance',
      description: 'Sets the appearance mode (dark/light) of an iOS simulator.',
      schema: publicSchemaObject.shape, // MCP SDK compatibility
      handler: createSessionAwareTool<SetSimAppearanceParams>({
        internalSchema: setSimAppearanceSchema as unknown as z.ZodType<SetSimAppearanceParams>,
        logicFunction: set_sim_appearanceLogic,
        getExecutor: getDefaultCommandExecutor,
        requirements: [{ allOf: ['simulatorId'], message: 'simulatorId is required' }],
      }),
    };
  • Helper utility to execute simctl commands via xcrun, handle success/error responses, logging, and return standardized ToolResponse.
    async function executeSimctlCommandAndRespond(
      params: SetSimAppearanceParams,
      simctlSubCommand: string[],
      operationDescriptionForXcodeCommand: string,
      successMessage: string,
      failureMessagePrefix: string,
      operationLogContext: string,
      extraValidation?: () => ToolResponse | undefined,
      executor: CommandExecutor = getDefaultCommandExecutor(),
    ): Promise<ToolResponse> {
      if (extraValidation) {
        const validationResult = extraValidation();
        if (validationResult) {
          return validationResult;
        }
      }
    
      try {
        const command = ['xcrun', 'simctl', ...simctlSubCommand];
        const result = await executor(command, operationDescriptionForXcodeCommand, true, undefined);
    
        if (!result.success) {
          const fullFailureMessage = `${failureMessagePrefix}: ${result.error}`;
          log(
            'error',
            `${fullFailureMessage} (operation: ${operationLogContext}, simulator: ${params.simulatorId})`,
          );
          return {
            content: [{ type: 'text', text: fullFailureMessage }],
          };
        }
    
        log(
          'info',
          `${successMessage} (operation: ${operationLogContext}, simulator: ${params.simulatorId})`,
        );
        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.simulatorId}: ${errorMessage}`,
        );
        return {
          content: [{ type: 'text', text: fullFailureMessage }],
        };
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states the action is a 'set' operation, implying mutation, but doesn't disclose side effects (e.g., if it requires simulator to be running, permissions needed, or error handling). It lacks details on what happens if the simulator isn't available or if the change is persistent.

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 front-loads the core purpose without unnecessary words. Every part ('Sets', 'appearance mode', 'iOS simulator', 'dark/light') contributes directly to understanding the tool's function, making it highly concise and well-structured.

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 adequate. It covers the basic purpose but lacks context on behavioral aspects (e.g., dependencies, effects) and usage guidelines. For a mutation tool with no annotations, more detail would improve completeness, but it's not entirely incomplete.

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 clear descriptions for both parameters (mode with enum values, simulatorUuid with source). The description adds no additional parameter semantics beyond what the schema provides, such as format details or examples. Baseline 3 is appropriate since 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 ('Sets') and the target ('appearance mode of an iOS simulator'), with specific modes mentioned ('dark/light'). It distinguishes from siblings like 'boot_sim' or 'list_sims' by focusing on appearance configuration rather than lifecycle or listing. However, it doesn't explicitly differentiate from potential appearance-related tools (none in the list), so it's not a perfect 5.

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., needing a booted simulator), exclusions, or related tools for checking appearance. The context is implied through the action, but no explicit usage instructions are given.

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

Related 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/getsentry/XcodeBuildMCP'

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