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
| Name | Required | Description | Default |
|---|---|---|---|
| toX | Yes | Release x. Range: 0 to 1. | |
| toY | Yes | Release y. Range: 0 to 1. | |
| udid | Yes | Target Chromium device id from `list-devices` (chromium-cdp-<port>). | |
| fromX | Yes | Press x. Range: 0 to 1. | |
| fromY | Yes | Press y. Range: 0 to 1. | |
| momentum | No | 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. | |
| durationMs | No | Total drag duration in milliseconds (default 300); the button stays down this long. Maximum: 10000. |