{"record":{"id":"1a71891418abe057","repo":"koala73/worldmonitor","slug":"no-focal-point-coverage-for-countrycode-that-country-is","errorCode":null,"errorMessage":"No focal-point coverage for ${countryCode}: that country is absent from the entity registry.","messagePattern":"No focal-point coverage for (.+?): that country is absent from the entity registry\\.","errorType":"validation","errorClass":"RpcValidationError","httpStatus":null,"severity":"warning","filePath":"api/mcp/registry/analysis-tools.ts","lineNumber":417,"sourceCode":"                signals_total: { type: 'number' },\n                signals_mapped: { type: 'number' },\n                signals_unmapped: { type: 'number' },\n              },\n            },\n          },\n          required: [],\n        },\n      },\n      required: ['cached_at', 'stale', 'data'],\n    },\n    annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n    _execute: async (params) => {\n      const rawCountry = params.country_code;\n      const countryCode = rawCountry == null || (typeof rawCountry === 'string' && !rawCountry.trim())\n        ? '' : requireCountryCode(rawCountry, 'get-focal-points');\n      const index = getSharedEntityIndex();\n      if (countryCode && index.byId.get(countryCode)?.type !== 'country') {\n        throw new RpcValidationError('get-focal-points', [{\n          field: 'country_code',\n          description: `No focal-point coverage for ${countryCode}: that country is absent from the entity registry.`,\n        }]);\n      }\n      const limit = resolveLimit(params.limit, 10);\n      const keys = ['news:insights:v1', 'intelligence:cross-source-signals:v1', CII_RISK_SCORE_CACHE_KEYS.live];\n      const checks: FreshnessCheck[] = [\n        { key: 'seed-meta:news:insights', maxStaleMin: 30 },\n        { key: 'seed-meta:intelligence:cross-source-signals', maxStaleMin: 30 },\n        { key: 'seed-meta:intelligence:risk-scores', maxStaleMin: 30, minRecordCount: 3 },\n      ];\n      const { payloads: [insights, crossSource, riskScores], freshness } = await readCachesWithFreshness(keys, checks);\n      requireAnyInput(\n        [insights, crossSource, riskScores],\n        freshness,\n        'No focal-point input feeds are available',\n      );\n","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/koala73/worldmonitor/blob/7d06c8633d256c18e38133030bc3613976a96ec9/api/mcp/registry/analysis-tools.ts#L399-L435","documentation":"The get-focal-points MCP tool validates its country_code against the shared entity registry (getSharedEntityIndex). If a non-empty country_code is not present in byId with type 'country', it throws an RpcValidationError stating there is no focal-point coverage for that country. This separates 'registry has no such country' from 'registry has the country but no focal points'.","triggerScenarios":"Calling get-focal-points with a country_code string that is not a key in the entity registry (typo'd code, deprecated country code, subdivision-level code like 'US-CA', or a code only valid in another dataset). Empty/whitespace codes skip the check and return the unfiltered set.","commonSituations":"LLM callers inventing country codes or passing region codes; registry seed out of date so recently changed codes (e.g. ISO renames) are absent; clients reusing codes from a non-registry dataset.","solutions":["Send an ISO 3166-1 alpha-2 code that exists in the entity registry (verify via the registry/lookup tool)","Check for typos and use sovereign-state codes, not subdivision codes ('US' not 'US-CA')","Refresh the shared entity registry seed if the country genuinely should exist","If you want all focal points, omit country_code instead of passing an invalid one"],"exampleFix":"// before\ngetFocalPoints({ country_code: 'UK' }); // not in registry\n// after\ngetFocalPoints({ country_code: 'GB' });","handlingStrategy":"validation","validationCode":"// pre-check against the registry before calling\nconst registry = getSharedEntityIndex();\nif (code && registry.byId.get(code)?.type !== 'country') throw new Error(`unknown country: ${code}`);","typeGuard":"function isRegisteredCountry(code, index) { return typeof code === 'string' && index.byId.get(code)?.type === 'country'; }","tryCatchPattern":"try { return await getFocalPoints(params); } catch (e) { if (e instanceof RpcValidationError) return { focalPoints: [], reason: 'country_not_in_registry' }; throw e; }","preventionTips":["Validate country codes against the entity registry in tool schemas","Reject subdivision codes (e.g. 'US-CA') at the client","Refresh registry seeds whenever ISO country data changes","Omit country_code entirely when an unfiltered result is acceptable"],"tags":["mcp","validation","registry","country-code"],"backgroundTag":"entity-not-found","analyzedSha":"7d06c8633d256c18e38133030bc3613976a96ec9","analyzedAt":"2026-09-15T16:44:39.439Z","contentChangedAt":"2026-09-15T16:44:39.439Z","schemaVersion":2},"datasetVersion":"2026-09-15T18:17:12.389Z"}