Skip to main content
Glama
BACH-AI-Tools

Flightradar24 MCP Server

get_airport_info_full

Retrieve comprehensive airport details including full name, codes, location, elevation, country, city, state, and timezone information using IATA or ICAO airport codes.

Instructions

Returns detailed airport information: full name, ICAO and IATA codes, localization, elevation, country, city, state, timezone details. REQUIRED: code must be provided and non-empty.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesAirport IATA or ICAO code.

Implementation Reference

  • Primary MCP tool handler and registration for 'get_airport_info_full'. Extracts airport code from params, fetches data via FR24Client, formats and returns as text content, handles errors.
    server.tool(
      'get_airport_info_full',
      'Returns detailed airport information: full name, ICAO and IATA codes, localization, elevation, country, city, state, timezone details. REQUIRED: code must be provided and non-empty.',
      airportInfoFullSchema.shape,
      async (params: z.infer<typeof airportInfoFullSchema>) => {
        const { code } = params;
        try {
          console.log(`Raw params received by handler: ${JSON.stringify(params)}`);
          const airport = await fr24Client.getAirportInfoFull(code);
          return {
            content: [{
              type: 'text' as const,
              text: `Airport information (full):\n${JSON.stringify(airport, null, 2)}`
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: 'text' as const,
              text: `Error fetching full airport info for ${code}: ${error instanceof Error ? error.message : 'Unknown error'}`
            }],
            isError: true
          };
        }
      }
    );
  • FR24Client method implementing the core API call for full airport information.
    async getAirportInfoFull(code: string): Promise<AirportFullInfo> {
      return this.makeRequest<AirportFullInfo>(`/static/airports/${ code}/full`);
    }
  • Zod input schema validation for the tool parameters.
    const airportInfoFullSchema = z.object({ code: z.string().min(1).describe('Airport IATA or ICAO code.') });
  • TypeScript interface defining the structure of full airport information returned by the API.
    export interface AirportFullInfo {
      name: string;
      iata: string;
      icao: string;
      lon: number;
      lat: number;
      elevation: number;
      country: CountryInfo;
      city: string;
      state: string | null;
      timezone: TimezoneInfo;
    }
  • Generic HTTP request helper method used by getAirportInfoFull to make authenticated API calls to Flightradar24.
    private async makeRequest<T>(endpoint: string, params?: Record<string, any>): Promise<T> {
      try {
        console.log(`Making request to ${endpoint} with params: ${JSON.stringify(params)}`);
        const response = await axios.get(`${this.baseUrl}${endpoint}`, {
          params: params,
          headers: {
            'Accept': 'application/json',
            'Accept-Version': 'v1',
            'Authorization': `Bearer ${this.apiKey}`
          }
        });
        // Handle responses nested under 'data' key, except for count endpoints and single objects
        if (response.data && response.data.data && Array.isArray(response.data.data)) {
          return response.data.data as T;
        }
        // Handle count responses
        if (response.data && typeof response.data.record_count === 'number') {
          return response.data as T;
        }
        // Handle single object responses (like flight tracks, airport info, airline info)
        if (response.data && typeof response.data === 'object' && !Array.isArray(response.data)) {
            return response.data as T;
        }
        // Fallback for unexpected structure
        return response.data as T;
      } catch (error) {
        const message = error instanceof AxiosError ? error.message : 'Unknown error';
        console.error(`API Request Failed: ${endpoint}`, error);
        throw new Error(`Failed request to ${endpoint}: ${message}`);
      }
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses the requirement for a non-empty code and lists the returned fields, implying a read-only operation. However, it does not explicitly state that no data is modified, nor does it describe error handling or response format. For a simple getter, this is adequate but not rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, information-dense sentence followed by a clear requirement. It is front-loaded with the key purpose and avoids any unnecessary filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one parameter and no output schema, the description sufficiently covers the purpose, input requirement, and output fields. It does not explicitly contrast with 'get_airport_info_light' but is otherwise complete for invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the parameter 'code' is already described as 'Airport IATA or ICAO code.' The description repeats the requirement but adds no extra meaning beyond the schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns detailed airport information with specific attributes (full name, ICAO/IATA codes, localization, etc.), using a specific verb and resource. The name 'get_airport_info_full' and the word 'detailed' distinguish it from the sibling 'get_airport_info_light'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a required input condition ('REQUIRED: code must be provided and non-empty') but gives no guidance on when to use this tool versus alternatives like 'get_airport_info_light'. It does not mention any exclusions or comparison among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.