mastra-ai/mastra · error · HTTPException

New observability endpoints require @mastra/core >= 1.13.2,

Error message

New observability endpoints require @mastra/core >= 1.13.2, please upgrade.

What it means

A 501 Not Implemented gate in the new observability route wrapper (createNewRoute) of @mastra/server. Before executing any wrapped handler it checks coreFeatures.has('observability:v1.13.2'); if the loaded @mastra/core does not advertise that feature flag, every wrapped route (list logs, list/create/get scores, aggregates, breakdowns) refuses to run and asks you to upgrade @mastra/core to >= 1.13.2.

Source

Thrown at packages/server/src/server/handlers/observability-new-endpoints.ts:105

  config: {
    pathParamSchema?: TPathSchema;
    queryParamSchema?: TQuerySchema;
    bodySchema?: TBodySchema;
    responseSchema?: TResponseSchema;
    handler: ServerRouteHandler<InferParams<TPathSchema, TQuerySchema, TBodySchema>>;
  },
) {
  const { handler, ...schemas } = config;
  return createRoute({
    ...def,
    ...schemas,
    responseType: 'json' as const,
    tags: ['Observability'],
    requiresAuth: true,
    handler: (async (params: InferParams<TPathSchema, TQuerySchema, TBodySchema> & ServerContext) => {
      try {
        if (!coreFeatures.has('observability:v1.13.2')) {
          throw new HTTPException(501, {
            message: 'New observability endpoints require @mastra/core >= 1.13.2, please upgrade.',
          });
        }

        return await handler(params);
      } catch (error) {
        return handleError(error, `Error calling: '${def.summary.toLocaleLowerCase()}'`);
      }
    }) as ServerRouteHandler<
      InferParams<TPathSchema, TQuerySchema, TBodySchema>,
      TResponseSchema extends z.ZodTypeAny ? z.infer<TResponseSchema> : unknown,
      'json'
    >,
  });
}

// ============================================================================
// Log Routes

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Upgrade @mastra/core to >= 1.13.2: `pnpm install @mastra/core@latest` (or matching minor) and commit the updated lockfile.
  2. Rebuild dependencies after the bump (`pnpm install`, then build relevant packages) so the server sees the new core features.
  3. Verify only one @mastra/core version is installed: `pnpm why @mastra/core` / dedupe if multiple versions resolve.
  4. If you must stay on older core, use the legacy observability endpoints instead of the new v1.13.2 routes.

Example fix

// before (package.json)
"@mastra/core": "1.12.0"
// after
"@mastra/core": "^1.13.2"
Defensive patterns

Strategy: fallback

Validate before calling

const supported = typeof coreFeatures?.has === 'function' && coreFeatures.has('observability:v1.13.2');
if (!supported) console.warn('Upgrade @mastra/core >= 1.13.2 for new observability endpoints.');

Type guard

function supportsObservabilityV2(features: Set<string> | undefined): boolean {
  return !!features?.has('observability:v1.13.2');
}

Try / catch

try {
  const res = await fetch('/api/observability/scores');
  return await res.json();
} catch (e) {
  if (e instanceof HTTPException && e.status === 501) {
    // fall back to legacy observability endpoints
  } else throw e;
}

Prevention

When it happens

Trigger: Hitting any of LIST_LOGS, LIST_SCORES, CREATE_SCORE, GET_SCORE, GET_SCORE_AGGREGATE, or GET_SCORE_BREAKDOWN endpoints while the workspace resolves @mastra/core < 1.13.2 (or a build whose feature set omits 'observability:v1.13.2').

Common situations: pnpm/yarn lockfile pinning an older @mastra/core while @mastra/server was updated; monorepo with mismatched workspace versions; deployed artifact bundling a stale core; skipping `pnpm install`/rebuild after upgrading server packages (AGENTS.md notes unresolved workspace issues often mean deps need building).

Related errors


AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30). Data as JSON: /api/errors/6100a2ee39c5f3e6. Report an issue: GitHub.