Skip to main content
Glama

openstreetmap-mcp-server

Execute a raw Overpass QL query

openstreetmap_query_raw
Read-onlyIdempotent

Run an arbitrary Overpass QL query for anything the convenience tools cannot express: multi-type or union queries, relation membership, historical queries, regex tag matching. The query must include [out:json], e.g. "[out:json][timeout:15];node"natural"="peak";out body;"; scope to an OSM boundary with rel();map_to_area->.a; or way();map_to_area->.a; then (area.a) on each statement (the 2400000000 way-area offset is gone since Overpass 0.7.57; openstreetmap_query_bbox takes the same scope as within, without QL). The response is one page: page with limit and offset, read totalFound and truncated for the whole match, and an element over max_element_bytes arrives with its members, nodes or geometry array withheld whole and withheldNotice saying how to fetch it back. For plain "near X" or "in this area" questions use openstreetmap_query_nearby or openstreetmap_query_bbox.

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum elements to return, up to 500 per call; a larger value is served as 500 and limitNotice says so. Applied after the Overpass query — if the query matched more, they are truncated.
queryYesOverpass QL query string. Must include [out:json]. The server sets the endpoint and User-Agent; do not include those. With no [maxsize:N] it adds [maxsize:268435456] (256 MiB), which a busy endpoint admits sooner than its 512 MiB default; write your own to change it. Example: "[out:json][timeout:15];node[\"natural\"=\"peak\"](47.5,-122.5,47.7,-122.2);out body;"
offsetNoElements to skip before applying limit, for paging a large result set. The full match set is cached ~10 minutes keyed by the query, so re-paging at a new offset is deterministic and costs no extra request; a result over 100000 elements is served uncached, so paging that far re-queries and depends on the endpoint returning the same order. Pass the nextOffset from a prior truncated response.
timeout_secondsNoHow long Overpass may spend on the query. A [timeout:N] directive in the query string wins over this. The client waits the full value rather than cutting a long query off early, but the endpoint enforces its own budget and may answer HTTP 504 first.
max_element_bytesNoSerialized-byte budget for one element, in UTF-8 bytes, applied per element after limit and offset — the dimension limit cannot bound, a single relation or geometry-heavy way. An over-budget element keeps every scalar and its tags but has its members, nodes and geometry arrays withheld whole, never truncated to a prefix, and lists each under withheld_keys with its item count and byte size; withheldElements and withheldNotice then give the offset and raised budget that fetch it back whole in one more call. That disclosure is not counted against the budget, so a bounded element runs ~60 bytes per withheld key above it.

Output Schema

NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
noticeNoWhy this page is empty and what to try: nothing matched (check the query syntax or broaden the filter), or offset ran past the end (retry lower). Absent when results were returned.
elementsNoRaw Overpass elements for this page, up to the limit. Shape varies by type: nodes carry lat/lon, ways nodes[], relations members[]. An element over max_element_bytes swaps those heavy arrays for withheld_keys, each naming the key, its item count, and its byte size.
truncatedNoTrue if elements were cut at the limit. Narrow the query, or page with offset to retrieve the rest.
nextOffsetNoOffset to pass on the next call to retrieve the following page of elements. Present only when more elements remain beyond this page.
totalFoundNoTotal elements returned by Overpass before limit truncation.
attributionNoRequired data attribution: Data © OpenStreetMap contributors, ODbL 1.0.
limitNoticeNoPresent when limit exceeded this tool's maximum: the value requested and the one applied.
data_timestampNoOSM data freshness timestamp from the Overpass response. Absent when the endpoint reported no freshness metadata.
effectiveQueryNoThe Overpass QL string as sent to the API (after any timeout or maxsize injection).
total_elementsNoNumber of elements returned on this page. See totalFound for the full match count.
withheldNoticeNoHow to retrieve the withheld arrays, one element per call. Absent when every element fit.
servingEndpointNoOverpass endpoint that answered, named by origin alone (scheme, host, port), with "(entry N)" added when two configured endpoints share an origin. May name a failover mirror, or the endpoint that originally served a cached response. Read with data_timestamp when a result looks slow, sparse, or stale.
withheldElementsNoElements on this page that exceeded max_element_bytes, each with the arguments that fetch it back whole. Absent when every element fit.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `query_error`: Overpass returned HTTP 400 — malformed query syntax. `query_timeout`: The query exceeded its timeout. `result_too_large`: Overpass ran out of memory on this query, or its response passed the server's 64 MiB read ceiling. `rate_limited`: Every configured endpoint refused the query as throttled — HTTP 429, or a throttle document in place of JSON. `upstream_error`: Overpass reported a runtime error that is neither a timeout nor memory exhaustion. `overpass_gateway_timeout`: Overpass answered HTTP 504 or 408 with no busy-dispatcher remark — the query exceeded the endpoint's own time budget, not the [timeout:N] directive. `overpass_unavailable`: Overpass answered an HTTP 5xx other than 501 and 504, a 425, or a 504 or 408 whose remark says its dispatcher is too busy or turned off — the endpoint is down, restarting, shedding load, or not taking the query yet. `endpoints_exhausted`: No endpoint answered within its attempt window, or the total time budget ran out first. `endpoints_unavailable`: No configured endpoint would serve the call — connections refused, DNS failures, HTTP refusals such as 401/403/404, throttling, or instance faults, in some mix. `endpoints_rejected`: Every configured endpoint refused the call by HTTP status: a 401, 403, 404, or 501, a redirect, or another non-retried status below 500 other than 400 and 429. `pacer_shed`: The query waited 30 seconds in total for an Overpass slot while other calls held every slot it could take. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `query_error`: Overpass returned HTTP 400 — malformed query syntax. `query_timeout`: The query exceeded its timeout. `result_too_large`: Overpass ran out of memory on this query, or its response passed the server's 64 MiB read ceiling. `rate_limited`: Every configured endpoint refused the query as throttled — HTTP 429, or a throttle document in place of JSON. `upstream_error`: Overpass reported a runtime error that is neither a timeout nor memory exhaustion. `overpass_gateway_timeout`: Overpass answered HTTP 504 or 408 with no busy-dispatcher remark — the query exceeded the endpoint's own time budget, not the [timeout:N] directive. `overpass_unavailable`: Overpass answered an HTTP 5xx other than 501 and 504, a 425, or a 504 or 408 whose remark says its dispatcher is too busy or turned off — the endpoint is down, restarting, shedding load, or not taking the query yet. `endpoints_exhausted`: No endpoint completed within its attempt window, or the total budget ran out first. `endpoints_unavailable`: No configured endpoint would serve the call — connections refused, DNS failures, HTTP refusals such as 401/403/404, throttling, or instance faults, in some mix. `endpoints_rejected`: Every configured endpoint refused the call by HTTP status: a 401, 403, 404, or 501, a redirect, or another non-retried status below 500 other than 400 and 429. `pacer_shed`: The query waited 30 seconds in total for an Overpass slot while other calls held every slot it could take. Other values are possible when a failure originates below the handler."
  2. Changed8 schema fields changed
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum elements to return. Applied after the Overpass query — if the query matched more, they are truncated."New value: +"Maximum elements to return, up to 500 per call; a larger value is served as 500 and limitNotice says so. Applied after the Overpass query — if the query matched more, they are truncated."
    • changedInput schema / properties / limit / maximum
      Previous value: -500New value: +10000
    • changedInput schema / properties / max_element_bytes / maximum
      Previous value: -10000000New value: +9007199254740991
    • changedInput schema / properties / query / description
      Previous value: -"Overpass QL query string. Must include [out:json]. The server sets the endpoint and User-Agent; do not include those. Example: \"[out:json][timeout:15];node[\\\"natural\\\"=\\\"peak\\\"](47.5,-122.5,47.7,-122.2);out body;\""New value: +"Overpass QL query string. Must include [out:json]. The server sets the endpoint and User-Agent; do not include those. With no [maxsize:N] it adds [maxsize:268435456] (256 MiB), which a busy endpoint admits sooner than its 512 MiB default; write your own to change it. Example: \"[out:json][timeout:15];node[\\\"natural\\\"=\\\"peak\\\"](47.5,-122.5,47.7,-122.2);out body;\""
    • changedOutput schema / properties / effectiveQuery / description
      Previous value: -"The Overpass QL string as sent to the API (after any timeout injection)."New value: +"The Overpass QL string as sent to the API (after any timeout or maxsize injection)."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `query_error`: Overpass returned HTTP 400 — malformed query syntax. `query_timeout`: The query exceeded its timeout. `result_too_large`: Overpass ran out of memory on this query. `rate_limited`: Every configured endpoint refused the query as throttled — HTTP 429, or a throttle document in place of JSON. `upstream_error`: Overpass reported a runtime error that is neither a timeout nor memory exhaustion. `overpass_gateway_timeout`: Overpass answered HTTP 504 or 408 — the query exceeded the endpoint's own time budget, not the [timeout:N] directive. `overpass_unavailable`: Overpass answered an HTTP 5xx other than 501 and 504, or a 425 — the endpoint is down, restarting, shedding load, or not taking the query yet. `endpoints_exhausted`: No endpoint answered within its attempt window, or the total time budget ran out first. `endpoints_unavailable`: No configured endpoint would serve the call — connections refused, DNS failures, HTTP refusals such as 401/403/404, throttling, or instance faults, in some mix. `endpoints_rejected`: Every configured endpoint refused the call by HTTP status: a 401, 403, 404, or 501, a redirect, or another non-retried status below 500 other than 400 and 429. `pacer_shed`: The query waited 30 seconds in total for an Overpass slot while other calls held every slot it could take. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `query_error`: Overpass returned HTTP 400 — malformed query syntax. `query_timeout`: The query exceeded its timeout. `result_too_large`: Overpass ran out of memory on this query, or its response passed the server's 64 MiB read ceiling. `rate_limited`: Every configured endpoint refused the query as throttled — HTTP 429, or a throttle document in place of JSON. `upstream_error`: Overpass reported a runtime error that is neither a timeout nor memory exhaustion. `overpass_gateway_timeout`: Overpass answered HTTP 504 or 408 with no busy-dispatcher remark — the query exceeded the endpoint's own time budget, not the [timeout:N] directive. `overpass_unavailable`: Overpass answered an HTTP 5xx other than 501 and 504, a 425, or a 504 or 408 whose remark says its dispatcher is too busy or turned off — the endpoint is down, restarting, shedding load, or not taking the query yet. `endpoints_exhausted`: No endpoint answered within its attempt window, or the total time budget ran out first. `endpoints_unavailable`: No configured endpoint would serve the call — connections refused, DNS failures, HTTP refusals such as 401/403/404, throttling, or instance faults, in some mix. `endpoints_rejected`: Every configured endpoint refused the call by HTTP status: a 401, 403, 404, or 501, a redirect, or another non-retried status below 500 other than 400 and 429. `pacer_shed`: The query waited 30 seconds in total for an Overpass slot while other calls held every slot it could take. Other values are possible when a failure originates below the handler."
    • addedOutput schema / properties / limitNotice
      Added value: +{
      +  "description": "Present when limit exceeded this tool's maximum: the value requested and the one applied.",
      +  "type": "string"
      +}
    • changedOutput schema / properties / withheldElements / items / properties / maxElementBytes / description
      Previous value: -"Serialized UTF-8 byte size of this element whole, which is the smallest max_element_bytes that returns it. Pass it on the retrieval call when it is at or below the 10000000 ceiling; above that no accepted budget returns the element whole and withheldNotice names the narrower query to use instead."New value: +"Serialized UTF-8 byte size of this element whole, which is the smallest max_element_bytes that returns it. Pass it on the retrieval call."
  3. Changed3 schema fields changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `query_error`: Overpass returned HTTP 400 — malformed query syntax. `query_timeout`: The query exceeded its timeout. `result_too_large`: Overpass ran out of memory on this query. `rate_limited`: Every configured endpoint refused the query as throttled — HTTP 429, or a throttle document in place of JSON. `upstream_error`: Overpass reported a runtime error that is neither a timeout nor memory exhaustion. `overpass_gateway_timeout`: Overpass answered HTTP 504 — the query exceeded the endpoint's own time budget, not the [timeout:N] directive. `overpass_unavailable`: Overpass answered an HTTP 5xx other than 504 — the endpoint is down, restarting, or shedding load. `endpoints_exhausted`: No endpoint answered within its attempt window, or the total time budget ran out first. `endpoints_unavailable`: No configured endpoint would serve the call — connections refused, DNS failures, HTTP refusals such as 401/403/404, throttling, or instance faults, in some mix. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `query_error`: Overpass returned HTTP 400 — malformed query syntax. `query_timeout`: The query exceeded its timeout. `result_too_large`: Overpass ran out of memory on this query. `rate_limited`: Every configured endpoint refused the query as throttled — HTTP 429, or a throttle document in place of JSON. `upstream_error`: Overpass reported a runtime error that is neither a timeout nor memory exhaustion. `overpass_gateway_timeout`: Overpass answered HTTP 504 or 408 — the query exceeded the endpoint's own time budget, not the [timeout:N] directive. `overpass_unavailable`: Overpass answered an HTTP 5xx other than 501 and 504, or a 425 — the endpoint is down, restarting, shedding load, or not taking the query yet. `endpoints_exhausted`: No endpoint answered within its attempt window, or the total time budget ran out first. `endpoints_unavailable`: No configured endpoint would serve the call — connections refused, DNS failures, HTTP refusals such as 401/403/404, throttling, or instance faults, in some mix. `endpoints_rejected`: Every configured endpoint refused the call by HTTP status: a 401, 403, 404, or 501, a redirect, or another non-retried status below 500 other than 400 and 429. `pacer_shed`: The query waited 30 seconds in total for an Overpass slot while other calls held every slot it could take. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "query_error",
      -  "query_timeout",
      -  "result_too_large",
      -  "rate_limited",
      -  "upstream_error",
      -  "overpass_gateway_timeout",
      -  "overpass_unavailable",
      -  "endpoints_exhausted",
      -  "endpoints_unavailable"
      -]New value: +[
      +  "query_error",
      +  "query_timeout",
      +  "result_too_large",
      +  "rate_limited",
      +  "upstream_error",
      +  "overpass_gateway_timeout",
      +  "overpass_unavailable",
      +  "endpoints_exhausted",
      +  "endpoints_unavailable",
      +  "endpoints_rejected",
      +  "pacer_shed"
      +]
    • changedOutput schema / properties / servingEndpoint / description
      Previous value: -"Overpass endpoint that answered, as origin and path. May name a failover mirror, or the endpoint that originally served a cached response. Read with data_timestamp when a result looks slow, sparse, or stale."New value: +"Overpass endpoint that answered, named by origin alone (scheme, host, port), with \"(entry N)\" added when two configured endpoints share an origin. May name a failover mirror, or the endpoint that originally served a cached response. Read with data_timestamp when a result looks slow, sparse, or stale."
  4. Changed1 schema field changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `query_error`: Overpass returned HTTP 400 — malformed query syntax. `query_timeout`: The query exceeded its timeout. `result_too_large`: Overpass ran out of memory on this query. `rate_limited`: Every configured endpoint refused the query as throttled — HTTP 429, or a throttle document in place of JSON. `upstream_error`: Overpass reported a runtime error that is neither a timeout nor memory exhaustion. `overpass_gateway_timeout`: Overpass answered HTTP 504 — the query exceeded the endpoint's own time budget, not the [timeout:N] directive. `overpass_unavailable`: Overpass answered an HTTP 5xx other than 504 — the endpoint is down, restarting, or shedding load. `endpoints_exhausted`: No endpoint answered within its attempt window, or the total time budget ran out first. `endpoints_unavailable`: No configured endpoint would serve the call — connections refused, DNS failures, throttling, or instance faults, in some mix. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `query_error`: Overpass returned HTTP 400 — malformed query syntax. `query_timeout`: The query exceeded its timeout. `result_too_large`: Overpass ran out of memory on this query. `rate_limited`: Every configured endpoint refused the query as throttled — HTTP 429, or a throttle document in place of JSON. `upstream_error`: Overpass reported a runtime error that is neither a timeout nor memory exhaustion. `overpass_gateway_timeout`: Overpass answered HTTP 504 — the query exceeded the endpoint's own time budget, not the [timeout:N] directive. `overpass_unavailable`: Overpass answered an HTTP 5xx other than 504 — the endpoint is down, restarting, or shedding load. `endpoints_exhausted`: No endpoint answered within its attempt window, or the total time budget ran out first. `endpoints_unavailable`: No configured endpoint would serve the call — connections refused, DNS failures, HTTP refusals such as 401/403/404, throttling, or instance faults, in some mix. Other values are possible when a failure originates below the handler."
  5. Changed7 schema fields changed
    • changedInput schema / properties / max_element_bytes / description
      Previous value: -"Serialized-byte budget for one element, measured in UTF-8 bytes and applied to each element of the page independently after limit and offset. It bounds what limit cannot: a single relation or geometry-heavy way. An element over budget keeps every scalar and its tags but has its members, nodes and geometry arrays withheld whole — never truncated to a prefix — and lists each one under withheld_keys with its item count and byte size; withheldElements and withheldNotice then carry the offset and raised budget that fetch that element back whole in one more call. The withheld_keys disclosure the element gains is not counted back against the budget, so a bounded element runs a fixed ~60 bytes per withheld key above it."New value: +"Serialized-byte budget for one element, in UTF-8 bytes, applied per element after limit and offset — the dimension limit cannot bound, a single relation or geometry-heavy way. An over-budget element keeps every scalar and its tags but has its members, nodes and geometry arrays withheld whole, never truncated to a prefix, and lists each under withheld_keys with its item count and byte size; withheldElements and withheldNotice then give the offset and raised budget that fetch it back whole in one more call. That disclosure is not counted against the budget, so a bounded element runs ~60 bytes per withheld key above it."
    • changedInput schema / properties / offset / description
      Previous value: -"Number of matching elements to skip before applying limit, for paging through a large result set. The full match set is fetched and cached ~10 minutes keyed by the query, so re-paging at a new offset is deterministic and costs no extra upstream request; a result over 100000 elements is served but not cached, so paging that far re-queries and depends on the endpoint returning the same order. Pass the nextOffset value from a prior truncated response."New value: +"Elements to skip before applying limit, for paging a large result set. The full match set is cached ~10 minutes keyed by the query, so re-paging at a new offset is deterministic and costs no extra request; a result over 100000 elements is served uncached, so paging that far re-queries and depends on the endpoint returning the same order. Pass the nextOffset from a prior truncated response."
    • changedInput schema / properties / timeout_seconds / description
      Previous value: -"Query timeout in seconds, bounding how long Overpass itself spends on the query. The [timeout:N] directive in the query string takes precedence if present. The client waits for what is requested here, up to 180s, so a long-running query is not cut off early — but the endpoint enforces its own budget and may answer HTTP 504 first."New value: +"How long Overpass may spend on the query. A [timeout:N] directive in the query string wins over this. The client waits the full value rather than cutting a long query off early, but the endpoint enforces its own budget and may answer HTTP 504 first."
    • changedOutput schema / properties / elements / description
      Previous value: -"Raw Overpass API response elements for this page, up to the limit. Structure varies by query type — nodes have lat/lon, ways have nodes[], relations have members[]. An element over max_element_bytes carries a withheld_keys array instead of the heavy arrays it names, each entry giving the key, its item count, and its serialized byte size."New value: +"Raw Overpass elements for this page, up to the limit. Shape varies by type: nodes carry lat/lon, ways nodes[], relations members[]. An element over max_element_bytes swaps those heavy arrays for withheld_keys, each naming the key, its item count, and its byte size."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `query_error`: Overpass returned a 400 error — malformed query syntax. `query_timeout`: The query exceeded its timeout (Overpass runtime error in response body). `result_too_large`: Overpass runtime error: query ran out of memory — result set exceeds the server memory limit. `rate_limited`: Overpass refused the query as throttled — HTTP 429, or a throttle document instead of JSON — on every configured endpoint. With a list in OSM_OVERPASS_ENDPOINTS the call advances to the next entry first, so this surfaces only once all of them have refused it. `upstream_error`: Overpass reported a runtime error that is neither a timeout nor memory exhaustion — the message carries the remark verbatim. `overpass_gateway_timeout`: Overpass answered HTTP 504 — it accepted the query but its dispatcher gave up before producing a result, so the query exceeded the time budget the endpoint enforces rather than the [timeout:N] directive. `overpass_unavailable`: Overpass answered with an HTTP 5xx other than 504 (500, 501, 502, 503) — the endpoint is down, restarting, or shedding load. Every one of them surfaces as ServiceUnavailable. `endpoints_exhausted`: Every Overpass endpoint tried was still unanswered — each accepted the query and held the connection past its attempt window instead of failing outright, or the call ran out of its total time budget before another endpoint could be tried. The message names each endpoint and the window it was given. `endpoints_unavailable`: No configured Overpass endpoint could serve the call — the hosts refused the connection, could not be resolved, were throttled, or reported their own instance fault, in some mix. The message names each endpoint and what it did. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `query_error`: Overpass returned HTTP 400 — malformed query syntax. `query_timeout`: The query exceeded its timeout. `result_too_large`: Overpass ran out of memory on this query. `rate_limited`: Every configured endpoint refused the query as throttled — HTTP 429, or a throttle document in place of JSON. `upstream_error`: Overpass reported a runtime error that is neither a timeout nor memory exhaustion. `overpass_gateway_timeout`: Overpass answered HTTP 504 — the query exceeded the endpoint's own time budget, not the [timeout:N] directive. `overpass_unavailable`: Overpass answered an HTTP 5xx other than 504 — the endpoint is down, restarting, or shedding load. `endpoints_exhausted`: No endpoint answered within its attempt window, or the total time budget ran out first. `endpoints_unavailable`: No configured endpoint would serve the call — connections refused, DNS failures, throttling, or instance faults, in some mix. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance when the page came back empty. Distinguishes a query that matched nothing (check syntax or broaden the filter) from an offset past the end of a non-empty result set (retry at a lower offset). Absent when results were returned."New value: +"Why this page is empty and what to try: nothing matched (check the query syntax or broaden the filter), or offset ran past the end (retry lower). Absent when results were returned."
    • changedOutput schema / properties / servingEndpoint / description
      Previous value: -"Overpass endpoint that produced this response, as origin and path. Differs from the first configured endpoint when a mirror answered after the primary failed, and names the endpoint that served a cached response rather than the one this call would have tried. Pair it with data_timestamp when a result looks unexpectedly slow, sparse, or stale."New value: +"Overpass endpoint that answered, as origin and path. May name a failover mirror, or the endpoint that originally served a cached response. Read with data_timestamp when a result looks slow, sparse, or stale."
  6. Changed2 schema fields changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `query_error`: Overpass returned a 400 error — malformed query syntax. `query_timeout`: The query exceeded its timeout (Overpass runtime error in response body). `result_too_large`: Overpass runtime error: query ran out of memory — result set exceeds the server memory limit. `rate_limited`: Overpass refused the query as throttled — HTTP 429, or a throttle document instead of JSON — on every configured endpoint. With a list in OSM_OVERPASS_ENDPOINTS the call advances to the next entry first, so this surfaces only once all of them have refused it. `upstream_error`: Overpass reported a runtime error that is neither a timeout nor memory exhaustion — the message carries the remark verbatim. `overpass_gateway_timeout`: Overpass answered HTTP 504 — it accepted the query but its dispatcher gave up before producing a result, so the query exceeded the time budget the endpoint enforces rather than the [timeout:N] directive. `overpass_unavailable`: Overpass answered with an HTTP 5xx other than 504 (500, 501, 502, 503) — the endpoint is down, restarting, or shedding load. Every one of them surfaces as ServiceUnavailable. `endpoints_exhausted`: Every Overpass endpoint tried was still unanswered when the call ran out of its total time budget — each accepted the query and held the connection instead of failing outright. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `query_error`: Overpass returned a 400 error — malformed query syntax. `query_timeout`: The query exceeded its timeout (Overpass runtime error in response body). `result_too_large`: Overpass runtime error: query ran out of memory — result set exceeds the server memory limit. `rate_limited`: Overpass refused the query as throttled — HTTP 429, or a throttle document instead of JSON — on every configured endpoint. With a list in OSM_OVERPASS_ENDPOINTS the call advances to the next entry first, so this surfaces only once all of them have refused it. `upstream_error`: Overpass reported a runtime error that is neither a timeout nor memory exhaustion — the message carries the remark verbatim. `overpass_gateway_timeout`: Overpass answered HTTP 504 — it accepted the query but its dispatcher gave up before producing a result, so the query exceeded the time budget the endpoint enforces rather than the [timeout:N] directive. `overpass_unavailable`: Overpass answered with an HTTP 5xx other than 504 (500, 501, 502, 503) — the endpoint is down, restarting, or shedding load. Every one of them surfaces as ServiceUnavailable. `endpoints_exhausted`: Every Overpass endpoint tried was still unanswered — each accepted the query and held the connection past its attempt window instead of failing outright, or the call ran out of its total time budget before another endpoint could be tried. The message names each endpoint and the window it was given. `endpoints_unavailable`: No configured Overpass endpoint could serve the call — the hosts refused the connection, could not be resolved, were throttled, or reported their own instance fault, in some mix. The message names each endpoint and what it did. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "query_error",
      -  "query_timeout",
      -  "result_too_large",
      -  "rate_limited",
      -  "upstream_error",
      -  "overpass_gateway_timeout",
      -  "overpass_unavailable",
      -  "endpoints_exhausted"
      -]New value: +[
      +  "query_error",
      +  "query_timeout",
      +  "result_too_large",
      +  "rate_limited",
      +  "upstream_error",
      +  "overpass_gateway_timeout",
      +  "overpass_unavailable",
      +  "endpoints_exhausted",
      +  "endpoints_unavailable"
      +]
  7. Changed4 schema fields changed
    • addedInput schema / properties / max_element_bytes
      Added value: +{
      +  "default": 20000,
      +  "description": "Serialized-byte budget for one element, measured in UTF-8 bytes and applied to each element of the page independently after limit and offset. It bounds what limit cannot: a single relation or geometry-heavy way. An element over budget keeps every scalar and its tags but has its members, nodes and geometry arrays withheld whole — never truncated to a prefix — and lists each one under withheld_keys with its item count and byte size; withheldElements and withheldNotice then carry the offset and raised budget that fetch that element back whole in one more call. The withheld_keys disclosure the element gains is not counted back against the budget, so a bounded element runs a fixed ~60 bytes per withheld key above it.",
      +  "maximum": 10000000,
      +  "minimum": 1000,
      +  "type": "integer"
      +}
    • changedOutput schema / properties / elements / description
      Previous value: -"Raw Overpass API response elements for this page, up to the limit. Structure varies by query type — nodes have lat/lon, ways have nodes[], relations have members[]."New value: +"Raw Overpass API response elements for this page, up to the limit. Structure varies by query type — nodes have lat/lon, ways have nodes[], relations have members[]. An element over max_element_bytes carries a withheld_keys array instead of the heavy arrays it names, each entry giving the key, its item count, and its serialized byte size."
    • addedOutput schema / properties / withheldElements
      Added value: +{
      +  "description": "Elements on this page that exceeded max_element_bytes, each with the arguments that fetch it back whole. Absent when every element fit.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "id": {
      +        "description": "OSM id of the bounded element.",
      +        "type": "number"
      +      },
      +      "keys": {
      +        "description": "Keys withheld whole from this element: members, nodes, or geometry.",
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "maxElementBytes": {
      +        "description": "Serialized UTF-8 byte size of this element whole, which is the smallest max_element_bytes that returns it. Pass it on the retrieval call when it is at or below the 10000000 ceiling; above that no accepted budget returns the element whole and withheldNotice names the narrower query to use instead.",
      +        "type": "number"
      +      },
      +      "offset": {
      +        "description": "Absolute offset of this element in the full match set. Pass it with limit 1 to fetch this element alone.",
      +        "type": "number"
      +      },
      +      "type": {
      +        "description": "OSM element type of the bounded element.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "type",
      +      "id",
      +      "keys",
      +      "offset",
      +      "maxElementBytes"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / withheldNotice
      Added value: +{
      +  "description": "How to retrieve the withheld arrays, one element per call. Absent when every element fit.",
      +  "type": "string"
      +}
  8. Changed1 schema field changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `query_error`: Overpass returned a 400 error — malformed query syntax. `query_timeout`: The query exceeded its timeout (Overpass runtime error in response body). `result_too_large`: Overpass runtime error: query ran out of memory — result set exceeds the server memory limit. `rate_limited`: Overpass refused the query as throttled — HTTP 429, or a throttle document instead of JSON — on every configured endpoint. With a list in OSM_OVERPASS_ENDPOINTS the call advances to the next entry first, so this surfaces only once all of them have refused it. `upstream_error`: Overpass reported a runtime error that is neither a timeout nor memory exhaustion — the message carries the remark verbatim. `overpass_gateway_timeout`: Overpass answered HTTP 504 — it accepted the query but its dispatcher gave up before producing a result, so the query exceeded the time budget the endpoint enforces rather than the [timeout:N] directive. `overpass_unavailable`: Overpass answered with an HTTP 5xx other than 504 (500, 501, 502, 503) — the endpoint is down, restarting, or shedding load. The thrown code tracks the status: 500 and 501 surface as InternalError, every other 5xx as ServiceUnavailable. `endpoints_exhausted`: Every Overpass endpoint tried was still unanswered when the call ran out of its total time budget — each accepted the query and held the connection instead of failing outright. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `query_error`: Overpass returned a 400 error — malformed query syntax. `query_timeout`: The query exceeded its timeout (Overpass runtime error in response body). `result_too_large`: Overpass runtime error: query ran out of memory — result set exceeds the server memory limit. `rate_limited`: Overpass refused the query as throttled — HTTP 429, or a throttle document instead of JSON — on every configured endpoint. With a list in OSM_OVERPASS_ENDPOINTS the call advances to the next entry first, so this surfaces only once all of them have refused it. `upstream_error`: Overpass reported a runtime error that is neither a timeout nor memory exhaustion — the message carries the remark verbatim. `overpass_gateway_timeout`: Overpass answered HTTP 504 — it accepted the query but its dispatcher gave up before producing a result, so the query exceeded the time budget the endpoint enforces rather than the [timeout:N] directive. `overpass_unavailable`: Overpass answered with an HTTP 5xx other than 504 (500, 501, 502, 503) — the endpoint is down, restarting, or shedding load. Every one of them surfaces as ServiceUnavailable. `endpoints_exhausted`: Every Overpass endpoint tried was still unanswered when the call ran out of its total time budget — each accepted the query and held the connection instead of failing outright. Other values are possible when a failure originates below the handler."
  9. Changed6 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "elements",
      +      "total_elements",
      +      "attribution",
      +      "effectiveQuery",
      +      "totalFound",
      +      "truncated"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / error
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Present when the call failed. Absent on success.",
      +  "properties": {
      +    "code": {
      +      "description": "JSON-RPC error code for this failure.",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "data": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "reason": {
      +          "description": "Machine-readable failure mode. Declared by this tool: `query_error`: Overpass returned a 400 error — malformed query syntax. `query_timeout`: The query exceeded its timeout (Overpass runtime error in response body). `result_too_large`: Overpass runtime error: query ran out of memory — result set exceeds the server memory limit. `rate_limited`: Overpass refused the query as throttled — HTTP 429, or a throttle document instead of JSON — on every configured endpoint. With a list in OSM_OVERPASS_ENDPOINTS the call advances to the next entry first, so this surfaces only once all of them have refused it. `upstream_error`: Overpass reported a runtime error that is neither a timeout nor memory exhaustion — the message carries the remark verbatim. `overpass_gateway_timeout`: Overpass answered HTTP 504 — it accepted the query but its dispatcher gave up before producing a result, so the query exceeded the time budget the endpoint enforces rather than the [timeout:N] directive. `overpass_unavailable`: Overpass answered with an HTTP 5xx other than 504 (500, 501, 502, 503) — the endpoint is down, restarting, or shedding load. The thrown code tracks the status: 500 and 501 surface as InternalError, every other 5xx as ServiceUnavailable. `endpoints_exhausted`: Every Overpass endpoint tried was still unanswered when the call ran out of its total time budget — each accepted the query and held the connection instead of failing outright. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "query_error",
      +            "query_timeout",
      +            "result_too_large",
      +            "rate_limited",
      +            "upstream_error",
      +            "overpass_gateway_timeout",
      +            "overpass_unavailable",
      +            "endpoints_exhausted"
      +          ],
      +          "type": "string"
      +        },
      +        "recovery": {
      +          "additionalProperties": {},
      +          "description": "Actionable next step for the caller.",
      +          "properties": {
      +            "hint": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "hint"
      +          ],
      +          "type": "object"
      +        },
      +        "retryable": {
      +          "description": "Whether retrying may succeed.",
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "message": {
      +      "description": "Human-readable description of what went wrong.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "code",
      +    "message"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "elements",
      -  "total_elements",
      -  "attribution",
      -  "effectiveQuery",
      -  "totalFound",
      -  "truncated"
      -]
  10. Changed10 schema fields changed
    • addedInput schema / properties / limit
      Added value: +{
      +  "default": 20,
      +  "description": "Maximum elements to return. Applied after the Overpass query — if the query matched more, they are truncated.",
      +  "maximum": 500,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "default": 0,
      +  "description": "Number of matching elements to skip before applying limit, for paging through a large result set. The full match set is fetched and cached ~10 minutes keyed by the query, so re-paging at a new offset is deterministic and costs no extra upstream request; a result over 100000 elements is served but not cached, so paging that far re-queries and depends on the endpoint returning the same order. Pass the nextOffset value from a prior truncated response.",
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • changedInput schema / properties / timeout_seconds / description
      Previous value: -"Query timeout in seconds. The [timeout:N] directive in the query string takes precedence if present. Max 180s."New value: +"Query timeout in seconds, bounding how long Overpass itself spends on the query. The [timeout:N] directive in the query string takes precedence if present. The client waits for what is requested here, up to 180s, so a long-running query is not cut off early — but the endpoint enforces its own budget and may answer HTTP 504 first."
    • changedOutput schema / properties / elements / description
      Previous value: -"Raw Overpass API response elements. Structure varies by query type — nodes have lat/lon, ways have nodes[], relations have members[]."New value: +"Raw Overpass API response elements for this page, up to the limit. Structure varies by query type — nodes have lat/lon, ways have nodes[], relations have members[]."
    • addedOutput schema / properties / nextOffset
      Added value: +{
      +  "description": "Offset to pass on the next call to retrieve the following page of elements. Present only when more elements remain beyond this page.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance when no elements were returned — e.g., check query syntax or broaden the filter. Absent when results were returned."New value: +"Guidance when the page came back empty. Distinguishes a query that matched nothing (check syntax or broaden the filter) from an offset past the end of a non-empty result set (retry at a lower offset). Absent when results were returned."
    • addedOutput schema / properties / totalFound
      Added value: +{
      +  "description": "Total elements returned by Overpass before limit truncation.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / total_elements / description
      Previous value: -"Number of elements returned."New value: +"Number of elements returned on this page. See totalFound for the full match count."
    • addedOutput schema / properties / truncated
      Added value: +{
      +  "description": "True if elements were cut at the limit. Narrow the query, or page with offset to retrieve the rest.",
      +  "type": "boolean"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "elements",
      -  "total_elements",
      -  "attribution",
      -  "effectiveQuery"
      -]New value: +[
      +  "elements",
      +  "total_elements",
      +  "attribution",
      +  "effectiveQuery",
      +  "totalFound",
      +  "truncated"
      +]
  11. Changed1 schema field changed
    • addedOutput schema / properties / servingEndpoint
      Added value: +{
      +  "description": "Overpass endpoint that produced this response, as origin and path. Differs from the first configured endpoint when a mirror answered after the primary failed, and names the endpoint that served a cached response rather than the one this call would have tried. Pair it with data_timestamp when a result looks unexpectedly slow, sparse, or stale.",
      +  "type": "string"
      +}
  12. Changed1 schema field changed
    • changedOutput schema / properties / data_timestamp / description
      Previous value: -"OSM data freshness timestamp from the Overpass response. Absent if not included in the response."New value: +"OSM data freshness timestamp from the Overpass response. Absent when the endpoint reported no freshness metadata."
  13. Changed3 schema fields changed
    • addedOutput schema / properties / effectiveQuery
      Added value: +{
      +  "description": "The Overpass QL string as sent to the API (after any timeout injection).",
      +  "type": "string"
      +}
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Guidance when no elements were returned — e.g., check query syntax or broaden the filter. Absent when results were returned.",
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "elements",
      -  "total_elements",
      -  "attribution"
      -]New value: +[
      +  "elements",
      +  "total_elements",
      +  "attribution",
      +  "effectiveQuery"
      +]
  14. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, openWorldHint, and idempotentHint, but the description adds substantial operational detail beyond them: it states the server sets endpoint and User-Agent, auto-adds [maxsize:268435456] unless specified, explains the one-page paging model with totalFound/truncated, describes ~10-minute caching for deterministic paging, and details how oversized elements are withheld whole with withheldNotice and withheldElements. It does not contradict the annotations.

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 long but front-loaded with purpose and usage, then moves through query format, scope, response paging, and withholding behavior. Every section carries relevant information for a complex raw-query tool, though the dense parenthetical style (e.g., the area-offset note) could be tightened.

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?

With an output schema present, the description needn't explain return values, yet it still covers the crucial response-shaping details: one-page results, totalFound/truncated, limitNotice, and oversized-element withholding with recovery instructions. It supplies everything an agent needs to call this complex 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?

Schema coverage is 100%, so the schema already documents each parameter. The description still adds meaningful context: query must include [out:json], the server handles endpoint/User-Agent, default maxsize behavior, limitNotice when limit exceeds 500, offset paging determinism from caching, timeout precedence over the query directive, and max_element_bytes withholding behavior. Some of this overlaps the schema, which keeps it at 4 rather than 5.

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: 'Run an arbitrary Overpass QL query for anything the convenience tools cannot express.' It explicitly lists distinguishing use cases (multi-type/union queries, relation membership, historical queries, regex tag matching) and names the sibling tools it replaces for simpler cases, so an agent can distinguish it from openstreetmap_query_nearby and openstreetmap_query_bbox without opening schemas.

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 when-to-use guidance ('for anything the convenience tools cannot express') and when-not guidance ('For plain "near X" or "in this area" questions use openstreetmap_query_nearby or openstreetmap_query_bbox'). It also notes that openstreetmap_query_bbox takes the same scope as within without QL, routing the agent to the right alternative.

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.