Skip to main content
Glama

Zip-Codes.com Location Intelligence: Spatial Analysis, Districts & 14+ Years of Demographics

ZIP Code lookup

zip_lookup
Read-onlyIdempotent

The full record for a postal code — the main location-intelligence tool. Takes a US ZIP Code, a US ZIP+4, a Canadian FSA, a Canadian postal code, or a latitude,longitude pair, and returns the city, state or province, county, whether it spans more than one county, area codes, elevation, metro area and postal details (metro.msa and metro.pmsa are legacy 1999 definitions; the current metro area, the CBSA, comes with census). A ZIP+4 also returns its delivery-segment street ranges, and coordinates reverse-geocode to the code containing the point. Optional enrichments add timezone, census geography, congressional and state legislative districts (for the current year or any TIGER/Line year served), school districts, demographics, Medicare geography and American Community Survey estimates for every release served, all in one schema per year; for Canadian codes, Statistics Canada geography and federal electoral districts (statcan). Use quick_zip instead when only the code and its place are needed — same inputs, about half the payload, no enrichments beyond timezone. Without an API key the core identity fields are returned and everything else is withheld, with each withheld path named.

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": {
      "code": "<code>"
    },
    "name": "zip_lookup"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesA US ZIP Code, ZIP+4, Canadian FSA, or Canadian postal code. For example 90210, 90210-1234, M5V, or M5V 2T6.
api_keyNoYour ZIP-Codes.com API key, only when you cannot send it as the X-Api-Key or Authorization: Bearer header (for example a key bought with buy_credits in this conversation). Leave it out to use the free tier. It is never shown back in a response.
includeNoEnrichments, spelled as the REST API's /v2/zip include flags. Each multiplies the credit cost: base times (1 + number of enrichments). census, cd (congressional district) and state_leg are US Census Bureau data; census_YYYY, cd_YYYY, state_leg_YYYY add boundaries as of a TIGER/Line year (the bare flag answers under `current`, other years under their own key). statcan is Canada only: Statistics Canada geography for a Canadian FSA or postal code, federal electoral districts included, under `statcan` (statcan_YYYY for a census year; census or cd on a Canadian code is answered as statcan). acs_PROFILE is the current American Community Survey release, acs_PROFILE_YYYY an earlier one; every ACS year has the SAME FIELD PATHS, so values compare across years directly. At most 16 ACS profile-years per call (one profile for one year is one); split a larger request into several calls. Accepted: timezone, census, cd, state_leg, school_district, demographics, medicare, statcan, acs_demographic, acs_social, acs_economic, acs_housing; statcan_YYYY for YYYY 2011, 2016, 2021; census_YYYY, cd_YYYY, state_leg_YYYY for YYYY 2010-2026; acs_demographic_YYYY, acs_social_YYYY, acs_economic_YYYY, acs_housing_YYYY for YYYY 2011-2024. A bare flag is its newest year.
acs_yearsNoAlias, kept for clients that learned it before include took year flags: ACS release years for the bare acs_ profiles in include (acs_social with acs_years [2015, 2024] is acs_social_2015 plus acs_social). Prefer the year flags in include. Every year has the SAME FIELD PATHS, and the answer comes back keyed by year. At most 16 profile-years per call. 2011 to 2024 (2024 is the current release).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / include / description
      Previous value: -"Enrichments, spelled as the REST API's /v2/zip include flags. Each multiplies the credit cost: base times (1 + number of enrichments). census, cd (congressional district) and state_leg are US Census Bureau data; census_YYYY, cd_YYYY, state_leg_YYYY add boundaries as of a TIGER/Line year (the bare flag answers under `current`, other years under their own key). statcan is Canada only: Statistics Canada geography for a Canadian FSA or postal code, federal electoral districts included, under `statcan` (statcan_YYYY for a census year; census or cd on a Canadian code is answered as statcan). acs_PROFILE is the current American Community Survey release, acs_PROFILE_YYYY an earlier one; every ACS year has the SAME FIELD PATHS, so values compare across years directly. Accepted: timezone, census, cd, state_leg, school_district, demographics, medicare, statcan, acs_demographic, acs_social, acs_economic, acs_housing; statcan_YYYY for YYYY 2011, 2016, 2021; census_YYYY, cd_YYYY, state_leg_YYYY for YYYY 2010-2026; acs_demographic_YYYY, acs_social_YYYY, acs_economic_YYYY, acs_housing_YYYY for YYYY 2011-2024. A bare flag is its newest year."New value: +"Enrichments, spelled as the REST API's /v2/zip include flags. Each multiplies the credit cost: base times (1 + number of enrichments). census, cd (congressional district) and state_leg are US Census Bureau data; census_YYYY, cd_YYYY, state_leg_YYYY add boundaries as of a TIGER/Line year (the bare flag answers under `current`, other years under their own key). statcan is Canada only: Statistics Canada geography for a Canadian FSA or postal code, federal electoral districts included, under `statcan` (statcan_YYYY for a census year; census or cd on a Canadian code is answered as statcan). acs_PROFILE is the current American Community Survey release, acs_PROFILE_YYYY an earlier one; every ACS year has the SAME FIELD PATHS, so values compare across years directly. At most 16 ACS profile-years per call (one profile for one year is one); split a larger request into several calls. Accepted: timezone, census, cd, state_leg, school_district, demographics, medicare, statcan, acs_demographic, acs_social, acs_economic, acs_housing; statcan_YYYY for YYYY 2011, 2016, 2021; census_YYYY, cd_YYYY, state_leg_YYYY for YYYY 2010-2026; acs_demographic_YYYY, acs_social_YYYY, acs_economic_YYYY, acs_housing_YYYY for YYYY 2011-2024. A bare flag is its newest year."
  2. Changed3 schema fields changed
    • addedInput schema / properties / api_key
      Added value: +{
      +  "default": null,
      +  "description": "Your ZIP-Codes.com API key, only when you cannot send it as the X-Api-Key or Authorization: Bearer header (for example a key bought with buy_credits in this conversation). Leave it out to use the free tier. It is never shown back in a response.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • changedInput schema / properties / include / description
      Previous value: -"Enrichments, spelled as the REST API's /v2/zip include flags. Each multiplies the credit cost: base times (1 + number of enrichments). census, cd (congressional district) and state_leg are US Census Bureau data; census_YYYY, cd_YYYY, state_leg_YYYY add boundaries as of a TIGER/Line year (the bare flag answers under `current`, other years under their own key). statcan is Canada only: Statistics Canada geography for a Canadian FSA or postal code, federal electoral districts included, under `statcan` (statcan_YYYY for a census year; census or cd on a Canadian code is answered as statcan). acs_PROFILE is the current American Community Survey release, acs_PROFILE_YYYY an earlier one; every ACS year has the SAME FIELD PATHS, so values compare across years directly. Accepted: timezone, census, cd, state_leg, school_district, demographics, medicare, statcan, acs_demographic, acs_social, acs_economic, acs_housing; statcan_YYYY for YYYY 2011, 2016, 2021; census_YYYY, cd_YYYY, state_leg_YYYY for YYYY 2010-2025; acs_demographic_YYYY, acs_social_YYYY, acs_economic_YYYY, acs_housing_YYYY for YYYY 2011-2024. A bare flag is its newest year."New value: +"Enrichments, spelled as the REST API's /v2/zip include flags. Each multiplies the credit cost: base times (1 + number of enrichments). census, cd (congressional district) and state_leg are US Census Bureau data; census_YYYY, cd_YYYY, state_leg_YYYY add boundaries as of a TIGER/Line year (the bare flag answers under `current`, other years under their own key). statcan is Canada only: Statistics Canada geography for a Canadian FSA or postal code, federal electoral districts included, under `statcan` (statcan_YYYY for a census year; census or cd on a Canadian code is answered as statcan). acs_PROFILE is the current American Community Survey release, acs_PROFILE_YYYY an earlier one; every ACS year has the SAME FIELD PATHS, so values compare across years directly. Accepted: timezone, census, cd, state_leg, school_district, demographics, medicare, statcan, acs_demographic, acs_social, acs_economic, acs_housing; statcan_YYYY for YYYY 2011, 2016, 2021; census_YYYY, cd_YYYY, state_leg_YYYY for YYYY 2010-2026; acs_demographic_YYYY, acs_social_YYYY, acs_economic_YYYY, acs_housing_YYYY for YYYY 2011-2024. A bare flag is its newest year."
    • changedInput schema / properties / include / items / pattern
      Previous value: -"^(timezone|census|cd|state_leg|school_district|demographics|medicare|statcan|acs_demographic|acs_social|acs_economic|acs_housing|statcan_(201[16]|2021)|(census|cd|state_leg)_(201\\d|202[0-5])|(acs_demographic|acs_social|acs_economic|acs_housing)_(201[1-9]|202[0-4]))$"New value: +"^(timezone|census|cd|state_leg|school_district|demographics|medicare|statcan|acs_demographic|acs_social|acs_economic|acs_housing|statcan_(201[16]|2021)|(census|cd|state_leg)_(201\\d|202[0-6])|(acs_demographic|acs_social|acs_economic|acs_housing)_(201[1-9]|202[0-4]))$"
  3. Changed1 schema field changed
    • addedInput schema / properties / code / type
      Added value: +"string"
  4. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already cover readOnly/idempotent/non-destructive, and the description adds substantial context beyond them: credit cost scales as base times (1 + number of enrichments), the 16 ACS profile-year per-call cap, legacy 1999 metro.msa/pmsa versus CBSA, and exactly which fields are withheld without a key ('each withheld path named'). These are the operational details an agent needs before spending credits.

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 identity of the tool and its accepted inputs, then return values, then the quick_zip routing rule. It is a single dense block and re-states a few schema details (ACS year range, 16-profile cap), which costs it a point, but nearly every clause carries distinct information.

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?

There is no output schema, and the description compensates by enumerating the returned fields, the ZIP+4 delivery-segment ranges, and the coordinate reverse-geocode case. For a 4-param tool with a large optional enrichment surface, the failure modes (missing key, enrichment cost, ACS-year cap) are all disclosed.

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 meaning the schema lacks — notably that `code` also accepts a latitude,longitude pair that reverse-geocodes to the containing code, which the schema's `code` description does not mention at all. It also clarifies year-flag semantics and ACS path comparability, though some of this overlaps the `include` description.

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 ('returns the full record for a postal code') and enumerates the accepted input types and the returned fields. It explicitly positions itself as 'the main location-intelligence tool' and names the sibling quick_zip it is not, so an agent can distinguish it without opening either schema.

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

Usage Guidelines5/5

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

Gives an explicit routing rule: 'Use quick_zip instead when only the code and its place are needed — same inputs, about half the payload.' It also states the alternative path for a Canadian code (statcan answers census/cd) and the behavior without an API key, so both when-to-use and when-not-to-use are covered.

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.