Skip to main content
Glama

glass_drag

Drag with a held button between window-relative points to select text, move items, or resize panes. Supports modifiers and duration; rejects endpoints outside the window.

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?

With no annotations, the description carries full burden and does so thoroughly: it explains the press-move-release sequence, the default button behavior, modifier handling, the role of duration_ms, and the safety refusal for out-of-window endpoints. Every behavioral trait material to using the tool correctly is disclosed.

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?

The description is information-dense but every sentence contributes value: it covers the action, coordinate system, mechanics, safety behavior, and usage context. It is front-loaded with the core verb phrase and avoids filler or repetition.

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?

Given the tool's complexity (7 parameters, no output schema, no annotations), the description covers all necessary aspects: coordinate system, parameter semantics, error behavior, use cases, and alternatives. It is fully complete for an agent to invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although the schema covers all parameters, the description adds meaning beyond the schema by explaining the window-relative coordinate system, the 'button overrides' default behavior, and the stepwise motion over duration_ms. It also clarifies that modifiers are held throughout, which is not explicitly stated in the schema.

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 starts with a specific verb and resource: 'Drag with a button held from (x1,y1) to (x2,y2)' and clearly defines the operation's scope. It also distinguishes itself from siblings by explicitly mentioning glass_gesture and glass_click as alternatives, making its purpose unique.

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?

The description gives explicit use cases ('selecting text, moving an item, resizing a pane') and clearly states when not to use it by naming the multi-touch equivalent (glass_gesture) and the press-and-release case (glass_click). This is exactly the level of guidance expected.

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