Skip to main content
Glama
zillow
by zillow

enableDemoMode

Configure device status bar indicators for consistent screenshots by setting time, battery level, signal strength, and notification visibility.

Instructions

Enable demo mode with consistent status bar indicators for screenshots

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeNoTime to display in statusbar in HHMM format (e.g., 1000 for 10:00)
batteryLevelNoBattery level percentage (0-100)
batteryPluggedNoWhether the device appears to be charging
wifiLevelNoWiFi signal strength (0-4)
mobileDataTypeNoMobile data type to display
mobileSignalLevelNoMobile signal strength (0-4)
hideNotificationsNoWhether to hide notification icons
platformYesTarget platform

Implementation Reference

  • The enableDemoModeHandler function that executes the tool logic by instantiating DemoMode and calling its execute method with the provided arguments.
    const enableDemoModeHandler = async (device: BootedDevice, args: EnableDemoModeArgs) => {
      try {
        const demoMode = new DemoMode(device);
        const result = await demoMode.execute(args);
    
        return createJSONToolResponse({
          message: "Demo mode enabled",
          observation: result.observation,
          ...result,
          demoModeEnabled: true
        });
      } catch (error) {
        logger.error("Failed to enable demo mode:", error);
        throw new ActionableError(`Failed to enable demo mode: ${error}`);
      }
    };
  • Zod schema defining the input parameters for the enableDemoMode tool.
    export const enableDemoModeSchema = z.object({
      time: z.string().optional().describe("Time to display in statusbar in HHMM format (e.g., 1000 for 10:00)"),
      batteryLevel: z.number().min(0).max(100).optional().describe("Battery level percentage (0-100)"),
      batteryPlugged: z.boolean().optional().describe("Whether the device appears to be charging"),
      wifiLevel: z.number().min(0).max(4).optional().describe("WiFi signal strength (0-4)"),
      mobileDataType: z.enum(["4g", "5g", "lte", "3g", "edge", "none"]).optional().describe("Mobile data type to display"),
      mobileSignalLevel: z.number().min(0).max(4).optional().describe("Mobile signal strength (0-4)"),
      hideNotifications: z.boolean().optional().describe("Whether to hide notification icons"),
      platform: z.enum(["android", "ios"]).describe("Target platform")
    });
  • Registration of the enableDemoMode tool in the ToolRegistry using the schema and handler.
    ToolRegistry.registerDeviceAware(
      "enableDemoMode",
      "Enable demo mode with consistent status bar indicators for screenshots",
      enableDemoModeSchema,
      enableDemoModeHandler
    );
  • Core implementation of demo mode enabling in the DemoMode class's execute method, which sends specific ADB commands to configure the Android status bar.
    async execute(options: DemoModeOptions = {}): Promise<DemoModeResult> {
      const {
        time = "1000",
        batteryLevel = 100,
        batteryPlugged = false,
        wifiLevel = 4,
        mobileDataType = "4g",
        mobileSignalLevel = 4,
        hideNotifications = true,
      } = options;
    
      try {
        // Get current package name from active window
        const activeWindow = await this.window.getActive(true);
        logger.info("Setting up Android demo mode for current app:", activeWindow.appId);
    
        // Allow demo mode
        await this.adb.executeCommand("shell settings put global sysui_demo_allowed 1");
    
        // Enter demo mode
        await this.adb.executeCommand("shell am broadcast -a com.android.systemui.demo -e command enter");
    
        // Set battery status
        await this.adb.executeCommand(
          `shell am broadcast -a com.android.systemui.demo -e command battery -e plugged ${
            batteryPlugged ? "true" : "false"
          } -e level ${batteryLevel}`
        );
    
        // Set clock time
        await this.adb.executeCommand(
          `shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm ${time}`
        );
    
        // Handle notifications
        if (hideNotifications) {
          await this.adb.executeCommand(
            "shell am broadcast -a com.android.systemui.demo -e command notifications -e visible false"
          );
        }
    
        // Set network status
        await this.adb.executeCommand(
          `shell am broadcast -a com.android.systemui.demo -e command network -e wifi show -e level ${wifiLevel} -e mobile show -e datatype ${mobileDataType} -e level ${mobileSignalLevel}`
        );
    
        logger.info("Demo mode setup completed successfully");
        return {
          success: true,
          message: "Demo mode enabled successfully",
          demoModeEnabled: true,
          packageName: activeWindow.appId,
          activityName: activeWindow.activityName
        };
      } catch (err) {
        const errorMessage = err instanceof Error ? err.message : String(err);
        logger.error("Failed to set up demo mode:", err);
        return {
          success: false,
          error: `Failed to set up demo mode: ${errorMessage}`,
          demoModeEnabled: false
        };
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the outcome ('consistent status bar indicators') but doesn't describe side effects, permissions needed, whether changes persist, or what happens if the tool fails. For a configuration tool with 8 parameters, this leaves significant behavioral gaps.

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. Every word earns its place: 'Enable demo mode' states the action, 'with consistent status bar indicators' specifies the configuration aspect, and 'for screenshots' provides the use case context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (8 parameters, configuration operation) and absence of both annotations and output schema, the description is minimally adequate. It states what the tool does but lacks information about behavioral consequences, error conditions, or what success looks like. The 100% schema coverage helps but doesn't compensate for missing behavioral context.

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%, so the schema already documents all 8 parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema (like explaining relationships between parameters or providing usage examples). Baseline 3 is appropriate when schema does all the work.

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

Purpose5/5

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

The description clearly states the action ('Enable demo mode') and the purpose ('with consistent status bar indicators for screenshots'), distinguishing it from sibling tools like 'disableDemoMode' by specifying its enabling function. It's specific about the resource being manipulated (demo mode configuration).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context (for screenshots) but doesn't explicitly state when to use this tool versus alternatives like 'setDeviceMode' or 'disableDemoMode'. No prerequisites or exclusions are mentioned, leaving the agent to infer appropriate usage scenarios.

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