Skip to main content
Glama

GeoNames country facts

geonames_get_countries
Read-onlyIdempotent

Get 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 GeoNames' bounding box for the country (a rectangle that can take in neighboring land and leave out outlying territory) — 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

NameRequiredDescriptionDefault
limitNoMaximum 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.
offsetNoEntries to skip before the first one returned, for paging. Default 0.
continentNoKeep only countries on this continent: AF Africa, AN Antarctica, AS Asia, EU Europe, NA North America, OC Oceania, SA South America.
countriesNoCountries 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.
nameContainsNoKeep 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.
geonamesUsernameNoYour 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

NameRequiredDescriptionDefault
capNoThe limit applied: limit as given, or 250 when it asked for more.
errorNoPresent when the call failed. Absent on success.
shownNoCountries returned on this page.
noticeNoGuidance when nothing matched, the offset is past the end, or more pages remain (naming a limit held to 250).
notFoundNoRequested codes that match no GeoNames country; empty when every code matched.
countriesNoCountries on this page, in GeoNames order (by alpha-2 code).
truncatedNoTrue when more countries remain past this page.
nextOffsetNoOffset of the next page; absent on the last page.
totalCountNoCountries matching the filters, before paging.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / countries / items / properties / boundingBox / description
      Previous value: -"Bounding box of the country's mainland."New value: +"GeoNames' rectangle for the country, which can take in neighboring land and leave out outlying territory: the United States box covers the contiguous states, while geonames_get_place 6252001's spans Alaska and Hawaii. A box with west above east crosses the 180° meridian (Fiji, Kiribati, Russia); geonames_search_places takes it as it stands."
  2. Changed3 schema fields changed
    • changedInput schema / properties / nameContains / description
      Previous value: -"Keep only countries whose English name contains every word of this text as a substring (niger also matches Nigeria), ignoring case, accents, and punctuation."New value: +"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."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `username_required`: Neither geonamesUsername nor the server's GEONAMES_USERNAME supplies a GeoNames account. `caller_account_rejected`: GeoNames rejected the caller-supplied geonamesUsername (unknown user, or free web services not enabled). `server_account_rejected`: GeoNames rejected the server's GEONAMES_USERNAME. `quota_exhausted`: GeoNames reported the account's hourly, daily, or weekly credit limit spent, or this server's pacer for the account shed the call. `upstream_rejected_parameter`: GeoNames rejected a value the schema let through; the message carries its text. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `name_contains_unsearchable`: nameContains is not blank but holds no letter or digit (only punctuation, symbols, emoji, or invisible characters), so it would match every country. `username_required`: Neither geonamesUsername nor the server's GEONAMES_USERNAME supplies a GeoNames account. `caller_account_rejected`: GeoNames rejected the caller-supplied geonamesUsername (unknown user, or free web services not enabled). `server_account_rejected`: GeoNames rejected the server's GEONAMES_USERNAME. `quota_exhausted`: GeoNames reported the account's hourly, daily, or weekly credit limit spent, or this server's pacer for the account shed the call. `upstream_rejected_parameter`: GeoNames rejected a value the schema let through; the message carries its text. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "username_required",
      -  "caller_account_rejected",
      -  "server_account_rejected",
      -  "quota_exhausted",
      -  "upstream_rejected_parameter"
      -]New value: +[
      +  "name_contains_unsearchable",
      +  "username_required",
      +  "caller_account_rejected",
      +  "server_account_rejected",
      +  "quota_exhausted",
      +  "upstream_rejected_parameter"
      +]
  3. Changed7 schema fields changed
    • changedInput schema / properties / continent / description
      Previous value: -"Keep only countries on this continent: AF Africa, AN Antarctica, AS Asia, EU Europe, NA North America, OC Oceania, SA South America. Case-insensitive."New value: +"Keep only countries on this continent: AF Africa, AN Antarctica, AS Asia, EU Europe, NA North America, OC Oceania, SA South America."
    • changedInput schema / properties / countries / description
      Previous value: -"Countries to return by ISO 3166-1 code: alpha-2 (US), alpha-3 (USA), or three-digit numeric (840), up to 50, as a list or a comma-separated string. Case-insensitive; UK is accepted for GB. Match country names with nameContains instead."New value: +"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."
    • changedInput schema / properties / countries / maxItems
      Previous value: -50New value: +250
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum entries to return, 1 to 250. Default 50."New value: +"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."
    • changedInput schema / properties / limit / maximum
      Previous value: -250New value: +1000
    • changedOutput schema / properties / cap / description
      Previous value: -"The limit that was applied."New value: +"The limit applied: limit as given, or 250 when it asked for more."
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance when nothing matched, the offset is past the end, or more pages remain."New value: +"Guidance when nothing matched, the offset is past the end, or more pages remain (naming a limit held to 250)."
  4. First observed

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes beyond the annotations (readOnly/openWorld/idempotent) with genuinely useful behavior: the table is fetched once a day (data freshness), costs 1 GeoNames credit, and is cached, plus a caveat that the bounding box is a rectangle that may include neighboring land and exclude outlying territory. These are exactly the traits annotations cannot convey. It does not repeat the read-only safety profile, which is correct.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the verb and resource, then scope, then relationships, then caching, so an agent can stop reading at any point. The long field enumeration and the bounding-box parenthetical are somewhat heavy since an output schema already exists, but they aid tool selection rather than waste space.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a six-parameter, read-only reference tool with a full output schema, the description covers selection modes, downstream linkages, credit cost, and data staleness. Return-value shape need not be explained because the output schema carries it, though the interaction between the 250-per-call cap and paging is left to the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage the schema already documents every parameter, so baseline 3 applies. The description's phrase 'for the countries named, a continent, or all 250' loosely maps to the countries/continent parameters but adds no syntax or format detail beyond the schema, which already covers alias handling (UK→GB) and name substring matching.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Get GeoNames country facts') and then enumerates the returned fields (ISO codes, FIPS, geonameId, capital, population, area, continent, languages, currency, postal format, bounding box) plus the three selection modes (named countries, a continent, or all 250). It also distinguishes itself from siblings by noting the geonameId anchors geonames_get_children and geonames_get_hierarchy.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Clearly frames when this tool applies: fetching facts for specific countries, a whole continent, or the entire table, and it signals the downstream relationship ('anchors geonames_get_children... and geonames_get_hierarchy'), which tells an agent to resolve a country first before walking divisions. It stops short of naming an alternative for country-name lookup it does mention nameContains in the schema rather than the description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.