query

Pack: overpass · Endpoint: https://gateway.pipeworx.io/overpass/mcp

Run a raw Overpass QL query against OpenStreetMap. Use for complex spatial queries the helper tools can’t express. Example: [out:json][timeout:25]; area["name"="Berlin"][admin_level=4]->.a; node["amenity"="library"](area.a); out body;. Returns the raw Overpass JSON (elements array with node/way/relation).

Parameters

NameTypeRequiredDescription
qqlstringyesFull Overpass QL query string. Start with [out:json][timeout:<n>]; and end with out body; (or similar output statement).

Example call

Arguments

{
  "qql": "[out:json][timeout:25]; area[\"name\"=\"Paris\"][admin_level=4]->.a; node[\"amenity\"=\"restaurant\"](area.a); out body;"
}

curl

curl -X POST https://gateway.pipeworx.io/overpass/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"query","arguments":{"qql":"[out:json][timeout:25]; area[\"name\"=\"Paris\"][admin_level=4]->.a; node[\"amenity\"=\"restaurant\"](area.a); out body;"}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('query', {
  "qql": "[out:json][timeout:25]; area[\"name\"=\"Paris\"][admin_level=4]->.a; node[\"amenity\"=\"restaurant\"](area.a); out body;"
});

More examples

{
  "qql": "[out:json][timeout:30]; way[\"building\"=\"yes\"][\"height\">20](bbox:48.8,2.2,48.9,2.4); out body;"
}

Response shape

Always returns: count, elements

FieldTypeDescription
countnumberNumber of elements returned
elementsarrayArray of normalized OSM elements
Full JSON Schema
{
  "type": "object",
  "properties": {
    "count": {
      "type": "number",
      "description": "Number of elements returned"
    },
    "elements": {
      "type": "array",
      "description": "Array of normalized OSM elements",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "node",
              "way",
              "relation"
            ],
            "description": "OSM element type"
          },
          "id": {
            "type": "number",
            "description": "OSM element ID"
          },
          "osm_url": {
            "type": "string",
            "description": "Direct link to element on OpenStreetMap"
          },
          "latitude": {
            "type": [
              "number",
              "null"
            ],
            "description": "Latitude coordinate or null if unavailable"
          },
          "longitude": {
            "type": [
              "number",
              "null"
            ],
            "description": "Longitude coordinate or null if unavailable"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "OSM name tag value or null"
          },
          "tags": {
            "type": "object",
            "description": "All OSM tags as key-value pairs"
          }
        },
        "required": [
          "type",
          "id",
          "osm_url",
          "latitude",
          "longitude",
          "name",
          "tags"
        ]
      }
    }
  },
  "required": [
    "count",
    "elements"
  ]
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "overpass": {
      "url": "https://gateway.pipeworx.io/overpass/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build June 26, 2026