Skip to main content
Glama

Drag

drag
Destructive

Press at one point and release at another to move items, adjust sliders, or select ranges; specify each end as an element ID or screen coordinates.

Instructions

Press at one point, move, and release at another to drag and drop, move a slider, or select a range. Give each end as an element id or as screen coordinates; the two ends may use different forms. A drop can move or reorder items in the app, so verify the result with get_app_state. On macOS a drag must stay inside one app window and never moves the user's pointer; on Windows and Linux most drags use real mouse input, which moves the user's pointer (the result then says via cursor).

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
to_xNoScreen x to release at, used with to_y when no to_element_id is given
to_yNoScreen y to release at, used with to_x when no to_element_id is given
from_xNoScreen x to start at, used with from_y when no from_element_id is given
from_yNoScreen y to start at, used with from_x when no from_element_id is given
state_queryNoWith return_state, list only elements whose role, label or value contains this text, like get_app_state's query
return_stateNoAfter acting, wait for the app to finish reacting (up to 2 s) and append a fresh get_app_state of the app you last read, so you can check the result and pick the next target in the same call. Its ids replace every earlier id.
to_element_idNoElement to release on, from get_app_state
from_element_idNoElement to start the drag on, from get_app_state

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.7.1
    • changedInput schema / properties / return_state / description
      Previous value: -"After acting, wait briefly for the UI to settle and append a fresh get_app_state of the app you last read, so you can check the result and pick the next target in the same call. Its ids replace every earlier id."New value: +"After acting, wait for the app to finish reacting (up to 2 s) and append a fresh get_app_state of the app you last read, so you can check the result and pick the next target in the same call. Its ids replace every earlier id."
  2. Changed2 schema fields changedv0.5.2
    • addedInput schema / properties / return_state
      Added value: +{
      +  "description": "After acting, wait briefly for the UI to settle and append a fresh get_app_state of the app you last read, so you can check the result and pick the next target in the same call. Its ids replace every earlier id.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / state_query
      Added value: +{
      +  "description": "With return_state, list only elements whose role, label or value contains this text, like get_app_state's query",
      +  "type": "string"
      +}
  3. Changed6 schema fields changedv0.3.1
    • addedInput schema / properties / from_element_id / description
      Added value: +"Element to start the drag on, from get_app_state"
    • addedInput schema / properties / from_x / description
      Added value: +"Screen x to start at, used with from_y when no from_element_id is given"
    • addedInput schema / properties / from_y / description
      Added value: +"Screen y to start at, used with from_x when no from_element_id is given"
    • addedInput schema / properties / to_element_id / description
      Added value: +"Element to release on, from get_app_state"
    • addedInput schema / properties / to_x / description
      Added value: +"Screen x to release at, used with to_y when no to_element_id is given"
    • addedInput schema / properties / to_y / description
      Added value: +"Screen y to release at, used with to_x when no to_element_id is given"
  4. First observedv0.3.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare destructive/not-read-only/not-idempotent; the description adds genuinely new behavioral facts: macOS drags are confined to one app window and never move the user's pointer, while Windows/Linux use real mouse input that does move the pointer and reports 'via cursor'. That platform-level side-effect disclosure is exactly what annotations cannot convey.

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

Conciseness5/5

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

Three sentences, front-loaded with the core action and outcomes, then the parameter-form rule, then the platform caveats. No filler, and the highest-value constraint (verify with get_app_state) is placed before the platform detail.

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?

For a destructive, non-idempotent interaction tool with no output schema, the description covers the action, both coordinate/element input forms, the verification path, and the platform-dependent side effects. Nothing an agent needs in order to invoke it safely is missing.

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 a rule the schema does not state: each end may be given as an element id or screen coordinates, and the two ends may use different forms. That mixed-form semantics is real added value over the per-parameter descriptions.

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?

The description gives a concrete verb sequence (press, move, release) and enumerates the three outcomes it covers: drag-and-drop, slider movement, and range selection. This cleanly separates it from siblings like click, scroll, and select_text, which an agent can rule out 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 Guidelines4/5

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

It tells the agent to follow up with get_app_state because a drop may move or reorder items, which is real routing guidance. It also frames the valid use cases (drop, slider, range). It stops short of explicit when-not-to-use or a named alternative for plain movement, so it is strong but not exhaustive.

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