{"record":{"id":"3471624a8ae031a4","repo":"mastra-ai/mastra","slug":"observability-storage-get-score-by-id-not-implemen","errorCode":"OBSERVABILITY_STORAGE_GET_SCORE_BY_ID_NOT_IMPLEMENTED","errorMessage":"This storage provider does not support getting scores by ID","messagePattern":"This storage provider does not support getting scores by ID","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/storage/domains/observability/base.ts","lineNumber":605,"sourceCode":"  }\n\n  /**\n   * Retrieves a list of scores with optional filtering.\n   */\n  async listScores(_args: ListScoresArgs): Promise<ListScoresResponse> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_LIST_SCORES_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support listing scores',\n    });\n  }\n\n  /**\n   * Retrieves a single score by its score ID.\n   */\n  async getScoreById(_scoreId: string): Promise<ScoreRecord | null> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_GET_SCORE_BY_ID_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support getting scores by ID',\n    });\n  }\n\n  async getScoreAggregate(_args: GetScoreAggregateArgs): Promise<GetScoreAggregateResponse> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_GET_SCORE_AGGREGATE_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support score aggregation',\n    });\n  }\n\n  async getScoreBreakdown(_args: GetScoreBreakdownArgs): Promise<GetScoreBreakdownResponse> {\n    throw new MastraError({","sourceCodeStart":587,"sourceCodeEnd":623,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/storage/domains/observability/base.ts#L587-L623","documentation":"getScoreById in the observability storage base throws by default because fetching a single score record by ID is an optional provider capability. Throwing this MastraError signals the configured storage adapter never overrode the method. It is a deliberate capability gap, not data corruption.","triggerScenarios":"Calling storage.getScoreById('<scoreId>') on an adapter that extends the base observability domain without implementing getScoreById — e.g. a custom minimal store or an in-house provider that only persists traces.","commonSituations":"Custom storage adapters written against an older base class; playground/score detail pages pointed at a provider lacking score reads; tests swapping in a stub storage implementation.","solutions":["Use a storage provider that implements score reads (libsql, postgres, upstash, etc.).","Override getScoreById in your custom adapter with a real lookup returning ScoreRecord | null.","Guard the call with try/catch and handle the unsupported case (return null / disable detail view).","Verify the adapter package version matches @mastra/core so the method is implemented."],"exampleFix":"// before\nconst score = await storage.getScoreById(scoreId); // throws on minimal adapter\n// after\ntry {\n  const score = await storage.getScoreById(scoreId);\n} catch (e) {\n  if (e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_GET_SCORE_BY_ID_NOT_IMPLEMENTED') {\n    return null;\n  }\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"const supportsGetScoreById = storage.constructor.prototype.hasOwnProperty('getScoreById');\nif (!supportsGetScoreById) return null;","typeGuard":"function canGetScoreById(s: any): boolean {\n  return typeof s?.getScoreById === 'function' && s.constructor.prototype.hasOwnProperty('getScoreById');\n}","tryCatchPattern":"try {\n  return await storage.getScoreById(scoreId);\n} catch (e) {\n  if (e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_GET_SCORE_BY_ID_NOT_IMPLEMENTED') return null;\n  throw e;\n}","preventionTips":["Verify adapter implements score reads before wiring score detail views","Keep adapter and core versions in lockstep","Stub-test custom adapters against the full storage interface","Surface provider capability in app config rather than discovering at runtime"],"tags":["storage","observability","not-implemented","scores"],"backgroundTag":"storage-capability-not-implemented","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}