Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

530 B
Raw Blame
import { getMcpRegistryErrorKind } from '../../../services/api/mcpRegistryErrors';

type Translate = (key: string, fallback?: string) => string;

export function mcpRegistryErrorMessage(error: unknown, t: Translate, fallbackKey: string): string {
  const kind = getMcpRegistryErrorKind(error);
  if (kind === 'not_found') return t('mcp.registry.error.notFound');
  if (kind === 'network') return t('mcp.registry.error.network');
  if (kind === 'unavailable') return t('mcp.registry.error.unavailable');
  return t(fallbackKey);
}