{"record":{"id":"97b964998f533c0f","repo":"koala73/worldmonitor","slug":"iso2-must-be-an-iso-3166-1-alpha-2-code-such-as","errorCode":null,"errorMessage":"iso2 must be an ISO 3166-1 alpha-2 code, such as \"DE\" or \"IR\".","messagePattern":"iso2 must be an ISO 3166-1 alpha-2 code, such as \"DE\" or \"IR\"\\.","errorType":"validation","errorClass":"SafeWebMcpError","httpStatus":null,"severity":"error","filePath":"src/services/webmcp.ts","lineNumber":1704,"sourceCode":"      description:\n        'Open the intelligence brief panel for a country by ISO 3166-1 alpha-2 code (e.g. \"DE\", \"IR\"). Routes the user to the country deep-dive view; the brief itself is fetched by the same path a click would take. This can consume daily briefing quota. To only pan the map, use focus_country.',\n      inputSchema: {\n        type: 'object',\n        properties: {\n          iso2: {\n            type: 'string',\n            description: 'ISO 3166-1 alpha-2 country code, uppercase.',\n            pattern: '^[A-Z]{2}$',\n          },\n        },\n        required: ['iso2'],\n        additionalProperties: false,\n      },\n      annotations: { readOnlyHint: false },\n      execute: withInvocationLogging(WEBMCP_SPA_TOOL.openCountryBrief, async (args, extra) => {\n        const iso2 = typeof args.iso2 === 'string' ? args.iso2.toUpperCase() : '';\n        if (!ISO2.test(iso2)) {\n          throw new SafeWebMcpError(\n            'iso2 must be an ISO 3166-1 alpha-2 code, such as \"DE\" or \"IR\".',\n            'validation',\n          );\n        }\n        const name = boundedText(app.resolveCountryName(iso2), 160) || iso2;\n        const opened = await app.openCountryBriefByCode(iso2, name, extra);\n        if (opened !== true) {\n          throw new SafeWebMcpError(\n            'The requested country brief did not become visible.',\n            'unavailable',\n          );\n        }\n        return `Opened intelligence brief for ${name} (${iso2}).`;\n      }, trackEvent),\n    },\n    {\n      name: WEBMCP_SPA_TOOL.openSearch,\n      title: 'Open Search',","sourceCodeStart":1686,"sourceCodeEnd":1722,"githubUrl":"https://github.com/koala73/worldmonitor/blob/9361220cc013571781071f0206e4d80fd14b2f7f/src/services/webmcp.ts#L1686-L1722","documentation":"Validation error text for the open_country_brief WebMCP tool's iso2 argument. The guard fires when iso2 is not a two-letter uppercase ISO 3166-1 alpha-2 country code (lowercase, three letters, digits, or wrong casing), as enforced by the ^[A-Z]{2}$ pattern; examples like DE or IR show the expected format. Opening the brief can consume daily briefing quota; use focus_country to only pan the map.","triggerScenarios":"Thrown at src/services/webmcp.ts:556 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid ISO 3166-1 alpha-2 country code: exactly two uppercase letters (e.g. \"DE\", \"IR\", \"US\"). Uppercase the input and trim whitespace before validating.","Validate against /^[A-Z]{2}$/ plus, if strictness is required, a known-code list; reject early with this message and the received value so the caller can self-correct."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9361220cc013571781071f0206e4d80fd14b2f7f","analyzedAt":"2026-08-27T19:53:08.521Z","contentChangedAt":"2026-08-27T19:53:08.521Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}