geocode_city
Geocode a city name to lat/lon, timezone, country, state and population. Handles ambiguity ("Paris, TX") and aliases (NYC, Munich), offline from GeoNames for 34,000 cities. Paid via x402 ($0.001 USDC on Base mainnet (also Polygon, Arbitrum and Solana)) on this tools/call request. Includes asOf and source. Invalid input is rejected without payment. Free trial: 3 unpaid calls/day per IP on this tool (HTTP: header X-Free-Trial: 1; MCP: automatic when no payment is sent).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"city": "<city>"
},
"name": "geocode_city"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| city | Yes | City name, optionally with state or country: "Paris", "Paris, TX", "Lyon, France", "NYC", "Munich". | |
| limit | No | Matches to return including the best one (default 5). | |
| state | No | Optional state or region to disambiguate, e.g. TX or Texas. | |
| country | No | Optional ISO 3166-1 alpha-2 code or country name to disambiguate, e.g. FR. |