GeoNames country facts
geonames_get_countriesGet GeoNames country facts — ISO alpha-2, alpha-3, and numeric codes, FIPS code, geonameId, capital, population, area in km², continent, languages, currency, postal-code format, and mainland bounding box — for the countries named, a continent, or all 250. The geonameId anchors geonames_get_children (a country's first-level divisions) and geonames_get_hierarchy. The full table is fetched once a day (1 GeoNames credit) and cached.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "geonames_get_countries"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum entries to return, 1 to 1,000. This tool returns at most 250 per call: a larger limit is held to 250, and the notice says so when more entries remain. Default 50. | |
| offset | No | Entries to skip before the first one returned, for paging. Default 0. | |
| continent | No | Keep only countries on this continent: AF Africa, AN Antarctica, AS Asia, EU Europe, NA North America, OC Oceania, SA South America. | |
| countries | No | Countries to return by ISO 3166-1 code: alpha-2 (US), alpha-3 (USA), or three-digit numeric (840), up to 250, as a list. UK is accepted for GB and FL for LI. Match country names with nameContains instead. | |
| nameContains | No | Keep only countries whose English name contains every word of this text as a substring (niger also matches Nigeria), ignoring case, accents, and punctuation. Give at least one letter or digit. | |
| geonamesUsername | No | Your own GeoNames username, spent only when the country table is not already cached, so the call uses that account's credit instead of the server's. The account needs free web services enabled on its geonames.org account page. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cap | No | The limit applied: limit as given, or 250 when it asked for more. | |
| error | No | Present when the call failed. Absent on success. | |
| shown | No | Countries returned on this page. | |
| notice | No | Guidance when nothing matched, the offset is past the end, or more pages remain (naming a limit held to 250). | |
| notFound | No | Requested codes that match no GeoNames country; empty when every code matched. | |
| countries | No | Countries on this page, in GeoNames order (by alpha-2 code). | |
| truncated | No | True when more countries remain past this page. | |
| nextOffset | No | Offset of the next page; absent on the last page. | |
| totalCount | No | Countries matching the filters, before paging. |