Skip to main content
Glama
zillow
by zillow

setActiveDevice

Select a mobile device to target for automation tasks by specifying its ID and platform (Android or iOS).

Instructions

Set the active device ID for subsequent operations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceIdYesThe device ID to set as active
platformYesTarget platform

Implementation Reference

  • The handler function that executes the setActiveDevice tool logic. It ensures the device is ready using DeviceSessionManager and returns a success response.
    const setActiveDeviceHandler = async (args: SetActiveDeviceArgs) => {
      try {
        await DeviceSessionManager.getInstance().ensureDeviceReady(args.platform, args.deviceId);
    
        return createJSONToolResponse({
          message: `Active device set to '${args.deviceId}'`,
          deviceId: args.deviceId,
        });
      } catch (error) {
        logger.error("Failed to set active device:", error);
        throw new ActionableError(`Failed to set active device: ${error}`);
      }
    };
  • Zod schema for validating input parameters of the setActiveDevice tool: deviceId (string) and platform (android/ios).
    export const setActiveDeviceSchema = z.object({
      deviceId: z.string().describe("The device ID to set as active"),
      platform: z.enum(["android", "ios"]).describe("Target platform")
    });
  • Registration of the setActiveDevice tool in the ToolRegistry, specifying name, description, schema, and handler function.
      "setActiveDevice",
      "Set the active device ID for subsequent operations",
      setActiveDeviceSchema,
      setActiveDeviceHandler
    );
  • TypeScript interface defining the arguments for the setActiveDevice handler, used for type safety.
    export interface SetActiveDeviceArgs {
      deviceId: string;
        platform: Platform;
    }
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 disclosing behavioral traits. It doesn't mention whether this requires specific permissions, if the change is persistent, potential side effects, or error conditions. For a mutation tool with zero annotation coverage, this is inadequate.

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 earns its place by specifying the action, target, and purpose concisely.

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 information about what 'active device' means operationally, how this affects other tools, return values, or error handling. Given the complexity of device management in the sibling context, 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 schema description coverage is 100%, with both parameters well-documented in the schema. The description adds no additional meaning beyond what the schema provides, such as explaining the relationship between deviceId and platform or usage context. 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 ('Set') and resource ('active device ID'), specifying it's for 'subsequent operations'. However, it doesn't differentiate from sibling tools like 'setDeviceMode' or 'setAppSource' that also modify device settings, missing explicit distinction.

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 implies usage by mentioning 'for subsequent operations', but provides no explicit guidance on when to use this tool versus alternatives like 'setDeviceMode' or prerequisites. There's no mention of when-not-to-use scenarios or clear context for selection among siblings.

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