Drag
dragSimulates a real pointer press, carry, and release to move elements onto targets, set sliders, or select canvas text; handles native and pointer-driven interactions.
Instructions
Drags an element with a real pointer: presses, carries (scrolling under itself where needed) and lets go. Drop onto another element (to, with slot before/after/on for sortable lists), onto a point of the view (x, y), or set a slider (value). Works for native drag and drop and for pointer-driven libraries. Or selects text a canvas shows (select, with text_before and text_after around it when it reads so in more than one place): presses before it and lets go after it. Or drags from a point (from_x, from_y) to a point or an element. The answer says what kind of drag the page made of it: a pointer drag selects; a native drag means the press landed on something the page drags (in an editor, text already selected), and that was dragged instead.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "drag"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | A point to let go at, in CSS pixels of the view; with snapshot_id, in pixels of that snapshot's image. | |
| y | No | Its y, in CSS pixels of the view; with snapshot_id, in pixels of that snapshot's image. | |
| to | No | An element id from a listing, such as a12. | |
| from | No | An element id from a listing, such as a12. | |
| slot | No | ||
| quiet | No | Answer without the changed elements (what opened on top, the focus and announcements stay); for pages such as Google Docs where every key changes much of the listing. | |
| value | No | A range input's value to set. | |
| from_x | No | A point to press at instead of an element, in CSS pixels of the view; with snapshot_id, in pixels of that snapshot's image. | |
| from_y | No | Its y, in CSS pixels of the view; with snapshot_id, in pixels of that snapshot's image. | |
| select | No | Text in the canvas text in view to select by a drag, from its start to its end. | |
| modifiers | No | Keys held through a drag from a point or a selection by text. | |
| text_after | No | With select: the text right after it. | |
| snapshot_id | No | The snapshot whose image the point was read off (s3): the point is then in that image's pixels, which view's note gives when they are not the view's CSS pixels. It must be of this tab's current page. | |
| text_before | No | With select: the text right before it. |