{"record":{"id":"819ca98677f8fee9","repo":"mastra-ai/mastra","slug":"tool-provider-providerid-does-not-support-listc","errorCode":null,"errorMessage":"Tool provider ${providerId} does not support listConnections","messagePattern":"Tool provider (.+?) does not support listConnections","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"packages/server/src/server/handlers/tool-providers.ts","lineNumber":434,"sourceCode":"  description:\n    'Returns existing provider connections on a toolkit, so the picker can offer them for pinning without re-running OAuth',\n  tags: ['Tool Providers'],\n  requiresAuth: true,\n  handler: async ({\n    mastra,\n    providerId,\n    toolkit,\n    authorId: queryAuthorId,\n    scope: queryScope,\n    page,\n    perPage,\n    requestContext,\n  }) => {\n    try {\n      const editor = requireEditor(mastra.getEditor());\n      const provider = await resolveProvider(editor, providerId);\n      if (!provider.listConnections) {\n        throw new HTTPException(400, { message: `Tool provider ${providerId} does not support listConnections` });\n      }\n      const callerAuthorId = resolveOwnerId(requestContext, mastra.getLogger());\n      const isAdmin = requestContext ? hasAdminBypass(requestContext, TOOL_PROVIDERS_RESOURCE) : false;\n\n      const requestedAuthorId =\n        isAdmin && typeof queryAuthorId === 'string' && queryAuthorId.length > 0 ? queryAuthorId : undefined;\n      const effectiveAuthorId = isAdmin ? requestedAuthorId : callerAuthorId;\n\n      const storage = mastra.getStorage();\n      const store = await storage?.getStore('toolProviderConnections');\n\n      // Strategy B: seed userIds[] from persisted rows so admins can enumerate\n      // connections owned by other authors.\n      let labelRows: Array<{\n        authorId: string;\n        connectionId: string;\n        label: string | null;\n        scope: 'shared' | 'per-author' | 'caller-supplied';","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/tool-providers.ts#L416-L452","documentation":"HTTP 400 thrown by the list-connections handler when the provider does not implement the optional listConnections method. Enumerating stored connections for a provider is opt-in, so providers lacking the method cannot list their connections.","triggerScenarios":"GET /api/tool-providers/:providerId/connections (tool-providers.ts:434) against a provider registered without listConnections.","commonSituations":"A connections settings page lists connections for every registered provider; custom provider implemented without the method; provider package version predates listConnections.","solutions":["Implement listConnections(...) on the ToolProvider and re-register it.","Hide the provider from the connections UI when it doesn't support listing.","Upgrade the provider package to a version implementing listConnections.","Catch the 400 and render an 'unsupported' state for that provider instead of failing the page."],"exampleFix":"// before\nfor (const id of providerIds) connections[id] = await api.listConnections(id); // 400 for some\n// after\nconst connections = Object.fromEntries(\n  (await Promise.all(providerIds.map(async id => [id,\n    supportsList(id) ? await api.listConnections(id).catch(() => null) : null])) as const)\n);","handlingStrategy":"try-catch","validationCode":"const provider = await api.getProvider(providerId);\nif (typeof provider?.listConnections !== 'function') {\n  return [];\n}","typeGuard":"function supportsListConnections(p: ToolProvider): p is ToolProvider & Required<Pick<ToolProvider, 'listConnections'>> {\n  return typeof p.listConnections === 'function';\n}","tryCatchPattern":"try {\n  return await api.listConnections(providerId);\n} catch (e) {\n  if (e.status === 400 && /does not support listConnections/.test(e.message)) return [];\n  throw e;\n}","preventionTips":["Render an 'unsupported' state instead of failing the connections page per provider.","Implement listConnections in providers that will appear in connection settings UI.","Discover provider capabilities once and cache them per session."],"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"}