Skip to main content
Glama

amadeus.airports.routes

Find all direct flight destinations from any airport using its IATA code. This tool retrieves available routes for travel planning and connectivity analysis.

Instructions

Get all direct flight destinations from an airport (Amadeus)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
airport_codeYesAirport IATA code (e.g. JFK, LAX)

Implementation Reference

  • Handler that builds the HTTP request for Amadeus airport routes API. Takes airport_code parameter and constructs GET request to /v1/airport/direct-destinations endpoint with OAuth2 Bearer token authentication.
    private buildAirportRoutesRequest(params: Record<string, unknown>): {
      url: string;
      method: string;
      headers: Record<string, string>;
    } {
      const qs = new URLSearchParams({
        departureAirportCode: params.airport_code as string,
      });
    
      return {
        url: `${this.baseUrl}/v1/airport/direct-destinations?${qs.toString()}`,
        method: 'GET',
        headers: { 'Authorization': `Bearer ${this.currentToken}` },
      };
    }
  • Input validation schema for airport routes tool. Validates that airport_code is exactly 3 characters (IATA code format).
    const amadeusAirportRoutes = z
      .object({
        airport_code: z.string().length(3).describe('Airport IATA code (e.g. JFK, LAX)'),
      })
      .strip();
  • Tool registration mapping internal toolId 'amadeus.airport_routes' to MCP name 'amadeus.airports.routes'. Marks tool as read-only operation.
    {
      toolId: 'amadeus.airport_routes',
      mcpName: 'amadeus.airports.routes',
      title: 'Get Airport Routes',
      description: 'Get all direct flight destinations from an airport (Amadeus)',
      annotations: READ_ONLY,
    },
  • Response parser for airport routes. Validates the API response contains expected data field and returns typed AmadeusDirectDestinationResponse.
    case 'amadeus.airport_routes': {
      const data = body as AmadeusDirectDestinationResponse;
      if (!data.data) {
        throw new Error('Missing data in Amadeus airport routes response');
      }
      return data;
    }
  • Type definitions for airport routes response. AmadeusDirectDestination describes a destination airport with IATA code, name, and metadata.
    export interface AmadeusDirectDestination {
      type: string;
      id: string;
      subType: string;
      name: string;
      iataCode: string;
    }
    
    export type AmadeusDirectDestinationResponse = AmadeusResponse<AmadeusDirectDestination>;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/whiteknightonhorse/APIbase'

If you have feedback or need assistance with the MCP directory API, please join our Discord server