Skip to main content
Glama

gesture-custom

Dispatch a custom sequence of touch events to perform complex gestures such as long press, drag-and-drop, custom scrolling, or two-finger pinch on a connected device.

Instructions

Send a sequence of touch events for complex gestures. Use for: long press, drag-and-drop, custom scroll, pinch (second touch point). For simple taps use the gesture-tap tool. For straight-line scrolling use the gesture-swipe tool. For pinch gestures use gesture-pinch. For rotation gestures use gesture-rotate. On a local iOS simulator, set edge to the starting side for a system gesture. To move a full-screen app into Split View on an open Duo, set edge:"bottom". In one continuous contact move from bottom center to center, pause there, drag to the requested side, and release. See the device-interact foldables reference for coordinates and timing. All x/y values are fractions of the screen width/height (not pixels). Physical iOS: a Down, any Moves, then an Up; x2/y2 adds a second finger. A plain Down then Up: same point = press-hold, other point = drag (Up delayMs = rest before the move); one Move at the Down point between them = long-press pickup (Move delayMs = hold, Up delayMs = move time). Any other train plays as timed paths, each event waiting its delayMs, and needs the app drawn in portrait. Returns { events: number } with the total count of events dispatched. On physical iOS, reactivated: true = app was re-fronted; re-describe. Fails if the target device is not booted or an event type is invalid.

Example long-press at center: [{"type":"Down","x":0.5,"y":0.5},{"type":"Up","x":0.5,"y":0.5,"delayMs":800}]

Example pick up a list item with a long press, then drag it up: [{"type":"Down","x":0.5,"y":0.6},{"type":"Move","x":0.5,"y":0.6,"delayMs":800},{"type":"Up","x":0.5,"y":0.3,"delayMs":500}]

Example smooth scroll down: [{"type":"Down","x":0.5,"y":0.7}, {"type":"Move","x":0.5,"y":0.6},{"type":"Move","x":0.5,"y":0.5},{"type":"Move","x":0.5,"y":0.4}, {"type":"Up","x":0.5,"y":0.3}]

Example pinch-to-zoom (with interpolate:10 for smoothness): events: [{"type":"Down","x":0.4,"y":0.5,"x2":0.6,"y2":0.5}, {"type":"Up","x":0.2,"y":0.5,"x2":0.8,"y2":0.5}] interpolate: 10

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "udid": "<udid>",
      "events": "<events>"
    },
    "name": "gesture-custom"
  }
}

Input Schema

NameRequiredDescriptionDefault
edgeNoStarting edge in upright screen coordinates for a single-finger system gesture on a local iOS simulator.
udidYesTarget device id from `list-devices` (iOS UDID or Android serial).
eventsYesTouch events, dispatched in order.
interpolateNoNumber of Move events to insert between each pair of consecutive events, linearly interpolating both x,y and x2,y2 and splitting the delay evenly, for a smooth gesture. Default: no interpolation.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changed
    • addedInput schema / properties / edge
      Added value: +{
      +  "description": "Starting edge in upright screen coordinates for a single-finger system gesture on a local iOS simulator.",
      +  "enum": [
      +    "top",
      +    "right",
      +    "bottom",
      +    "left"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / events / description
      Previous value: -"Sequence of touch events; x/y (and optional second touch) are normalized 0.0–1.0, not pixels"New value: +"Touch events, dispatched in order."
    • changedInput schema / properties / events / items / properties / x / description
      Previous value: -"Normalized x 0.0–1.0 (not pixels; same as tap/swipe)"New value: +"Touch x. Range: 0 to 1."
    • addedInput schema / properties / events / items / properties / x / maximum
      Added value: +1
    • addedInput schema / properties / events / items / properties / x / minimum
      Added value: +0
    • changedInput schema / properties / events / items / properties / x2 / description
      Previous value: -"Second touch x for two-finger gestures: normalized 0.0–1.0 (not pixels)"New value: +"Second finger x, for two-finger gestures. Range: 0 to 1."
    • addedInput schema / properties / events / items / properties / x2 / maximum
      Added value: +1
    • addedInput schema / properties / events / items / properties / x2 / minimum
      Added value: +0
    • changedInput schema / properties / events / items / properties / y / description
      Previous value: -"Normalized y 0.0–1.0 (not pixels; same as tap/swipe)"New value: +"Touch y. Range: 0 to 1."
    • addedInput schema / properties / events / items / properties / y / maximum
      Added value: +1
    • addedInput schema / properties / events / items / properties / y / minimum
      Added value: +0
    • changedInput schema / properties / events / items / properties / y2 / description
      Previous value: -"Second touch y for two-finger gestures: normalized 0.0–1.0 (not pixels)"New value: +"Second finger y, for two-finger gestures. Range: 0 to 1."
    • addedInput schema / properties / events / items / properties / y2 / maximum
      Added value: +1
    • addedInput schema / properties / events / items / properties / y2 / minimum
      Added value: +0
    • changedInput schema / properties / interpolate / description
      Previous value: -"Number of intermediate Move events to auto-insert between each pair of consecutive events. Smooths out gestures by linearly interpolating both primary (x,y) and secondary (x2,y2) coordinates. The delay is split evenly across interpolated frames. Default: no interpolation."New value: +"Number of Move events to insert between each pair of consecutive events, linearly interpolating both x,y and x2,y2 and splitting the delay evenly, for a smooth gesture. Default: no interpolation."
  2. First observedv0.15.0

TDQS

A4.8/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 largely does: it states the return shape (`{ events: number }`), the `reactivated: true` re-fronting signal, explicit failure conditions (device not booted, invalid event type), and the portrait-only constraint for timed-path trains. It also discloses the non-obvious physical-iOS interpretation rules (Down/Up at same point = press-hold vs. other point = drag; a mid-point Move = long-press pickup), which an agent could not infer from the schema.

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?

Purpose and exclusions are front-loaded before platform detail and examples, which is the right order. The density of the physical-iOS paragraph is high and the long-press/scroll examples partially overlap what gesture-swipe already handles, so a sentence or two could be trimmed, but nothing is pure filler.

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?

There is no output schema, and the description compensates by naming the return value and the `reactivated` flag, plus failure modes. For a tool whose complexity comes from event-train sequencing on two platforms, the combination of behavioural rules and worked examples is sufficient to invoke it correctly.

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 the baseline is 3, and the description clears that bar: it explains that x/y are screen fractions rather than pixels (the schema only says "Range: 0 to 1"), that x2/y2 add a second finger, and that `interpolate` inserts linearly interpolated Moves with split delays. It also gives `delayMs` context-dependent meaning per event train. What it does not do is restate the `edge` enum semantics beyond the simulator/Duo procedures, which the schema already covers.

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?

"Send a sequence of touch events for complex gestures" names a specific verb and resource, and the definition immediately carves out its niche against gesture-tap, gesture-swipe, gesture-pinch and gesture-rotate. An agent can distinguish this as the low-level escape hatch for arbitrary multi-event trains 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 Guidelines5/5

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

It gives an explicit "Use for:" list (long press, drag-and-drop, custom scroll, two-finger pinch) and then routes the agent away to each named alternative with the condition that selects it. It further adds platform-scoped guidance — `edge` for local iOS simulator system gestures and the Duo Split View bottom-edge procedure. The only slight tension is listing "pinch (second touch point)" as a use case while directing plain pinch to gesture-pinch, but the qualifier makes the distinction recoverable.

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