{"record":{"id":"4f7bd208b997c3c0","repo":"n8n-io/n8n","slug":"operation-not-supported-pdf","errorCode":null,"errorMessage":"Operation not supported: pdf","messagePattern":"Operation not supported: pdf","errorType":"exception","errorClass":"UnsupportedOperationError","httpStatus":null,"severity":"warning","filePath":"packages/@n8n/mcp-browser/src/adapters/agent-browser.ts","lineNumber":526,"sourceCode":"\tgetConsoleSummary(_pageId: string): { errors: number; warnings: number } {\n\t\treturn { errors: 0, warnings: 0 };\n\t}\n\n\tgetModalStates(_pageId: string): ModalState[] {\n\t\treturn [];\n\t}\n\n\tasync getNetwork(_pageId: string, _filter?: string, _clear?: boolean): Promise<NetworkEntry[]> {\n\t\tawait Promise.resolve();\n\t\treturn [];\n\t}\n\n\tasync pdf(\n\t\t_pageId: string,\n\t\t_options?: { format?: string; landscape?: boolean },\n\t): Promise<{ data: string; pages: number }> {\n\t\tawait Promise.resolve();\n\t\tthrow new UnsupportedOperationError('pdf', this.name);\n\t}\n\n\t// =========================================================================\n\t// Wait\n\t// =========================================================================\n\n\tasync wait(pageId: string, options: WaitOptions): Promise<number> {\n\t\tawait this.switchToTab(pageId);\n\t\tconst timeout = options.timeoutMs ?? 30_000;\n\t\tconst start = Date.now();\n\t\tif (options.selector) {\n\t\t\tAgentBrowserAdapter.assertSafeArg(options.selector, 'selector');\n\t\t\tawait this.run(['wait', options.selector], timeout + 5_000);\n\t\t} else if (options.text) {\n\t\t\tawait this.run(['wait', 'text=' + options.text], timeout + 5_000);\n\t\t} else if (options.timeoutMs) {\n\t\t\tawait this.run(['wait', String(options.timeoutMs)], timeout + 5_000);\n\t\t} else {","sourceCodeStart":508,"sourceCodeEnd":544,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/mcp-browser/src/adapters/agent-browser.ts#L508-L544","documentation":"Thrown as UnsupportedOperationError('pdf', 'agent-browser') by the agent-browser adapter's pdf() stub. The agent-browser CLI cannot render PDFs, so the adapter explicitly rejects the operation. UnsupportedOperationError extends McpBrowserError. The Playwright adapter supports pdf rendering; agent-browser does not.","triggerScenarios":"Calling adapter.pdf(pageId, options?) on an AgentBrowserAdapter instance. The method awaits a resolved promise then throws synchronously.","commonSituations":"A tool layer calls pdf() generically across adapters; migrating from Playwright to agent-browser; an LLM emitted a pdf-generation tool call against an agent-browser session.","solutions":["Switch to the Playwright adapter when PDF generation is required.","Gate pdf behind adapter.name === 'playwright' before calling.","For agent-browser, capture a screenshot() instead if a visual snapshot is acceptable."],"exampleFix":"// before\nconst pdf = await adapter.pdf(pageId);\n\n// after — fall back to screenshot on agent-browser\nconst image = adapter.name === 'playwright'\n  ? await adapter.pdf(pageId)\n  : await adapter.screenshot(pageId);","handlingStrategy":"validation","validationCode":"function adapterSupportsPdf(name: string): boolean {\n  return name === 'playwright';\n}","typeGuard":"function supportsPdf(adapter: Adapter): boolean {\n  return adapter.name !== 'agent-browser';\n}","tryCatchPattern":null,"preventionTips":["Check adapter.name before calling pdf().","Fall back to screenshot() on agent-browser if a visual capture suffices.","Use the Playwright adapter when PDF output is required."],"tags":["mcp-browser","agent-browser","unsupported","pdf","capability"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}