Skip to main content
Glama

reset_simulator_location

Reset the location of a specified simulator to default using its UUID, simplifying testing workflows in XcodeBuildMCP.

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 main handler function that executes the reset simulator location logic by invoking the simctl command to clear the location via a generic executor helper.
    export async function reset_sim_locationLogic(
      params: ResetSimulatorLocationParams,
      executor: CommandExecutor,
    ): Promise<ToolResponse> {
      log('info', `Resetting simulator ${params.simulatorId} location`);
    
      return executeSimctlCommandAndRespond(
        params,
        ['location', params.simulatorId, 'clear'],
        'Reset Simulator Location',
        `Successfully reset simulator ${params.simulatorId} location.`,
        'Failed to reset simulator location',
        'reset simulator location',
        executor,
      );
    }
  • Zod schema for input validation, requiring a simulatorId UUID.
    const resetSimulatorLocationSchema = z.object({
      simulatorId: z
        .string()
        .uuid()
        .describe('UUID of the simulator to use (obtained from list_simulators)'),
    });
  • Exports the tool object for registration in the MCP server, including name, description, schema, and a session-aware handler wrapping the core logic.
    export default {
      name: 'reset_sim_location',
      description: "Resets the simulator's location to default.",
      schema: publicSchemaObject.shape, // MCP SDK compatibility
      handler: createSessionAwareTool<ResetSimulatorLocationParams>({
        internalSchema:
          resetSimulatorLocationSchema as unknown as z.ZodType<ResetSimulatorLocationParams>,
        logicFunction: reset_sim_locationLogic,
        getExecutor: getDefaultCommandExecutor,
        requirements: [{ allOf: ['simulatorId'], message: 'simulatorId is required' }],
      }),
    };
  • Reusable helper function for executing simctl commands on simulators, handling responses, logging, and errors. Used by the reset location handler.
    async function executeSimctlCommandAndRespond(
      params: ResetSimulatorLocationParams,
      simctlSubCommand: string[],
      operationDescriptionForXcodeCommand: string,
      successMessage: string,
      failureMessagePrefix: string,
      operationLogContext: string,
      executor: CommandExecutor,
      extraValidation?: () => ToolResponse | undefined,
    ): Promise<ToolResponse> {
      if (extraValidation) {
        const validationResult = extraValidation();
        if (validationResult) {
          return validationResult;
        }
      }
    
      try {
        const command = ['xcrun', 'simctl', ...simctlSubCommand];
        const result = await executor(command, operationDescriptionForXcodeCommand, true, {});
    
        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 only states the action without behavioral details. It doesn't disclose if this is destructive, requires specific permissions, has side effects, or what happens on success/failure. This is inadequate for a mutation tool with zero annotation coverage.

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 no wasted words, making it highly concise and front-loaded. It efficiently communicates the core purpose without unnecessary elaboration.

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 lacks details on behavioral traits, error handling, or what 'default' entails, leaving significant gaps for an AI agent to understand and invoke it correctly.

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 'simulatorUuid' well-documented in the schema. The description adds no additional parameter semantics beyond implying the tool acts on a simulator, so it meets the baseline of 3 where 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 target ('simulator's location') with specificity, distinguishing it from sibling tools like 'set_simulator_location'. However, it doesn't specify what 'default' means (e.g., factory reset, home location), leaving some ambiguity.

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 explicit guidance on when to use this tool versus alternatives like 'set_simulator_location' or other simulator-related tools. The description implies usage for resetting location but lacks context on prerequisites or scenarios where it's 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

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