Geometry primitivesFree tier

distance_matrix

Geodesic N×N distance matrix (in meters) between an input list of up to 50 points. Symmetric — only the upper triangle is computed and mirrored. Use it for TSP-light scheduling, clustering, or pre-routing inputs.

Use cases

  • Cluster a set of candidate sites by pairwise geodesic distance.
  • Pre-compute the N×N distances feeding a small TSP solver.
  • Score the spread of a list of properties around a center point.
  • Validate that a generated list of “nearby” points is actually close to each other.

Arguments

NameTypeRequiredDescription
points array required Array of { lat, lon } objects.
Cap N=50.

Example request

curl
bash
curl -X POST https://mcp.qubitdata.it/mcp \
  -H "Authorization: Bearer $QUBITDATA_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "distance_matrix",
      "arguments": {
            "points": [
                  {
                        "lat": 45.46,
                        "lon": 9.19
                  },
                  {
                        "lat": 45.47,
                        "lon": 9.18
                  },
                  {
                        "lat": 45.48,
                        "lon": 9.2
                  }
            ]
      }
    }
  }'

Example response

JSON-RPC 2.0 result
json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\n  \"n\": 3,\n  \"matrix\": [\n    [0,    1342, 2253],\n    [1342, 0,    1188],\n    [2253, 1188, 0]\n  ]\n}"
      }
    ]
  }
}

Prompts to try

Drop these into Claude Desktop, Cursor, or any MCP-aware client wired to https://mcp.qubitdata.it/mcp.

  • Claude Desktop
    Compute the distance matrix between these 5 candidate sites.
  • Cursor
    Use distance_matrix on my list of 30 stops to feed a TSP solver.
  • Custom MCP client
    Get pairwise distances for clustering this set of POIs.

Related tools

isochrone_proxy · nearest_n

Get started

Sign up for a free key to call this tool from your agent. Need a wider geo cap or higher quota? See pricing.

Last updated: