{"record":{"id":"2bec14423215572d","repo":"mastra-ai/mastra","slug":"tool-provider-providerid-does-not-support-getau","errorCode":null,"errorMessage":"Tool provider ${providerId} does not support getAuthStatus","messagePattern":"Tool provider (.+?) does not support getAuthStatus","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"packages/server/src/server/handlers/tool-providers.ts","lineNumber":364,"sourceCode":"/**\n * GET /tool-providers/:providerId/auth-status/:authId — Poll OAuth flow status.\n */\nexport const GET_TOOL_PROVIDER_AUTH_STATUS_ROUTE = createRoute({\n  method: 'GET',\n  path: '/tool-providers/:providerId/auth-status/:authId',\n  responseType: 'json',\n  pathParamSchema: toolProviderAuthStatusPathParams,\n  responseSchema: authStatusToolProviderResponseSchema,\n  summary: 'Get tool provider auth status',\n  description: 'Polls the OAuth flow status for an outstanding authorize call',\n  tags: ['Tool Providers'],\n  requiresAuth: true,\n  handler: async ({ mastra, providerId, authId }) => {\n    try {\n      const editor = requireEditor(mastra.getEditor());\n      const provider = await resolveProvider(editor, providerId);\n      if (!provider.getAuthStatus) {\n        throw new HTTPException(400, { message: `Tool provider ${providerId} does not support getAuthStatus` });\n      }\n      const status = await provider.getAuthStatus(authId);\n      return { status };\n    } catch (error) {\n      return handleError(error, 'Error getting tool provider auth status');\n    }\n  },\n});\n\n/**\n * POST /tool-providers/:providerId/connection-status — Batch-check connection liveness.\n */\nexport const TOOL_PROVIDER_CONNECTION_STATUS_ROUTE = createRoute({\n  method: 'POST',\n  path: '/tool-providers/:providerId/connection-status',\n  responseType: 'json',\n  pathParamSchema: toolProviderIdPathParams,\n  bodySchema: connectionStatusToolProviderBodySchema,","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/tool-providers.ts#L346-L382","documentation":"HTTP 400 thrown by the auth-status handler when the provider does not implement the optional getAuthStatus method. Checking whether an authorization attempt completed is provider-specific, so providers lacking it cannot report auth status.","triggerScenarios":"GET /api/tool-providers/:providerId/auth-status/:authId (tool-providers.ts:364) against a provider registered without getAuthStatus.","commonSituations":"Polling auth status after starting an OAuth flow on a provider that doesn't support status checks; custom provider implemented without the method; SDK/frontend assumes all providers expose status polling.","solutions":["Implement getAuthStatus(authId) on the ToolProvider and re-register it.","Skip status polling for this provider and treat authorization as synchronous if the flow allows.","Upgrade the provider package to a version implementing getAuthStatus.","Check provider capabilities before starting an async auth flow so the UI uses a supported flow."],"exampleFix":"// before\nconst { status } = await api.getAuthStatus(providerId, authId); // 400 if unsupported\n// after\nconst supportsStatus = providerHasMethod(providerId, 'getAuthStatus');\nconst status = supportsStatus ? await api.getAuthStatus(providerId, authId) : 'unsupported';","handlingStrategy":"try-catch","validationCode":"const provider = await api.getProvider(providerId);\nif (typeof provider?.getAuthStatus !== 'function') {\n  return { status: 'unsupported' as const };\n}","typeGuard":"function supportsGetAuthStatus(p: ToolProvider): p is ToolProvider & Required<Pick<ToolProvider, 'getAuthStatus'>> {\n  return typeof p.getAuthStatus === 'function';\n}","tryCatchPattern":"try {\n  return await api.getAuthStatus(providerId, authId);\n} catch (e) {\n  if (e.status === 400 && /does not support getAuthStatus/.test(e.message)) return { status: 'unsupported' };\n  throw e;\n}","preventionTips":["Gate auth-status polling UI on provider capability.","Treat authorization as synchronous for providers without status support.","Upgrade provider packages when status polling becomes required."],"tags":["http-400","tool-providers","missing-capability","oauth"],"backgroundTag":"unsupported-provider-capability","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}