Skip to main content
Glama

reset_simulator_location

Reset a simulator's location to default coordinates using its UUID to restore original positioning for testing.

Instructions

Resets the simulator's location to default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
simulatorUuidYesUUID of the simulator to use (obtained from list_simulators)

Implementation Reference

  • The core handler function for the 'reset_simulator_location' tool. It validates the simulatorUuid, logs the action, and executes the 'xcrun simctl location clear' command via the helper function.
    async (params: { simulatorUuid: string }): Promise<ToolResponse> => {
      log('info', `Resetting simulator ${params.simulatorUuid} location`);
    
      return executeSimctlCommandAndRespond(
        params,
        ['location', params.simulatorUuid, 'clear'],
        'Reset Simulator Location',
        `Successfully reset simulator ${params.simulatorUuid} location.`,
        'Failed to reset simulator location',
        'reset simulator location',
      );
    },
  • Zod input schema defining the required 'simulatorUuid' parameter for the tool.
      simulatorUuid: z
        .string()
        .describe('UUID of the simulator to use (obtained from list_simulators)'),
    },
  • The server.tool registration call within registerResetSimulatorLocationTool that defines and registers the tool with name, description, schema, and handler.
    server.tool(
      'reset_simulator_location',
      "Resets the simulator's location to default.",
      {
        simulatorUuid: z
          .string()
          .describe('UUID of the simulator to use (obtained from list_simulators)'),
      },
      async (params: { simulatorUuid: string }): Promise<ToolResponse> => {
        log('info', `Resetting simulator ${params.simulatorUuid} location`);
    
        return executeSimctlCommandAndRespond(
          params,
          ['location', params.simulatorUuid, 'clear'],
          'Reset Simulator Location',
          `Successfully reset simulator ${params.simulatorUuid} location.`,
          'Failed to reset simulator location',
          'reset simulator location',
        );
      },
    );
  • Entry in the toolRegistrations array that includes this tool's register function, associating it with SIMULATOR_MANAGEMENT group and controlled by XCODEBUILDMCP_TOOL_RESET_SIMULATOR_LOCATION env var.
      register: registerResetSimulatorLocationTool,
      groups: [ToolGroup.SIMULATOR_MANAGEMENT],
      envVar: 'XCODEBUILDMCP_TOOL_RESET_SIMULATOR_LOCATION',
    },
  • Shared helper function called by the handler to perform the actual simctl command execution, validation, error handling, and response formatting for simulator operations.
    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 the full burden of behavioral disclosure. It states the action ('Resets') but doesn't explain what 'default' means, whether this is a destructive operation, if it requires specific permissions, or what happens to the simulator's state. For a mutation tool with zero annotation coverage, this is insufficient.

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 no wasted words. It's front-loaded with the core action and target, making it easy to parse quickly.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what 'default' location entails, the effects on the simulator, error conditions, or return values. Given the complexity of simulator operations and lack of structured data, more context is needed.

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 'simulatorUuid' documented as 'UUID of the simulator to use (obtained from list_simulators)'. The description doesn't add any parameter details beyond what the schema provides, so the baseline score of 3 is appropriate given 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 ('Resets') and the target ('simulator's location to default'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'set_simulator_location' or other simulator-related tools, which would require explicit differentiation.

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?

No guidance is provided on when to use this tool versus alternatives like 'set_simulator_location' or other simulator configuration tools. The description lacks context about prerequisites, such as needing a simulator UUID from 'list_sims', or when resetting location is appropriate.

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