calculate_distance

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

Calculate straight-line distance between two airports by IATA code (e.g., “JFK” to “LHR”). Returns kilometers and miles.

Parameters

NameTypeRequiredDescription
fromstringyesIATA code of the origin airport (e.g. “JFK”)
tostringyesIATA code of the destination airport (e.g. “LHR”)

Example call

Arguments

{
  "from": "JFK",
  "to": "LHR"
}

curl

curl -X POST https://gateway.pipeworx.io/airports/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"calculate_distance","arguments":{"from":"JFK","to":"LHR"}}}'

TypeScript (@pipeworx/sdk)

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

const result = await pipeworx.call('calculate_distance', {
  "from": "JFK",
  "to": "LHR"
});

More examples

{
  "from": "LAX",
  "to": "NRT"
}

Response shape

Always returns: from, to, distance_km, distance_miles

FieldTypeDescription
fromobjectOrigin airport details
toobjectDestination airport details
distance_kmnumberDistance in kilometers
distance_milesnumberDistance in miles
Full JSON Schema
{
  "type": "object",
  "properties": {
    "from": {
      "type": "object",
      "description": "Origin airport details",
      "properties": {
        "name": {
          "type": "string",
          "description": "Airport name"
        },
        "city": {
          "type": "string",
          "description": "City where airport is located"
        },
        "country": {
          "type": "string",
          "description": "Country where airport is located"
        },
        "iata": {
          "type": "string",
          "description": "Three-letter IATA code"
        },
        "icao": {
          "type": "string",
          "description": "Four-letter ICAO code"
        },
        "latitude": {
          "type": "number",
          "description": "Latitude coordinate"
        },
        "longitude": {
          "type": "number",
          "description": "Longitude coordinate"
        },
        "altitude_ft": {
          "type": "number",
          "description": "Altitude in feet"
        },
        "timezone": {
          "type": "string",
          "description": "Airport timezone"
        }
      }
    },
    "to": {
      "type": "object",
      "description": "Destination airport details",
      "properties": {
        "name": {
          "type": "string",
          "description": "Airport name"
        },
        "city": {
          "type": "string",
          "description": "City where airport is located"
        },
        "country": {
          "type": "string",
          "description": "Country where airport is located"
        },
        "iata": {
          "type": "string",
          "description": "Three-letter IATA code"
        },
        "icao": {
          "type": "string",
          "description": "Four-letter ICAO code"
        },
        "latitude": {
          "type": "number",
          "description": "Latitude coordinate"
        },
        "longitude": {
          "type": "number",
          "description": "Longitude coordinate"
        },
        "altitude_ft": {
          "type": "number",
          "description": "Altitude in feet"
        },
        "timezone": {
          "type": "string",
          "description": "Airport timezone"
        }
      }
    },
    "distance_km": {
      "type": "number",
      "description": "Distance in kilometers"
    },
    "distance_miles": {
      "type": "number",
      "description": "Distance in miles"
    }
  },
  "required": [
    "from",
    "to",
    "distance_km",
    "distance_miles"
  ]
}

Connect

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

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

See Getting Started for client-specific install steps.

Regenerated from source · build May 9, 2026