Skip to main content
Glama

glass_drag

Drag with a held button between window-relative coordinates, with configurable button, modifiers, and duration. Enables text selection, item moving, and pane resizing in GUI apps.

Instructions

Drag with a button held from (x1,y1) to (x2,y2) — window-relative coordinates, so 0,0 is the window's top-left, not the screen's. Presses at the start point, moves across in steps over duration_ms, and releases at the end; the button is left (button overrides) and optional modifiers are held throughout, e.g. ["ctrl"] or ["ctrl","shift"] for multi/range-select. Either endpoint outside the window is refused with an error giving the window size, so a drag never lands somewhere you did not aim. Use this for a single pointer — selecting text, moving an item, resizing a pane; glass_gesture is the multi-touch equivalent (2+ pointers, for pinch/rotate), and glass_click is the press-and-release-in-place case. If at least two next actions or waits are known, use glass_do instead of separate calls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
x1YesPress-point x, window-relative — 0 is the window's left edge, not the screen's.
x2YesRelease-point x, window-relative.
y1YesPress-point y, window-relative — 0 is the window's top edge, not the screen's.
y2YesRelease-point y, window-relative.
buttonNoButton held for the drag: "left" (default), "right", or "middle".
modifiersNoModifier keys to hold during the action, e.g. ["ctrl"] or ["ctrl","shift"] for multi/range-select.
duration_msNoSpan the drag's motion over this many milliseconds so a frame-based GUI samples the path across multiple frames (and registers the drag even while it repaints). Default 200. Lower = faster but coarser.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed6 schema fields changedv1.2.0
    • addedInput schema / properties / button / description
      Added value: +"Button held for the drag: \"left\" (default), \"right\", or \"middle\"."
    • addedInput schema / properties / x1 / description
      Added value: +"Press-point x, window-relative — 0 is the window's left edge, not the screen's."
    • addedInput schema / properties / x2 / description
      Added value: +"Release-point x, window-relative."
    • addedInput schema / properties / y1 / description
      Added value: +"Press-point y, window-relative — 0 is the window's top edge, not the screen's."
    • addedInput schema / properties / y2 / description
      Added value: +"Release-point y, window-relative."
    • removedInput schema / title
      Removed value: -"DragArgs"
  2. First observedv1.0.1

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only carry basic hints (readOnly=false, destructive=false), so the description carries the behavioral burden and delivers richly: window-relative vs screen-relative coordinate semantics, the press-move-release lifecycle in steps over duration_ms, default button behavior, modifiers held throughout, and the safety behavior that out-of-window endpoints are refused with an error reporting window size. No contradiction with annotations.

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?

Dense but every sentence earns its place: coordinate semantics, mechanics, defaults, error behavior, use cases, alternatives, and batching guidance. The most decision-relevant fact (window-relative coordinates disambiguating 0,0) is front-loaded, and the sibling routing is compactly appended.

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 7-parameter, 4-required tool with no output schema, the description covers the key behavioral surface an agent needs: coordinate frame, execution lifecycle, defaults, modifier handling, out-of-bounds refusal, and alternative-tool routing. No critical call-time decision is left undocumented.

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 baseline is 3. The description adds value beyond the schema by explaining how duration_ms shapes motion ('moves across in steps'), the default button behavior, and how modifiers apply ('held throughout'), plus the endpoint-validation constraint tying x1/y1/x2/y2 to the window bounds. This is genuine added meaning, not mere restatement.

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?

Opens with a specific verb+resource: 'Drag with a button held from (x1,y1) to (x2,y2)'. It explicitly differentiates from siblings — glass_gesture (multi-touch pinch/rotate), glass_click (press-and-release in place), and glass_do (batching). An agent can tell exactly what this tool does and what it is not without opening the 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 explicit selection criteria: 'Use this for a single pointer — selecting text, moving an item, resizing a pane', then names the alternatives with their distinguishing conditions (glass_gesture for 2+ pointers, glass_click for in-place press/release, glass_do when two or more next actions are known). The when/when-not/alternatives guidance is complete and leaves nothing to inference.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fixed-width/glass'

If you have feedback or need assistance with the MCP directory API, please join our Discord server