Skip to main content
Glama

fold

Adjusts an iPhone Duo simulator's hinge to closed, half-open, or open, or animates it via angle keyframes, then reads the hinge angle back to confirm the pose change.

Instructions

Fold or unfold a foldable iPhone simulator (iPhone Duo) into the closed, half-open, or open pose, or follow timestamped angle keyframes, by sending a simulator HID hinge event, then read the hinge angle back from CoreDevice to confirm it. A pose change moves the app to a different panel with a different point size, so 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-only; 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 CoreDevice read back after the pose settled.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.21.12

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries full behavioral burden and does so thoroughly: it explains the underlying HID event, post-command coordinate staleness requiring re-snapshot, simulator prerequisites, specific error behavior (UNSUPPORTED_OPERATION with unsupported-device-scope), and the 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.

Conciseness5/5

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

The description is dense but every sentence earns its place: core action, side-effect warning, compatibility constraints, error condition, and timeout. It front-loads the command's purpose and consequences.

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 complex tool with 18 parameters and no annotations, the description covers prerequisites, side effects, failure modes, and timeout behavior. An output schema exists, so omitting return-value details is acceptable.

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 every parameter. The description adds some context around pose and keyframes but does not provide additional parameter-level semantics beyond what the schema details.

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 opens with a specific verb and resource: it folds or unfolds the foldable iPhone simulator into a pose or follows keyframes. It also clearly distinguishes the mechanism (HID hinge event, CoreDevice confirmation) and is not a tautology.

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 clearly states simulator-only usage, required SDK, and that Device Hub/Accessibility permissions are not required. It also warns against non-default simulator sets and instructs to run against the default set, but it does not explicitly name alternative tools.

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