koala73/worldmonitor · error · McpSourceUnavailableError

No convergence input feeds are available

Error message

No convergence input feeds are available

What it means

McpSourceUnavailableError thrown by requireAnyInput (api/mcp/registry/analysis-tools.ts:173) for the convergence analysis tool: every input cache payload read via readCachesWithFreshness came back null, so no live input feed exists to compute convergence from. The error preserves freshness.unavailable_inputs (genuine cache misses) and freshness.failed_inputs (Redis reads that errored) so dispatch can surface them in JSON-RPC error.data and the caller can distinguish a retryable outage from an unseeded dataset.

Source

Thrown at api/mcp/registry/analysis-tools.ts:179

    items: { type: 'string' },
    description: 'Required cache keys that were missing or unreadable; their contribution is not treated as quiet.',
  },
  failed_inputs: {
    type: 'array',
    items: { type: 'string' },
    description: 'Subset of unavailable_inputs whose Redis read failed rather than returning a genuine miss.',
  },
} as const;

type AnalysisFreshness = Awaited<ReturnType<typeof readCachesWithFreshness>>['freshness'];

function requireAnyInput(
  payloads: unknown[],
  freshness: AnalysisFreshness,
  message: string,
): void {
  if (payloads.every((value) => value === null)) {
    throw new McpSourceUnavailableError(
      message,
      freshness.unavailable_inputs,
      freshness.failed_inputs,
    );
  }
}

function resolveLimit(raw: unknown, fallback: number): number {
  if (raw === undefined || raw === null) return fallback;
  const parsed = Math.round(Number(raw));
  if (!Number.isFinite(parsed)) return fallback;
  if (parsed <= 0) return Number.POSITIVE_INFINITY;
  return parsed;
}

// Keep the analysis schemas aligned with cacheEnvelope(). Content age is not a
// universal rule: evaluateFreshness() applies it only to checks that explicitly
// declare honorContentAge.

View on GitHub (pinned to 9361220cc0)

Solutions

  1. Inspect error.data.unavailable_inputs vs failed_inputs: failed_inputs present means Redis read errors (check Upstash); all-miss means the producer has not written
  2. Check /api/health for the convergence input keys' freshness/seed-meta markers
  3. Retry after the producer's next publish cycle if it is a timing gap
  4. If keys are absent and should exist, run the corresponding seed script or restart the producer job
Defensive patterns

Strategy: retry

Validate before calling

// Pre-check the convergence inputs' freshness on the health surface
const health = await fetch('https://<host>/api/health').then(r => r.json());
const inputsReady = convergenceInputKeys.every(k => health?.datasets?.[k]?.fresh !== false);

Type guard

function isSourceUnavailable(e) {
  return typeof e === 'object' && e !== null
    && (e.name === 'McpSourceUnavailableError'
      || (Array.isArray(e.data?.unavailable_inputs) && Array.isArray(e.data?.failed_inputs)));
}

Try / catch

try {
  const r = await client.callTool('get_convergence_analysis', args);
} catch (e) {
  if (isSourceUnavailable(e)) {
    const { unavailable_inputs = [], failed_inputs = [] } = e.data ?? {};
    if (failed_inputs.length > 0) return retryWithBackoff(call, 3);   // Redis read failures — retryable
    scheduleRetry(producerCadenceMs);                                   // genuine miss — wait for producer
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling the convergence analysis tool while all of its input cache keys are null — upstream producer pipelines (news/analysis writers) stopped publishing, keys expired between producer runs, Redis read failures, or a deployment where the analysis seeds have never run.

Common situations: New environment without seed data. Producer cron/edge job failure upstream of MCP. Upstash degradation turning reads into nulls. Post-deploy window before the first producer cycle completes.

Related errors


AI-assisted analysis of koala73/worldmonitor@9361220cc0 (2026-08-21). Data as JSON: /api/errors/e4db497b3ab3fb3b. Report an issue: GitHub.