Skip to main content
Glama
Cyreslab-AI

FlightRadar MCP Server

get_flight_status

Check real-time flight status using IATA or ICAO flight codes to track current location and operational details.

Instructions

Get the current status of a flight by flight number

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flight_iataNoIATA flight code (e.g., 'BA123')
flight_icaoNoICAO flight code (e.g., 'BAW123')

Implementation Reference

  • The main handler function for the get_flight_status tool. It queries the AviationStack API with the provided flight number (IATA or ICAO), formats a human-readable status summary including departure/arrival details, delays, and live tracking data if available.
    private async handleGetFlightStatus(args: any) {
      const params: Record<string, any> = {};
    
      if (args.flight_iata) {
        params.flight_iata = args.flight_iata;
      } else if (args.flight_icao) {
        params.flight_icao = args.flight_icao;
      } else {
        throw new McpError(
          ErrorCode.InvalidParams,
          "Either flight_iata or flight_icao must be provided"
        );
      }
    
      const response = await this.axiosInstance.get("/flights", { params });
    
      if (!response.data.data || response.data.data.length === 0) {
        return {
          content: [
            {
              type: "text",
              text: "No flight status found for the specified flight number.",
            },
          ],
        };
      }
    
      const flight = response.data.data[0];
    
      // Create a human-readable status summary
      let statusSummary = `Flight ${flight.flight.iata} (${flight.airline.name}) is currently ${flight.flight_status}.`;
    
      // Add departure information
      if (flight.departure) {
        statusSummary += `\n\nDeparture: ${flight.departure.airport} (${flight.departure.iata})`;
    
        if (flight.departure.terminal) {
          statusSummary += `, Terminal ${flight.departure.terminal}`;
        }
    
        if (flight.departure.gate) {
          statusSummary += `, Gate ${flight.departure.gate}`;
        }
    
        if (flight.departure.scheduled) {
          statusSummary += `\nScheduled: ${new Date(flight.departure.scheduled).toLocaleString()}`;
        }
    
        if (flight.departure.estimated) {
          statusSummary += `\nEstimated: ${new Date(flight.departure.estimated).toLocaleString()}`;
        }
    
        if (flight.departure.actual) {
          statusSummary += `\nActual: ${new Date(flight.departure.actual).toLocaleString()}`;
        }
    
        if (flight.departure.delay) {
          statusSummary += `\nDelay: ${flight.departure.delay} minutes`;
        }
      }
    
      // Add arrival information
      if (flight.arrival) {
        statusSummary += `\n\nArrival: ${flight.arrival.airport} (${flight.arrival.iata})`;
    
        if (flight.arrival.terminal) {
          statusSummary += `, Terminal ${flight.arrival.terminal}`;
        }
    
        if (flight.arrival.gate) {
          statusSummary += `, Gate ${flight.arrival.gate}`;
        }
    
        if (flight.arrival.scheduled) {
          statusSummary += `\nScheduled: ${new Date(flight.arrival.scheduled).toLocaleString()}`;
        }
    
        if (flight.arrival.estimated) {
          statusSummary += `\nEstimated: ${new Date(flight.arrival.estimated).toLocaleString()}`;
        }
    
        if (flight.arrival.actual) {
          statusSummary += `\nActual: ${new Date(flight.arrival.actual).toLocaleString()}`;
        }
    
        if (flight.arrival.delay) {
          statusSummary += `\nDelay: ${flight.arrival.delay} minutes`;
        }
      }
    
      // Add live tracking data if available
      if (flight.live) {
        statusSummary += `\n\nLive Tracking:`;
        statusSummary += `\nAltitude: ${flight.live.altitude} feet`;
        statusSummary += `\nSpeed: ${flight.live.speed_horizontal} knots`;
        statusSummary += `\nHeading: ${flight.live.heading} degrees`;
        statusSummary += `\nLatitude: ${flight.live.latitude}`;
        statusSummary += `\nLongitude: ${flight.live.longitude}`;
      }
    
      return {
        content: [
          {
            type: "text",
            text: statusSummary,
          },
        ],
      };
    }
  • Input schema for the get_flight_status tool, requiring either flight_iata or flight_icao.
    inputSchema: {
      type: "object",
      properties: {
        flight_iata: {
          type: "string",
          description: "IATA flight code (e.g., 'BA123')",
        },
        flight_icao: {
          type: "string",
          description: "ICAO flight code (e.g., 'BAW123')",
        },
      },
      oneOf: [
        { required: ["flight_iata"] },
        { required: ["flight_icao"] },
      ],
    },
  • src/index.ts:136-156 (registration)
    Registration of the get_flight_status tool in the ListTools response, including name, description, and input schema.
    {
      name: "get_flight_status",
      description: "Get the current status of a flight by flight number",
      inputSchema: {
        type: "object",
        properties: {
          flight_iata: {
            type: "string",
            description: "IATA flight code (e.g., 'BA123')",
          },
          flight_icao: {
            type: "string",
            description: "ICAO flight code (e.g., 'BAW123')",
          },
        },
        oneOf: [
          { required: ["flight_iata"] },
          { required: ["flight_icao"] },
        ],
      },
    },
  • src/index.ts:181-182 (registration)
    Dispatcher case in CallToolRequestSchema handler that routes get_flight_status calls to the handler function.
    case "get_flight_status":
      return await this.handleGetFlightStatus(request.params.arguments);
Behavior2/5

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

With no annotations, the description carries full burden but only states the basic action without disclosing behavioral traits like data freshness (e.g., real-time vs. cached), error handling (e.g., invalid flight codes), or rate limits. It's minimal and lacks critical operational context.

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, efficient sentence with zero waste, clearly front-loading the core purpose. It's appropriately sized for a simple lookup tool.

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?

Given the tool's low complexity (simple query with two parameters) and full schema coverage, the description is adequate but incomplete due to missing output details (no output schema) and insufficient behavioral context for a tool with no annotations.

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 schema fully documents the two parameters (flight_iata, flight_icao) and their oneOf logic. The description adds no additional meaning beyond implying flight number usage, meeting the baseline for high schema coverage.

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 clearly states the verb ('Get') and resource ('current status of a flight'), making the purpose specific and actionable. It distinguishes from 'get_flight_data' and 'search_flights' by focusing on status retrieval, though it doesn't explicitly differentiate them in the text.

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 no guidance on when to use this tool versus its siblings ('get_flight_data', 'search_flights'), such as for real-time status vs. historical data or search queries. It also lacks prerequisites like flight number availability.

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

Install Server

Other Tools

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/Cyreslab-AI/flightradar-mcp-server'

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