Skip to main content
Glama

pilot_drag

Drag elements between positions in a browser using source and target references for browser automation tasks.

Instructions

Drag from one element to another.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_refYesSource element ref or CSS selector
end_refYesTarget element ref or CSS selector

Implementation Reference

  • The 'pilot_drag' tool handler implementation, which uses Playwright's `dragTo` method to perform a drag-and-drop operation between two elements.
    server.tool(
      'pilot_drag',
      'Drag from one element to another.',
      {
        start_ref: z.string().describe('Source element ref or CSS selector'),
        end_ref: z.string().describe('Target element ref or CSS selector'),
      },
      async ({ start_ref, end_ref }) => {
        await bm.ensureBrowser();
        try {
          const page = bm.getPage();
          const startResolved = await bm.resolveRef(start_ref);
          const endResolved = await bm.resolveRef(end_ref);
    
          const startLocator = 'locator' in startResolved ? startResolved.locator : page.locator(startResolved.selector);
          const endLocator = 'locator' in endResolved ? endResolved.locator : page.locator(endResolved.selector);
    
          await startLocator.dragTo(endLocator, { timeout: 5000 });
          bm.resetFailures();
          return { content: [{ type: 'text' as const, text: `Dragged ${start_ref} → ${end_ref}` }] };
        } catch (err) {
          bm.incrementFailures();
          return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true };
        }
      }
    );
Behavior2/5

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

No annotations are provided, yet the description fails to disclose critical behavioral details: whether the operation requires visible elements, if it simulates mouseDown-move-mouseUp sequence, what happens if the drag fails, or whether it triggers specific drag events.

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?

Single sentence with no filler words. Front-loaded with the operative verb. However, the brevity leaves significant gaps in behavioral context that could have been addressed in a second sentence without harming conciseness.

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?

Browser drag operations involve complex mouse event simulation and visibility prerequisites. Given zero annotations and no output schema, the description should disclose success conditions, failure modes, or event triggers, but omits all behavioral context.

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?

With 100% schema description coverage (both start_ref and end_ref fully documented), the description serves only to reinforce the 'from-to' relationship without adding syntax details, format examples, or constraints beyond what the schema already provides.

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 clear verb (drag) and resources (elements), mapping to the two parameters (start_ref, end_ref). While minimal, it communicates the core operation effectively without being tautological.

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?

Provides no guidance on when to use this tool versus alternatives like pilot_click or pilot_hover, nor does it mention typical use cases such as drag-and-drop reordering vs. text selection.

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/TacosyHorchata/Pilot'

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