{"record":{"id":"360a64c51770c789","repo":"modelcontextprotocol/servers","slug":"32042","errorCode":"-32042","errorMessage":"This request requires browser-based authorization.","messagePattern":"This request requires browser-based authorization\\.","errorType":"error_code","errorClass":"UrlElicitationRequiredError","httpStatus":null,"severity":"error","filePath":"src/everything/tools/trigger-url-elicitation.ts","lineNumber":165,"sourceCode":"        //     path. Without this, the retry would re-enter the error path and\n        //     re-request the prerequisite URL — another loop.\n        if (errorPath) {\n          if (issuedErrorPathElicitations.has(errorPathKey)) {\n            // Retry of a satisfied prerequisite: clear the one-shot marker and\n            // ignore errorPath, falling through to the request path below.\n            issuedErrorPathElicitations.delete(errorPathKey);\n          } else {\n            // Originating call: record that we issued a prerequisite for this\n            // request, then signal the client via -32042.\n            issuedErrorPathElicitations.add(errorPathKey);\n            const prerequisiteElicitation: ElicitRequestURLParams = {\n              mode: \"url\",\n              url: \"https://modelcontextprotocol.io\",\n              message:\n                \"Open this link to satisfy the prerequisite, then retry the request.\",\n              elicitationId: randomUUID(),\n            };\n            throw new UrlElicitationRequiredError(\n              [prerequisiteElicitation],\n              \"This request requires browser-based authorization.\"\n            );\n          }\n        }\n\n        // Request path: send elicitation/create and await the user's response\n        const elicitationResult = await extra.sendRequest(\n          {\n            method: \"elicitation/create\",\n            params: elicitationParams,\n          },\n          ElicitResultSchema,\n          { timeout: 10 * 60 * 1000 /* 10 minutes */ }\n        );\n\n        // Handle different response actions\n        const content: CallToolResult[\"content\"] = [];","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/modelcontextprotocol/servers/blob/76d64c822f5125032f89eb71dbdb94e42b434821/src/everything/tools/trigger-url-elicitation.ts#L147-L183","documentation":"Thrown as `UrlElicitationRequiredError` (MCP error code -32042) by the `trigger-url-elicitation` tool when `errorPath=true` and the call is the originating (non-retry) request. It signals the client that a prerequisite browser-based URL elicitation must be satisfied before the request can proceed. The tool remembers the issued prerequisite; a retry with the same stable key (session+url+callerElicitationId) clears the marker and falls through to the request path.","triggerScenarios":"Calling `trigger-url-elicitation` with `{ errorPath: true, url: ... }` for the first time in a session for that url. The thrown error carries a prerequisite elicitation pointing at `https://modelcontextprotocol.io`. Retrying the identical call after satisfying the prerequisite does NOT re-throw.","commonSituations":"Client does not handle -32042 / URL-elicitation capability, retries with different arguments (changing url or elicitationId) so the one-shot key never matches, or never satisfies the prerequisite so retries keep missing the marker-removal branch. Also: clients that don't advertise `elicitation.url` capability won't even see the tool registered.","solutions":["Satisfy the prerequisite URL elicitation, then retry the original call with identical arguments (same url and caller-supplied elicitationId) so the marker matches and errorPath is ignored.","If you don't want the error-path flow, call the tool with `errorPath: false` (default) to use the request path directly.","Ensure the client advertises `elicitation.url` capability in initialize; otherwise the tool is not registered at all."],"exampleFix":"// before: client ignores -32042 and retries with a new elicitationId each time\n// after: satisfy the prerequisite, then retry with the SAME url + callerElicitationId\ncallTool({ url: 'https://app/auth', errorPath: true, elicitationId: 'stable-id' });\n// ... satisfy prerequisite ...\ncallTool({ url: 'https://app/auth', errorPath: true, elicitationId: 'stable-id' }); // falls through","handlingStrategy":"try-catch","validationCode":"// choose request path to avoid the error entirely\ncallTool({ url, message, errorPath: false });\n// or, for error path: keep callerElicitationId stable across retries\ncallTool({ url, message, errorPath: true, elicitationId: 'stable-id' });","typeGuard":null,"tryCatchPattern":"try {\n  await callTool({ url, errorPath: true, elicitationId: 'stable-id' });\n} catch (e) {\n  if (e instanceof UrlElicitationRequiredError) {\n    // satisfy the prerequisite URL, then RETRY with identical args (same url + elicitationId)\n    await satisfyPrerequisite(e.elicitations);\n    await callTool({ url, errorPath: true, elicitationId: 'stable-id' });\n  }\n}","preventionTips":["Advertise elicitation.url capability in initialize or the tool won't register.","Keep url + callerElicitationId identical between the originating call and the retry.","Prefer errorPath:false unless you specifically need the -32042 flow."],"tags":["mcp","typescript","everything-server","elicitation","error-code-32042","oauth","tools"],"backgroundTag":null,"analyzedSha":"76d64c822f5125032f89eb71dbdb94e42b434821","analyzedAt":"2026-08-12T10:02:41.718Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}