Run an Overpass query
overpass_queryRuns an Overpass QL query on the full OpenStreetMap planet at overpass.ch (minutely updates) and returns the matching nodes, ways and relations with their tags. Start the query with a settings line such as [out:json][timeout:25]; JSON is used when the query does not set [out:]. [timeout:N] stops the query after N s: at most 120 s through this tool, and the plan may allow less. Patterns:
Box (south,west,north,east): nwr"amenity"="cafe"; out center;
Radius in metres around lat,lon: nwr"amenity"="pharmacy"; out center;
In a place: overpass_area_id from geocode_search, then area(id:3600051701)->.a; nwr"tourism"="hotel"; out center;
By name (exact, local language): area["name"="Wien"]["admin_level"="4"]->.a;
Count: out count; Tags only: out tags; At most 50: out center 50; Lines with coordinates: out geom; (large)
Regex, any case: ["name"~"^Bahnhof",i]
By id: node(3470507586); out; way(id:1,2,3); out tags;
The map at a past date (Pro and Business plans): [date:"2015-01-01T00:00:00Z"] in the settings line. The answer starts with counts and the date of the data, then one JSON object per element and line, up to max_chars characters. When it is cut, call again with offset, or narrow the query. Each call counts as one request of the plan, a cut one too. Data © OpenStreetMap contributors, ODbL.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "overpass_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | the Overpass QL (or XML) query | |
| offset | No | the element (or CSV row) to start at, for the next part of a cut answer | |
| max_chars | No | most characters of the answer to show; larger answers are cut, and offset shows the next part | |
| add_elevation | No | add the height in metres to every point of a JSON answer; one elevation lookup per point |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cut | Yes | true when elements after the part shown were left out; next_offset gives the next part | |
| shown | Yes | elements (or rows) shown in this part | |
| total | Yes | elements (json), data rows (csv) or lines (xml) in the answer | |
| counts | No | elements by type | |
| format | Yes | format of the answer | |
| offset | Yes | the first element (or row) shown | |
| remark | No | remark of Overpass | |
| complete | Yes | false when the answer was larger than what was read; total then counts only the part read | |
| attribution | No | licence of the data | |
| next_offset | No | offset of the next part | |
| data_timestamp | No | date of the data (timestamp_osm_base) |