Skip to main content
Glama
zillow
by zillow

setDeviceMode

Configure device parameters for mobile testing modes like exploration or test authoring to automate mobile app testing workflows.

Instructions

Set parameters for a particular device in a given mode.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
explorationNo
testAuthoringNo
deviceIdYesDevice ID for which these settings will apply.
platformYesTarget platform

Implementation Reference

  • The handler function for the 'setDeviceMode' tool. It updates the device session configuration using ConfigurationManager.updateDeviceSession and returns a JSON response indicating success or failure.
    async (args: DeviceSessionArgs): Promise<any> => {
      try {
        // Update configuration with provided parameters
        await ConfigurationManager.getInstance().updateDeviceSession(args, args.platform);
    
        return createJSONToolResponse({
          success: true,
          message: `Device configuration updated successfully`
        });
      } catch (error) {
        logger.error("Failed to configure MCP server:", error);
        const result = {
          success: false,
          message: `Failed to configure MCP server: ${error}`
        };
        return createJSONToolResponse(result);
      }
  • Zod input schema (ConfigSchema) used for validating parameters of the 'setDeviceMode' tool.
    const ConfigSchema = z.object({
      exploration: z.object({
        deepLinkSkipping: z.boolean()
      }).optional(),
      testAuthoring: z.object({
        appId: z.string().describe("App ID to be used for test authoring."),
        description: z.string().describe("Rough description of the test to be authored."),
        persist: z.enum(["never", "devicePresent", "always"]).describe("What conditions to stay in test authoring mode. Default devicePresent"),
      }).optional(),
      deviceId: z.string().describe("Device ID for which these settings will apply."),
      platform: z.enum(["android", "ios"]).describe("Target platform")
    });
  • Registration of the 'setDeviceMode' tool using ToolRegistry.register, including the name, description, schema, and inline handler function.
    ToolRegistry.register(
      "setDeviceMode",
      "Set parameters for a particular device in a given mode.",
      ConfigSchema,
      async (args: DeviceSessionArgs): Promise<any> => {
        try {
          // Update configuration with provided parameters
          await ConfigurationManager.getInstance().updateDeviceSession(args, args.platform);
    
          return createJSONToolResponse({
            success: true,
            message: `Device configuration updated successfully`
          });
        } catch (error) {
          logger.error("Failed to configure MCP server:", error);
          const result = {
            success: false,
            message: `Failed to configure MCP server: ${error}`
          };
          return createJSONToolResponse(result);
        }
      }
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions setting parameters but doesn't clarify if this is a write operation, what permissions are needed, whether changes are reversible, or any side effects like device state changes. This is inadequate for a tool with multiple parameters and nested objects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that is front-loaded with the core action. However, it lacks detail that would enhance clarity, making it somewhat under-specified rather than optimally concise for the tool's complexity.

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 tool's complexity (4 parameters, nested objects, no output schema, and no annotations), the description is incomplete. It doesn't cover behavioral aspects, parameter interactions, or usage context, leaving the agent with insufficient information to invoke the tool correctly without relying heavily on the schema.

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

Parameters2/5

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

Schema description coverage is 50%, with only some parameters documented in the schema. The description adds no meaning beyond the schema, failing to explain the purpose of modes like 'exploration' or 'testAuthoring,' or how parameters interact. For a tool with 4 parameters and nested objects, this leaves significant gaps in understanding.

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 tool 'Set parameters for a particular device in a given mode,' which provides a general purpose (setting device parameters) but is vague about what specific modes or parameters are involved. It doesn't distinguish from sibling tools like 'setActiveDevice' or 'resetConfig,' which also involve device settings, leaving ambiguity about its unique role.

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. The description lacks context about prerequisites, such as whether the device must be active or in a specific state, and doesn't mention any sibling tools as alternatives, leaving the agent to infer usage from the input schema alone.

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