Skip to main content
Glama

drag

Moves an element onto another using mouse press, step and release actions to reorder sortable lists, boards, sliders or HTML5 drop targets.

Instructions

Drags an element onto another with the mouse, for sortable lists, boards, sliders and HTML5 drag and drop: presses on 'from' (scrolled into view; waits up to 2 s for it to appear or be enabled; fails when hidden, covered or disabled), moves in steps to the centre of 'to' (which must be in the viewport) and releases. Firefox simulates HTML5 drag and drop with script events.

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": {
      "from": "<from>",
      "to": "<to>"
    },
    "name": "drag"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesElement to drop onto, same forms as 'from'.
fromYesElement to drag: CSS selector, 'host >>> inner' (into an open shadow root or same-origin iframe) or snapshot ref (e12).
tab_idNoDefault: the active tab.
instance_idNoDefault: 'default'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0-rc.1

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and delivers: 'from' is scrolled into view, waits up to 2 s to appear or be enabled, and fails when hidden, covered or disabled; movement is stepped to the centre of 'to', which must be in the viewport; Firefox simulates HTML5 DnD with script events. These are exactly the preconditions and failure modes an agent needs before invoking a gesture tool.

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 in the first clause, with operational detail following in a single parenthetical chain. It is dense but every clause (scroll, wait, failure conditions, viewport, Firefox caveat) adds information, though the nested parentheses make it slightly harder to scan.

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 4-parameter gesture tool with no annotations and no output schema, the description covers preconditions, timing, failure modes and browser-specific behavior thoroughly. The main omission is what a successful call returns or how failure is surfaced (error vs. result), which the agent must infer.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds parameter-specific behavior not in the schema: the auto-scroll and 2 s enable-wait applied to 'from', and the hard viewport requirement for 'to'. Only the optional tab_id/instance_id defaults are left entirely to the schema, which 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 ('Drags an element onto another with the mouse') and enumerates concrete use cases (sortable lists, boards, sliders, HTML5 drag and drop). This clearly separates it from siblings like click_element or hover, which cannot express a press-move-release gesture.

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 cases ('sortable lists, boards, sliders and HTML5 drag and drop') tell an agent exactly when this tool is the right pick over a click or hover. It stops short of explicit exclusions or naming an alternative for plain clicks, which keeps it below a 5.

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