Skip to main content
Glama

drag_drop

Drag one DOM element onto another to reorder Kanban cards, sortable lists, or file targets, choosing HTML5, pointer, or mouse events and returning the method that worked.

Instructions

Drag and drop one DOM element onto another using element references. Tries three methods in order: HTML5 DragEvent (dragstart/drop), PointerEvent sequence (for react-beautiful-dnd and similar libraries), and MouseEvent sequence (basic fallback). Use for Kanban card reordering, sortable lists, file drag targets, or any drag-and-drop interaction between two identifiable DOM elements. Returns which method succeeded. For canvas/coordinate-based drag, use the drag tool instead. Related: drag (coordinate-based drag for canvas/map), drop_file (drop files onto upload zones), get_dom_snapshot (find source and target element refs). 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
stepsNoNumber of intermediate move events during drag (default 10)
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.
holdMsNoMilliseconds to hold before starting drag motion (default 150, increase for libraries that need longer press)
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 move step (default 20)
visual_reasonYesShort human-readable reason shown in the overlay (for example, "Logging in to GitHub"). Required.
sourceSelectorYesCSS selector or element reference (e.g., "e5", "#card-1") for the element to drag
targetSelectorYesCSS selector or element reference (e.g., "e12", "#column-2") for the drop target element

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/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: it discloses the three-method fallback order (HTML5 DragEvent, PointerEvent for react-beautiful-dnd, MouseEvent), that it reports which method succeeded, the multi-agent tab ownership rule (cross-agent reject with TAB_NOT_OWNED, cap default 8 range 1-64), and tab auto-resolution behavior. These are non-obvious operational traits an agent could not infer from the schema.

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 purpose, then use cases, alternative, related tools, multi-agent constraints, and return behavior in a logical order. It is long, but the length is justified by the tool's complexity; the only mild redundancy is re-explaining the change_report after already covering returns.

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?

No output schema exists, so the description must explain returns, and it does so thoroughly: the change_report field contents (URL, dialogs_opened, nodes_added/removed, attrs_changed, inputs_changed, focus_shift), its truncation flag/hint, and the read_page fallback. Combined with the method fallback and tab constraints, an agent has everything needed to call and interpret this tool.

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 nine parameters including tab_id semantics and the steps/holdMs/stepDelayMs timing knobs. The description restates tab_id usage ('pass only when this agent owns multiple tabs; auto-resolves otherwise') and frames source/target as element references, but adds little beyond what the schema states, so the baseline 3 is appropriate.

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 and drop one DOM element onto another using element references,' and immediately scopes it as interaction between two identifiable DOM elements. It explicitly distinguishes itself from the coordinate-based sibling ('For canvas/coordinate-based drag, use the drag tool instead') and from drop_file, so an agent can route correctly without opening any 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 concrete when-to-use cases (Kanban reordering, sortable lists, file drag targets) plus the explicit when-not-and-use-instead rule pointing to the drag tool. It also lists related tools (drag, drop_file, get_dom_snapshot) with one-line disambiguation for each, leaving nothing to inference.

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