Skip to main content
Glama

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

NameRequiredDescriptionDefault
cityYesCity name, optionally with state or country: "Paris", "Paris, TX", "Lyon, France", "NYC", "Munich".
limitNoMatches to return including the best one (default 5).
stateNoOptional state or region to disambiguate, e.g. TX or Texas.
countryNoOptional ISO 3166-1 alpha-2 code or country name to disambiguate, e.g. FR.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full load and does most of it well: per-call pricing via x402 ($0.001 USDC on Base, with alternate chains), the free-trial quota (3/day per IP, with the HTTP header vs MCP-automatic distinction), and that invalid input is not billed. It stops short of stating failure modes beyond invalid input, rate limits after the trial, or latency expectations from the offline dataset.

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?

Return fields are front-loaded in the first sentence and the pricing/trial details follow, so the scan order is right. The nested parenthetical around payment chains and the trial header is dense and slightly harder to parse than a single flat sentence would be.

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

Completeness5/5

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

No output schema exists, yet the description enumerates the returned fields (coordinates, timezone, country, state, population, asOf, source). Combined with the payment, trial, and rejection semantics for a 4-parameter tool, an agent has everything needed to call it correctly.

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?

Schema coverage is 100%, so each parameter already has an example-laden description; the body text adds only the general notion of disambiguation and alias handling. The `limit` parameter's role (matches returned including the best one) is left entirely to the schema, so this lands at the baseline.

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 ("Geocode a city name") plus the exact outputs returned: lat/lon, timezone, country, state, population. That scope plus the ambiguity/alias examples makes it clearly distinguishable from any sibling tool.

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?

Explains the disambiguation workflow ("Paris, TX", aliases like NYC/Munich) and notes that invalid input is rejected without charge, which tells the agent how to shape calls. It never names an alternative tool or an explicit when-not-to-use condition, but no sibling overlaps in function.

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.

Resources