Skip to main content
Glama

page.drag

Drag and drop, slide sliders, swipe, reorder lists, pan maps, or draw strokes in a browser via pointer or touch gestures.

Instructions

Press, travel and release like a hand: drag-and-drop, slide a slider or "slide to unlock", reorder a list, pan a map, draw a stroke, or swipe (direction + distance, with touch input on a phone). The pointer approaches the source, presses, holds briefly, moves along a curved slow-fast-slow path with slight wobble, pauses, then releases. Native HTML5 draggable elements are detected and finished with real dragenter/dragover/drop. release:false leaves the press down for page.pointer or another page.drag.

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": "page.drag"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNoWith y and no locator: start at this viewport point (CSS px).
yNo
nthNoZero-based index when the locator matches several elements.
refNoSnapshot ref (eNN) from page.snapshot.
by_xNoEnd this many px right of the start (negative: left). The usual way to move a slider.
by_yNoEnd this many px below the start (negative: above).
seedNoSeed for the human randomness, to repeat a gesture exactly. Every call reports the seed it used.
textNoVisible text of the element.
to_xNoWith to_y: end at this viewport point.
to_yNo
html5NoDefault true: detect native draggable and finish with drag events. false: only pointer events.
humanNoDefault true: curved path, slow-fast-slow speed, hand jitter, short pauses. false: straight, even, no pauses.
inputNoDefault auto: touch when touch emulation is on for the tab (device.preset), else mouse.
stepsNoIntermediate moves. Default one per ~16ms of travel.
xpathNoXPath expression.
buttonNo
to_nthNo
to_refNoSnapshot ref of the drop target.
verifyNoWatch for DOM mutations after the gesture. Default true.
hold_msNoHold still after pressing, before moving. Default 70-180ms human; raise it (500+) for "press and hold to drag" lists.
releaseNoDefault true. false: keep the button/finger down at the end.
to_textNo
distanceNoWith direction. Default half the viewport.
frame_idNoFrame to search within; see page.list_frames.
selectorNoCSS selector; pierces shadow DOM.
to_xpathNo
directionNoSwipe: the way the finger/pointer moves. Without a start locator it starts at the viewport centre.
jitter_pxNoHand wobble mid-path in CSS px. Default 1.5; 0 for a steady hand. Ends are always exact.
modifiersNoKeys held throughout, e.g. ["Shift"] or ["Alt"].
settle_msNoHold still at the end before releasing. Default 60-160ms human.
target_idNoTarget handle (tgt_*). Omit for the active page.
verify_msNoHow long to watch. Default 300.
browser_idNoBrowser handle (br_*). Omit to use the only running browser, or auto-launch one.
duration_msNoTravel time. Default from distance and target size (Fitts), roughly 250-900ms; a direction swipe defaults to a 150-500ms flick released without a pause.
to_selectorNoDrop on this element (its centre).
backend_node_idNoCDP backendNodeId, e.g. from inspector.pick.
to_backend_node_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only supply readOnlyHint=false and openWorldHint=true, so the description carries the real behavioral burden and does so well. It discloses the simulated motion model (curved slow-fast-slow path, jitter, brief hold, pause), native HTML5 draggable detection ending in real dragenter/dragover/drop, the default DOM-mutation verification, and seed reporting for exact replay.

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 is front-loaded and the three sentences each carry information about capability, motion model, and the release flag. The opening enumeration of seven use cases is slightly list-heavy, but each item aids routing to this tool rather than padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 37-parameter, high-complexity gesture tool with no output schema and minimal annotations, the description covers motion behavior, HTML5 handling, verification, and chaining adequately. The remaining gap is the return shape of the verify step, which is only hinted at with 'Every call reports the seed it used.'

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 81%, so the schema already documents the default behaviors of hold_ms, human, steps, jitter_px, duration_ms, and input. The description adds marginal value by explaining that release:false enables chaining and that the seed is reported back, but with 37 parameters it does not meaningfully deepen semantics beyond the structured fields. Baseline 3 applies.

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 opening sentence names a concrete gesture ('Press, travel and release like a hand') and enumerates the exact tasks it covers: drag-and-drop, slider movement, list reordering, map panning, stroke drawing, and swipes. It also separates itself from the sibling page.pointer by stating that release:false leaves the press down for page.pointer or another page.drag.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

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

The use-case list gives clear situational context, and the note about chaining with page.pointer covers one alternative explicitly. However, it never states when NOT to use this tool versus page.click, page.long_press, or page.pinch, so the agent must infer the boundaries from the enumerated scenarios.

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

Deploy Server

Other Tools