openstreetmap-mcp-server

Geocode, reverse geocode, and run Overpass spatial queries on OpenStreetMap data.

¿Debería usar esto?

Calidad y seguridad

A
Calidad de la descripción
100%
Integridad del esquema
96%
Calidad de los nombres
100%
Riesgo de envenenamiento
100%
Coincidencia de permisos
100%
Cumplimiento del protocolo
100%

Basado en el análisis automatizado de las definiciones de herramientas y el cumplimiento del protocolo.

Costo de contexto

~12,655Tokens (definiciones de herramientas)
~24.9 KBTamaño de respuesta típico
Impacto significativo en la atención (9.89% del contexto de 128k)

Este es el número aproximado de tokens que se consumen cada vez que las herramientas del servidor se cargan en el contexto de un modelo. Los recuentos más altos reducen la atención disponible para otras tareas.

Instalar

Instalación con un clic

Agrega esto a tu archivo `claude_desktop_config.json`:

{
  "mcpServers": {
    "openstreetmap-mcp-server": {
      "command": "bun",
      "args": [
        "@cyanheads/openstreetmap-mcp-server"
      ]
    }
  }
}

Paquetes ejecutables

npm@cyanheads/openstreetmap-mcp-server0.5.2streamable-http

Puntos de conexión remotos

https://openstreetmap.caseyjhand.com/mcpstreamable-http

Qué puede hacer

Inventario de herramientas

Herramientas (6)

🟢 Solo lectura🟡 Escritura🔴 Eliminación⚪ Desconocido
🟢openstreetmap_search_places(query, street, city, county, state, ...)

Geocode a place name or address to coordinates and structured place data via Nominatim. Send either a free-form query or the structured address fields (street, city, county, state, country, postalcode), never both; results are the best-ranked matches, not every matching object, and matching never uses an OSM attribute tag, so filter or enumerate by tag with openstreetmap_query_nearby, openstreetmap_query_bbox, or openstreetmap_query_raw.

Esquema de entrada

{
  "type": "object",
  "properties": {
    "query": {
      "description": "Free-form search string, e.g. \"Space Needle Seattle\" or \"1600 Pennsylvania Ave NW, Washington DC\". Not combinable with the structured address fields. Nominatim reads commas as an address hierarchy, so give the name plus its city or region and nothing in between: \"Beinecke Library, New Haven\" matches where \"Beinecke Library, Yale University, New Haven\" returns nothing.",
      "type": "string"
    },
    "street": {
      "description": "House number and street name (structured query). Use with city/state/country fields. Cannot be combined with query.",
      "type": "string"
    },
    "city": {
      "description": "City name (structured query).",
      "type": "string"
    },
    "county": {
      "description": "County or district (structured query).",
      "type": "string"
    },
    "state": {
      "description": "State or province (structured query).",
      "type": "string"
    },
    "country": {
      "description": "Country name or ISO 3166-1 alpha-2 code (structured query).",
      "type": "string"
    },
    "postalcode": {
      "description": "Postal or ZIP code (structured query).",
      "type": "string"
    },
    "limit": {
      "default": 5,
      "description": "Maximum results to return. Nominatim may return fewer when additional results do not sufficiently match. Max 40.",
      "type": "integer",
      "minimum": 1,
      "maximum": 40
    },
    "countrycodes": {
      "description": "Restrict results to one or more countries: comma-separated ISO 3166-1 alpha-2 codes (e.g. \"us,ca\"), any casing, optional spaces around the commas. Any other form — alpha-3, a semicolon list, a country name — is rejected rather than silently dropped upstream. A well-formed code for a country that does not exist matches nothing. An empty value counts as omitted. Prefer this over the structured country field for filtering.",
      "anyOf": [
        {
          "type": "string",
          "const": ""
        },
        {
          "type": "string",
          "pattern": "^\\s*(?:[A-Za-z]{2}\\s*)?(?:,\\s*(?:[A-Za-z]{2}\\s*)?)*$",
          "description": "One ISO 3166-1 alpha-2 country code, or a comma-separated list of them, in any casing."
        }
      ]
    },
    "viewbox": {
      "description": "Rectangular area to bias results toward, disambiguating a name that repeats worldwide (a creek in one watershed, a street in one municipality). Narrower than countrycodes. Bias only by default: a better match outside the box is still returned. Set bounded for a hard restriction. Unlike openstreetmap_query_bbox this box may not cross the antimeridian — west must be less than east and south less than north, or the call is rejected.",
      "type": "object",
      "properties": {
        "west": {
          "type": "number",
          "minimum": -180,
          "maximum": 180,
          "description": "Western boundary longitude. Must be strictly less than east."
        },
        "south": {
          "type": "number",
          "minimum": -90,
          "maximum": 90,
          "description": "Southern boundary latitude. Must be strictly less than north."
        },
        "east": {
          "type": "number",
          "minimum": -180,
          "maximum": 180,
          "description": "Eastern boundary longitude. Must be strictly greater than west."
        },
        "north": {
          "type": "number",
          "minimum": -90,
          "maximum": 90,
          "description": "Northern boundary latitude. Must be strictly greater than south."
        }
      },
      "required": [
        "west",
        "south",
        "east",
        "north"
      ]
    },
    "bounded": {
      "description": "Restrict results to the viewbox instead of merely biasing toward it. Requires viewbox — setting it alone is rejected rather than ignored. With it, a match outside the box is dropped even when it scores higher.",
      "type": "boolean"
    },
    "layer": {
      "description": "Filter by data layer: one of address, poi, railway, natural, manmade, or a comma-separated list of them, in any casing. Any other name is rejected here, not upstream; an empty value counts as omitted. Default: no restriction.",
      "anyOf": [
        {
          "type": "string",
          "const": ""
        },
        {
          "type": "string",
          "pattern": "^\\s*(?:(?:[aA][dD][dD][rR][eE][sS][sS]|[pP][oO][iI]|[rR][aA][iI][lL][wW][aA][yY]|[nN][aA][tT][uU][rR][aA][lL]|[mM][aA][nN][mM][aA][dD][eE])(?:\\s*,\\s*(?:[aA][dD][dD][rR][eE][sS][sS]|[pP][oO][iI]|[rR][aA][iI][lL][wW][aA][yY]|[nN][aA][tT][uU][rR][aA][lL]|[mM][aA][nN][mM][aA][dD][eE]))*)?\\s*$",
          "description": "One documented layer name, or a comma-separated list of them, in any casing."
        }
      ]
    },
    "featureType": {
      "description": "Restrict results to a geographic feature type. Automatically implies the address layer.",
      "type": "string",
      "enum": [
        "country",
        "state",
        "city",
        "settlement"
      ]
    },
    "extratags": {
      "default": false,
      "description": "Include the matched object's extra OSM tags — contact and metadata (phone, website, opening_hours, wikidata) and physical attributes (surface, tracktype, sac_scale, ele, access). An absent tag describes that object, not OpenStreetMap. Increases response size.",
      "type": "boolean"
    },
    "language": {
      "description": "Preferred language for result names (BCP 47 code or Accept-Language string, e.g., \"en\", \"de\", \"fr,en\"). Defaults to local OSM language.",
      "type": "string"
    },
    "exclude_place_ids": {
      "description": "OSM refs (N/W/R + id) or Nominatim place_ids to drop from results; any other token form is rejected here rather than by Nominatim. Entries are trimmed, lowercase ref prefixes uppercased, a blank entry treated as absent. Page toward further matches by passing back a prior full page's nextExcludeIds, which prefers stable OSM refs over volatile place_ids; the walk ends when a page returns zero results with an exhaustion notice — a success, not an error. Best-effort, not a cursor: Nominatim ranking can reorder between calls, so already-seen results may shift.",
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string",
            "const": ""
          },
          {
            "type": "string",
            "pattern": "^\\s*(?:[NWRnwr]\\d+|\\d+)?\\s*$",
            "description": "An OSM ref (N/W/R plus the object id) or a bare Nominatim place_id."
          }
        ],
        "description": "One exclusion token, or an empty value that excludes nothing."
      }
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "anyOf": [
    {
      "type": "object",
      "required": [
        "query"
      ]
    },
    {
      "type": "object",
      "required": [
        "street"
      ]
    },
    {
      "type": "object",
      "required": [
        "city"
      ]
    },
    {
      "type": "object",
      "required": [
        "county"
      ]
    },
    {
      "type": "object",
      "required": [
        "state"
      ]
    },
    {
      "type": "object",
      "required": [
        "country"
      ]
    },
    {
      "type": "object",
      "required": [
        "postalcode"
      ]
    }
  ]
}

Esquema de salida

{
  "type": "object",
  "properties": {
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "place_id": {
            "type": "number",
            "description": "Nominatim internal place ID. Stable cross-server reference: osm_type+osm_id."
          },
          "osm_type": {
            "description": "OSM object type.",
            "type": "string",
            "enum": [
              "node",
              "way",
              "relation"
            ]
          },
          "osm_id": {
            "description": "OSM object ID. Combine with osm_type for openstreetmap_lookup_objects, or pass \"R\"/\"W\" + this id as within on openstreetmap_query_bbox to search inside this boundary. The same scope in openstreetmap_query_raw is rel(<osm_id>);map_to_area->.a; or way(<osm_id>);map_to_area->.a; then (area.a) on each statement.",
            "type": "number"
          },
          "lat": {
            "type": "number",
            "description": "Latitude in WGS84 decimal degrees."
          },
          "lon": {
            "type": "number",
            "description": "Longitude in WGS84 decimal degrees."
          },
          "display_name": {
            "type": "string",
            "description": "Full human-readable address string."
          },
          "name": {
            "description": "Feature name; absent for address-only results.",
            "type": "string"
          },
          "category": {
            "description": "OSM feature category (e.g. \"amenity\", \"man_made\").",
            "type": "string"
          },
          "type": {
            "description": "OSM feature type within category (e.g. \"hospital\", \"tower\").",
            "type": "string"
          },
          "importance": {
            "description": "Nominatim relevance score (0–1). Higher is more globally prominent.",
            "type": "number"
          },
          "address": {
            "description": "Structured address breakdown, keys varying by feature type and country: house_number, road, suburb, city, state, postcode, country, country_code.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "boundingbox": {
            "description": "Bounding box as [south, north, west, east] in WGS84 decimal degrees.",
            "type": "array",
            "prefixItems": [
              {
                "type": "number"
              },
              {
                "type": "number"
              },
              {
                "type": "number"
              },
              {
                "type": "number"
              }
            ],
            "items": false,
            "minItems": 4,
            "maxItems": 4
          },
          "extratags": {
            "description": "Extra OSM tags this object carries — contact and metadata (phone, website, opening_hours, wikidata) and physical attributes (surface, tracktype, sac_scale, ele, access). Present only when extratags was requested; an absent tag describes this object, not OpenStreetMap.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "place_id",
          "lat",
          "lon",
          "display_name"
        ],
        "additionalProperties": false,
        "description": "A single geocoding result."
      },
      "description": "Geocoding results, ordered by Nominatim relevance (importance score descending)."
    },
    "total": {
      "type": "number",
      "description": "Number of results returned."
    },
    "attribution": {
      "type": "string",
      "description": "Required data attribution: Data © OpenStreetMap contributors, ODbL 1.0."
    },
    "effectiveQuery": {
      "type": "string",
      "description": "The effective query sent to Nominatim — the free-form query string, or a reconstructed string from the provided structured address fields."
    },
    "truncated": {
      "description": "True when the page filled the requested limit and a same-call probe confirmed another match at this query's relevance cutoff; absent otherwise. Absence is not exhaustion — excluding a full page's ids can still surface less accurate matches past that cutoff, which is why nextExcludeIds is offered on any full page. Nominatim reports no total, so this is a confirmed observation, not an inference from page size.",
      "type": "boolean"
    },
    "shown": {
      "description": "Number of results returned.",
      "type": "number"
    },
    "cap": {
      "description": "The limit applied to this request.",
      "type": "number"
    },
    "nextExcludeIds": {
      "description": "Accumulated exclude tokens (prior excludes plus this page) to pass as exclude_place_ids on the next call. Each is a stable OSM ref (N/W/R + osm_id) when the result carries one, the Nominatim place_id otherwise. Present whenever the page filled the requested limit, whether or not truncated is set: excluding a full page can surface less accurate matches past the probe's cutoff. Best-effort, not a cursor — ranking can reorder between calls, so a walk can end sooner than the page count suggests.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "notice": {
      "description": "Paging guidance, in two cases: results were capped at limit with a probe confirming a further match at the query's relevance cutoff (truncated true — keep paging with nextExcludeIds), or an exclude_place_ids walk was exhausted and the page came back empty (the query matched; the walk simply ended, so no rewrite is needed). Tell them apart by truncated and the result count, not by this field's presence. Absent when a page returns below the limit, and when it fills the limit with nothing past the cutoff — read nextExcludeIds for whether paging can continue.",
      "type": "string"
    },
    "effectiveViewbox": {
      "description": "The viewbox forwarded to Nominatim on this call, echoed so an ambiguous result can be read against the area that scoped it. Absent when no viewbox was supplied.",
      "type": "object",
      "properties": {
        "west": {
          "type": "number",
          "description": "Western boundary longitude sent to Nominatim."
        },
        "south": {
          "type": "number",
          "description": "Southern boundary latitude sent to Nominatim."
        },
        "east": {
          "type": "number",
          "description": "Eastern boundary longitude sent to Nominatim."
        },
        "north": {
          "type": "number",
          "description": "Northern boundary latitude sent to Nominatim."
        }
      },
      "required": [
        "west",
        "south",
        "east",
        "north"
      ],
      "additionalProperties": false
    },
    "boundedApplied": {
      "description": "True when the viewbox was a hard restriction (bounded=1 was sent), false when it biased ranking only and a match outside it could still be returned. Absent when no viewbox was supplied.",
      "type": "boolean"
    },
    "tagSelectionCaveat": {
      "description": "Standing caveat: tag-based selection lives on the Overpass tools (openstreetmap_query_nearby, openstreetmap_query_bbox, openstreetmap_query_raw), never here. extratags decorates the returned objects rather than selecting them, so a missing tag is not evidence the tag is missing from OpenStreetMap. Present on every successful response.",
      "type": "string"
    },
    "error": {
      "description": "Present when the call failed. Absent on success.",
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991,
          "description": "JSON-RPC error code for this failure."
        },
        "message": {
          "type": "string",
          "description": "Human-readable description of what went wrong."
        },
        "data": {
          "type": "object",
          "properties": {
            "reason": {
              "type": "string",
              "description": "Machine-readable failure mode. Declared by this tool: `no_results`: No places matched, and no exclude_place_ids were supplied — an exhausted paging walk returns success with zero results instead. `conflicting_query_mode`: query and at least one structured address field were both supplied; the two modes are mutually exclusive. `missing_query_mode`: Neither query nor any structured address field was supplied. `bounded_without_viewbox`: bounded was set without a viewbox for it to restrict results to. `invalid_viewbox`: The viewbox is inverted or degenerate: west at or beyond east, or south at or beyond north. `invalid_parameters`: Nominatim returned HTTP 400, refusing one of the forwarded parameters; its own message names which one. `rate_limited`: Nominatim returned HTTP 429, or HTTP 200 with a throttle document in place of JSON — the one request per second policy was exceeded. `upstream_error`: Nominatim returned a non-2xx status other than 429, or HTTP 200 with a non-JSON body carrying no throttle signature. Other values are possible when a failure originates below the handler.",
              "examples": [
                "no_results",
                "conflicting_query_mode",
                "missing_query_mode",
                "bounded_without_viewbox",
                "invalid_viewbox",
                "invalid_parameters",
                "rate_limited",
                "upstream_error"
              ]
            },
            "recovery": {
              "description": "Actionable next step for the caller.",
              "type": "object",
              "properties": {
                "hint": {
                  "type": "string"
                }
              },
              "required": [
                "hint"
              ],
              "additionalProperties": {}
            },
            "retryable": {
              "description": "Whether retrying may succeed.",
              "type": "boolean"
            }
          },
          "additionalProperties": {}
        }
      },
      "required": [
        "code",
        "message"
      ],
      "additionalProperties": {}
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "anyOf": [
    {
      "not": {
        "required": [
          "error"
        ]
      },
      "required": [
        "results",
        "total",
        "attribution",
        "effectiveQuery"
      ]
    },
    {
      "required": [
        "error"
      ]
    }
  ]
}
🟢openstreetmap_reverse_geocode(lat, lon, zoom, layer, extratags, ...)

Convert a latitude/longitude pair to the nearest address or named place via Nominatim. The result is the closest indexed OSM object at the requested zoom (18 building, 10 city), which in dense areas can be a neighbouring feature rather than the one containing the coordinate; proximity and layer pick it, never an OSM attribute tag, so find features by tag with openstreetmap_query_nearby, openstreetmap_query_bbox, or openstreetmap_query_raw.

Esquema de entrada

{
  "type": "object",
  "properties": {
    "lat": {
      "type": "number",
      "minimum": -90,
      "maximum": 90,
      "description": "Latitude in WGS84 decimal degrees."
    },
    "lon": {
      "type": "number",
      "minimum": -180,
      "maximum": 180,
      "description": "Longitude in WGS84 decimal degrees."
    },
    "zoom": {
      "default": 18,
      "description": "Address detail level, roughly corresponding to map zoom. 18=building, 16=street, 14=neighbourhood, 12=town, 10=city, 8=county, 5=state, 3=country.",
      "type": "integer",
      "minimum": 3,
      "maximum": 18
    },
    "layer": {
      "description": "Restrict which OSM layer is matched: one of address, poi, railway, natural, manmade, or a comma-separated list of them, in any casing. Any other name is rejected here, not upstream; an empty value counts as omitted. Default: address,poi.",
      "anyOf": [
        {
          "type": "string",
          "const": ""
        },
        {
          "type": "string",
          "pattern": "^\\s*(?:(?:[aA][dD][dD][rR][eE][sS][sS]|[pP][oO][iI]|[rR][aA][iI][lL][wW][aA][yY]|[nN][aA][tT][uU][rR][aA][lL]|[mM][aA][nN][mM][aA][dD][eE])(?:\\s*,\\s*(?:[aA][dD][dD][rR][eE][sS][sS]|[pP][oO][iI]|[rR][aA][iI][lL][wW][aA][yY]|[nN][aA][tT][uU][rR][aA][lL]|[mM][aA][nN][mM][aA][dD][eE]))*)?\\s*$",
          "description": "One documented layer name, or a comma-separated list of them, in any casing."
        }
      ]
    },
    "extratags": {
      "default": false,
      "description": "Include the matched object's extra OSM tags — contact and metadata (phone, website, opening_hours, wikidata) and physical attributes (surface, tracktype, sac_scale, ele, access). An absent tag describes that object, not OpenStreetMap.",
      "type": "boolean"
    },
    "language": {
      "description": "Preferred language for the result (BCP 47 code or Accept-Language string).",
      "type": "string"
    }
  },
  "required": [
    "lat",
    "lon"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false
}

Esquema de salida

{
  "type": "object",
  "properties": {
    "result": {
      "type": "object",
      "properties": {
        "place_id": {
          "type": "number",
          "description": "Nominatim internal place ID."
        },
        "osm_type": {
          "description": "OSM object type.",
          "type": "string",
          "enum": [
            "node",
            "way",
            "relation"
          ]
        },
        "osm_id": {
          "description": "OSM object ID. Combine with osm_type for openstreetmap_lookup_objects, or pass \"R\"/\"W\" + this id as within on openstreetmap_query_bbox to search inside this boundary. The same scope in openstreetmap_query_raw is rel(<osm_id>);map_to_area->.a; or way(<osm_id>);map_to_area->.a; then (area.a) on each statement.",
          "type": "number"
        },
        "lat": {
          "type": "number",
          "description": "Latitude in WGS84 decimal degrees."
        },
        "lon": {
          "type": "number",
          "description": "Longitude in WGS84 decimal degrees."
        },
        "display_name": {
          "type": "string",
          "description": "Full human-readable address."
        },
        "name": {
          "description": "Feature name when the object is named.",
          "type": "string"
        },
        "category": {
          "description": "OSM feature category (e.g. \"amenity\", \"building\").",
          "type": "string"
        },
        "type": {
          "description": "OSM feature type within category.",
          "type": "string"
        },
        "address": {
          "description": "Structured address, keys varying by feature type: house_number, road, suburb, city, state, postcode, country, country_code.",
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "string"
          }
        },
        "boundingbox": {
          "description": "Bounding box as [south, north, west, east] in WGS84 decimal degrees.",
          "type": "array",
          "prefixItems": [
            {
              "type": "number"
            },
            {
              "type": "number"
            },
            {
              "type": "number"
            },
            {
              "type": "number"
            }
          ],
          "items": false,
          "minItems": 4,
          "maxItems": 4
        },
        "extratags": {
          "description": "Extra OSM tags this object carries — contact and metadata (phone, website, opening_hours, wikidata) and physical attributes (surface, tracktype, sac_scale, ele, access). Present only when extratags was requested; an absent tag describes this object, not OpenStreetMap.",
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "string"
          }
        }
      },
      "required": [
        "place_id",
        "lat",
        "lon",
        "display_name"
      ],
      "additionalProperties": false,
      "description": "The closest matching OSM object at the given coordinates."
    },
    "attribution": {
      "type": "string",
      "description": "Required data attribution."
    },
    "tagSelectionCaveat": {
      "description": "Standing caveat: tag-based selection lives on the Overpass tools (openstreetmap_query_nearby, openstreetmap_query_bbox, openstreetmap_query_raw), never here. extratags decorates the returned objects rather than selecting them, so a missing tag is not evidence the tag is missing from OpenStreetMap. Present when extratags was requested.",
      "type": "string"
    },
    "error": {
      "description": "Present when the call failed. Absent on success.",
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991,
          "description": "JSON-RPC error code for this failure."
        },
        "message": {
          "type": "string",
          "description": "Human-readable description of what went wrong."
        },
        "data": {
          "type": "object",
          "properties": {
            "reason": {
              "type": "string",
              "description": "Machine-readable failure mode. Declared by this tool: `no_coverage`: Nominatim reported no OSM data at the coordinates — open ocean or unmapped territory. `invalid_parameters`: Nominatim returned HTTP 400, refusing one of the forwarded parameters; its own message names which one. `rate_limited`: Nominatim returned HTTP 429, or HTTP 200 with a throttle document in place of JSON — the one request per second policy was exceeded. `upstream_error`: Nominatim returned a non-2xx status other than 429, or HTTP 200 with a non-JSON body carrying no throttle signature. Other values are possible when a failure originates below the handler.",
              "examples": [
                "no_coverage",
                "invalid_parameters",
                "rate_limited",
                "upstream_error"
              ]
            },
            "recovery": {
              "description": "Actionable next step for the caller.",
              "type": "object",
              "properties": {
                "hint": {
                  "type": "string"
                }
              },
              "required": [
                "hint"
              ],
              "additionalProperties": {}
            },
            "retryable": {
              "description": "Whether retrying may succeed.",
              "type": "boolean"
            }
          },
          "additionalProperties": {}
        }
      },
      "required": [
        "code",
        "message"
      ],
      "additionalProperties": {}
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "anyOf": [
    {
      "not": {
        "required": [
          "error"
        ]
      },
      "required": [
        "result",
        "attribution"
      ]
    },
    {
      "required": [
        "error"
      ]
    }
  ]
}
🟢openstreetmap_lookup_objects(osm_ids, extratags, language)

Fetch the Nominatim address record for up to 50 known OSM objects by ID, each prefixed N (node), W (way), or R (relation), e.g. "N240109189". Use it for IDs already in hand from openstreetmap_query_nearby or openstreetmap_query_bbox; it returns only objects named in osm_ids, listing any that resolve to nothing under not_found, and cannot select by tag, so discover objects with those tools or openstreetmap_query_raw first.

Esquema de entrada

{
  "type": "object",
  "properties": {
    "osm_ids": {
      "minItems": 1,
      "maxItems": 50,
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "OSM IDs to look up, each prefixed with N (node), W (way), or R (relation). Always an array, including for a single ID: [\"N240109189\"], [\"W50637691\", \"R146656\"]. Up to 50 IDs per call."
    },
    "extratags": {
      "default": false,
      "description": "Include each looked-up object's extra OSM tags — contact and metadata (phone, website, opening_hours, wikidata) and physical attributes (surface, tracktype, sac_scale, ele, access). An absent tag describes that object, not OpenStreetMap.",
      "type": "boolean"
    },
    "language": {
      "description": "Preferred language for names (BCP 47 code).",
      "type": "string"
    }
  },
  "required": [
    "osm_ids"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false
}

Esquema de salida

{
  "type": "object",
  "properties": {
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "place_id": {
            "type": "number",
            "description": "Nominatim internal place ID."
          },
          "osm_type": {
            "description": "OSM object type.",
            "type": "string",
            "enum": [
              "node",
              "way",
              "relation"
            ]
          },
          "osm_id": {
            "description": "OSM object ID. Pass \"R\"/\"W\" + this id as within on openstreetmap_query_bbox to search inside this boundary. The same scope in openstreetmap_query_raw is rel(<osm_id>);map_to_area->.a; or way(<osm_id>);map_to_area->.a; then (area.a) on each statement.",
            "type": "number"
          },
          "lat": {
            "type": "number",
            "description": "Latitude in WGS84 decimal degrees."
          },
          "lon": {
            "type": "number",
            "description": "Longitude in WGS84 decimal degrees."
          },
          "display_name": {
            "type": "string",
            "description": "Full human-readable address string."
          },
          "name": {
            "description": "Feature name if applicable.",
            "type": "string"
          },
          "category": {
            "description": "OSM feature category.",
            "type": "string"
          },
          "type": {
            "description": "OSM feature type within category.",
            "type": "string"
          },
          "address": {
            "description": "Structured address breakdown. Keys vary by feature type.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "boundingbox": {
            "description": "Bounding box as [south, north, west, east] in WGS84 decimal degrees.",
            "type": "array",
            "prefixItems": [
              {
                "type": "number"
              },
              {
                "type": "number"
              },
              {
                "type": "number"
              },
              {
                "type": "number"
              }
            ],
            "items": false,
            "minItems": 4,
            "maxItems": 4
          },
          "extratags": {
            "description": "Extra OSM tags this object carries — contact and metadata (phone, website, opening_hours, wikidata) and physical attributes (surface, tracktype, sac_scale, ele, access). Present only when extratags was requested; an absent tag describes this object, not OpenStreetMap.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "place_id",
          "lat",
          "lon",
          "display_name"
        ],
        "additionalProperties": false,
        "description": "Address details for a single OSM ID lookup result."
      },
      "description": "Address details for the requested OSM IDs that were found."
    },
    "not_found": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "OSM IDs from the request that returned no result."
    },
    "total": {
      "type": "number",
      "description": "Number of results returned."
    },
    "attribution": {
      "type": "string",
      "description": "Required data attribution: Data © OpenStreetMap contributors, ODbL 1.0."
    },
    "tagSelectionCaveat": {
      "description": "Standing caveat: tag-based selection lives on the Overpass tools (openstreetmap_query_nearby, openstreetmap_query_bbox, openstreetmap_query_raw), never here. extratags decorates the returned objects rather than selecting them, so a missing tag is not evidence the tag is missing from OpenStreetMap. Present when extratags was requested.",
      "type": "string"
    },
    "error": {
      "description": "Present when the call failed. Absent on success.",
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991,
          "description": "JSON-RPC error code for this failure."
        },
        "message": {
          "type": "string",
          "description": "Human-readable description of what went wrong."
        },
        "data": {
          "type": "object",
          "properties": {
            "reason": {
              "type": "string",
              "description": "Machine-readable failure mode. Declared by this tool: `invalid_id_format`: An array element is not a single N/W/R-prefixed OSM ID. `invalid_parameters`: Nominatim returned HTTP 400, refusing one of the forwarded parameters; its own message names which one. `rate_limited`: Nominatim returned HTTP 429, or HTTP 200 with a throttle document in place of JSON — the one request per second policy was exceeded. `upstream_error`: Nominatim returned a non-2xx status other than 429, or HTTP 200 with a non-JSON body carrying no throttle signature. Other values are possible when a failure originates below the handler.",
              "examples": [
                "invalid_id_format",
                "invalid_parameters",
                "rate_limited",
                "upstream_error"
              ]
            },
            "recovery": {
              "description": "Actionable next step for the caller.",
              "type": "object",
              "properties": {
                "hint": {
                  "type": "string"
                }
              },
              "required": [
                "hint"
              ],
              "additionalProperties": {}
            },
            "retryable": {
              "description": "Whether retrying may succeed.",
              "type": "boolean"
            }
          },
          "additionalProperties": {}
        }
      },
      "required": [
        "code",
        "message"
      ],
      "additionalProperties": {}
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "anyOf": [
    {
      "not": {
        "required": [
          "error"
        ]
      },
      "required": [
        "results",
        "not_found",
        "total",
        "attribution"
      ]
    },
    {
      "required": [
        "error"
      ]
    }
  ]
}
🟢openstreetmap_query_nearby(lat, lon, radius_meters, amenity, tag_key, ...)

Find OSM features within a radius of a point via the Overpass API, the tool for "what is near X?" questions. Filter with amenity, or with tag_key plus an optional tag_value, ANDing up to five more filters; every feature returns with its full OSM tag set (no extratags flag here), sorted nearest-first by distance_meters, with nodes covering standalone POIs and ways covering buildings and areas.

Esquema de entrada

{
  "type": "object",
  "properties": {
    "lat": {
      "type": "number",
      "minimum": -90,
      "maximum": 90,
      "description": "Center latitude in WGS84 decimal degrees."
    },
    "lon": {
      "type": "number",
      "minimum": -180,
      "maximum": 180,
      "description": "Center longitude in WGS84 decimal degrees."
    },
    "radius_meters": {
      "default": 1000,
      "description": "Search radius in meters. Max 50,000m (50km). Keep under 5,000m for dense urban POI queries to avoid slow responses.",
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 50000
    },
    "amenity": {
      "description": "OSM amenity tag value (e.g. \"hospital\", \"pharmacy\", \"restaurant\", \"atm\"), shortcut for tag_key=\"amenity\". Exactly one primary mode is required: this or tag_key, never both.",
      "type": "string"
    },
    "tag_key": {
      "description": "Primary OSM tag key (e.g. \"leisure\", \"shop\", \"highway\"); omit tag_value to match any feature carrying the key, or supply it for exact equality. The alternative to amenity, never both. Additional filters are ANDed with this tag.",
      "type": "string"
    },
    "tag_value": {
      "description": "Literal value paired with tag_key for exact equality (e.g., \"park\", \"supermarket\"); omit for key existence. Explicit empty or whitespace-only values are invalid. Keys and values are trimmed; blank unused fields are ignored in amenity mode.",
      "type": "string"
    },
    "filters": {
      "description": "Up to five additional filters, ANDed with the required primary amenity or tag_key filter in input order. Omitted or [] adds no conditions. Keys must be unique after trimming; keys and values must not contain Overpass QL metacharacters (\" \\ [ ] ; ( )).",
      "maxItems": 5,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Literal OSM tag key. Trimmed and nonblank; must be unique across the primary tag and all filters."
          },
          "value": {
            "description": "Literal exact-match value. Omit for key existence; an explicitly blank value is invalid. Trimmed before matching.",
            "type": "string"
          }
        },
        "required": [
          "key"
        ],
        "additionalProperties": false,
        "description": "One additional literal equality or key-existence filter."
      }
    },
    "element_types": {
      "default": [
        "node",
        "way"
      ],
      "description": "OSM element types to search, at least one. Ways cover most buildings and areas; nodes cover most standalone POIs. Add \"relation\" for complex structures like large campuses. Omit the field to search nodes and ways; an empty array is rejected because it can only match nothing.",
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "node",
          "way",
          "relation"
        ]
      }
    },
    "limit": {
      "default": 20,
      "description": "Maximum results to return. Applied after the Overpass query — if the area has more features, they are truncated.",
      "type": "integer",
      "minimum": 1,
      "maximum": 500
    },
    "offset": {
      "default": 0,
      "description": "Number of matching features to skip before applying limit, for paging through a large result set. Features are distance-sorted before paging, so higher offsets return progressively farther matches; the full set is cached ~10 minutes so re-paging costs no extra upstream request. Pass the nextOffset value from a prior truncated response.",
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "timeout_seconds": {
      "default": 25,
      "description": "Overpass query timeout in seconds. Increase for large radius or dense areas.",
      "type": "integer",
      "minimum": 5,
      "maximum": 60
    }
  },
  "required": [
    "lat",
    "lon"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "anyOf": [
    {
      "type": "object",
      "required": [
        "amenity"
      ]
    },
    {
      "type": "object",
      "required": [
        "tag_key"
      ]
    }
  ]
}

Esquema de salida

{
  "type": "object",
  "properties": {
    "elements": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "osm_type": {
            "type": "string",
            "enum": [
              "node",
              "way",
              "relation"
            ],
            "description": "OSM element type."
          },
          "osm_id": {
            "type": "number",
            "description": "OSM element ID. Use with osm_type for openstreetmap_lookup_objects."
          },
          "lat": {
            "description": "Latitude (present for nodes and ways/relations with computed center).",
            "type": "number"
          },
          "lon": {
            "description": "Longitude (present for nodes and ways/relations with computed center).",
            "type": "number"
          },
          "distance_meters": {
            "description": "Great-circle distance in meters from the query center, rounded to one decimal. Results are sorted ascending by this value; omitted for elements without a computed coordinate.",
            "type": "number"
          },
          "name": {
            "description": "Feature name from OSM tags.",
            "type": "string"
          },
          "tags": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            },
            "description": "All OSM tags for this feature. Values are always strings."
          }
        },
        "required": [
          "osm_type",
          "osm_id",
          "tags"
        ],
        "additionalProperties": false,
        "description": "A single matching OSM feature."
      },
      "description": "Matching OSM features, up to the limit."
    },
    "data_timestamp": {
      "description": "OSM data freshness timestamp from the Overpass response. Absent when the endpoint reported no freshness metadata.",
      "type": "string"
    },
    "attribution": {
      "type": "string",
      "description": "Required data attribution: Data © OpenStreetMap contributors, ODbL 1.0."
    },
    "effectiveTag": {
      "type": "string",
      "description": "The full ordered AND filter chain: key=value for equality, key alone for existence (e.g. \"amenity=restaurant, cuisine=italian, name\")."
    },
    "totalFound": {
      "type": "number",
      "description": "Total features returned by Overpass before limit truncation."
    },
    "truncated": {
      "type": "boolean",
      "description": "True if results were cut at the limit. Reduce radius, add more specific tags, or page with offset to retrieve the rest."
    },
    "nextOffset": {
      "description": "Offset to pass on the next call to retrieve the following page of features. Present only when more features remain beyond this page.",
      "type": "number"
    },
    "servingEndpoint": {
      "description": "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.",
      "type": "string"
    },
    "notice": {
      "description": "Why this page is empty and what to try: nothing matched (widen the radius or change the tag), or offset ran past the end (retry lower). Absent when results were returned.",
      "type": "string"
    },
    "error": {
      "description": "Present when the call failed. Absent on success.",
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991,
          "description": "JSON-RPC error code for this failure."
        },
        "message": {
          "type": "string",
          "description": "Human-readable description of what went wrong."
        },
        "data": {
          "type": "object",
          "properties": {
            "reason": {
              "type": "string",
              "description": "Machine-readable failure mode. Declared by this tool: `invalid_tag`: Tag modes conflict or are missing, a key or supplied value is blank, keys repeat after trimming, or a filter carries Overpass QL metacharacters. `query_timeout`: The query exceeded timeout_seconds. `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 timeout_seconds. `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.",
              "examples": [
                "invalid_tag",
                "query_timeout",
                "result_too_large",
                "rate_limited",
                "upstream_error",
                "overpass_gateway_timeout",
                "overpass_unavailable",
                "endpoints_exhausted",
                "endpoints_unavailable"
              ]
            },
            "recovery": {
              "description": "Actionable next step for the caller.",
              "type": "object",
              "properties": {
                "hint": {
                  "type": "string"
                }
              },
              "required": [
                "hint"
              ],
              "additionalProperties": {}
            },
            "retryable": {
              "description": "Whether retrying may succeed.",
              "type": "boolean"
            }
          },
          "additionalProperties": {}
        }
      },
      "required": [
        "code",
        "message"
      ],
      "additionalProperties": {}
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "anyOf": [
    {
      "not": {
        "required": [
          "error"
        ]
      },
      "required": [
        "elements",
        "attribution",
        "effectiveTag",
        "totalFound",
        "truncated"
      ]
    },
    {
      "required": [
        "error"
      ]
    }
  ]
}
🟢openstreetmap_query_bbox(within, south, west, north, east, ...)

Find OSM features inside an area via the Overpass API, for surveys of everything in a region (openstreetmap_query_nearby covers proximity to a point). Scope with the four corner fields south, west, north, east, or with within and a single OSM boundary ref such as a city relation or a park way, which searches the boundary polygon itself instead of an overcovering box; never both. Filter with amenity, or with tag_key plus an optional tag_value, ANDing up to five more filters; every feature returns with its full OSM tag set (no extratags flag here).

Esquema de entrada

{
  "type": "object",
  "properties": {
    "within": {
      "description": "OSM boundary to search inside, as one ref: R plus a relation id (\"R237385\", Seattle) or W plus a closed-way id (\"W13800188\", a park), case-insensitive. Take it from osm_type plus osm_id on openstreetmap_search_places, openstreetmap_reverse_geocode, or openstreetmap_lookup_objects. The alternative to the four corner fields, never both. A node ref is rejected: a node is never an area. A ref that maps to no Overpass area returns an empty page whose notice names the cause.",
      "type": "string",
      "pattern": "^[RWrw]\\d+$"
    },
    "south": {
      "description": "Southern boundary latitude (minimum latitude). One of four corner fields: supply all four, or use within instead.",
      "type": "number",
      "minimum": -90,
      "maximum": 90
    },
    "west": {
      "description": "Western boundary longitude (minimum longitude). A west greater than east is valid, not an error: Overpass reads it as an antimeridian-crossing box and returns the union of west..180 and -180..east.",
      "type": "number",
      "minimum": -180,
      "maximum": 180
    },
    "north": {
      "description": "Northern boundary latitude (maximum latitude).",
      "type": "number",
      "minimum": -90,
      "maximum": 90
    },
    "east": {
      "description": "Eastern boundary longitude (maximum longitude). A value below west describes an antimeridian crossing rather than an inverted box.",
      "type": "number",
      "minimum": -180,
      "maximum": 180
    },
    "amenity": {
      "description": "OSM amenity tag value shortcut (e.g. \"cafe\", \"bench\", \"hospital\"). Exactly one primary mode is required: this or tag_key, never both.",
      "type": "string"
    },
    "tag_key": {
      "description": "Primary OSM tag key (e.g. \"leisure\", \"shop\", \"natural\"); omit tag_value to match any feature carrying the key, or supply it for exact equality. The alternative to amenity, never both. Additional filters are ANDed with this tag.",
      "type": "string"
    },
    "tag_value": {
      "description": "Literal value paired with tag_key for exact equality (e.g., \"park\", \"supermarket\"); omit for key existence. Explicit empty or whitespace-only values are invalid. Keys and values are trimmed; blank unused fields are ignored in amenity mode.",
      "type": "string"
    },
    "filters": {
      "description": "Up to five additional filters, ANDed with the required primary amenity or tag_key filter in input order. Omitted or [] adds no conditions. Keys must be unique after trimming; keys and values must not contain Overpass QL metacharacters (\" \\ [ ] ; ( )).",
      "maxItems": 5,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Literal OSM tag key. Trimmed and nonblank; must be unique across the primary tag and all filters."
          },
          "value": {
            "description": "Literal exact-match value. Omit for key existence; an explicitly blank value is invalid. Trimmed before matching.",
            "type": "string"
          }
        },
        "required": [
          "key"
        ],
        "additionalProperties": false,
        "description": "One additional literal equality or key-existence filter."
      }
    },
    "element_types": {
      "default": [
        "node",
        "way"
      ],
      "description": "OSM element types to search, at least one. Ways cover most buildings and areas; nodes cover most standalone POIs. Add \"relation\" for complex structures. Omit the field to search nodes and ways; an empty array is rejected because it can only match nothing.",
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "node",
          "way",
          "relation"
        ]
      }
    },
    "limit": {
      "default": 20,
      "description": "Maximum results to return. Applied after the Overpass query — if the area has more features, they are truncated.",
      "type": "integer",
      "minimum": 1,
      "maximum": 500
    },
    "offset": {
      "default": 0,
      "description": "Number of matching features 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. Pass the nextOffset value from a prior truncated response.",
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "timeout_seconds": {
      "default": 25,
      "description": "Overpass query timeout in seconds. Increase for large bounding boxes or dense areas.",
      "type": "integer",
      "minimum": 5,
      "maximum": 60
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "anyOf": [
    {
      "type": "object",
      "required": [
        "south",
        "west",
        "north",
        "east",
        "amenity"
      ]
    },
    {
      "type": "object",
      "required": [
        "south",
        "west",
        "north",
        "east",
        "tag_key"
      ]
    },
    {
      "type": "object",
      "required": [
        "within",
        "amenity"
      ]
    },
    {
      "type": "object",
      "required": [
        "within",
        "tag_key"
      ]
    }
  ]
}

Esquema de salida

{
  "type": "object",
  "properties": {
    "elements": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "osm_type": {
            "type": "string",
            "enum": [
              "node",
              "way",
              "relation"
            ],
            "description": "OSM element type."
          },
          "osm_id": {
            "type": "number",
            "description": "OSM element ID. Use with osm_type for openstreetmap_lookup_objects."
          },
          "lat": {
            "description": "Latitude (present for nodes and ways/relations with computed center).",
            "type": "number"
          },
          "lon": {
            "description": "Longitude (present for nodes and ways/relations with computed center).",
            "type": "number"
          },
          "name": {
            "description": "Feature name from OSM tags.",
            "type": "string"
          },
          "tags": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            },
            "description": "All OSM tags for this feature. Values are always strings."
          }
        },
        "required": [
          "osm_type",
          "osm_id",
          "tags"
        ],
        "additionalProperties": false,
        "description": "A single matching OSM feature."
      },
      "description": "Matching OSM features inside the requested scope — the bounding box, or the within boundary — up to the limit."
    },
    "data_timestamp": {
      "description": "OSM data freshness timestamp from the Overpass response. Absent when the endpoint reported no freshness metadata.",
      "type": "string"
    },
    "attribution": {
      "type": "string",
      "description": "Required data attribution: Data © OpenStreetMap contributors, ODbL 1.0."
    },
    "effectiveTag": {
      "type": "string",
      "description": "The full ordered AND filter chain: key=value for equality, key alone for existence (e.g. \"amenity=restaurant, cuisine=italian, name\")."
    },
    "effectiveArea": {
      "description": "The boundary scope as resolved: the within ref and the Overpass area it mapped to. Absent when the call used the four corner fields.",
      "type": "string"
    },
    "areasTimestamp": {
      "description": "Freshness of the Overpass area database, rebuilt on its own schedule and so lagging data_timestamp — a boundary edited since is scoped against its older polygon. Present only on a within call whose endpoint reported it.",
      "type": "string"
    },
    "totalFound": {
      "type": "number",
      "description": "Total features returned by Overpass before limit truncation."
    },
    "truncated": {
      "type": "boolean",
      "description": "True if results were cut at the limit. Reduce bbox area, add more specific tags, or page with offset to retrieve the rest."
    },
    "nextOffset": {
      "description": "Offset to pass on the next call to retrieve the following page of features. Present only when more features remain beyond this page.",
      "type": "number"
    },
    "servingEndpoint": {
      "description": "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.",
      "type": "string"
    },
    "notice": {
      "description": "Why this page is empty and what to try: the within ref resolved to no Overpass area, nothing matched (change the scope or tag), or offset ran past the end (retry lower). Absent when results were returned.",
      "type": "string"
    },
    "error": {
      "description": "Present when the call failed. Absent on success.",
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991,
          "description": "JSON-RPC error code for this failure."
        },
        "message": {
          "type": "string",
          "description": "Human-readable description of what went wrong."
        },
        "data": {
          "type": "object",
          "properties": {
            "reason": {
              "type": "string",
              "description": "Machine-readable failure mode. Declared by this tool: `invalid_scope`: The two spatial scopes conflict: within sent alongside a corner field, neither scope sent, or only part of the four-corner set sent. `invalid_bbox`: south exceeds north — the latitude bounds are inverted. `invalid_tag`: Tag modes conflict or are missing, a key or supplied value is blank, keys repeat after trimming, or a filter carries Overpass QL metacharacters. `query_timeout`: The query exceeded timeout_seconds. `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 timeout_seconds. `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.",
              "examples": [
                "invalid_scope",
                "invalid_bbox",
                "invalid_tag",
                "query_timeout",
                "result_too_large",
                "rate_limited",
                "upstream_error",
                "overpass_gateway_timeout",
                "overpass_unavailable",
                "endpoints_exhausted",
                "endpoints_unavailable"
              ]
            },
            "recovery": {
              "description": "Actionable next step for the caller.",
              "type": "object",
              "properties": {
                "hint": {
                  "type": "string"
                }
              },
              "required": [
                "hint"
              ],
              "additionalProperties": {}
            },
            "retryable": {
              "description": "Whether retrying may succeed.",
              "type": "boolean"
            }
          },
          "additionalProperties": {}
        }
      },
      "required": [
        "code",
        "message"
      ],
      "additionalProperties": {}
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "anyOf": [
    {
      "not": {
        "required": [
          "error"
        ]
      },
      "required": [
        "elements",
        "attribution",
        "effectiveTag",
        "totalFound",
        "truncated"
      ]
    },
    {
      "required": [
        "error"
      ]
    }
  ]
}
🟢openstreetmap_query_raw(query, limit, offset, max_element_bytes, timeout_seconds)

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\"](47.5,-122.5,47.7,-122.2);out body;"; scope to an OSM boundary with rel(<id>);map_to_area->.a; or way(<id>);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.

Esquema de entrada

{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "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;\""
    },
    "limit": {
      "default": 20,
      "description": "Maximum elements to return. Applied after the Overpass query — if the query matched more, they are truncated.",
      "type": "integer",
      "minimum": 1,
      "maximum": 500
    },
    "offset": {
      "default": 0,
      "description": "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.",
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "max_element_bytes": {
      "default": 20000,
      "description": "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.",
      "type": "integer",
      "minimum": 1000,
      "maximum": 10000000
    },
    "timeout_seconds": {
      "default": 30,
      "description": "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.",
      "type": "integer",
      "minimum": 5,
      "maximum": 180
    }
  },
  "required": [
    "query"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false
}

Esquema de salida

{
  "type": "object",
  "properties": {
    "elements": {
      "type": "array",
      "items": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {}
      },
      "description": "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."
    },
    "total_elements": {
      "type": "number",
      "description": "Number of elements returned on this page. See totalFound for the full match count."
    },
    "data_timestamp": {
      "description": "OSM data freshness timestamp from the Overpass response. Absent when the endpoint reported no freshness metadata.",
      "type": "string"
    },
    "attribution": {
      "type": "string",
      "description": "Required data attribution: Data © OpenStreetMap contributors, ODbL 1.0."
    },
    "effectiveQuery": {
      "type": "string",
      "description": "The Overpass QL string as sent to the API (after any timeout injection)."
    },
    "totalFound": {
      "type": "number",
      "description": "Total elements returned by Overpass before limit truncation."
    },
    "truncated": {
      "type": "boolean",
      "description": "True if elements were cut at the limit. Narrow the query, or page with offset to retrieve the rest."
    },
    "nextOffset": {
      "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"
    },
    "servingEndpoint": {
      "description": "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.",
      "type": "string"
    },
    "notice": {
      "description": "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.",
      "type": "string"
    },
    "withheldElements": {
      "description": "Elements on this page that exceeded max_element_bytes, each with the arguments that fetch it back whole. Absent when every element fit.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "OSM element type of the bounded element."
          },
          "id": {
            "type": "number",
            "description": "OSM id of the bounded element."
          },
          "keys": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Keys withheld whole from this element: members, nodes, or geometry."
          },
          "offset": {
            "type": "number",
            "description": "Absolute offset of this element in the full match set. Pass it with limit 1 to fetch this element alone."
          },
          "maxElementBytes": {
            "type": "number",
            "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."
          }
        },
        "required": [
          "type",
          "id",
          "keys",
          "offset",
          "maxElementBytes"
        ],
        "additionalProperties": false
      }
    },
    "withheldNotice": {
      "description": "How to retrieve the withheld arrays, one element per call. Absent when every element fit.",
      "type": "string"
    },
    "error": {
      "description": "Present when the call failed. Absent on success.",
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991,
          "description": "JSON-RPC error code for this failure."
        },
        "message": {
          "type": "string",
          "description": "Human-readable description of what went wrong."
        },
        "data": {
          "type": "object",
          "properties": {
            "reason": {
              "type": "string",
              "description": "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.",
              "examples": [
                "query_error",
                "query_timeout",
                "result_too_large",
                "rate_limited",
                "upstream_error",
                "overpass_gateway_timeout",
                "overpass_unavailable",
                "endpoints_exhausted",
                "endpoints_unavailable"
              ]
            },
            "recovery": {
              "description": "Actionable next step for the caller.",
              "type": "object",
              "properties": {
                "hint": {
                  "type": "string"
                }
              },
              "required": [
                "hint"
              ],
              "additionalProperties": {}
            },
            "retryable": {
              "description": "Whether retrying may succeed.",
              "type": "boolean"
            }
          },
          "additionalProperties": {}
        }
      },
      "required": [
        "code",
        "message"
      ],
      "additionalProperties": {}
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "anyOf": [
    {
      "not": {
        "required": [
          "error"
        ]
      },
      "required": [
        "elements",
        "total_elements",
        "attribution",
        "effectiveQuery",
        "totalFound",
        "truncated"
      ]
    },
    {
      "required": [
        "error"
      ]
    }
  ]
}

Comunidad

Califica este servidor

Evidencia

Observaciones recientes

verificadoversión no registrada6 herramientas
verificadoversión no registrada6 herramientas