Skip to main content
Glama

Search boundaries

search_boundaries
Read-onlyIdempotent

Finds administrative boundaries (countries, states, counties, cities, districts) and postcode areas by name, in any language. Filter by country, kind or admin_level; bias toward a point with near. Free and public. A name we hold (the place's own name or a translation, optionally followed by ", " such as "Paris, France" or "Springfield, IL") is answered from our own index with no upstream call; anything else is looked up in OpenStreetMap. Returns candidates with id, kind, admin_level, country, parents, bbox, centroid and population, but no polygon: pass the id to get_boundary for that. Choose by kind: admin_level is OpenStreetMap's number and is null for a result whose level we do not hold. A street address or a landmark is not a boundary: when nothing is named that but the text matched one, results is empty and located gives its point (name, kind, lat, lon) with a hint to call reverse_boundaries for every boundary containing it (or create_area for a park, reef or region with no boundary). When nothing at all matched, results is empty with a hint naming the call that gets somewhere instead (a city or district name, reverse_boundaries, create_area); do not retry other spellings of a shop or street. A city OpenStreetMap maps only as a point under another name ("Christchurch" inside "Christchurch City") returns the boundaries containing it with matched: "containing" and a hint; check the first result is the area meant. While OpenStreetMap's search is down, a name nobody searched before is answered from the boundaries already cached under it, marked partial: true with retry_after and a hint (others with the same name may be missing), or 503 upstream_unavailable with retry_after when none is cached.

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": {
      "q": "<q>"
    },
    "name": "search_boundaries"
  }
}

Input Schema

NameRequiredDescriptionDefault
qYesA place name, e.g. "Berlin", "Alameda County", "75011". A street address returns located (its point) instead of results.
kindNoOnly this kind (normalized across countries): country, state, region, province, county, district, municipality, city, borough, ward, neighbourhood, postal_code.
nearNolat,lon to prefer results near, e.g. 37.77,-122.42.
limitNoAt most this many results (1–40, default 10).
countryNoLimit to countries: ISO 3166-1 alpha-2, comma-separated (e.g. US or de,at,ch).
admin_levelNoOnly this OSM admin_level (2 = country; meaning varies by country below that). Leaves out results whose level we do not hold; prefer kind.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / admin_level / description
      Previous value: -"Only this OSM admin_level (2 = country; meaning varies by country below that)."New value: +"Only this OSM admin_level (2 = country; meaning varies by country below that). Leaves out results whose level we do not hold; prefer kind."
  2. Changed1 schema field changed
    • changedInput schema / properties / q / description
      Previous value: -"A place name, e.g. \"Berlin\", \"Alameda County\", \"75011\"."New value: +"A place name, e.g. \"Berlin\", \"Alameda County\", \"75011\". A street address returns located (its point) instead of results."
  3. First observed

TDQS

A4.4/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, openWorld and non-destructive, and the description goes well beyond them: no-polygon return contract, cached-index vs upstream lookup, partial:true with retry_after during OSM outages, and 503 upstream_unavailable. It does not state rate limits or auth requirements, but for a free public read that is a minor omission.

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 purpose followed by progressively rarer cases, and every sentence carries actionable information. The cost is density: several long run-on sentences packed with edge cases make it harder to scan than a short bulleted routing list would.

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, so the description carries the full burden and does: it enumerates returned fields (id, kind, admin_level, country, parents, bbox, centroid, population), the located alternative shape, the matched:'containing' case, and the partial/503 error shapes with retry_after.

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 a baseline of 3 applies, and the description adds real meaning: q accepts localized names and the ', <where it lies>' disambiguation form, admin_level may be null for levels not held and should be avoided in favor of kind, and near is a bias not a filter. Some of this restates the schema but the disambiguation syntax is genuinely new.

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?

Names a specific verb and resource (finds administrative boundaries and postcode areas) with scope (by name, any language) and explicitly separates the named-index vs OpenStreetMap lookup paths, while stating it returns no polygon and routing to get_boundary for that.

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 explicit routing decisions against alternatives: get_boundary for polygons, reverse_boundaries when only a street address or landmark matched, create_area for features with no boundary, and 'do not retry other spellings of a shop or street'. It also states what to do when results are empty, which is the common failure mode.

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