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
| Name | Type | Required | Description |
|---|---|---|---|
from | string | yes | IATA code of the origin airport (e.g. “JFK”) |
to | string | yes | IATA 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
| Field | Type | Description |
|---|---|---|
from | object | Origin airport details |
to | object | Destination airport details |
distance_km | number | Distance in kilometers |
distance_miles | number | Distance 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.