Skip to main content
Glama

drop_file

Simulate dropping a file onto a file-upload dropzone by creating a synthetic file and dispatching dragenter, dragover, and drop events for upload handler testing.

Instructions

Simulate dropping a file onto a dropzone element. Creates a synthetic File with the given name, content, and MIME type, then dispatches HTML5 DragEvent sequence (dragenter, dragover, drop) on the target element. Use for file upload dropzones (Dropzone.js, react-dropzone, native HTML5 drop handlers). For drag-and-drop of DOM elements (not files), use drag_drop instead. Related: drag_drop (drag DOM elements between containers), get_dom_snapshot (find dropzone selectors). Multi-agent: agent-scoped tabs; cross-agent reject with TAB_NOT_OWNED; cap configurable (default 8, 1-64). Pass tab_id only when this agent owns multiple tabs; auto-resolves otherwise. RETURNS change_report: when this tool runs, the response includes a change_report field with a compact diff of what the action mutated (URL, dialogs_opened, nodes_added, nodes_removed, attrs_changed, inputs_changed, focus_shift). Use this to learn the consequence without calling read_page next. If the report exceeds the size cap, change_report.truncated:true and change_report_hint are set; call read_page for the full state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientYesAllowlisted client label. Validated against the shared v0.9.36 server/extension allowlist (see mcp/src/tools/visual-session.ts -- MCP_VISUAL_CLIENT_LABELS). Required.
tab_idNoOptional. Tab id this action targets. Omit when the calling agent owns exactly one tab; pass to disambiguate when the agent owns multiple. Single-tab agents and legacy popup/sidepanel/autopilot do not need to pass this.
fileNameNoName of the synthetic file to drop (e.g., "photo.jpg", "document.pdf")
is_finalNoWhen true, the visual session clears immediately after this tool resolves. Optional (default false).
mimeTypeNoMIME type of the file (e.g., "text/plain", "image/png", "application/pdf")
selectorYesCSS selector for the dropzone element (the area where files are dropped)
fileContentNoText content of the file (for text-based files)
visual_reasonYesShort human-readable reason shown in the overlay (for example, "Logging in to GitHub"). Required.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it discloses the synthetic File construction, the exact event sequence dispatched, multi-agent tab ownership rules with the TAB_NOT_OWNED cross-agent rejection, the configurable concurrency cap (default 8, range 1-64), and when tab_id is required. It also documents the change_report return, its fields, and the truncation behavior.

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-loaded with the core action and mechanism, then alternatives, then the operational notes and return shape. Nearly every sentence earns its place, though the multi-agent/tab-ownership and cap paragraph is dense enough to slightly dilute the main guidance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter tool with no output schema, it covers execution mechanics, concurrency semantics, and the return payload including the truncated/hint fallback to read_page. The one notable gap is that the sibling upload_file is never mentioned, so the distinction between dropping a file onto a dropzone and uploading via a file input is left implicit.

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 schema already documents all eight parameters and the baseline is 3. The description adds genuine context for tab_id (ownership-based resolution) and clarifies how fileName/fileContent/mimeType combine into the synthetic File, but it adds nothing for selector, client, visual_reason, or is_final beyond 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?

States a specific verb and resource ("Simulate dropping a file onto a dropzone element") and explains the mechanism: a synthetic File plus an HTML5 DragEvent sequence (dragenter, dragover, drop). It explicitly distinguishes itself from drag_drop for DOM-element dragging, so an agent can route correctly without opening either 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?

Names the target use cases concretely (Dropzone.js, react-dropzone, native HTML5 drop handlers) and gives an explicit exclusion with the alternative: "For drag-and-drop of DOM elements (not files), use drag_drop instead." It also points to get_dom_snapshot for finding dropzone selectors.

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