Check within distance
within_distanceCheck whether a place matching a category or name exists within a given distance from a location. Returns the nearest match and its distance, or confirms none is found in range.
Instructions
Is the nearest place matching category/name within max_distance_m of (lat, lon)?
Give the center as lat/lon, or as `where` — a {"lat", "lon"} dict, a
GERS id, or a free-text place name — but not both (and not neither);
either way returns {"error": "bad_request"} naming the choice. A
`where` given as an id/name adds a compact "resolved": {"name", "id",
"lat", "lon", "matched_by"} to the answer; absent for lat/lon or a
{lat,lon} where.
max_distance_m is required and must be a positive number of meters — a
zero, negative, non-finite, or missing value returns {"error":
"bad_request"} rather than silently searching a 0m (or omitted from a
call entirely, in which case the schema itself rejects it before this
tool ever runs) window and answering a confident-looking "false".
Returns {"within": bool, "nearest": {...place row with id...} | None,
"distance_m": float | None}. nearest is None if nothing matches within
a search window capped at max_distance_m * 2 — a real match further out
than that isn't found (documented, not a bug: keeps the search bounded).
name is a literal substring match only — no alt-spelling or typo
fallback applies here, so a misspelled name is an honest "no match",
never a silent yes about a different name.
Returns a structured {"error": ...} if upstream is unavailable or the
dataset is missing columns this tool depends on.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lat | No | ||
| lon | No | ||
| name | No | ||
| where | No | ||
| category | No | ||
| max_distance_m | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||