Skip to main content
Glama

Drag and drop for HTML5 drag-and-drop targets

browser_drag_html5

Simulates HTML5 drag-and-drop by dispatching dragstart, dragenter, dragover, drop, and dragend with a real DataTransfer, enabling drops on pages that listen for standard drag events.

Instructions

Perform an HTML5 drag-and-drop by dispatching the DOM events (dragstart/dragenter/dragover/drop/dragend) with a real DataTransfer. WHY THIS EXISTS: MEASURED — the pointer-based browser_drag triggers dragstart and dragover but never drop or dragend, because BiDi only synthesizes mouse/wheel/touch (there is no Input.dispatchDragEvent as in CDP) and Firefox cancels a drag on pointer-up. This tool therefore SIMULATES the drop in page script: it works on pages that listen for the standard drag events, but it is NOT a real drag — pages that check event.isTrusted, or that require genuine OS drag semantics, will still refuse. This exists because of upstream bug 1515879: WebDriver-driven HTML5 DnD never gets a drop event.

Input Schema

NameRequiredDescriptionDefault
dataNoPayload to carry in the DataTransfer (default: the text content of the source element)
mimeTypeNoMIME type for the payload (default text/plain)
toSelectorYesElement to drop onto
fromSelectorYesElement to drag from

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond readOnlyHint=false: it discloses the exact events synthesized, that the drop is simulated in page script rather than a real drag, the underlying BiDi/Firefox limitation and upstream bug, and the resulting failure modes. This is exactly the side-effect context an agent needs before attempting a drag.

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?

Front-loads the action, then the rationale and caveats in clearly labeled clauses; dense but every part is relevant. Mild redundancy in restating the upstream-bug rationale at the end costs it a point.

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?

No output schema exists, but the description makes clear what the tool does and does not achieve, and what kinds of pages it will fail on — everything an agent needs to decide whether to call it or fall back to browser_drag.

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

Parameters3/5

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

Schema description coverage is 100%, so fromSelector, toSelector, data and mimeType (including defaults) are already documented in the schema. The description adds no per-parameter meaning, so the baseline 3 applies.

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?

States a specific verb and resource ('Perform an HTML5 drag-and-drop by dispatching the DOM events ... with a real DataTransfer') and explicitly contrasts it with the sibling pointer-based browser_drag, so an agent can pick between them 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 when-to-use ('works on pages that listen for the standard drag events') and when-not ('pages that check event.isTrusted, or that require genuine OS drag semantics, will still refuse'), plus the named alternative browser_drag and why it fails.

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

Deploy Server

Other Tools