Skip to main content
Glama

gesture-swipe

Performs swipe or drag touch gestures between two screen points on iOS simulators, physical devices, or Android emulators to scroll lists, dismiss modals, drag elements, or navigate pages.

Instructions

Execute a smooth swipe / drag touch gesture between two points on the device (iOS simulator or physical device, or Android emulator). All from/to positions are fractions of screen width/height (not pixels), same as gesture-tap. Generates interpolated Move events for a natural feel (~60fps). Swipe up (fromY > toY) to scroll content down. Use when you need to scroll a list, dismiss a modal, drag an element, or navigate between pages. Not supported on Chromium; use gesture-scroll there instead. Physical iOS: an edge gesture (back-swipe) needs fromX 0 exactly; durationMs sets drag speed, not time; momentum:false only rests 300ms at the end and does not damp. Returns { swiped: true, timestampMs }. On physical iOS, reactivated: true = app was re-fronted; re-describe. Fails if the simulator-server / emulator backend is not reachable for the given device.

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>",
      "fromX": "<fromX>",
      "fromY": "<fromY>",
      "toX": "<toX>",
      "toY": "<toY>"
    },
    "name": "gesture-swipe"
  }
}

Input Schema

NameRequiredDescriptionDefault
toXYesEnd x. Range: 0 to 1.
toYYesEnd y. Range: 0 to 1.
udidYesTarget device id from `list-devices` (iOS UDID or Android serial).
fromXYesStart x. Range: 0 to 1.
fromYYesStart y. Range: 0 to 1.
momentumNoWhether the swipe releases with momentum; default true (a natural flinging swipe). false eases the finger into the end point so the OS applies little to no fling and the content stops where the finger lifts: use it when you need a deterministic scroll distance, e.g. in scroll-to-element loops. false needs durationMs >= 150 and is rejected below that; near 150 it can still land short or fling, so keep the default 300.
durationMsNoTotal gesture duration in milliseconds (default 300); the finger stays down this long. Below ~32ms the whole travel lands in one or two frames, which the OS flings as hard as any flick. Maximum: 10000.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changed
    • changedInput schema / properties / durationMs / description
      Previous value: -"Total gesture duration in milliseconds (default 300, at most 10000 - the gesture holds a finger down for exactly this long)"New value: +"Total gesture duration in milliseconds (default 300); the finger stays down this long. Below ~32ms the whole travel lands in one or two frames, which the OS flings as hard as any flick. Maximum: 10000."
    • changedInput schema / properties / fromX / description
      Previous value: -"Start x: normalized 0.0–1.0 (not pixels; same as tap)"New value: +"Start x. Range: 0 to 1."
    • addedInput schema / properties / fromX / maximum
      Added value: +1
    • addedInput schema / properties / fromX / minimum
      Added value: +0
    • changedInput schema / properties / fromY / description
      Previous value: -"Start y: normalized 0.0–1.0 (not pixels; same as tap)"New value: +"Start y. Range: 0 to 1."
    • addedInput schema / properties / fromY / maximum
      Added value: +1
    • addedInput schema / properties / fromY / minimum
      Added value: +0
    • changedInput schema / properties / momentum / description
      Previous value: -"Whether the swipe releases with momentum; default true (a natural flinging swipe). Pass false for a momentum-free swipe at the default durationMs: the finger decelerates into the end point (ease-out) so the OS reads ~0 release velocity and applies little to no fling. Use false for scroll-to-element loops. momentum: false needs durationMs >= 150 and is rejected below it: a shorter ease-out gives the OS velocity fit too little wall clock to read the deceleration as a stop, and it flings harder than a plain swipe instead (on Android, backwards). At 150 itself the swipe lands short of where the finger stopped, and 2 of 47 runs still flung backwards."New value: +"Whether the swipe releases with momentum; default true (a natural flinging swipe). false eases the finger into the end point so the OS applies little to no fling and the content stops where the finger lifts: use it when you need a deterministic scroll distance, e.g. in scroll-to-element loops. false needs durationMs >= 150 and is rejected below that; near 150 it can still land short or fling, so keep the default 300."
    • removedInput schema / properties / settle
      Removed value: -{
      -  "description": "Retired: renamed to `momentum` with the opposite sense. Pass `momentum: false` for what `settle: true` meant; `settle: false` was the default, so drop the key.",
      -  "not": {}
      -}
    • changedInput schema / properties / toX / description
      Previous value: -"End x: normalized 0.0–1.0 (not pixels; same as tap)"New value: +"End x. Range: 0 to 1."
    • addedInput schema / properties / toX / maximum
      Added value: +1
    • addedInput schema / properties / toX / minimum
      Added value: +0
    • changedInput schema / properties / toY / description
      Previous value: -"End y: normalized 0.0–1.0 (not pixels; same as tap)"New value: +"End y. Range: 0 to 1."
    • addedInput schema / properties / toY / maximum
      Added value: +1
    • addedInput schema / properties / toY / minimum
      Added value: +0
  2. Changed6 schema fields changedv0.24.0
    • changedInput schema / properties / durationMs / description
      Previous value: -"Total gesture duration in milliseconds (default 300)"New value: +"Total gesture duration in milliseconds (default 300, at most 10000 - the gesture holds a finger down for exactly this long)"
    • addedInput schema / properties / durationMs / maximum
      Added value: +10000
    • addedInput schema / properties / momentum
      Added value: +{
      +  "description": "Whether the swipe releases with momentum; default true (a natural flinging swipe). Pass false for a momentum-free swipe at the default durationMs: the finger decelerates into the end point (ease-out) so the OS reads ~0 release velocity and applies little to no fling. Use false for scroll-to-element loops. momentum: false needs durationMs >= 150 and is rejected below it: a shorter ease-out gives the OS velocity fit too little wall clock to read the deceleration as a stop, and it flings harder than a plain swipe instead (on Android, backwards). At 150 itself the swipe lands short of where the finger stopped, and 2 of 47 runs still flung backwards.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / settle / description
      Previous value: -"Momentum-free swipe: decelerate into the end point (ease-out) so the OS reads ~0 release velocity and applies little to no fling. Use for scroll-to-element loops; default false (a natural flinging swipe)."New value: +"Retired: renamed to `momentum` with the opposite sense. Pass `momentum: false` for what `settle: true` meant; `settle: false` was the default, so drop the key."
    • addedInput schema / properties / settle / not
      Added value: +{}
    • removedInput schema / properties / settle / type
      Removed value: -"boolean"
  3. Changed1 schema field changedv0.16.0
    • addedInput schema / properties / settle
      Added value: +{
      +  "description": "Momentum-free swipe: decelerate into the end point (ease-out) so the OS reads ~0 release velocity and applies little to no fling. Use for scroll-to-element loops; default false (a natural flinging swipe).",
      +  "type": "boolean"
      +}
  4. 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 supplied, the description carries the full behavioral burden and does so thoroughly: it discloses interpolated Move events at ~60fps, platform-specific edge-gesture requirements, momentum behavior on physical iOS, the return shape, a reactivated flag that requires re-describing, and failure when the backend is unreachable.

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?

The description is front-loaded with the action and coordinate system, then layers in platform and return-value details. Every sentence carries substantive information, but the density of caveats makes it somewhat run-on rather than crisply structured.

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?

Given seven parameters, no annotations, and no output schema, the description is remarkably complete: it covers coordinate semantics, platform differences, failure conditions, and the return value. An agent has enough information to invoke it correctly without consulting external documentation.

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, but the description adds meaning beyond the schema by explaining that all coordinates are fractions of screen width/height, that fromY > toY scrolls content down, and that physical iOS back-swipe requires fromX exactly 0. The extra direction and platform constraints are useful, though much of the durationMs and momentum detail is already present in the schema.

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 states a specific verb and resource — 'Execute a smooth swipe / drag touch gesture between two points' — and immediately clarifies the coordinate system and platform scope. It distinguishes itself from siblings by noting that gesture-scroll is the alternative on Chromium, so an agent can identify the right tool without opening another 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 explicit use cases: scroll a list, dismiss a modal, drag an element, or navigate between pages. It also names the exclusion and alternative — 'Not supported on Chromium; use gesture-scroll there instead' — leaving no ambiguity about when to pick this tool versus a sibling.

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