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
| Name | Type | Required | Description |
|---|---|---|---|
code | string | yes | ISO 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
| Field | Type | Description |
|---|---|---|
name | string | Common country name |
official_name | string | Official country name |
codes | object | |
capital | string | Capital city or N/A if not available |
region | string | Geographic region |
subregion | string | Subregion name, empty if not available |
population | integer | Total population |
area_km2 | number | null | Total area in square kilometers |
languages | array | Languages spoken in the country |
currencies | array | Currencies used in the country |
flag | string | Flag 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.