Skip to main content
Glama

Run an Overpass query

overpass_query
Read-onlyIdempotent

Runs 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

NameRequiredDescriptionDefault
queryYesthe Overpass QL (or XML) query
offsetNothe element (or CSV row) to start at, for the next part of a cut answer
max_charsNomost characters of the answer to show; larger answers are cut, and offset shows the next part
add_elevationNoadd the height in metres to every point of a JSON answer; one elevation lookup per point

Output Schema

NameRequiredDescriptionDefault
cutYestrue when elements after the part shown were left out; next_offset gives the next part
shownYeselements (or rows) shown in this part
totalYeselements (json), data rows (csv) or lines (xml) in the answer
countsNoelements by type
formatYesformat of the answer
offsetYesthe first element (or row) shown
remarkNoremark of Overpass
completeYesfalse when the answer was larger than what was read; total then counts only the part read
attributionNolicence of the data
next_offsetNooffset of the next part
data_timestampNodate of the data (timestamp_osm_base)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "attribution": {
      +      "description": "licence of the data",
      +      "type": "string"
      +    },
      +    "complete": {
      +      "description": "false when the answer was larger than what was read; total then counts only the part read",
      +      "type": "boolean"
      +    },
      +    "counts": {
      +      "additionalProperties": {
      +        "type": "integer"
      +      },
      +      "description": "elements by type",
      +      "type": "object"
      +    },
      +    "cut": {
      +      "description": "true when elements after the part shown were left out; next_offset gives the next part",
      +      "type": "boolean"
      +    },
      +    "data_timestamp": {
      +      "description": "date of the data (timestamp_osm_base)",
      +      "type": "string"
      +    },
      +    "format": {
      +      "description": "format of the answer",
      +      "enum": [
      +        "json",
      +        "csv",
      +        "xml",
      +        "text"
      +      ],
      +      "type": "string"
      +    },
      +    "next_offset": {
      +      "default": 0,
      +      "description": "offset of the next part",
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "offset": {
      +      "default": 0,
      +      "description": "the first element (or row) shown",
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "remark": {
      +      "description": "remark of Overpass",
      +      "type": "string"
      +    },
      +    "shown": {
      +      "default": 0,
      +      "description": "elements (or rows) shown in this part",
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "total": {
      +      "default": 0,
      +      "description": "elements (json), data rows (csv) or lines (xml) in the answer",
      +      "minimum": 0,
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "format",
      +    "total",
      +    "complete",
      +    "offset",
      +    "shown",
      +    "cut"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already indicate a read-only, open-world, idempotent, non-destructive tool, and the description adds substantial operational context beyond them: minutely freshness, timeout limits of 120 seconds and possible lower plan limits, handling of cut answers via offset, and that every call including a cut call counts as one request. It also discloses Pro/Business plan restrictions for historical dates and attribution requirements.

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 dense but front-loaded, opening with the tool's action, endpoint, and return type before moving into syntax patterns and truncation behavior. The pattern list is long but structured and useful for a complex query language, though some schema-level details such as max_chars and offset are repeated.

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?

Given the complexity of Overpass QL, the presence of annotations, and a full output schema, the description covers the essential operational details: endpoint, data freshness, timeout behavior, output shape, truncation and resumption, request counting, and historical-date restrictions. Nothing critical for correct invocation appears to be missing.

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 description coverage is 100%, so the schema already defines query, offset, max_chars, and add_elevation. The description still adds meaningful semantics for the required query parameter by explaining Overpass QL settings, timeout syntax, and several spatial and output forms; it does not discuss add_elevation, leaving that entirely to the schema.

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?

States a specific verb and resource: runs an Overpass QL query against the full OpenStreetMap planet and returns matching nodes, ways, and relations with tags. It also names the endpoint and update cadence, and references geocode_search as the way to obtain an area id, which distinguishes its role from that sibling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides detailed guidance through query patterns for boxes, radius searches, area searches, name matching, counts, tags, geometry, regex, and id lookup, plus the geocode_search handoff for area ids. It lacks an explicit when-not-to-use statement or exclusions relative to overpass_examples and overpass_tags, so it falls short of the strongest guidance tier.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources