{"record":{"id":"59f0c5f8f05e9339","repo":"koala73/worldmonitor","slug":"no-focal-point-input-feeds-are-available","errorCode":null,"errorMessage":"No focal-point input feeds are available","messagePattern":"No focal-point input feeds are available","errorType":"exception","errorClass":"McpSourceUnavailableError","httpStatus":null,"severity":"error","filePath":"api/mcp/registry/analysis-tools.ts","lineNumber":179,"sourceCode":"    items: { type: 'string' },\n    description: 'Required cache keys that were missing or unreadable; their contribution is not treated as quiet.',\n  },\n  failed_inputs: {\n    type: 'array',\n    items: { type: 'string' },\n    description: 'Subset of unavailable_inputs whose Redis read failed rather than returning a genuine miss.',\n  },\n} as const;\n\ntype AnalysisFreshness = Awaited<ReturnType<typeof readCachesWithFreshness>>['freshness'];\n\nfunction requireAnyInput(\n  payloads: unknown[],\n  freshness: AnalysisFreshness,\n  message: string,\n): void {\n  if (payloads.every((value) => value === null)) {\n    throw new McpSourceUnavailableError(\n      message,\n      freshness.unavailable_inputs,\n      freshness.failed_inputs,\n    );\n  }\n}\n\nfunction resolveLimit(raw: unknown, fallback: number): number {\n  if (raw === undefined || raw === null) return fallback;\n  const parsed = Math.round(Number(raw));\n  if (!Number.isFinite(parsed)) return fallback;\n  if (parsed <= 0) return Number.POSITIVE_INFINITY;\n  return parsed;\n}\n\n// Keep the analysis schemas aligned with cacheEnvelope(). Content age is not a\n// universal rule: evaluateFreshness() applies it only to checks that explicitly\n// declare honorContentAge.","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/koala73/worldmonitor/blob/9361220cc013571781071f0206e4d80fd14b2f7f/api/mcp/registry/analysis-tools.ts#L161-L197","documentation":"McpSourceUnavailableError thrown by requireAnyInput (api/mcp/registry/analysis-tools.ts:173) for the focal-point analysis tool: every input cache payload was null after readCachesWithFreshness, so no focal-point feed is computable. Carries unavailable_inputs (genuine misses) and failed_inputs (Redis read failures) in the typed fields for dispatch to re-emit in JSON-RPC error.data.","triggerScenarios":"Calling the focal-point analysis tool when all of its input cache keys return null: producer outage, TTL expiry between publish cycles, unseeded environment, or Redis read failures on every input at once.","commonSituations":"Fresh deploy before producers cycle. Upstash eviction or outage. Upstream data pipeline (geopolitical event writers) paused. Wrong Upstash database configured for the MCP edge.","solutions":["Read error.data.failed_inputs — non-empty means fix Redis; empty means wait for/re-run the producer","Verify the focal-point input keys appear fresh on /api/health","Retry once the producer's publish cadence has elapsed","Run the matching seed script if the keys have never been written in this environment"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"const health = await fetch('https://<host>/api/health').then(r => r.json());\nif (focalPointInputKeys.some(k => !health?.datasets?.[k]?.fresh)) {\n  defer('focal-point inputs not fresh yet');\n}","typeGuard":"function isSourceUnavailable(e) {\n  return e?.name === 'McpSourceUnavailableError'\n    || (Array.isArray(e?.data?.unavailable_inputs));\n}","tryCatchPattern":"try {\n  await client.callTool(focalPointTool, args);\n} catch (e) {\n  if (isSourceUnavailable(e)) {\n    return e.data?.failed_inputs?.length ? retryWithBackoff(call, 3) : retryAfter(producerCadence);\n  }\n  throw e;\n}","preventionTips":["Distinguish failed_inputs (retry now) from unavailable_inputs (wait for producer) on every catch","Track producer cadence so scheduled analyses run after publish cycles, not during gaps","Alert on repeated unavailable_inputs — that is a producer/seed regression, not transient"],"tags":["mcp","analysis","redis","data-source","focal-point"],"backgroundTag":"data-source-unavailable","analyzedSha":"9361220cc013571781071f0206e4d80fd14b2f7f","analyzedAt":"2026-08-21T16:51:25.751Z","contentChangedAt":"2026-08-21T16:51:25.751Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}