distance

Pack: geodistance · Connect: https://pipeworx.io/mcp (see Connect below for a single-pack URL)

No MCP client? Call it directly: GET https://gateway.pipeworx.io/v1/tools/distance for the schema, then POST the same URL with its arguments for the data.

Great-circle (haversine) distance between two lat/lon points. Returns the distance in km, miles, nautical miles, meters & feet, plus the initial compass bearing from point 1 to point 2.

Parameters

NameTypeRequiredDescription
lat1numberyesLatitude of point 1 (decimal degrees).
lon1numberyesLongitude of point 1.
lat2numberyesLatitude of point 2.
lon2numberyesLongitude of point 2.

Example call

Arguments

{
  "lat1": 40.7128,
  "lon1": -74.006,
  "lat2": 51.5074,
  "lon2": -0.1278
}

curl

curl -X POST https://gateway.pipeworx.io/geodistance/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"distance","arguments":{"lat1":40.7128,"lon1":-74.006,"lat2":51.5074,"lon2":-0.1278}}}'

TypeScript (@pipeworx/sdk)

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

const result = await pipeworx.call('distance', {
  "lat1": 40.7128,
  "lon1": -74.006,
  "lat2": 51.5074,
  "lon2": -0.1278
});

More examples

{
  "lat1": 34.0522,
  "lon1": -118.2437,
  "lat2": 37.7749,
  "lon2": -122.4194
}

Connect

Add this to your MCP client config — every tool in the catalog, including this one — or use one-click install buttons:

{
  "mcpServers": {
    "pipeworx": {
      "url": "https://pipeworx.io/mcp"
    }
  }
}
Connect to just the geodistance pack
{
  "mcpServers": {
    "geodistance": {
      "url": "https://gateway.pipeworx.io/geodistance/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build September 29, 2026