amadeus.airports.nearest
Find the nearest airports to any geographic location by providing latitude and longitude coordinates. Search within a specified radius to identify nearby airport options for travel planning.
Instructions
Find nearest airports by geographic coordinates (Amadeus)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| latitude | Yes | Latitude in decimal degrees (-90 to 90) | |
| longitude | Yes | Longitude in decimal degrees (-180 to 180) | |
| radius | No | Search radius in km (1-500) |
Implementation Reference
- src/adapters/amadeus/index.ts:235-252 (handler)The core handler that builds the API request for 'amadeus.airport_nearest'. Constructs a GET request to Amadeus API endpoint /v1/reference-data/locations/airports with latitude, longitude, and optional radius parameters.
private buildAirportNearestRequest(params: Record<string, unknown>): { url: string; method: string; headers: Record<string, string>; } { const qs = new URLSearchParams({ latitude: String(params.latitude), longitude: String(params.longitude), }); if (params.radius) qs.set('radius', String(params.radius)); return { url: `${this.baseUrl}/v1/reference-data/locations/airports?${qs.toString()}`, method: 'GET', headers: { 'Authorization': `Bearer ${this.currentToken}` }, }; } - src/adapters/amadeus/index.ts:120-126 (handler)Response parser for 'amadeus.airport_nearest' tool. Validates and casts the raw API response to AmadeusNearestAirportResponse type, throwing an error if data is missing.
case 'amadeus.airport_nearest': { const data = body as AmadeusNearestAirportResponse; if (!data.data) { throw new Error('Missing data in Amadeus airport nearest response'); } return data; } - src/schemas/amadeus.schema.ts:42-48 (schema)Zod schema for 'amadeus.airport_nearest' input validation. Defines required latitude (-90 to 90), longitude (-180 to 180), and optional radius (1-500 km, default 500) parameters.
const amadeusAirportNearest = z .object({ latitude: z.number().min(-90).max(90).describe('Latitude in decimal degrees (-90 to 90)'), longitude: z.number().min(-180).max(180).describe('Longitude in decimal degrees (-180 to 180)'), radius: z.number().int().min(1).max(500).optional().default(500).describe('Search radius in km (1-500)'), }) .strip(); - src/mcp/tool-adapter.ts:304-310 (registration)Tool registration mapping internal toolId 'amadeus.airport_nearest' to MCP name 'amadeus.airports.nearest' with title and description for MCP clients.
{ toolId: 'amadeus.airport_nearest', mcpName: 'amadeus.airports.nearest', title: 'Find Nearest Airports', description: 'Find nearest airports by geographic coordinates (Amadeus)', annotations: READ_ONLY, }, - TypeScript type definitions for the nearest airport response. AmadeusNearestAirport extends AmadeusLocation with distance and relevance fields.
export interface AmadeusNearestAirport extends AmadeusLocation { distance: { value: number; unit: string }; relevance: number; } export type AmadeusNearestAirportResponse = AmadeusResponse<AmadeusNearestAirport>;