get_country_by_code

Pack: countries · Endpoint: https://gateway.pipeworx.io/countries/mcp

Get country details by ISO code (e.g., “US” for United States or “FRA” for France). Returns capital, population, languages, currencies, area, and region.

Parameters

NameTypeRequiredDescription
codestringyesISO 3166-1 alpha-2 or alpha-3 country code

Example call

Arguments

{
  "code": "US"
}

curl

curl -X POST https://gateway.pipeworx.io/countries/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_country_by_code","arguments":{"code":"US"}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('get_country_by_code', {
  "code": "US"
});

More examples

{
  "code": "FRA"
}

Response shape

Always returns: name, official_name, codes, capital, region, subregion, population, area_km2, languages, currencies, flag

FieldTypeDescription
namestringCommon country name
official_namestringOfficial country name
codesobject
capitalstringCapital city or N/A if not available
regionstringGeographic region
subregionstringSubregion name, empty if not available
populationintegerTotal population
area_km2number | nullTotal area in square kilometers
languagesarrayLanguages spoken in the country
currenciesarrayCurrencies used in the country
flagstringFlag emoji or empty string
Full JSON Schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Common country name"
    },
    "official_name": {
      "type": "string",
      "description": "Official country name"
    },
    "codes": {
      "type": "object",
      "properties": {
        "alpha2": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2 code"
        },
        "alpha3": {
          "type": "string",
          "description": "ISO 3166-1 alpha-3 code"
        }
      },
      "required": [
        "alpha2",
        "alpha3"
      ]
    },
    "capital": {
      "type": "string",
      "description": "Capital city or N/A if not available"
    },
    "region": {
      "type": "string",
      "description": "Geographic region"
    },
    "subregion": {
      "type": "string",
      "description": "Subregion name, empty if not available"
    },
    "population": {
      "type": "integer",
      "description": "Total population"
    },
    "area_km2": {
      "type": [
        "number",
        "null"
      ],
      "description": "Total area in square kilometers"
    },
    "languages": {
      "type": "array",
      "description": "Languages spoken in the country",
      "items": {
        "type": "string"
      }
    },
    "currencies": {
      "type": "array",
      "description": "Currencies used in the country",
      "items": {
        "type": "string"
      }
    },
    "flag": {
      "type": "string",
      "description": "Flag emoji or empty string"
    }
  },
  "required": [
    "name",
    "official_name",
    "codes",
    "capital",
    "region",
    "subregion",
    "population",
    "area_km2",
    "languages",
    "currencies",
    "flag"
  ]
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "countries": {
      "url": "https://gateway.pipeworx.io/countries/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build May 9, 2026