mastra-ai/mastra · error · Error

Registry with ID "${registryId}" not found.

Error message

Registry with ID "${registryId}" not found.

What it means

fetchServersFromRegistry looks up a registry by ID in the bundled registryData. If no registry entry has that ID, it throws 'Registry with ID "<id>" not found.' — the caller referenced a registry that is not present in the registry data.

Source

Thrown at packages/mcp-registry-registry/src/registry/fetch-servers.ts:13

import { registryData } from './registry';
import type { ServerEntry } from './types';

/**
 * Fetches servers from a registry's servers_url endpoint
 */
export async function fetchServersFromRegistry(registryId: string): Promise<ServerEntry[]> {
  try {
    // Find the registry in our registry data
    const registry = registryData.registries.find(r => r.id === registryId);

    if (!registry) {
      throw new Error(`Registry with ID "${registryId}" not found.`);
    }

    if (!registry.servers_url) {
      throw new Error(`Registry "${registry.name}" does not have a servers endpoint.`);
    }

    console.info(`Fetching servers from ${registry.name} at ${registry.servers_url}`);

    // Fetch the servers from the registry's servers_url
    const response = await fetch(registry.servers_url);

    if (!response.ok) {
      throw new Error(`Failed to fetch servers from ${registry.servers_url}: ${response.statusText}`);
    }

    const data = (await response.json()) as unknown;

    // If the registry has a custom post-processing function, use it

View on GitHub (pinned to 75dd419e61)

Solutions

  1. List available registries from registryData.registries and use an exact, existing ID.
  2. Fix typos and use the ID (not the registry name).
  3. If the registry existed in an older version, check the package changelog for renames/removals and update the ID.

Example fix

// before
await fetchServersFromRegistry('Mastra Registry');
// after
await fetchServersFromRegistry('mastra'); // exact registry ID from registryData
Defensive patterns

Strategy: validation

Validate before calling

import { registryData } from './registry-data';
const validIds = registryData.registries.map(r => r.id);
if (!validIds.includes(registryId)) {
  throw new Error(`Unknown registryId "${registryId}". Available: ${validIds.join(', ')}`);
}
await fetchServersFromRegistry(registryId);

Try / catch

try {
  const servers = await fetchServersFromRegistry(registryId);
} catch (e) {
  if (e instanceof Error && e.message.startsWith('Registry with ID')) {
    // list valid registry IDs for the caller instead of failing hard
  } else throw e;
}

Prevention

When it happens

Trigger: Calling the servers tool (via fetchServersFromRegistry) with a registryId that does not exist in registryData.registries — misspelled ID, deleted/renamed registry, or querying an external registry that is not in the bundled data.

Common situations: Agents guessing registry IDs; registry data updated/renamed between package versions so old IDs no longer resolve; copy-paste of a registry name instead of its ID.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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