{"record":{"id":"2a6e4c61a607bded","repo":"n8n-io/n8n","slug":"operation-not-supported-upload","errorCode":null,"errorMessage":"Operation not supported: upload","messagePattern":"Operation not supported: upload","errorType":"exception","errorClass":"UnsupportedOperationError","httpStatus":null,"severity":"warning","filePath":"packages/@n8n/mcp-browser/src/adapters/agent-browser.ts","lineNumber":421,"sourceCode":"\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,\n\t\t_files: string[],\n\t): Promise<void> {\n\t\tawait Promise.resolve();\n\t\tthrow new UnsupportedOperationError('upload', this.name);\n\t}\n\n\tasync dialog(_pageId: string, _action: 'accept' | 'dismiss', _text?: string): Promise<string> {\n\t\tawait Promise.resolve();\n\t\tthrow new UnsupportedOperationError('dialog', this.name);\n\t}\n\n\t// =========================================================================\n\t// Inspection\n\t// =========================================================================\n\n\tasync snapshot(\n\t\tpageId: string,\n\t\t_target?: ElementTarget,\n\t\tinteractive = true,\n\t): Promise<SnapshotResult> {\n\t\tawait this.switchToTab(pageId);\n\t\tconst args = interactive ? ['snapshot', '-i'] : ['snapshot'];","sourceCodeStart":403,"sourceCodeEnd":439,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/mcp-browser/src/adapters/agent-browser.ts#L403-L439","documentation":"Thrown as UnsupportedOperationError('upload', 'agent-browser') by the agent-browser adapter's upload() stub. The agent-browser CLI has no file-upload command, so the adapter explicitly rejects the operation. UnsupportedOperationError extends McpBrowserError with a hint that the operation is unavailable for agent-browser sessions. The Playwright adapter supports upload; agent-browser does not.","triggerScenarios":"Calling adapter.upload(pageId, target, files) on an AgentBrowserAdapter instance. The method awaits a resolved promise then throws synchronously.","commonSituations":"A tool layer calls upload() generically without checking the adapter capability; migrating from Playwright adapter to agent-browser; an LLM emitted an upload tool call against an agent-browser session.","solutions":["Switch to the Playwright adapter for sessions that need file upload.","Gate upload behind adapter.name === 'playwright' before calling.","Surface upload as an unsupported capability to the LLM/tool layer so it doesn't emit the call."],"exampleFix":"// before\nawait adapter.upload(pageId, target, ['/tmp/file.csv']);\n\n// after — capability gate\nif (adapter.name === 'playwright') {\n  await adapter.upload(pageId, target, ['/tmp/file.csv']);\n} else {\n  throw new Error('File upload is not supported in this browser session.');\n}","handlingStrategy":"validation","validationCode":"function adapterSupportsUpload(name: string): boolean {\n  return name === 'playwright';\n}","typeGuard":"function supportsUpload(adapter: Adapter): boolean {\n  return adapter.name !== 'agent-browser';\n}","tryCatchPattern":null,"preventionTips":["Check adapter.name before calling upload().","Use the Playwright adapter for sessions that need file upload.","Surface upload as an unsupported capability to the caller."],"tags":["mcp-browser","agent-browser","unsupported","upload","capability"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}