centroid

Pack: coordinates · 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/centroid for the schema, then POST the same URL with its arguments for the data.

Average (spherical) center of a list of lat/lon points. points is an array of {lat, lon}.

Parameters

NameTypeRequiredDescription
pointsarrayyesArray of {lat, lon} objects.

Example call

Arguments

{
  "points": [
    {
      "lat": 40.7128,
      "lon": -74.006
    },
    {
      "lat": 34.0522,
      "lon": -118.2437
    },
    {
      "lat": 41.8781,
      "lon": -87.6298
    }
  ]
}

curl

curl -X POST https://gateway.pipeworx.io/coordinates/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"centroid","arguments":{"points":[{"lat":40.7128,"lon":-74.006},{"lat":34.0522,"lon":-118.2437},{"lat":41.8781,"lon":-87.6298}]}}}'

TypeScript (@pipeworx/sdk)

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

const result = await pipeworx.call('centroid', {
  "points": [
    {
      "lat": 40.7128,
      "lon": -74.006
    },
    {
      "lat": 34.0522,
      "lon": -118.2437
    },
    {
      "lat": 41.8781,
      "lon": -87.6298
    }
  ]
});

More examples

{
  "points": [
    {
      "lat": 51.5074,
      "lon": -0.1278
    },
    {
      "lat": 48.8566,
      "lon": 2.3522
    }
  ]
}

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 coordinates pack
{
  "mcpServers": {
    "coordinates": {
      "url": "https://gateway.pipeworx.io/coordinates/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build September 30, 2026