{"record":{"id":"6ed91fde55af4de3","repo":"mastra-ai/mastra","slug":"tool-provider-providerid-does-not-support-getco","errorCode":null,"errorMessage":"Tool provider ${providerId} does not support getConnectionStatus","messagePattern":"Tool provider (.+?) does not support getConnectionStatus","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"packages/server/src/server/handlers/tool-providers.ts","lineNumber":393,"sourceCode":" * 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,\n  responseSchema: connectionStatusToolProviderResponseSchema,\n  summary: 'Get connection status for a provider',\n  description: 'Batch-checks whether a set of (connectionId, toolkit) tuples are still connected',\n  tags: ['Tool Providers'],\n  requiresAuth: true,\n  handler: async ({ mastra, providerId, items }) => {\n    try {\n      const editor = requireEditor(mastra.getEditor());\n      const provider = await resolveProvider(editor, providerId);\n      if (!provider.getConnectionStatus) {\n        throw new HTTPException(400, { message: `Tool provider ${providerId} does not support getConnectionStatus` });\n      }\n      const result = await provider.getConnectionStatus({ items });\n      return { items: result };\n    } catch (error) {\n      return handleError(error, 'Error getting connection status');\n    }\n  },\n});\n\n/**\n * GET /tool-providers/:providerId/connections — Existing provider connections\n * scoped to a toolkit. Admin callers can pass `authorId` and `scope` filters;\n * non-admins always see only their own + shared rows.\n */\nexport const LIST_TOOL_PROVIDER_CONNECTIONS_ROUTE = createRoute({\n  method: 'GET',\n  path: '/tool-providers/:providerId/connections',\n  responseType: 'json',","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/tool-providers.ts#L375-L411","documentation":"HTTP 400 thrown by the connection-status handler when the provider does not implement the optional getConnectionStatus method. Batch health checks of stored connections are opt-in, so providers lacking the method cannot report connection state.","triggerScenarios":"POST /api/tool-providers/:providerId/connection-status with an items list (tool-providers.ts:393) against a provider registered without getConnectionStatus.","commonSituations":"A monitoring dashboard or UI polls status for all providers uniformly; custom provider only implements authorize/disconnect; provider package version predates getConnectionStatus.","solutions":["Implement getConnectionStatus({ items }) on the ToolProvider and re-register it.","Exclude this provider from status polling in the caller.","Upgrade the provider package to a version implementing getConnectionStatus.","Gate the status UI on a capabilities check per provider."],"exampleFix":"// before\nclass MyProvider implements ToolProvider { async authorize() { /* ... */ } }\n// after\nclass MyProvider implements ToolProvider {\n  async authorize() { /* ... */ }\n  async getConnectionStatus({ items }) {\n    return items.map(i => ({ connectionId: i.connectionId, status: 'connected' }));\n  }\n}","handlingStrategy":"try-catch","validationCode":"const provider = await api.getProvider(providerId);\nif (typeof provider?.getConnectionStatus !== 'function') {\n  return { items: [] };\n}","typeGuard":"function supportsGetConnectionStatus(p: ToolProvider): p is ToolProvider & Required<Pick<ToolProvider, 'getConnectionStatus'>> {\n  return typeof p.getConnectionStatus === 'function';\n}","tryCatchPattern":"try {\n  return await api.getConnectionStatus(providerId, items);\n} catch (e) {\n  if (e.status === 400 && /does not support getConnectionStatus/.test(e.message)) return { items: [] };\n  throw e;\n}","preventionTips":["Skip status checks for providers lacking getConnectionStatus.","Mark status column as 'unknown' instead of erroring in dashboards.","Implement getConnectionStatus in custom providers used in monitored environments."],"tags":["http-400","tool-providers","missing-capability","connections"],"backgroundTag":"unsupported-provider-capability","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}