Skip to main content
Glama
BACH-AI-Tools

Flightradar24 MCP Server

get_airline_info

Retrieve airline details including name, ICAO, and IATA codes by providing a valid ICAO code. This tool helps identify airlines from their codes within flight tracking systems.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
icaoYesAirline ICAO code.

Implementation Reference

  • The MCP tool handler function for 'get_airline_info'. It extracts the ICAO code from input parameters, fetches the airline information using FR24Client, formats the response as text content, and handles errors appropriately.
    async (params: z.infer<typeof airlineInfoSchema>) => {
      const { icao } = params;
      try {
        console.log(`Raw params received by handler: ${JSON.stringify(params)}`);
        const airline = await fr24Client.getAirlineInfo(icao);
        return {
          content: [{
            type: 'text' as const,
            text: `Airline information (light):\n${JSON.stringify(airline, null, 2)}`
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: 'text' as const,
            text: `Error fetching airline info for ${icao}: ${error instanceof Error ? error.message : 'Unknown error'}`
          }],
          isError: true
        };
      }
    }
  • src/server.ts:391-416 (registration)
    Registration of the 'get_airline_info' tool on the McpServer instance, specifying name, description, input schema, and handler function.
    server.tool(
      'get_airline_info',
      'Returns airline name, ICAO and IATA codes. REQUIRED: icao code must be provided and non-empty.',
      airlineInfoSchema.shape,
      async (params: z.infer<typeof airlineInfoSchema>) => {
        const { icao } = params;
        try {
          console.log(`Raw params received by handler: ${JSON.stringify(params)}`);
          const airline = await fr24Client.getAirlineInfo(icao);
          return {
            content: [{
              type: 'text' as const,
              text: `Airline information (light):\n${JSON.stringify(airline, null, 2)}`
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: 'text' as const,
              text: `Error fetching airline info for ${icao}: ${error instanceof Error ? error.message : 'Unknown error'}`
            }],
            isError: true
          };
        }
      }
    );
  • Zod schema defining the input parameters for the 'get_airline_info' tool: a required 'icao' string.
    const airlineInfoSchema = z.object({ icao: z.string().min(1).describe('Airline ICAO code.') });
  • Helper method in FR24Client class that makes the API request to retrieve airline information from the Flightradar24 API endpoint.
    async getAirlineInfo(icao: string): Promise<AirlineInfo> {
      return this.makeRequest<AirlineInfo>(`/static/airlines/${icao}/light`);
    }
  • TypeScript interface defining the structure of the AirlineInfo response object used by the tool.
    export interface AirlineInfo {
      icao: string;
      iata: string;
      name: string;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It says 'Returns' which implies a read operation, but doesn't disclose behavior like error handling, output format, or whether any dependencies exist. For a simple lookup tool 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 two short sentences, front-loaded with the primary purpose and then the key constraint. Every word earns its place with no redundancy or 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 single-parameter lookup tool, the description adequately states the return fields and the required input. It lacks details about error responses or edge cases, but the tool's simplicity does not demand much more. The absence of an output schema means the description usefully lists the returned fields.

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?

The input schema already covers the single parameter 'icao' with 100% coverage, including minLength and required. The description's emphasis on 'must be provided and non-empty' adds no new semantic information beyond what the schema declares, so the baseline score of 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 what the tool does: 'Returns airline name, ICAO and IATA codes.' It uses a specific verb ('Returns') and names the exact resource and output fields. The sibling tools are all flight- or airport-focused, so this airline-specific tool is clearly differentiated.

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

Usage Guidelines3/5

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

The description does not explicitly state when to use this tool over alternatives or mention any exclusions. It provides the hard requirement that ICAO code must be non-empty, which guides usage, but there is no comparison to sibling tools or guidance on when choosing airline info is appropriate.

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