Skip to main content
Glama

gesture-drag

Perform a desktop mouse drag in a Chromium app: press at a start point, move, and release using window-relative coordinates. Use it for sliders, drag-and-drop, text selection, or draggable UI elements.

Instructions

Press the left mouse button at a start point, move to an end point, and release: a desktop mouse drag in a Chromium app, with mouse moves interpolated at ~60fps. All positions are fractions of the window width/height (not pixels), the same space as gesture-tap and describe, except that exactly 1.0 lands one pixel inside the window edge. Use for slider thumbs, drag-and-drop, text selection, or draggable UI elements. Dragging never scrolls content on desktop; use gesture-scroll for lists/pages. Chromium only: on iOS/Android use gesture-swipe. Returns { dragged: true, timestampMs }. Fails if the Chromium CDP session 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-drag"
  }
}

Input Schema

NameRequiredDescriptionDefault
toXYesRelease x. Range: 0 to 1.
toYYesRelease y. Range: 0 to 1.
udidYesTarget Chromium device id from `list-devices` (chromium-cdp-<port>).
fromXYesPress x. Range: 0 to 1.
fromYYesPress y. Range: 0 to 1.
momentumNoWhether the drag releases with momentum; default true (a constant-speed drag). false decelerates into the release point, so an app that derives a fling from the release velocity (carousels, drag libraries) applies little to no momentum: use it when the drag must stop where it was aimed. Under ~100ms durationMs some fling survives; keep the default 300 when the fling must be fully suppressed.
durationMsNoTotal drag duration in milliseconds (default 300); the button stays down this long. Maximum: 10000.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changed
    • changedInput schema / properties / durationMs / description
      Previous value: -"Total drag duration in milliseconds (default 300, at most 10000 - the button stays down for exactly this long), interpolated at ~60fps."New value: +"Total drag duration in milliseconds (default 300); the button stays down this long. Maximum: 10000."
    • changedInput schema / properties / fromX / description
      Previous value: -"Press x: normalized 0.0–1.0 (fraction of window width, not pixels)."New value: +"Press 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: -"Press y: normalized 0.0–1.0 (fraction of window height, not pixels)."New value: +"Press 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 drag releases with momentum; default true (a constant-speed drag). Pass false to decelerate into the release point (ease-out) so an app deriving fling from pointer release velocity (carousels, drag libraries) reads ~0 and applies little to no momentum — use it when the drag must stop where it was aimed rather than fling past. Deceleration needs wall clock: under ~100ms the whole drag fits inside the velocity window a page averages over (tens of ms), so some fling survives, and under ~70ms its extra frames cannot dispatch fast enough to fit durationMs. Keep durationMs at its default when the fling must be fully suppressed."New value: +"Whether the drag releases with momentum; default true (a constant-speed drag). false decelerates into the release point, so an app that derives a fling from the release velocity (carousels, drag libraries) applies little to no momentum: use it when the drag must stop where it was aimed. Under ~100ms durationMs some fling survives; keep the default 300 when the fling must be fully suppressed."
    • 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: -"Release x: normalized 0.0–1.0 (not pixels; same space as tap)."New value: +"Release 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: -"Release y: normalized 0.0–1.0 (not pixels; same space as tap)."New value: +"Release y. Range: 0 to 1."
    • addedInput schema / properties / toY / maximum
      Added value: +1
    • addedInput schema / properties / toY / minimum
      Added value: +0
  2. Changed4 schema fields changedv0.24.0
    • changedInput schema / properties / durationMs / description
      Previous value: -"Total drag duration in milliseconds (default 300), interpolated at ~60fps."New value: +"Total drag duration in milliseconds (default 300, at most 10000 - the button stays down for exactly this long), interpolated at ~60fps."
    • addedInput schema / properties / durationMs / maximum
      Added value: +10000
    • addedInput schema / properties / momentum
      Added value: +{
      +  "description": "Whether the drag releases with momentum; default true (a constant-speed drag). Pass false to decelerate into the release point (ease-out) so an app deriving fling from pointer release velocity (carousels, drag libraries) reads ~0 and applies little to no momentum — use it when the drag must stop where it was aimed rather than fling past. Deceleration needs wall clock: under ~100ms the whole drag fits inside the velocity window a page averages over (tens of ms), so some fling survives, and under ~70ms its extra frames cannot dispatch fast enough to fit durationMs. Keep durationMs at its default when the fling must be fully suppressed.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / settle
      Added 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": {}
      +}
  3. 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 does so: ~60fps interpolation, the fractional coordinate space, the edge behavior at 1.0, that the button stays down for durationMs, the return shape { dragged: true, timestampMs }, and the CDP-unreachable failure mode. These are behavioral facts an agent could not derive from the schema alone.

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?

Front-loads the action and coordinate model, then usage, then platform constraints, then return and failure. Every sentence carries information, though the coordinate paragraph is a long compound sentence with a parenthetical that could be split for faster scanning.

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?

Seven parameters with no annotations and no output schema, yet the description covers coordinate semantics, platform gating, return value, and failure condition. Nothing needed to invoke it correctly 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 the baseline is 3, but the description adds real meaning the schema does not: coordinates are fractions of window width/height shared with gesture-tap and describe, and exactly 1.0 lands one pixel inside the edge. The momentum/durationMs interplay is largely already spelled out in the schema, which keeps this from a 5.

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 and resource chain — press left button at a start point, move, release — and names what it is (a desktop mouse drag in a Chromium app). It immediately distinguishes itself from gesture-tap/gesture-scroll/gesture-swipe, so an agent can pick it without opening a sibling 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?

Gives explicit use cases (slider thumbs, drag-and-drop, text selection, draggable elements) and explicit exclusions with alternatives: 'Dragging never scrolls content on desktop; use gesture-scroll for lists/pages' and 'Chromium only: on iOS/Android use gesture-swipe.' Both when-to-use and when-not-to-use are covered.

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