Skip to main content
Glama

Look up postal code (120+ countries, GeoNames)

lookup_postal_code

Use this when you need the city, region/state and coordinates for a postal code, or the postal codes of a place name, to validate or complete an address in 120+ countries. For Mexico each match also carries colonia, municipio and estado. Offline and deterministic (GeoNames postal code table, CC BY 4.0, refreshed monthly). Some countries ship only the first part of the code (GB, CA, NL, IE, MT, CL, CN, AR) and partial matches are flagged. Supported countries: AD, AE, AI, AL, AM, AR, AS, AT, AU, AX, AZ, BD, BE, BG, BM, BR, BY, CA, CC, CH, CL, CN, CO, CR, CX, CY, CZ, DE, DK, DO, DZ, EC, EE, ES, FI, FK, FM, FO, FR, GB, GF, GG, GI, GL, GP, GS, GT, GU, HK, HM, HN, HR, HT, HU, ID, IE, IM, IN, IO, IS, IT, JE, JP, KE, KR, LI, LK, LT, LU, LV, MA, MC, MD, MH, MK, MO, MP, MQ, MT, MW, MX, MY, NC, NF, NL, NO, NR, NU, NZ, PA, PE, PF, PH, PK, PL, PM, PN, PR, PT, PW, PY, RE, RO, RS, RU, SE, SG, SI, SJ, SK, SM, TC, TH, TR, UA, US, UY, VA, VI, WF, WS, YT, ZA. Others return UNSUPPORTED_COUNTRY without charge.

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": "lookup_postal_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsNoBatch mode: up to 500 items, each with the same fields as a single call. Omit when validating a single value through the top-level fields.
queryNoPlace / city / neighbourhood name to find postal codes for, e.g. "Monterrey", "Polanco", "Lisboa". Provide postalCode or query.
countryNoISO 3166-1 alpha-2 country code, e.g. "MX", "US", "DE", "ES", "BR". "UK" is accepted for "GB".
maxResultsNoMaximum matches returned per item (1–100, default 20).
postalCodeNoPostal code to resolve, e.g. "06600" (MX), "10001" (US), "SW1A" (GB outward code), "01310-000" (BR). Provide postalCode or query.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/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 burden and does so well: offline, deterministic, data provenance (GeoNames, CC BY 4.0, monthly refresh), partial-match flagging, and the fact that unsupported countries return UNSUPPORTED_COUNTRY "without charge" — a useful billing/side-effect signal. It stops short of auth/rate-limit or batch-cost details, keeping it out of 5 territory.

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 use case and behavior; the ~117-code country list is dense but placed last and is the only place that information is encoded (no enum in schema), so it earns its space. The first sentence is slightly overstuffed, which is the only drag.

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?

No output schema, so the description must imply returns — it does (city, region/state, coordinates, Mexico colonia/municipio/estado, partial-match flag). Missing only the failure shape for an unresolvable code and how batch errors are reported per item, which is minor for a 5-param lookup.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning the schema lacks: the enumerable set of supported countries (the `country` param has no enum), the list of countries that only ship partial codes, and Mexico-specific return fields tied to input. It does not explain the single-vs-batch interaction beyond what the schema says.

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+resource and describes both directions of the lookup (postal code → city/region/coords, and place name → postal codes), plus the concrete purpose (validate or complete an address). An agent can distinguish this from every sibling validator without opening the schema.

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?

Clear trigger condition ("Use this when you need ... to validate or complete an address in 120+ countries") and a stated exclusion behavior for unsupported countries. No sibling tool overlaps in function, so no alternative is named, which is acceptable here.

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.