Skip to main content
Glama

drag

Simulate a mouse press, move, and release between two viewport coordinates using CDP trusted events. Essential for canvas drawing, sliders, and map interactions that ignore DOM gestures.

Instructions

Drag from one viewport coordinate to another using CDP trusted events. Produces mousePressed at start, N intermediate mouseMoved events, then mouseReleased at end. Essential for canvas drawing tools, sliders, and map interactions where DOM drag events are ignored. Supports modifier keys for constrained drawing (shift+drag). Coordinates are CSS pixels relative to the browser viewport. Related: drag_drop (DOM element-to-element drag using selectors), drag_variable_speed (human-like variable-speed drag for CAPTCHAs), click_at (simple click at coordinates), click_and_hold (press and hold without moving). Multi-agent: agent-scoped tabs; cross-agent reject with TAB_NOT_OWNED; cap configurable (default 8, 1-64). Pass tab_id only when this agent owns multiple tabs; auto-resolves otherwise. RETURNS change_report: when this tool runs, the response includes a change_report field with a compact diff of what the action mutated (URL, dialogs_opened, nodes_added, nodes_removed, attrs_changed, inputs_changed, focus_shift). Use this to learn the consequence without calling read_page next. If the report exceeds the size cap, change_report.truncated:true and change_report_hint are set; call read_page for the full state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
altNoHold Alt key during drag
ctrlNoHold Ctrl key during drag
endXYesEnd X coordinate in viewport CSS pixels
endYYesEnd Y coordinate in viewport CSS pixels
shiftNoHold Shift key during drag (for constrained movement)
stepsNoNumber of intermediate mouseMoved events (default 10, increase for smoother drag)
clientYesAllowlisted client label. Validated against the shared v0.9.36 server/extension allowlist (see mcp/src/tools/visual-session.ts -- MCP_VISUAL_CLIENT_LABELS). Required.
startXYesStart X coordinate in viewport CSS pixels
startYYesStart Y coordinate in viewport CSS pixels
tab_idNoOptional. Tab id this action targets. Omit when the calling agent owns exactly one tab; pass to disambiguate when the agent owns multiple. Single-tab agents and legacy popup/sidepanel/autopilot do not need to pass this.
is_finalNoWhen true, the visual session clears immediately after this tool resolves. Optional (default false).
stepDelayMsNoDelay in ms between each mouseMoved step (default 20)
visual_reasonYesShort human-readable reason shown in the overlay (for example, "Logging in to GitHub"). Required.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the emitted event sequence (mousePressed, N mouseMoved, mouseReleased), modifier-key support, coordinate semantics, multi-agent tab scoping, and the change_report shape. These are genuine behavioral disclosures. However, it does not explain what happens when coordinates fall outside the viewport, how failures surface, or whether steps affect reliability, leaving some behavioral ground uncovered for a trusted-event CDP action.

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-loaded with the core action and its event mechanics, then alternatives, then multi-agent rules, then the return contract. The change_report paragraph is long but justified because no output schema exists. Minor redundancy between the description's modifier note and the schema's shift description keeps it from a 5.

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?

With 13 parameters, no output schema, and no annotations, the description covers everything an agent needs: coordinate basis, event sequence, sibling disambiguation, tab ownership behavior, and the full change_report return contract including truncation and the read_page fallback.

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 100%, so the schema already documents all 13 parameters, including modifiers, steps, stepDelayMs, tab_id, and visual_reason. The description restates coordinate semantics ('CSS pixels relative to the browser viewport') and the shift constraint without adding format or edge-case guidance beyond the schema. Baseline 3 applies when the schema does the heavy lifting.

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 ('Drag from one viewport coordinate to another using CDP trusted events') and immediately differentiates itself from drag_drop, drag_variable_speed, click_at, and click_and_hold by naming each sibling and its distinct mechanism.

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?

Explicitly names when to use it ('canvas drawing tools, sliders, and map interactions where DOM drag events are ignored') and routes the agent elsewhere for element-to-element drag, CAPTCHA drags, and simple clicks. Also gives the tab_id ownership rule and the cross-agent TAB_NOT_OWNED failure mode.

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