Skip to main content
Glama

mouse_drag

Drag the mouse from start to end coordinates with left button held for sliders, drag-and-drop, canvas drawing, and window resizing. Start coordinate is auto-guarded against the target window for safe operation.

Instructions

Click and drag from (startX, startY) to (endX, endY) holding the left mouse button — for sliders, drag-and-drop, canvas drawing, and window resizing. Pass windowTitle so the server auto-guards the start coordinate and returns post.perception. Examples: mouse_drag({windowTitle:'Notepad', startX:50, startY:50, endX:200, endY:200}). lensId is optional and only for advanced pinned-target workflows. Caveats: Left button only. Both start and endpoint are guarded. Cross-window and desktop drags are blocked by default — pass allowCrossWindowDrag:true to confirm intent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
startXYes
startYYes
endXYes
endYYes
narrateNoNarration level. rich includes UIA or browser state diff when supported.minimal
speedNoCursor movement speed in px/sec. 0 = instant.
homingNoEnable homing correction if the target window moved.
windowTitleNoPartial title of the target window.
hwndNoDirect window handle ID (takes precedence over windowTitle). Obtain from get_windows response (hwnd field). String type to avoid 64-bit precision issues.
lensIdNoOptional perception lens ID. Guards and envelope same as mouse_click.
allowCrossWindowDragNoWhen true, allow dragging the endpoint into a different window or the desktop background. Default false — cross-window drags (including desktop/wallpaper) are blocked to prevent accidents. Pass true to confirm intent for deliberate cross-window or desktop-area drags.
allowTabDragNoWhen true, allow drags that start in the title-bar / tab-strip area of a tabbed app (Notepad, Terminal, Edge, Chrome, etc.). Default false — such drags are blocked because they detach the tab into a new window rather than moving the window. Pass true only when you intentionally want to rearrange or detach a tab. Note: active only when auto-guard is enabled (same scope as allowCrossWindowDrag).
includeNoOptional response-shape opt-in. `['envelope']` returns the self-documenting envelope (`_version` / `data` / `as_of` / `confidence`). `['raw']` forces raw shape (overrides DESKTOP_TOUCH_ENVELOPE=1 server default). Default behaviour is raw shape (compat with existing clients).
Behavior5/5

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

With no annotations, the description fully carries the burden. It discloses that both start and end points are guarded, cross-window drags are blocked by default, and mentions the optional lensId for advanced workflows. It also includes the instant speed option (speed=0) and homing correction, providing comprehensive behavioral transparency.

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 concise (4 sentences) and front-loaded with the core action. It uses a clear structure: action, use cases, example, caveats. Every sentence adds value without redundancy.

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 no output schema and 13 parameters, the description provides complete context: it explains the drag action, the required parameters, optional advanced parameters (lensId, allowCrossWindowDrag, allowTabDrag), and behavioral constraints (guarding, blocking cross-window). No gaps remain for an agent to safely invoke the tool.

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?

The description adds meaning beyond schema by explaining the purpose of allowCrossWindowDrag (to confirm intent for cross-window drags) and allowTabDrag (for rearranging tabs). It also contextualizes lensId as 'only for advanced pinned-target workflows'. With 69% schema coverage, the description compensates well for the remaining parameters by giving usage examples and caveats.

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 clearly states the tool does click-and-drag with specific verb+resource ('Click and drag from (startX, startY) to (endX, endY)') and lists example use cases (sliders, drag-and-drop, canvas drawing, window resizing). It distinguishes from siblings by its unique action of dragging, as opposed to mouse_click which only clicks.

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 description explicitly states the tool is for dragging actions and provides caveats like 'Left button only' and 'Cross-window and desktop drags are blocked by default', guiding when to use with allowCrossWindowDrag. However, it does not explicitly differentiate from sibling tools like mouse_click, though the context implies it.

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/Harusame64/desktop-touch-mcp'

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