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 itView on GitHub (pinned to 75dd419e61)
Solutions
- List available registries from registryData.registries and use an exact, existing ID.
- Fix typos and use the ID (not the registry name).
- 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
- Enumerate registry IDs from registryData before querying; never guess IDs.
- Use the registry ID, not its display name.
- Re-check valid IDs after upgrading the mcp-registry package.
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
- Template "${slug}" not found. Available templates: ${templat
- EXPERIMENT_TARGET_NOT_FOUND
- Target not found: ${targetType}/${targetId}
- Prompt not found: ${name}
- Lesson "${lessonName}" not found.
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/ddd498af80de8855.
Report an issue: GitHub.