Skip to main content
Glama

browser_drag

Drag and drop elements in Chrome using precise selectors, bypassing anti-bot detection for automation and testing on protected websites.

Instructions

Drag an element to another element

Args: sourceSelector: The selector for the element to drag - required targetSelector: The selector for the target location - required

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceSelectorYes
targetSelectorYes

Implementation Reference

  • The handler function for the 'browser_drag' tool. It is registered via @mcp.tool() decorator. Performs drag-and-drop operation from source element to target element using Selenium's ActionChains.
    @mcp.tool() async def browser_drag( sourceSelector: str, targetSelector: str, ): """Drag an element to another element Args: sourceSelector: The selector for the element to drag - required targetSelector: The selector for the target location - required """ assert sourceSelector, "Source selector is required" assert targetSelector, "Target selector is required" async def drag_handler(driver: uc.Chrome): source = driver.find_element(By.CSS_SELECTOR, sourceSelector) target = driver.find_element(By.CSS_SELECTOR, targetSelector) ActionChains(driver).drag_and_drop(source, target).perform() return await create_success_response( f"Dragged {sourceSelector} to {targetSelector}" ) return await tool.safe_execute( ToolContext(webdriver=await ensure_browser()), drag_handler )

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/dragons96/mcp-undetected-chromedriver'

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