{"record":{"id":"7f6bde4c4a6dd677","repo":"n8n-io/n8n","slug":"operation-not-supported-drag","errorCode":null,"errorMessage":"Operation not supported: drag","messagePattern":"Operation not supported: drag","errorType":"exception","errorClass":"UnsupportedOperationError","httpStatus":null,"severity":"warning","filePath":"packages/@n8n/mcp-browser/src/adapters/agent-browser.ts","lineNumber":399,"sourceCode":"\t\tconst resp = await this.run(['eval', script]);\n\t\tif (!resp.success) throw new Error(resp.error ?? 'select failed');\n\t\treturn Array.isArray(resp.data) ? (resp.data as string[]) : values;\n\t}\n\n\tasync hover(pageId: string, target: ElementTarget): Promise<void> {\n\t\tawait this.switchToTab(pageId);\n\t\tawait this.runAction(['hover', this.resolveTarget(target)]);\n\t}\n\n\tasync press(pageId: string, keys: string): Promise<void> {\n\t\tAgentBrowserAdapter.assertSafeArg(keys, 'key');\n\t\tawait this.switchToTab(pageId);\n\t\tawait this.runAction(['press', keys]);\n\t}\n\n\tasync drag(_pageId: string, _from: ElementTarget, _to: ElementTarget): Promise<void> {\n\t\tawait Promise.resolve();\n\t\tthrow new UnsupportedOperationError('drag', this.name);\n\t}\n\n\tasync scroll(pageId: string, target?: ElementTarget, options?: ScrollOptions): Promise<void> {\n\t\tawait this.switchToTab(pageId);\n\t\tif (target) {\n\t\t\tawait this.runAction(['scrollintoview', this.resolveTarget(target)]);\n\t\t} else {\n\t\t\tawait this.runAction([\n\t\t\t\t'scroll',\n\t\t\t\toptions?.direction ?? 'down',\n\t\t\t\tString(options?.amount ?? 300),\n\t\t\t]);\n\t\t}\n\t}\n\n\tasync upload(\n\t\t_pageId: string,\n\t\t_target: ElementTarget | undefined,","sourceCodeStart":381,"sourceCodeEnd":417,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/mcp-browser/src/adapters/agent-browser.ts#L381-L417","documentation":"Thrown as UnsupportedOperationError('drag', 'agent-browser') by the agent-browser adapter's drag() stub. The agent-browser CLI has no drag command, so the adapter explicitly rejects the operation rather than silently no-op'ing. UnsupportedOperationError extends McpBrowserError and carries a hint that the operation is not available for agent-browser sessions.","triggerScenarios":"Calling adapter.drag(pageId, fromTarget, toTarget) on an AgentBrowserAdapter instance. The method awaits a resolved promise (to satisfy the async signature) then throws synchronously, so the rejection is immediate.","commonSituations":"A tool/orchestrator layer calls drag() generically across adapters without checking capability; a caller migrated from the Playwright adapter (which supports drag) to agent-browser; an LLM tool emitted a drag action against an agent-browser session.","solutions":["Check adapter.name === 'agent-browser' before calling drag, and either skip the action or switch to the Playwright adapter.","Emulate drag with a sequence of hover + mouse-down-equivalent clicks if the page supports it.","Gate drag behind a capability check surfaced to the LLM so it doesn't emit unsupported actions."],"exampleFix":"// before\nawait adapter.drag(pageId, from, to);\n\n// after — guard by adapter capability\nif (adapter.name === 'playwright') {\n  await adapter.drag(pageId, from, to);\n} else {\n  // emulate, or surface 'unsupported' to the caller\n}","handlingStrategy":"validation","validationCode":"function adapterSupportsDrag(name: string): boolean {\n  return name === 'playwright';\n}","typeGuard":"function supportsDrag(adapter: Adapter): boolean {\n  return adapter.name !== 'agent-browser';\n}","tryCatchPattern":null,"preventionTips":["Check adapter.name before calling drag() — gate unsupported adapters.","Surface capability metadata to the LLM so it doesn't emit unsupported actions.","Prefer the Playwright adapter for sessions that need drag."],"tags":["mcp-browser","agent-browser","unsupported","drag","capability"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}