Skip to main content
Glama
BACH-AI-Tools

Flightradar24 MCP Server

get_airport_info_light

Retrieve airport details including name, ICAO, and IATA codes by providing an airport code to access aviation information from Flightradar24 data.

Instructions

Returns airport name, ICAO and IATA codes. REQUIRED: code must be provided and non-empty.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesAirport IATA or ICAO code.

Implementation Reference

  • The handler function that executes the tool logic: destructures the 'code' param, fetches airport info via FR24Client, returns formatted JSON text or error.
    async (params: z.infer<typeof airportInfoLightSchema>) => {
      const { code } = params;
      try {
        console.log(`Raw params received by handler: ${JSON.stringify(params)}`);
        const airport = await fr24Client.getAirportInfoLight(code);
        return {
          content: [{
            type: 'text' as const,
            text: `Airport information (light):\n${JSON.stringify(airport, null, 2)}`
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: 'text' as const,
            text: `Error fetching light airport info for ${code}: ${error instanceof Error ? error.message : 'Unknown error'}`
          }],
          isError: true
        };
      }
    }
  • Zod input schema defining the required 'code' parameter for the tool.
    const airportInfoLightSchema = z.object({ code: z.string().min(1).describe('Airport IATA or ICAO code.') });
  • src/server.ts:418-443 (registration)
    Registration of the tool using McpServer.tool() with name, description, schema, and handler.
    server.tool(
      'get_airport_info_light',
      'Returns airport name, ICAO and IATA codes. REQUIRED: code must be provided and non-empty.',
      airportInfoLightSchema.shape,
      async (params: z.infer<typeof airportInfoLightSchema>) => {
        const { code } = params;
        try {
          console.log(`Raw params received by handler: ${JSON.stringify(params)}`);
          const airport = await fr24Client.getAirportInfoLight(code);
          return {
            content: [{
              type: 'text' as const,
              text: `Airport information (light):\n${JSON.stringify(airport, null, 2)}`
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: 'text' as const,
              text: `Error fetching light airport info for ${code}: ${error instanceof Error ? error.message : 'Unknown error'}`
            }],
            isError: true
          };
        }
      }
    );
  • Helper method in FR24Client that makes the API request to fetch light airport information.
    async getAirportInfoLight(code: string): Promise<AirportInfoLight> {
      return this.makeRequest<AirportInfoLight>(`/static/airports/${code}/light`);
    }
  • TypeScript interface defining the structure of the AirportInfoLight output.
    export interface AirportInfoLight {
      name: string;
      iata: string;
      icao: string;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.3/5.0
Behavior3/5

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

No annotations are provided, so the description must carry the transparency burden. It discloses the output (airport name, ICAO, IATA codes) and the required non-empty code, but mostly repeats schema constraints (required, minLength). It does not mention error behavior for unknown codes, read-only status, or any side effects. 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 one concise sentence plus a direct warning, with no filler. It leads with the core output and immediately states the critical requirement. Every word earns its place.

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

Completeness3/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 covers the essential return fields and the required parameter. However, it lacks guidance on when to prefer this 'light' tool over get_airport_info_full, and does not clarify behavior for invalid or not-found codes. These gaps keep it from being fully complete.

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% (single 'code' parameter clearly described as 'Airport IATA or ICAO code'). The description adds no new meaning beyond the schema; it merely restates that the code must be non-empty, which is already captured by required and minLength. Thus, baseline 3 applies.

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

Purpose4/5

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

The description states the tool returns airport name, ICAO, and IATA codes, using the verb 'returns' with a specific resource and output items, making the purpose clear. However, it does not explicitly differentiate from the sibling get_airport_info_full, so it stops short of full sibling distinction.

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 only usage guidance is 'REQUIRED: code must be provided and non-empty,' which is a precondition for invoking the tool rather than guidance on when to select it over alternatives. No mention of when to use the 'light' version vs get_airport_info_full, and no exclusions or alternatives are provided.

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