Skip to main content
Glama

mouse_drag

Performs left-button drag from start to end coordinates within a target window for sliders, drag-and-drop, canvas drawing, or resizing, with auto-guards against cross-window and tab-strip drags.

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; that refusal is code:'CrossWindowDragBlocked'. A drag starting in a tabbed application's tab strip returns code:'TabDragBlocked' — pass allowTabDrag:true when tearing off or rearranging a tab is intended. hints.verifyDelivery:{status:'delivered'|'focus_only'|'unverifiable', reason} reports the post-drop observation in the same 3-value shape as mouse_click. MouseDragNotDelivered is SUGGESTS-registered but reserved-only (not emitted) — degradation is expressed via the 'unverifiable' status rather than a typed code. Win11 foreground refusal (UIPI cross-elevation / admin-only target / call from a background process or service) returns code:'ForegroundRestricted' ok:false from the homing path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endXYes
endYYes
hwndNoDirect window handle ID (takes precedence over windowTitle). Obtain from get_windows response (hwnd field). String type to avoid 64-bit precision issues.
speedNoCursor movement speed in px/sec. 0 = instant.
homingNoEnable homing correction if the target window moved.
lensIdNoOptional perception lens ID. Guards and envelope same as mouse_click.
startXYes
startYYes
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).
narrateNoNarration level. rich includes UIA or browser state diff when supported.minimal
windowTitleNoPartial title of the target window.
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).
verifyDeliveryYesParameter 'verifyDeliveryParam' from the Windows server schema.
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.
Behavior5/5

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

With no annotations provided, the description fully discloses critical behaviors: left-button only, start and endpoint guards, cross-window and tab drag restrictions with error codes, verifyDelivery status shape, and Win11 foreground refusal conditions. It even clarifies that MouseDragNotDelivered is reserved-only and not emitted, setting precise expectations.

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

Conciseness4/5

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

The description is front-loaded with the core action and use cases, and every sentence provides valuable detail. However, it is a dense single paragraph without structural breaks, which could slightly reduce readability. Despite this, the length is justified by the tool's complexity and many behavioral caveats.

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?

The description is exceptionally complete for a complex input tool with no output schema. It covers primary purpose, specific use-cases, error codes, guarded behaviors, verification mechanisms, and example usage. It addresses the richness of the tool effectively, making it fully usable by an AI agent.

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?

The description adds significant meaning beyond the schema by explaining the purpose of windowTitle ('auto-guards the start coordinate'), lensId ('advanced pinned-target workflows'), allowCrossWindowDrag, allowTabDrag, and verifyDelivery (delivery status shape). This complements the 71% schema coverage and clarifies otherwise ambiguous parameters.

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 identifies the tool as a mouse drag operation: 'Click and drag from (startX, startY) to (endX, endY) holding the left mouse button.' It also lists concrete use cases (sliders, drag-and-drop, canvas drawing, window resizing) and gives an example invocation, which distinguishes it from sibling tools like mouse_click and scroll.

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 explicitly states when to use the tool ('for sliders, drag-and-drop, canvas drawing, and window resizing') and provides detailed caveats about blocked scenarios (cross-window drags, tab-strip drags) with specific opt-in flags. It also notes lensId is 'only for advanced pinned-target workflows,' giving clear guidance on when not to use 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