koala73/worldmonitor · error · McpSourceUnavailableError

No event feeds are available for exposure enrichment

Error message

No event feeds are available for exposure enrichment

What it means

McpSourceUnavailableError thrown by requireAnyInput (api/mcp/registry/analysis-tools.ts:173) for exposure enrichment: the event feeds the enrichment pass needs are all null, so the tool cannot correlate exposures with events. Typed fields expose unavailable_inputs (genuine misses) and failed_inputs (Redis errors) for downstream classification.

Solutions

  1. Check error.data.failed_inputs for Redis-side failures vs unavailable_inputs for unseeded keys
  2. Verify event feed freshness on /api/health
  3. Retry after the event producer's next run
  4. Run the event feed seed script if keys are missing in this environment
Defensive patterns

Strategy: retry

Validate before calling

const health = await fetch('https://<host>/api/health').then(r => r.json());
if (eventFeedKeys.some(k => health?.datasets?.[k]?.fresh === false)) defer('event feeds stale');

Type guard

function isSourceUnavailable(e) {
  return e?.name === 'McpSourceUnavailableError' || Array.isArray(e?.data?.unavailable_inputs);
}

Try / catch

try {
  await client.callTool(exposureEnrichmentTool, args);
} catch (e) {
  if (isSourceUnavailable(e)) {
    return e.data?.failed_inputs?.length ? retryWithBackoff(call, 3) : retryAfter(eventProducerCadence);
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling the exposure-enrichment analysis tool when every event-feed cache key reads null — event producer down, keys expired mid-cycle, seeds never run, or Redis read failures across all inputs.

Common situations: Event ingestion pipeline paused. Fresh environment without event seeds. Upstash degradation. Timing gap right after deploy before the first event publish.

Related errors


AI-assisted analysis of koala73/worldmonitor@7d06c8633d (2026-08-21). Data as JSON: /api/errors/12b4ff0ff18754e8. Report an issue: GitHub.

Appendix: source

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

      stale: evaluated.stale || unavailableInputs.length > 0,
      unavailable_inputs: unavailableInputs,
      failed_inputs: failedInputs,
    },
  };
}

const ANALYSIS_CACHE_STATUS_PROPERTIES = {
  unavailable_inputs: {
    type: 'array',
    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 {

View on GitHub (pinned to 7d06c8633d)