Skip to main content
Glama
zillow
by zillow

killDevice

Stop a running mobile device by specifying its name, ID, and platform to terminate processes and free resources.

Instructions

Kill a running device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceYes

Implementation Reference

  • The main handler function for the killDevice tool that instantiates DeviceUtils and calls its killDevice method.
    const killDeviceHandler = async (args: KillDeviceArgs) => {
      try {
        const deviceUtils = new DeviceUtils();
        await deviceUtils.killDevice(args.device);
        return createJSONToolResponse({
          message: `${args.device.platform} '${args.device.name}' shutdown successfully`,
          udid: args.device.name,
          name: args.device.name,
          platform: args.device.platform
        });
      } catch (error) {
        throw new ActionableError(`Failed to kill ${args.device.platform} device: ${error}`);
      }
    };
  • Zod schema defining the input parameters for the killDevice tool.
    export const killDeviceSchema = z.object({
      device: z.object({
        name: z.string().describe("The device image name to kill"),
        deviceId: z.string().describe("The device unique ID"),
        platform: z.enum(["android", "ios"]).describe("Target platform")
      })
    });
  • Registration of the killDevice tool with ToolRegistry, including name, description, schema, and handler.
    ToolRegistry.register(
      "killDevice",
      "Kill a running device",
      killDeviceSchema,
      killDeviceHandler
    );
  • DeviceUtils.killDevice method that routes to platform-specific killers (AndroidEmulator for android, Simctl for iOS).
    async killDevice(
      device: BootedDevice
    ): Promise<void> {
      switch (device.platform) {
        case "android":
          return this.emulator.killDevice(device);
        case "ios":
          return this.simctl.killSimulator(device);
      }
    }
  • Core Android-specific implementation that uses ADB to execute 'emu kill' on the target emulator device.
    async killDevice(device: BootedDevice): Promise<void> {
      const runningEmulators = await this.getBootedDevices();
      const emulator = runningEmulators.find(emu => emu.deviceId === device.deviceId);
    
      if (!emulator || !emulator.deviceId) {
        throw new ActionableError(`Emulator '${device.name}' is not running`);
      }
    
      // Use ADB to stop the emulator
      const adb = new AdbUtils(emulator);
      await adb.executeCommand("emu kill");
    
      logger.info(`Killed emulator '${device.name}'`);
    }
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. 'Kill' implies a destructive operation, but the description doesn't specify if this is irreversible, requires permissions, affects other processes, or has side effects like data loss. This leaves critical behavioral traits undisclosed.

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 extremely concise with a single sentence ('Kill a running device'), which is front-loaded and wastes no words. It efficiently communicates the core action 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?

Given the complexity (destructive operation with nested parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral risks, prerequisites, or what happens post-execution, making it inadequate for safe and effective use by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no parameter semantics beyond the input schema, which has 0% description coverage. However, there is only 1 parameter (a nested object), so the burden is lower. The schema defines the nested properties clearly, making the description's lack of detail less critical, but it still doesn't explain what 'device' entails in context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the verb ('kill') and resource ('a running device'), which clarifies the basic action. However, it doesn't distinguish this tool from sibling tools like 'terminateApp' or 'startDevice', leaving ambiguity about scope and 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?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'terminateApp', 'startDevice', and 'setActiveDevice', there's no indication of whether 'killDevice' is for physical devices, emulators, or specific contexts, leading to potential misuse.

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/zillow/auto-mobile'

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