Skip to main content
Glama

drag

Destructive

Performs a mouse drag from one screen point to another for drawing, selecting, or moving sliders. Sends intermediate motion steps so drag targets register, and releases the button even if a step fails.

Instructions

Drag (mouse-down → move → up) from (x1,y1) to (x2,y2) — for drawing, selecting, sliders.

Returns {"ok", "action", "instance", "detail", "steps"}. steps (default 10, 1–100) is the number of intermediate motion events: canvases, sliders and drag-and-drop targets usually need a few to register the drag (1 = jump straight to the end point). The button is released even if a motion step fails (a stuck button would turn every later click into a drag). observe/settle_ms: see click(). Fails (isError) if the instance is down or either point is off-screen.

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": {
      "x1": "<x1>",
      "y1": "<y1>",
      "x2": "<x2>",
      "y2": "<y2>"
    },
    "name": "drag"
  }
}

Input Schema

NameRequiredDescriptionDefault
x1Yes
x2Yes
y1Yes
y2Yes
stepsNo
buttonNo
observeNonone
instanceNo
settle_msNo
observe_regionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.6.1
    • addedInput schema / properties / observe_region
      Added value: +{
      +  "default": "",
      +  "title": "Observe Region",
      +  "type": "string"
      +}
  2. Changed1 schema field changedv0.3.0
    • addedInput schema / properties / steps
      Added value: +{
      +  "default": 10,
      +  "title": "Steps",
      +  "type": "integer"
      +}
  3. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, but the description adds genuinely non-obvious behavior: the button is always released even if a motion step fails, and the call errors when the instance is down or either coordinate is off-screen. The return-key list compensates for the absent output schema, though it doesn't explain what 'detail' or 'steps' actually contain.

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-loads the gesture and destination points before the return shape and parameter notes; every sentence carries information (failure semantics, step range, button-release guarantee). It is dense but not padded, with only the family of unrelated parameters (observe_region) left dangling.

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 10-parameter mutating tool with no output schema and no schema descriptions, the definition covers the return object, failure modes, and the highest-risk parameter (steps). The remaining gaps — observe_region and the meaning of the button index — are minor relative to how much it explains elsewhere.

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 description coverage is 0% and there are 10 parameters, so the description must carry the load — and it does for most: it defines the four coordinate points as start/end, gives steps a default and 1–100 range with meaning, and ties button release, instance failure, and observe/settle_ms to click(). observe_region and the button index semantics remain undocumented.

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 the specific gesture and mechanics (mouse-down → move → up from point A to point B) plus the concrete use cases (drawing, selecting, sliders), which distinguishes it from click, double_click and move_mouse without naming them. An agent knows immediately this is a sustained press-and-move operation, not a discrete click.

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 clause 'for drawing, selecting, sliders' gives positive usage contexts and the steps explanation tells the agent when intermediate motion matters (canvases, sliders, drag-and-drop targets) versus when 1 suffices. It stops short of explicit exclusions or naming a sibling as the alternative, and defers observe/settle_ms guidance to click() rather than restating it.

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