Skip to main content
Glama

Drag

drag

Simulates 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

NameRequiredDescriptionDefault
xNoA point to let go at, in CSS pixels of the view; with snapshot_id, in pixels of that snapshot's image.
yNoIts y, in CSS pixels of the view; with snapshot_id, in pixels of that snapshot's image.
toNoAn element id from a listing, such as a12.
fromNoAn element id from a listing, such as a12.
slotNo
quietNoAnswer 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.
valueNoA range input's value to set.
from_xNoA 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_yNoIts y, in CSS pixels of the view; with snapshot_id, in pixels of that snapshot's image.
selectNoText in the canvas text in view to select by a drag, from its start to its end.
modifiersNoKeys held through a drag from a point or a selection by text.
text_afterNoWith select: the text right after it.
snapshot_idNoThe 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_beforeNoWith select: the text right before it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changedv0.1.2
    • addedInput schema / properties / from_x
      Added value: +{
      +  "description": "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.",
      +  "type": "number"
      +}
    • addedInput schema / properties / from_y
      Added value: +{
      +  "description": "Its y, in CSS pixels of the view; with snapshot_id, in pixels of that snapshot's image.",
      +  "type": "number"
      +}
    • addedInput schema / properties / modifiers
      Added value: +{
      +  "description": "Keys held through a drag from a point or a selection by text.",
      +  "items": {
      +    "enum": [
      +      "Alt",
      +      "Ctrl",
      +      "Meta",
      +      "Shift"
      +    ],
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / quiet
      Added value: +{
      +  "description": "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.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / select
      Added value: +{
      +  "description": "Text in the canvas text in view to select by a drag, from its start to its end.",
      +  "type": "string"
      +}
    • addedInput schema / properties / snapshot_id
      Added value: +{
      +  "description": "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.",
      +  "type": "string"
      +}
    • addedInput schema / properties / text_after
      Added value: +{
      +  "description": "With select: the text right after it.",
      +  "type": "string"
      +}
    • addedInput schema / properties / text_before
      Added value: +{
      +  "description": "With select: the text right before it.",
      +  "type": "string"
      +}
    • addedInput schema / properties / x / description
      Added value: +"A point to let go at, in CSS pixels of the view; with snapshot_id, in pixels of that snapshot's image."
    • addedInput schema / properties / y / description
      Added value: +"Its y, in CSS pixels of the view; with snapshot_id, in pixels of that snapshot's image."
    • removedInput schema / required
      Removed value: -[
      -  "from"
      -]
  2. First observedv0.1.0

TDQS

A3.5/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does substantial work: it discloses the real-pointer press/carry/release mechanics, that it scrolls under itself, and how to interpret the result ('a pointer drag selects; a native drag means the press landed on something the page drags'). It omits failure behavior (target not draggable, element missing, timeouts), leaving a real gap for a mutation-style interaction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded with the core verb and mechanism, which is good, but the middle sentences are dense run-ons with nested parentheticals ('Or selects text a canvas shows (select, with text_before and text_after around it when it reads so in more than one place)'). Splitting the modes into discrete clauses would have preserved the content while making it far easier to scan.

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

Completeness3/5

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

For a 14-parameter tool with no annotations and no output schema, the description covers most modes and hints at the return value's meaning. Gaps remain significant: the primary source parameter 'from' is never explained, there is no error or idempotency guidance, and it is unclear what happens when no source is supplied given that all parameters are optional.

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 coverage is 93%, so the baseline is 3. The description does add combination semantics the schema cannot express—slot before/after/on is scoped to sortable lists, value is for a range input, text_before/text_after disambiguate a repeated selection, from_x/from_y switch to point-based dragging. However, the source parameter 'from' is never mentioned, and parameters like modifiers and quiet are left entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence names a specific verb and resource plus the mechanism: 'Drags an element with a real pointer: presses, carries (scrolling under itself where needed) and lets go.' It also enumerates the distinct modes (drop onto element/point, slider value, text selection, drag from a point), so an agent can tell it does more than a simple click. It never names a sibling tool as an alternative, which keeps it from a 5.

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

Usage Guidelines3/5

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

Usage is implied through mode descriptions ('Works for native drag and drop and for pointer-driven libraries'; 'Drop onto another element... or set a slider'), which helps an agent recognize the scenario. But there is no explicit when-not guidance and no routing against obvious alternatives such as click, press, or the select tool, even though text selection overlaps with the select sibling.

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