Skip to main content
Glama

Fold or unfold a foldable iPhone simulator or Android emulator

fold

Fold or unfold foldable iOS simulators and Android emulators into closed, half-open, or open poses, or follow timestamped angle keyframes, then confirm the resulting hinge angle and device state.

Instructions

Fold or unfold a foldable iPhone simulator (iPhone Duo) or a foldable Android emulator into the closed, half-open, or open pose. iOS sends a simulator HID hinge event, then reads the hinge angle back inside the simulator to confirm it, and can follow timestamped angle keyframes; Android sets the emulator console posture, then confirms the device state the guest commits and reports the angle read from the hinge sensor, which can differ from the AVD profile's per-posture angles, and dismisses the lock screen a fold to the cover display can raise. On iOS a pose change moves the app to a different panel with a different point size; on Android a fold to or from closed moves the app between the cover and inner displays, and any pose change can reshape the app window, whose size the next snapshot reports. Either way every ref and coordinate from before it is stale. Taps, long presses, and scrolling target the app window on its current panel in closed, half-open, and open poses. Simulator and emulator only; iOS requires the iOS simulator SDK; Device Hub and host Accessibility permission are not required. An iOS simulator in a scoped simulator set folds the same way as one in the default set. Times out after 255s.

Input Schema

NameRequiredDescriptionDefault
poseNoInstant preset; mutually exclusive with keyframes.
udidNoApple device or simulator UDID.
deviceNoDevice name; ids go in udid or serial.
serialNoAndroid, HarmonyOS, or Vega VVD serial.
sessionNoSession name.
noRecordNoDo not record this action.
platformNoDevice platform.
keyframesNoPiecewise-linear hinge motion. Start at 0ms; strictly increasing timestamps, up to 60000ms. Repeated angles create holds. Mutually exclusive with pose.
deviceTargetNoDevice form factor.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.21.38
    • removedInput schema / properties / debug
      Removed value: -{
      -  "description": "Enable debug diagnostics.",
      -  "type": "boolean"
      -}
    • removedInput schema / properties / includeCost
      Removed value: -{
      -  "description": "Add agent cost (cost.wallClockMs, …) to the result, returned as JSON text.",
      -  "type": "boolean"
      -}
    • removedInput schema / properties / mcpOutputFormat
      Removed value: -{
      -  "description": "Result text: compact optimized (default) or the full result as JSON (larger).",
      -  "enum": [
      -    "optimized",
      -    "json"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / responseLevel
      Removed value: -{
      -  "description": "Result detail: digest (smallest) or full (largest), as JSON; default is compact text.",
      -  "enum": [
      -    "digest",
      -    "default",
      -    "full"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / target
      Removed value: -{
      -  "description": "Alias for deviceTarget.",
      -  "enum": [
      -    "mobile",
      -    "tv",
      -    "desktop"
      -  ],
      -  "type": "string"
      -}
  2. Changed15 schema fields changedv0.21.37
    • removedInput schema / properties / androidDeviceAllowlist
      Removed value: -{
      -  "description": "Android serial allowlist used for device resolution.",
      -  "type": "string"
      -}
    • changedInput schema / properties / device / description
      Previous value: -"Device name selector (a UDID belongs in udid, a serial in serial)."New value: +"Device name; ids go in udid or serial."
    • changedInput schema / properties / deviceTarget / description
      Previous value: -"Device target form. Maps to the CLI --target flag."New value: +"Device form factor."
    • changedInput schema / properties / includeCost / description
      Previous value: -"Include per-command agent-cost (cost.wallClockMs, …) in structuredContent. Defaults to off; the default response shape is unchanged."New value: +"Add agent cost (cost.wallClockMs, …) to the result, returned as JSON text."
    • removedInput schema / properties / leaseId
      Removed value: -{
      -  "description": "Existing lease identifier.",
      -  "type": "string"
      -}
    • changedInput schema / properties / mcpOutputFormat / description
      Previous value: -"MCP text content format. Defaults to optimized agent-friendly text; use json for JSON text. Structured content is always returned separately."New value: +"Result text: compact optimized (default) or the full result as JSON (larger)."
    • changedInput schema / properties / platform / description
      Previous value: -"Platform selector used to resolve a device."New value: +"Device platform."
    • changedInput schema / properties / responseLevel / description
      Previous value: -"Response verbosity: token-cheap digest / default (today) / full. Defaults to default; the default response shape is unchanged."New value: +"Result detail: digest (smallest) or full (largest), as JSON; default is compact text."
    • removedInput schema / properties / runId
      Removed value: -{
      -  "description": "Lease run identifier.",
      -  "type": "string"
      -}
    • changedInput schema / properties / serial / description
      Previous value: -"Android, HarmonyOS, or Vega VVD serial selector."New value: +"Android, HarmonyOS, or Vega VVD serial."
    • changedInput schema / properties / session / description
      Previous value: -"Agent-device session name."New value: +"Session name."
    • changedInput schema / properties / target / description
      Previous value: -"Alias for deviceTarget on commands without a UI target field. Interaction commands reserve target for the UI element."New value: +"Alias for deviceTarget."
    • removedInput schema / properties / tenant
      Removed value: -{
      -  "description": "Remote tenant identifier.",
      -  "type": "string"
      -}
    • changedInput schema / properties / udid / description
      Previous value: -"Apple device or simulator UDID; the selector that pins one device when several share a name."New value: +"Apple device or simulator UDID."
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "action": {
      -      "const": "fold",
      -      "type": "string"
      -    },
      -    "hingeAngleDegrees": {
      -      "description": "Hinge angle read back after the pose settled: from CoreMotion inside the simulator on iOS, from the emulator hinge sensor on Android.",
      -      "type": "number"
      -    },
      -    "message": {
      -      "type": "string"
      -    },
      -    "pose": {
      -      "enum": [
      -        "closed",
      -        "half-open",
      -        "open"
      -      ],
      -      "type": "string"
      -    },
      -    "screen": {
      -      "properties": {
      -        "coordinateSpace": {
      -          "const": "native-panel",
      -          "type": "string"
      -        },
      -        "display": {
      -          "description": "CoreDevice name of the panel the device now lights.",
      -          "type": "string"
      -        },
      -        "heightPt": {
      -          "description": "Panel height in native panel points (pixels divided by point scale), NOT snapshot coordinates; take a fresh snapshot to place a tap.",
      -          "type": "number"
      -        },
      -        "widthPt": {
      -          "description": "Panel width in native panel points (pixels divided by point scale), NOT snapshot coordinates; take a fresh snapshot to place a tap.",
      -          "type": "number"
      -        }
      -      },
      -      "required": [
      -        "display",
      -        "coordinateSpace",
      -        "widthPt",
      -        "heightPt"
      -      ],
      -      "type": "object"
      -    }
      -  },
      -  "required": [
      -    "action",
      -    "pose",
      -    "hingeAngleDegrees",
      -    "message"
      -  ],
      -  "type": "object"
      -}New value: +null
  3. Changed1 schema field changedv0.21.32
    • changedOutput schema / properties / hingeAngleDegrees / description
      Previous value: -"Hinge angle read back after the pose settled: from CoreDevice on iOS, from the emulator hinge sensor on Android."New value: +"Hinge angle read back after the pose settled: from CoreMotion inside the simulator on iOS, from the emulator hinge sensor on Android."
  4. Changed1 schema field changedv0.21.27
    • changedOutput schema / properties / hingeAngleDegrees / description
      Previous value: -"Hinge angle CoreDevice read back after the pose settled."New value: +"Hinge angle read back after the pose settled: from CoreDevice on iOS, from the emulator hinge sensor on Android."
  5. Addedv0.21.12

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false; the description goes far beyond them, disclosing the iOS HID hinge event plus read-back confirmation, the Android console posture set plus guest-committed state confirmation, sensor-vs-profile angle divergence, lock-screen dismissal, panel/display switching, window reshaping, and a 255s timeout. It also warns that all prior refs and coordinates go stale after a pose change, which is critical operational context.

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

Conciseness3/5

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

The core purpose is front-loaded, but the body is a dense run-on of clause-chained sentences mixing iOS and Android behavior, side effects, and caveats. It is information-rich yet hard to scan, and the panel/tap-targeting sentence sits awkwardly mid-paragraph rather than as a discrete caveat.

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

Completeness5/5

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

For a mutation tool with 9 parameters, no output schema, and modest annotations, the description covers prerequisites, platform-specific mechanics, side effects (lock screen, window resize), the stale-ref hazard, and the timeout. Nothing an agent needs to invoke it correctly or interpret consequences is missing.

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?

Schema coverage is 100%, so baseline is 3, but the description adds real meaning: pose is an instant preset, keyframes are timestamped piecewise-linear motion where repeated angles create holds, and the two modes are mutually exclusive. The oneOf exclusivity and keyframe constraints are already in the schema, so the gain is moderate rather than large.

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 first sentence names a specific verb (fold/unfold), the exact resources (foldable iPhone simulator, foldable Android emulator), and the target states (closed, half-open, open). An agent can distinguish this from gesture/click/hardware-button siblings without opening the schema.

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

Usage Guidelines4/5

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

It states the applicability boundary clearly ("Simulator and emulator only"), the iOS prerequisite (simulator SDK), and what is not required (Device Hub, host Accessibility permission, default vs. scoped simulator set). It does not name an alternative tool for non-foldable devices or for continuous hinge motion vs. gestures, so the routing guidance is clear but not exhaustive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.