EU Parliament Monitor — API Documentation - v0.8.42
    Preparing search index...

    Function isMCPSupportedWBCountryCode

    • Guard: returns true if code is safe to pass to any worldbank-mcp@1.0.1 tool (get-country-info, get-economic-data, get-social-data, get-health-data, get-education-data), and false if the code would cause the MCP server to return Error: Country not found — which is handled as an empty-data fallback upstream and therefore fails silently.

      The guard accepts any 2-letter (ISO 3166-1 alpha-2) or 3-letter (alpha-3) country code and rejects:

      • The 8 aggregate codes listed in WB_AGGREGATE_LABELS (EUU, EMU, OED, WLD, ECS, NAC, EAS, SSF). These work only against the raw WB REST API — use the IMF client for EU-aggregate economic context.
      • The informal alias UK — use GB instead.
      • Empty, non-string, or malformed inputs.

      The guard is case-insensitive: 'euu' and 'EUU' both return false, 'de' and 'DE' both return true.

      Parameters

      • code: unknown

        Country code candidate

      Returns boolean

      true when the code is a per-country identifier accepted by the MCP server, false when it is an aggregate, an informal alias, or invalid

      isMCPSupportedWBCountryCode('DE');   // → true
      isMCPSupportedWBCountryCode('DEU'); // → true
      isMCPSupportedWBCountryCode('EUU'); // → false (aggregate)
      isMCPSupportedWBCountryCode('UK'); // → false (use 'GB')
      isMCPSupportedWBCountryCode(''); // → false