Skip to main content
Glama

reset_network_condition

Reset network conditions to default in a simulator for testing network-dependent applications.

Instructions

Resets network conditions to default in the simulator.

Input Schema

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

Implementation Reference

  • The async handler function for the 'reset_network_condition' tool. It logs the action and calls executeSimctlCommandAndRespond to run the simctl command 'status_bar [uuid] clear' which resets the network conditions (and status bar) on the simulator.
    async (params: { simulatorUuid: string }): Promise<ToolResponse> => {
      log('info', `Resetting simulator ${params.simulatorUuid} network condition`);
    
      return executeSimctlCommandAndRespond(
        params,
        ['status_bar', params.simulatorUuid, 'clear'],
        'Reset Network Condition',
        `Successfully reset simulator ${params.simulatorUuid} network conditions.`,
        'Failed to reset network condition',
        'reset network condition',
      );
    },
  • Zod input schema defining the simulatorUuid parameter for the tool.
      simulatorUuid: z
        .string()
        .describe('UUID of the simulator to use (obtained from list_simulators)'),
    },
  • The registerResetNetworkConditionTool function that registers the tool on the MCP server, providing name, description, input schema, and handler.
    export function registerResetNetworkConditionTool(server: McpServer): void {
      server.tool(
        'reset_network_condition',
        'Resets network conditions to default in the simulator.',
        {
          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} network condition`);
    
          return executeSimctlCommandAndRespond(
            params,
            ['status_bar', params.simulatorUuid, 'clear'],
            'Reset Network Condition',
            `Successfully reset simulator ${params.simulatorUuid} network conditions.`,
            'Failed to reset network condition',
            'reset network condition',
          );
        },
      );
    }
  • Configuration object in toolRegistrations array that enables conditional registration of the reset_network_condition tool based on environment variable.
      register: registerResetNetworkConditionTool,
      groups: [ToolGroup.SIMULATOR_MANAGEMENT],
      envVar: 'XCODEBUILDMCP_TOOL_RESET_NETWORK_CONDITION',
    },

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