geonames-mcp-server

v0.1.2 pre-1.0

Search GeoNames places, walk admin hierarchies, reverse geocode, get postal codes and country info via MCP. STDIO or Streamable HTTP.

geonames.caseyjhand.com/mcp
claude mcp add --transport http geonames-mcp-server https://geonames.caseyjhand.com/mcp
codex mcp add geonames-mcp-server --url https://geonames.caseyjhand.com/mcp
{
  "mcpServers": {
    "geonames-mcp-server": {
      "url": "https://geonames.caseyjhand.com/mcp"
    }
  }
}
gemini mcp add --transport http geonames-mcp-server https://geonames.caseyjhand.com/mcp
{
  "mcpServers": {
    "geonames-mcp-server": {
      "command": "bunx",
      "args": [
        "mcp-remote",
        "https://geonames.caseyjhand.com/mcp"
      ]
    }
  }
}
{
  "mcpServers": {
    "geonames-mcp-server": {
      "type": "http",
      "url": "https://geonames.caseyjhand.com/mcp"
    }
  }
}
curl -X POST https://geonames.caseyjhand.com/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"1.0.0"}}}'

Tools

8

geonames_search_places

open-world

Search the GeoNames gazetteer of 13M+ places by name and filters: country, feature class (P populated places, A admin divisions, T mountains and terrain, H water, S buildings and spots), feature code (PPLC capitals, ADM1 states, MT mountains, AIRP airports), population tier, and bounding box. Results carry the geonameId that geonames_get_place, geonames_get_hierarchy, and geonames_get_children take. The default match requires a query term in the place name while letting other terms match the country or admin names ("Berlin, Germany"). Costs 1 GeoNames credit per call.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "geonames_search_places",
    "arguments": {}
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "query": {
      "description": "Place name to search for, such as Springfield or \"Berlin, Germany\", up to 200 characters. match sets how it is compared. Omit it to search by filters alone, which then needs at least one of countries, featureClasses, featureCodes, or boundingBox (cities alone is not enough).",
      "type": "string",
      "maxLength": 200
    },
    "match": {
      "description": "How query is matched. name_required (the default) needs at least one query term in the place name while other terms may match the country or admin names; any_field lets every term match any of those fields; exact_name matches the whole name exactly, alternate and historical names included; name_prefix matches names that start with query. Needs query. Case-insensitive.",
      "type": "string",
      "enum": [
        "name_required",
        "any_field",
        "exact_name",
        "name_prefix"
      ]
    },
    "countries": {
      "description": "ISO 3166-1 country codes, up to 10, as a list or a comma-separated string: alpha-2 (US, GB, DE), alpha-3 (USA, GBR, DEU), or three-digit numeric (840, 826, 276), each sent to GeoNames as alpha-2. Case-insensitive; UK is accepted for GB.",
      "maxItems": 10,
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^([A-Z]{2,3}|\\d{3})$",
        "description": "ISO 3166-1 alpha-2, alpha-3, or three-digit numeric country code."
      }
    },
    "featureClasses": {
      "description": "GeoNames feature classes: A admin divisions, H water, L areas, P populated places, R roads, S spots and buildings, T terrain, U undersea, V vegetation. A list or a comma-separated string; case-insensitive. With featureCodes too, the two lists intersect: list exactly the classes of those codes, or pass featureCodes alone.",
      "maxItems": 9,
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "A",
          "H",
          "L",
          "P",
          "R",
          "S",
          "T",
          "U",
          "V"
        ],
        "description": "One-letter GeoNames feature class."
      }
    },
    "featureCodes": {
      "description": "GeoNames feature codes (PPLC capital, ADM1 state, MT mountain, AIRP airport), up to 20, as a list or a comma-separated string. Case-insensitive; a class prefix (P.PPLC) is dropped. Each code implies its class; with featureClasses too, the two lists intersect, so featureClasses must list exactly these codes' classes. geonames_list_reference topic feature_codes lists every code.",
      "maxItems": 20,
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Z0-9]{2,5}$",
        "description": "GeoNames feature code without its class prefix."
      }
    },
    "cities": {
      "description": "Keep only populated places (class P) with a population of at least 1,000 (cities1000), 5,000 (cities5000), or 15,000 (cities15000), plus seats of admin divisions: GeoNames' cities tiers. Beside featureClasses or featureCodes, list only class P or class-P codes such as PPLC. Case-insensitive.",
      "type": "string",
      "enum": [
        "cities1000",
        "cities5000",
        "cities15000"
      ]
    },
    "boundingBox": {
      "description": "Keep only places inside this box. The box cannot cross the 180° meridian: split such an area into two searches.",
      "type": "object",
      "properties": {
        "north": {
          "type": "number",
          "minimum": -90,
          "maximum": 90,
          "description": "Northern latitude bound, decimal degrees, -90 to 90."
        },
        "south": {
          "type": "number",
          "minimum": -90,
          "maximum": 90,
          "description": "Southern latitude bound, decimal degrees, -90 to 90; below north."
        },
        "east": {
          "type": "number",
          "minimum": -180,
          "maximum": 180,
          "description": "Eastern longitude bound, decimal degrees, -180 to 180."
        },
        "west": {
          "type": "number",
          "minimum": -180,
          "maximum": 180,
          "description": "Western longitude bound, decimal degrees, -180 to 180; below east."
        }
      },
      "required": [
        "north",
        "south",
        "east",
        "west"
      ],
      "additionalProperties": false
    },
    "orderBy": {
      "description": "Result order: relevance (GeoNames' default) or population, largest first. Case-insensitive.",
      "type": "string",
      "enum": [
        "relevance",
        "population"
      ]
    },
    "limit": {
      "description": "Maximum entries to return, 1 to 100. Default 10.",
      "default": 10,
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "offset": {
      "description": "Entries to skip before the first one returned, for paging, 0 to 5000. Default 0.",
      "default": 0,
      "type": "integer",
      "minimum": 0,
      "maximum": 5000
    },
    "geonamesUsername": {
      "description": "Your own GeoNames username, so the call spends that account's free credits instead of the server's. Omit it to use the server's account. The account needs free web services enabled on its geonames.org account page.",
      "type": "string",
      "pattern": "^\\S{1,64}$"
    }
  },
  "required": [
    "limit",
    "offset"
  ],
  "additionalProperties": false
}
view source ↗

geonames_get_place

open-world

Fetch the full GeoNames record for one geonameId: coordinates, feature type, the admin chain with each level's code, name, and geonameId, timezone, bounding box, recorded and DEM elevation, population, Wikipedia URL, names in other languages, postal codes, and external identifiers (IATA, ICAO, UN/LOCODE, Wikidata). Take the geonameId from geonames_search_places, geonames_reverse_geocode, geonames_get_children, or geonames_get_countries. An unknown id returns found: false. Costs 1 GeoNames credit; repeat lookups are cached.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "geonames_get_place",
    "arguments": {
      "geonameId": "<geonameId>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "geonameId": {
      "description": "GeoNames feature id, a positive integer up to 2147483647 such as 5809844 (Seattle), as returned in geonameId by the other geonames tools. A geonames.org/<id> URL is reduced to its id.",
      "type": "string",
      "pattern": "^[1-9]\\d*$"
    },
    "nameLanguages": {
      "description": "Keep only alternate names in these languages, up to 20, as a list or a comma-separated string. Case-insensitive; a tag also matches its regional forms (zh matches zh, zh-CN, and zh-TW). Omit to return every alternate name, including those under GeoNames pseudo-language tags (abbr, phon, piny, fr_1793), which this filter cannot select. Postal codes, links, and identifiers are unaffected.",
      "maxItems": 20,
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z]{2,3}(-[a-z0-9]{2,8})*$",
        "description": "Language tag or prefix, such as en, de, or zh-tw."
      }
    },
    "geonamesUsername": {
      "description": "Your own GeoNames username, so the call spends that account's free credits instead of the server's. Omit it to use the server's account. The account needs free web services enabled on its geonames.org account page.",
      "type": "string",
      "pattern": "^\\S{1,64}$"
    }
  },
  "required": [
    "geonameId"
  ],
  "additionalProperties": false
}
view source ↗

geonames_get_hierarchy

open-world

Return the parent chain of a GeoNames feature, ordered from Earth and its continent through the country and admin divisions down to the feature itself, each with its geonameId, feature code, and coordinates. Use it to find which country, state, and county contain a place, or to fill an admin path for a geonameId. An unknown id returns found: false. Costs 1 GeoNames credit; cached.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "geonames_get_hierarchy",
    "arguments": {
      "geonameId": "<geonameId>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "geonameId": {
      "description": "GeoNames feature id, a positive integer up to 2147483647 such as 5809844 (Seattle), as returned in geonameId by the other geonames tools. A geonames.org/<id> URL is reduced to its id.",
      "type": "string",
      "pattern": "^[1-9]\\d*$"
    },
    "geonamesUsername": {
      "description": "Your own GeoNames username, so the call spends that account's free credits instead of the server's. Omit it to use the server's account. The account needs free web services enabled on its geonames.org account page.",
      "type": "string",
      "pattern": "^\\S{1,64}$"
    }
  },
  "required": [
    "geonameId"
  ],
  "additionalProperties": false
}
view source ↗

geonames_get_children

open-world

List the direct children of a GeoNames feature — Earth's continents, a continent's countries, a country's first-level divisions, a state's counties, a city's sections — in the administrative tree, or in the tourism tree (islands, coasts, and their municipalities; almost all in Spain) or the dependency tree (a country's dependent territories). Start from a country's geonameId (geonames_get_countries) or any admin division's. Children are mostly admin divisions (class A) and populated places (class P); continents and coasts are class L and islands class T. For other feature types inside a place, use geonames_search_places with a boundingBox. GeoNames answers a tourism or dependency request with the administrative children when the feature has no such tree, so the tool compares the two lists and sets sameAsAdministrative when they match, keeping the rows (a real tree can match too). The full child list is fetched once (1 GeoNames credit) and cached, so paging and nameContains filtering are free; a tourism or dependency call also reads the administrative list for the comparison, 1 more credit unless it is cached.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "geonames_get_children",
    "arguments": {
      "geonameId": "<geonameId>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "geonameId": {
      "description": "GeoNames id of the parent feature, a positive integer up to 2147483647 such as 6252001 (United States), as returned in geonameId by the other geonames tools. A geonames.org/<id> URL is reduced to its id.",
      "type": "string",
      "pattern": "^[1-9]\\d*$"
    },
    "hierarchy": {
      "description": "Which tree to descend: administrative (the default: continents (class L), countries, admin divisions, populated places), tourism (islands (class T), coasts (class L), and their municipalities; almost all in Spain), or dependency (a country's dependent territories). For a feature with no tourism or dependency tree, GeoNames answers with its administrative children, which sameAsAdministrative flags; the comparison reads the administrative list, 1 more credit unless it is cached. Case-insensitive.",
      "default": "administrative",
      "type": "string",
      "enum": [
        "administrative",
        "tourism",
        "dependency"
      ]
    },
    "nameContains": {
      "description": "Keep only children whose name or toponym name contains every word of this text as a substring (kansas also matches Arkansas), ignoring case, accents, and punctuation.",
      "type": "string",
      "maxLength": 100
    },
    "limit": {
      "description": "Maximum entries to return, 1 to 500. Default 100.",
      "default": 100,
      "type": "integer",
      "minimum": 1,
      "maximum": 500
    },
    "offset": {
      "description": "Entries to skip before the first one returned, for paging. Default 0.",
      "default": 0,
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "geonamesUsername": {
      "description": "Your own GeoNames username, so the call spends that account's free credits instead of the server's. Omit it to use the server's account. The account needs free web services enabled on its geonames.org account page.",
      "type": "string",
      "pattern": "^\\S{1,64}$"
    }
  },
  "required": [
    "geonameId",
    "hierarchy",
    "limit",
    "offset"
  ],
  "additionalProperties": false
}
view source ↗

geonames_reverse_geocode

open-world

Resolve a latitude/longitude to the country and admin subdivisions that contain it (down to ADM5, each with its geonameId and ISO 3166-2 code where one exists), or the ocean or sea when the point is offshore, plus the nearest populated places with distances; these include neighborhood sections (PPLX) and historical places (PPLH), marked by featureCode. Set featureClasses or featureCodes to list the nearest features of that type instead (peaks, lakes, airports), cities to keep only places above a population tier, and includeTimezone for the IANA timezone with local time, sunrise, and sunset (offshore points get only GeoNames' UTC-offset estimate). A harbor, pier, or shoreline point can fall just outside every country outline and resolve to the sea; coastalBufferKm (up to 50) matches the nearest country within that distance instead. Costs 1 GeoNames credit for containment, with or without the buffer, plus 3 for nearest populated places or 4 for nearest features (nearbyLimit 0 skips them), 1 for the ocean when no country contains the point or lies within the buffer, and 1 for the timezone.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "geonames_reverse_geocode",
    "arguments": {
      "lat": "<lat>",
      "lng": "<lng>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "lat": {
      "type": "number",
      "minimum": -90,
      "maximum": 90,
      "description": "Latitude in decimal degrees, -90 to 90."
    },
    "lng": {
      "type": "number",
      "minimum": -180,
      "maximum": 180,
      "description": "Longitude in decimal degrees, -180 to 180."
    },
    "nearbyLimit": {
      "description": "How many nearest places or features to list, 0 to 50. Default 5. 0 skips the nearby lookup and its 3 or 4 credits.",
      "default": 5,
      "type": "integer",
      "minimum": 0,
      "maximum": 50
    },
    "radiusKm": {
      "description": "Radius in kilometres for the nearby lookup, above 0 and at most 300 (GeoNames' free-tier limit). Default 20.",
      "default": 20,
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 300
    },
    "cities": {
      "description": "Keep only nearby populated places with a population of at least 1,000 (cities1000), 5,000 (cities5000), or 15,000 (cities15000), plus seats of admin divisions: GeoNames' cities tiers. Not combinable with featureClasses or featureCodes.",
      "type": "string",
      "enum": [
        "cities1000",
        "cities5000",
        "cities15000"
      ]
    },
    "featureClasses": {
      "description": "List the nearest features of these GeoNames classes instead of populated places: A admin divisions, H water, L areas, P populated places, R roads, S spots and buildings, T terrain, U undersea, V vegetation. A list or a comma-separated string; case-insensitive. With featureCodes too, the two lists intersect: list exactly the classes of those codes, or pass featureCodes alone. Not combinable with cities.",
      "maxItems": 9,
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "A",
          "H",
          "L",
          "P",
          "R",
          "S",
          "T",
          "U",
          "V"
        ],
        "description": "One-letter GeoNames feature class."
      }
    },
    "featureCodes": {
      "description": "List the nearest features with these GeoNames codes instead of populated places (MT mountain, PK peak, LK lake, AIRP airport), up to 20, as a list or a comma-separated string. Case-insensitive; a class prefix (T.MT) is dropped. Each code implies its class; with featureClasses too, the two lists intersect, so featureClasses must list exactly these codes' classes. geonames_list_reference topic feature_codes lists every code. Not combinable with cities.",
      "maxItems": 20,
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Z0-9]{2,5}$",
        "description": "GeoNames feature code without its class prefix."
      }
    },
    "includeTimezone": {
      "description": "Also return the timezone: IANA id, UTC offsets, local time, sunrise, and sunset (1 more credit). Default false.",
      "default": false,
      "type": "boolean"
    },
    "coastalBufferKm": {
      "description": "When no country contains the point, match the nearest country within this many kilometres, 0 to 50. Default 0: exact containment only. Set it for a harbor, pier, or shoreline point, which can fall just outside a country's outline as GeoNames maps it and otherwise resolves to the sea; a match carries country.distanceInKm. The nearby and timezone lookups keep the exact point. No extra credit.",
      "default": 0,
      "type": "number",
      "minimum": 0,
      "maximum": 50
    },
    "geonamesUsername": {
      "description": "Your own GeoNames username, so the call spends that account's free credits instead of the server's. Omit it to use the server's account. The account needs free web services enabled on its geonames.org account page.",
      "type": "string",
      "pattern": "^\\S{1,64}$"
    }
  },
  "required": [
    "lat",
    "lng",
    "nearbyLimit",
    "radiusKm",
    "includeTimezone",
    "coastalBufferKm"
  ],
  "additionalProperties": false
}
view source ↗

geonames_find_postal_codes

open-world

Look up postal codes in the GeoNames postal database (122 countries): mode code resolves a postal code to its place, admin names, and centroid; mode place_name finds postal codes for a place name; mode nearby lists postal codes within radiusKm (up to 30 km) of a coordinate, nearest first. Ireland returns only Eircode routing keys and Malta only the letter prefix; the United Kingdom (GB), Canada, and the Netherlands hold both full codes and their outward or district prefixes. Check coverage with geonames_list_reference topic postal_countries. Costs 1 GeoNames credit (2 for nearby); cached.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "geonames_find_postal_codes",
    "arguments": {
      "mode": "<mode>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "mode": {
      "description": "What to look up. code: the place for postalCode (required). place_name: the postal codes of placeName (required). nearby: postal codes around lat and lng (both required; countries not accepted). Case-insensitive.",
      "type": "string",
      "enum": [
        "code",
        "place_name",
        "nearby"
      ]
    },
    "postalCode": {
      "description": "Postal code to resolve, such as 98101, SW1A 1AA, or K1A 0A1: letters, digits, spaces, and hyphens, up to 12 characters. Case and extra spaces are normalized. Required in mode code; in mode place_name it narrows the match; not used in mode nearby.",
      "type": "string",
      "pattern": "^[A-Z0-9][A-Z0-9 -]{0,11}$"
    },
    "placeName": {
      "description": "Place name to find postal codes for, up to 100 characters. GeoNames matches it against place, admin, and country names. Required in mode place_name; in mode code it narrows the match; not used in mode nearby.",
      "type": "string",
      "maxLength": 100
    },
    "lat": {
      "description": "Latitude in decimal degrees, -90 to 90. Required in mode nearby.",
      "type": "number",
      "minimum": -90,
      "maximum": 90
    },
    "lng": {
      "description": "Longitude in decimal degrees, -180 to 180. Required in mode nearby.",
      "type": "number",
      "minimum": -180,
      "maximum": 180
    },
    "radiusKm": {
      "description": "Search radius in kilometres for mode nearby, above 0 and at most 30 (GeoNames' free-tier limit). Default 10.",
      "default": 10,
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 30
    },
    "countries": {
      "description": "Keep only postal codes in these countries: ISO 3166-1 codes, up to 10, as a list or a comma-separated string: alpha-2 (US, GB, DE), alpha-3 (USA, GBR, DEU), or three-digit numeric (840, 826, 276), each sent to GeoNames as alpha-2. Case-insensitive; UK is accepted for GB. Modes code and place_name only.",
      "maxItems": 10,
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^([A-Z]{2,3}|\\d{3})$",
        "description": "ISO 3166-1 alpha-2, alpha-3, or three-digit numeric country code."
      }
    },
    "limit": {
      "description": "Maximum entries to return, 1 to 100. Default 10.",
      "default": 10,
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "geonamesUsername": {
      "description": "Your own GeoNames username, so the call spends that account's free credits instead of the server's. Omit it to use the server's account. The account needs free web services enabled on its geonames.org account page.",
      "type": "string",
      "pattern": "^\\S{1,64}$"
    }
  },
  "required": [
    "mode",
    "radiusKm",
    "limit"
  ],
  "additionalProperties": false
}
view source ↗

geonames_get_countries

open-world

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 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.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "geonames_get_countries",
    "arguments": {}
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "countries": {
      "description": "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.",
      "maxItems": 50,
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^([A-Z]{2,3}|\\d{3})$",
        "description": "ISO 3166-1 alpha-2, alpha-3, or three-digit numeric country code."
      }
    },
    "continent": {
      "description": "Keep only countries on this continent: AF Africa, AN Antarctica, AS Asia, EU Europe, NA North America, OC Oceania, SA South America. Case-insensitive.",
      "type": "string",
      "enum": [
        "AF",
        "AN",
        "AS",
        "EU",
        "NA",
        "OC",
        "SA"
      ]
    },
    "nameContains": {
      "description": "Keep only countries whose English name contains every word of this text as a substring (niger also matches Nigeria), ignoring case, accents, and punctuation.",
      "type": "string",
      "maxLength": 100
    },
    "limit": {
      "description": "Maximum entries to return, 1 to 250. Default 50.",
      "default": 50,
      "type": "integer",
      "minimum": 1,
      "maximum": 250
    },
    "offset": {
      "description": "Entries to skip before the first one returned, for paging. Default 0.",
      "default": 0,
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "geonamesUsername": {
      "description": "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.",
      "type": "string",
      "pattern": "^\\S{1,64}$"
    }
  },
  "required": [
    "limit",
    "offset"
  ],
  "additionalProperties": false
}
view source ↗

geonames_list_reference

open-world

Decode GeoNames vocabulary used by the other tools: topic feature_classes lists the 9 one-letter classes; topic feature_codes lists the 684 feature codes with names and definitions, filterable by class and text; topic postal_countries lists the 122 countries with postal-code data and each one's code range and count. feature_classes and feature_codes are bundled and spend no credits; postal_countries costs 1 GeoNames credit a day (cached).

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "geonames_list_reference",
    "arguments": {
      "topic": "<topic>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "topic": {
      "description": "Vocabulary to list: feature_classes (the 9 one-letter classes), feature_codes (the 684 codes), or postal_countries (countries with postal-code data). Case-insensitive.",
      "type": "string",
      "enum": [
        "feature_classes",
        "feature_codes",
        "postal_countries"
      ]
    },
    "featureClass": {
      "description": "Topic feature_codes only: keep the codes of this one-letter class (A, H, L, P, R, S, T, U, V). Case-insensitive.",
      "type": "string",
      "enum": [
        "A",
        "H",
        "L",
        "P",
        "R",
        "S",
        "T",
        "U",
        "V"
      ]
    },
    "nameContains": {
      "description": "Keep only entries whose code, name, or description contains every word of this text as a substring (port also matches airport), ignoring case, accents, and punctuation.",
      "type": "string",
      "maxLength": 100
    },
    "limit": {
      "description": "Maximum entries to return, 1 to 700. Default 100.",
      "default": 100,
      "type": "integer",
      "minimum": 1,
      "maximum": 700
    },
    "offset": {
      "description": "Entries to skip before the first one returned, for paging. Default 0.",
      "default": 0,
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "geonamesUsername": {
      "description": "Topic postal_countries only, and only when the list is not already cached: your own GeoNames username, so the call spends that account's credit instead of the server's. The account needs free web services enabled on its geonames.org account page.",
      "type": "string",
      "pattern": "^\\S{1,64}$"
    }
  },
  "required": [
    "topic",
    "limit",
    "offset"
  ],
  "additionalProperties": false
}
view source ↗