Skip to main content
Glama

glass_drag

Simulate a mouse drag within a native GUI window from one coordinate to another over a set duration, holding optional modifiers. Ideal for selecting text, moving items, or resizing panes while preventing off-window drags with clear errors.

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.

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.
Behavior5/5

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

The description thoroughly discloses behavior beyond annotations: it presses at the start point, moves in steps over duration_ms, releases at the end, holds modifiers throughout, and refuses endpoints outside the window with an error giving window size. Annotations (readOnlyHint=false, destructiveHint=false) are consistent, and the description adds significant operational context.

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?

Every sentence earns its place: behavior, coordinate system, button/modifier semantics, error handling, and sibling differentiation. The description is information-dense but not padded, and the most important facts are front-loaded.

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 pointer-input tool with no output schema, the description covers all essential invocation context: valid use cases, coordinate frame, parameter behavior, error conditions, and alternatives. An agent has everything needed to call this tool correctly.

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. The description adds meaningful context beyond the schema by clarifying defaults ('button is left'), behavior over time ('moves across in steps over duration_ms'), and coordinate semantics in narrative form. It reinforces and slightly extends the schema, warranting a 4.

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 opens with a specific verb and resource: dragging with a button held from (x1,y1) to (x2,y2). It clearly differentiates from siblings by stating glass_gesture is the multi-touch equivalent and glass_click is the press-and-release-in-place case, so an agent can disambiguate immediately.

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?

It explicitly says when to use the tool: 'Use this for a single pointer — selecting text, moving an item, resizing a pane.' It also names the alternatives and the conditions that select them, leaving no ambiguity about choosing glass_gesture or glass_click.

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

Install Server

Other Tools

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