Skip to main content
Glama

fold

Fold or unfold a foldable iPhone simulator (iPhone Duo) or a foldable Android emulator into the closed, half-open, or open pose.

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 from CoreDevice 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 hinge angle the AVD profile defines for that posture, 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: re-snapshot after this command. 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. A simulator scoped to a non-default simulator set is refused with UNSUPPORTED_OPERATION and reason unsupported-device-scope; run fold against a simulator in the default set. Times out after 255s.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
poseNoInstant preset; mutually exclusive with keyframes.
udidNoApple device or simulator UDID; the selector that pins one device when several share a name.
debugNoEnable debug diagnostics.
runIdNoLease run identifier.
deviceNoDevice name selector (a UDID belongs in udid, a serial in serial).
serialNoAndroid, HarmonyOS, or Vega VVD serial selector.
targetNoAlias for deviceTarget on commands without a UI target field. Interaction commands reserve target for the UI element.
tenantNoRemote tenant identifier.
leaseIdNoExisting lease identifier.
sessionNoAgent-device session name.
noRecordNoDo not record this action.
platformNoPlatform selector used to resolve a device.
keyframesNoPiecewise-linear hinge motion. Start at 0ms; strictly increasing timestamps, up to 60000ms. Repeated angles create holds. Mutually exclusive with pose.
includeCostNoInclude per-command agent-cost (cost.wallClockMs, …) in structuredContent. Defaults to off; the default response shape is unchanged.
deviceTargetNoDevice target form. Maps to the CLI --target flag.
responseLevelNoResponse verbosity: token-cheap digest / default (today) / full. Defaults to default; the default response shape is unchanged.
mcpOutputFormatNoMCP text content format. Defaults to optimized agent-friendly text; use json for JSON text. Structured content is always returned separately.
androidDeviceAllowlistNoAndroid serial allowlist used for device resolution.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
poseYes
actionYes
screenNo
messageYes
hingeAngleDegreesYesHinge angle read back after the pose settled: from CoreDevice on iOS, from the emulator hinge sensor on Android.

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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."
  2. Addedv0.21.12

TDQS

A4.2/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and delivers: platform-specific mechanics (iOS sends a HID hinge event then reads back the angle from CoreDevice; Android sets the emulator console posture, confirms the guest-committed state, reports the AVD-defined hinge angle, and dismisses the cover-display lock screen). It discloses failure semantics (UNSUPPORTED_OPERATION/unsupported-device-scope), staleness of refs/coordinates requiring a re-snapshot, environment requirements, and a 255s timeout.

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?

Purpose is front-loaded in the first sentence, but the body is a dense, multi-clause run-on covering device mechanics, lock-screen behavior, app relocation, staleness, and timeouts. Content is high-value but packed without paragraph or bullet structure, slightly hurting scanability.

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

Completeness4/5

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

An output schema exists so return values needn't be explained, and the description compensates for the absence of annotations with thorough behavioral coverage including the critical re-snapshot-after-fold instruction. The main gap is that it never states which Android and iOS values/platform selector combinations are valid or what the keyframes-vs-pose exclusivity means at the schema oneOf level.

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 coverage is 100%, so all 18 parameters are already documented in the schema, making the baseline 3. The description adds behavioral meaning for the pose/keyframe distinction (instant preset vs. timestamped angle keyframes, with the confirmation/readback behavior), but does not extend the many device-selection parameters.

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?

States a specific verb (fold/unfold) and resource (foldable iPhone simulator / Android emulator) and enumerates the three poses it can reach. An agent can distinguish this from siblings like open, close, or orientation without opening any 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?

The description implies when to use it (foldable simulators/emulators, pose changes) and discloses a hard precondition: a simulator scoped to a non-default simulator set is refused with UNSUPPORTED_OPERATION, and the tool is simulator/emulator-only. However it names no explicit alternative for non-foldable devices, so it falls short of a true when/when-not mapping.

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