Skip to main content
Glama
Playwright MCP Server

Playwright MCP Server

by sohitmahato

playwright_drag_and_drop

Drag an element to a specified drop target using CSS selectors for source and target, automating browser drag-and-drop interactions.

Instructions

Drag and drop an element

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sourceSelector": "<sourceSelector>",
      "targetSelector": "<targetSelector>"
    },
    "name": "playwright_drag_and_drop"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourceSelectorYesCSS selector of element to drag
targetSelectorYesCSS selector of drop target

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full behavioral burden and discloses almost nothing: not whether it dispatches HTML5 dragstart/dragover/drop events versus mouse-move sequences, not whether it scrolls elements into view or waits for the target, and not what happens on failure or timeout. Only the bare action is conveyed.

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?

A single front-loaded phrase with zero wasted words and a clear verb-resource shape. It is efficient, though the brevity leaves the substantive gaps captured in the other dimensions.

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

Completeness2/5

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

Drag-and-drop is a behaviorally subtle action in browser automation, and with no annotations and no output schema the description should explain event model and success semantics. Instead it provides only the action label, leaving an agent unable to predict how the drag is performed.

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%, with both sourceSelector and targetSelector documented as CSS selectors in the schema itself. The description adds no meaning beyond that, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ("Drag and drop an element") that is clearly distinguishable from sibling actions like playwright_click and playwright_hover. It does not explicitly name those siblings, but the action itself is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to prefer this over alternatives such as click, hover, or select, and no prerequisites stated (page loaded, elements visible, drag source interactable). The agent must infer all usage conditions from the name alone.

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