Skip to main content
Glama

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

Radius search

radius_search
Read-onlyIdempotent

Find every US ZIP Code and Canadian postal area within a radius of a centre point, with the distance to each. The centre takes a US ZIP Code, a US ZIP+4, a Canadian FSA, a Canadian postal code, or a latitude,longitude pair; a ZIP+4 searches from its parent ZIP, and coordinates are used as the point itself, so the centre comes back with no code. Centroid mode measures centre to centre and reaches 500 miles; spatial mode intersects real boundaries, reports how much of each area falls inside, and reaches 250 miles. Set a minimum radius to search a ring rather than a circle. summary.total_count is the number of matches returned; when the list is cut, summary.total_available is the number in the radius and a notice says so. ACS statistics always cover the whole radius. They are aggregates of the ZIP Codes' estimates: est and pct only, with no margin of error or Census column; for one ZIP Code's estimate with its margin of error, use zip_lookup. timezone and ACS come back with the search itself; only census and district data need zip_lookup per ZIP. Without an API key the count and a sample of matches are returned and the rest is withheld; free-tier keys are capped at 100 miles centroid and 50 spatial.

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>",
      "max": "<max>"
    },
    "name": "radius_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
maxYesRadius in miles, as a number or a string. Up to 500 in centroid mode or 250 in spatial mode; exceeding the cap is an error rather than being reduced. May also be 'auto' to pick a radius from local population density, or 'auto-commute' to use commuting patterns where available.
minNoMinimum radius in miles, to exclude the middle and search a ring. Must be less than max. Defaults to 0.
codeYesCentre point: a US ZIP Code, ZIP+4, Canadian FSA or postal code, or a latitude,longitude pair.
modeNoHow to measure. centroid measures centre to centre and is the default when omitted; spatial intersects actual boundaries and adds how much of each area lies inside, at a lower maximum radius.
limitNoMaximum number of matches to return, up to 100, which is also the default. A larger value is reduced to 100 and the result says so in notices. When the list is cut, summary.total_available is the number of matches in the radius (summary.total_count is the number returned) and a RESULTS_CAPPED notice says so; to see matches beyond the first 100, narrow the radius or raise `min` to step outwards in bands.
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/radius include flags; each multiplies the credit cost. timezone lands on each match. acs_PROFILE (current release) and acs_PROFILE_YYYY return aggregate statistics across the whole result set, with the same field paths every year. Census and district enrichments are not available here; use zip_lookup. At most 16 ACS profile-years per call (one profile for one year is one); split a larger request into several calls. Accepted: timezone, acs_demographic, acs_social, acs_economic, acs_housing; 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] is acs_social_2015). Prefer the year flags in include. 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/radius include flags; each multiplies the credit cost. timezone lands on each match. acs_PROFILE (current release) and acs_PROFILE_YYYY return aggregate statistics across the whole result set, with the same field paths every year. Census and district enrichments are not available here; use zip_lookup. Accepted: timezone, acs_demographic, acs_social, acs_economic, acs_housing; 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/radius include flags; each multiplies the credit cost. timezone lands on each match. acs_PROFILE (current release) and acs_PROFILE_YYYY return aggregate statistics across the whole result set, with the same field paths every year. Census and district enrichments are not available here; use zip_lookup. At most 16 ACS profile-years per call (one profile for one year is one); split a larger request into several calls. Accepted: timezone, acs_demographic, acs_social, acs_economic, acs_housing; acs_demographic_YYYY, acs_social_YYYY, acs_economic_YYYY, acs_housing_YYYY for YYYY 2011-2024. A bare flag is its newest year."
  2. Changed1 schema field 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"
      +  ]
      +}
  3. Changed2 schema fields changed
    • addedInput schema / properties / code / type
      Added value: +"string"
    • addedInput schema / properties / max / 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?

Beyond the read-only annotations, the description discloses substantial behavior: mode-specific radius caps, how truncated results are reported via summary.total_count and total_available, what ACS statistics cover, and what happens without an API key. It also clarifies that timezone and ACS return with the search while census and district data require zip_lookup.

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?

The description is dense and information-rich, with little wasted language. It is front-loaded with purpose and key constraints, though the single-paragraph form makes some operational details harder to scan than necessary.

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?

Without an output schema, the description still explains return counts, truncation notices, ACS aggregate limitations, mode-specific caps, and free-tier restrictions. This is complete enough for an agent to select and invoke the tool correctly.

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?

With 100% schema description coverage, the schema already documents most parameters well. The description adds useful meaning for centre-point handling, including that ZIP+4 searches from its parent ZIP and coordinates return no code for the centre, plus mode-specific radius behavior and result-cut semantics.

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?

The description opens with a specific verb and resource: find every US ZIP Code and Canadian postal area within a radius, with distances. It clearly distinguishes the tool from siblings by explaining centre-point inputs, measurement modes, and return behavior.

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?

It gives explicit routing guidance, including when to use centroid versus spatial mode, how min creates a ring, and when to use zip_lookup instead for per-ZIP census or district data. It also states free-tier limitations and API key behavior, leaving little ambiguity about when and how to call it.

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.