{"record":{"id":"d242d3f0ff556e09","repo":"mastra-ai/mastra","slug":"tool-provider-connections-storage-is-not-configure","errorCode":null,"errorMessage":"Tool provider connections storage is not configured","messagePattern":"Tool provider connections storage is not configured","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"packages/server/src/server/handlers/tool-providers.ts","lineNumber":685,"sourceCode":"  pathParamSchema: toolProviderConnectionPathParams,\n  bodySchema: updateConnectionBodySchema,\n  responseSchema: updateConnectionResponseSchema,\n  summary: 'Update a connection label',\n  description:\n    'Updates the persisted display label on tool_provider_connections. Returns 403 when caller is neither the owner nor admin (and the row is not shared), 404 when the row does not exist.',\n  tags: ['Tool Providers'],\n  requiresAuth: true,\n  handler: async ({ mastra, providerId, connectionId, label, requestContext }) => {\n    try {\n      const editor = requireEditor(mastra.getEditor());\n      const provider = await resolveProvider(editor, providerId);\n      const callerAuthorId = resolveOwnerId(requestContext, mastra.getLogger());\n      const isAdmin = requestContext ? hasAdminBypass(requestContext, TOOL_PROVIDERS_RESOURCE) : false;\n\n      const storage = mastra.getStorage();\n      const store = await storage?.getStore('toolProviderConnections');\n      if (!store) {\n        throw new HTTPException(500, {\n          message: 'Tool provider connections storage is not configured',\n        });\n      }\n\n      const rows = await store.listConnectionsByAuthor({ providerId: provider.info.id });\n      const match = rows.find(r => r.connectionId === connectionId);\n      if (!match) {\n        throw new HTTPException(404, {\n          message: `Connection ${connectionId} not found for provider ${providerId}`,\n        });\n      }\n\n      const isShared = match.scope === 'shared';\n      if (!isShared && match.authorId !== callerAuthorId && !isAdmin) {\n        throw new HTTPException(403, {\n          message: 'You do not have permission to update this connection',\n        });\n      }","sourceCodeStart":667,"sourceCodeEnd":703,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/tool-providers.ts#L667-L703","documentation":"A 500 thrown when the Mastra storage instance has no 'toolProviderConnections' store registered. The handler fails closed because it cannot read or list stored connections without that store. It indicates a missing or incomplete storage configuration rather than a caller mistake.","triggerScenarios":"Any tool-provider connection endpoint (e.g. GET connections list, update, disconnect) where mastra.getStorage() returns undefined or storage.getStore('toolProviderConnections') returns null — i.e. Mastra instantiated without a storage backend supporting tool provider connections.","commonSituations":"Mastra instance created without a storage option (in-memory/no DB setup); storage package version that predates the toolProviderConnections store; storage misconfiguration in mastra/ config after upgrading server but not storage.","solutions":["Configure a storage backend in the Mastra constructor (e.g. LibSQL/Postgres storage instance).","Upgrade @mastra/storage (or your chosen storage adapter) to a version that implements the toolProviderConnections store.","Verify mastra.getStorage() returns the expected instance in your server bootstrap."],"exampleFix":"// before\nnew Mastra({ agents: [agent] });\n// after\nimport { LibSQLStore } from '@mastra/libsql';\nnew Mastra({ agents: [agent], storage: new LibSQLStore({ url: process.env.DATABASE_URL! }) });","handlingStrategy":"validation","validationCode":"const storage = mastra.getStorage();\nconst store = storage ? await storage.getStore('toolProviderConnections') : undefined;\nif (!store) throw new Error('Server storage does not support toolProviderConnections; configure a storage backend.');","typeGuard":"function hasToolProviderStore(s: unknown): s is { getStore(name: 'toolProviderConnections'): Promise<unknown | null> } {\n  return !!s && typeof (s as any).getStore === 'function';\n}","tryCatchPattern":null,"preventionTips":["Always configure a storage backend in Mastra server deployments.","Keep storage adapter versions in sync with @mastra/server.","Assert storage availability in server bootstrap/health checks."],"tags":["http-500","storage","configuration","tool-providers"],"backgroundTag":"missing-storage-configuration","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}