Skip to main content
Glama
sunsetcoder

flightradar24-mcp-server

by sunsetcoder

get_flight_positions

Retrieve real-time flight positions filtered by airports, geographic bounds, aircraft categories, or result limits.

Instructions

Get real-time flight positions with various filtering options

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
airportsNoComma-separated list of airport ICAO codes
boundsNoGeographical bounds (lat1,lon1,lat2,lon2)
categoriesNoAircraft categories (P,C,J)
limitNoMaximum number of results

Implementation Reference

  • The handler for the 'get_flight_positions' tool. It extracts parameters from tool arguments, validates them via isValidFlightTrackingParams, then calls the Flightradar24 API endpoint '/api/live/flight-positions/light' and returns the response.
    case 'get_flight_positions': {
      const params: FlightTrackingParams = {
        ...toolArgs,
        limit: toolArgs?.limit ? parseInt(toolArgs.limit as string) : undefined
      };
    
      if (!isValidFlightTrackingParams(params)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid or missing query parameters. At least one valid parameter is required.'
        );
      }
    
      const response = await fr24Client.get<FlightPositionsResponse>(
        '/api/live/flight-positions/light',
        { params }
      );
    
      return {
        content: [{
          type: "text",
          text: JSON.stringify(response.data, null, 2)
        }]
      };
    }
  • src/index.ts:75-86 (registration)
    Registration of the 'get_flight_positions' tool in the ListToolsRequestSchema handler, defining its name, description, and input schema (airports, bounds, categories, limit).
      name: 'get_flight_positions',
      description: 'Get real-time flight positions with various filtering options',
      inputSchema: {
        type: 'object',
        properties: {
          airports: { type: 'string', description: 'Comma-separated list of airport ICAO codes' },
          bounds: { type: 'string', description: 'Geographical bounds (lat1,lon1,lat2,lon2)' },
          categories: { type: 'string', description: 'Aircraft categories (P,C,J)' },
          limit: { type: 'number', description: 'Maximum number of results' }
        }
      }
    },
  • FlightTrackingParams interface defining all possible input parameters for the flight positions query (bounds, flights, callsigns, airports, categories, limit, etc.).
    export interface FlightTrackingParams {
      bounds?: string;
      flights?: string;
      callsigns?: string;
      registrations?: string;
      painted_as?: string;
      operating_as?: string;
      airports?: string;
      routes?: string;
      aircraft?: string;
      altitude_ranges?: string;
      squawks?: string;
      categories?: string;
      data_sources?: string;
      airspaces?: string;
      limit?: number;
    }
  • FlightPositionsResponse interface defining the response shape containing an array of FlightPosition objects.
    export interface FlightPositionsResponse {
      data: FlightPosition[];
    }
  • isValidFlightTrackingParams validation function that checks at least one valid parameter is provided before making the API call.
    export function isValidFlightTrackingParams(params: unknown): params is FlightTrackingParams {
      if (!params || typeof params !== 'object') {
        return false;
      }
    
      const typedParams = params as Record<string, unknown>;
    
      // Check that at least one valid parameter is provided
      const validParams = [
        'bounds', 'flights', 'callsigns', 'registrations', 'painted_as',
        'operating_as', 'airports', 'routes', 'aircraft', 'altitude_ranges',
        'squawks', 'categories', 'data_sources', 'airspaces', 'limit'
      ];
    
      const hasValidParam = validParams.some(param => {
        const value = typedParams[param];
        if (param === 'limit') {
          return typeof value === 'number' && value > 0;
        }
        return typeof value === 'string' && value.length > 0;
      });
    
      return hasValidParam;
    }
Behavior2/5

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

Without annotations, the description carries the full burden. It indicates 'real-time' but does not disclose data freshness, update frequency, or any behavioral traits such as rate limits or data scope. The minimal description fails to provide necessary behavioral context beyond the obvious.

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

Conciseness2/5

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

The description is very short (one sentence) but underspecified for a tool with 4 parameters. It lacks structure and front-loads only the core purpose. The brevity sacrifices necessary detail, making it inadequate for effective tool use.

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

Completeness2/5

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

Given the tool's 4 optional parameters and lack of output schema, the description is incomplete. It does not explain filtering behavior, default values, output format, or how parameters interact. This leaves significant gaps for an agent to invoke the tool correctly.

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 baseline is 3. The description adds no additional meaning beyond the schema; it merely mentions 'filtering options' without elaborating on parameter usage or constraints. No improvement over the schema alone.

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 tool's purpose: 'Get real-time flight positions'. The addition of 'with various filtering options' hints at functionality but does not explicitly differentiate from the sibling tool 'get_flight_eta', which is about ETA. The distinction is implicit but not stated.

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?

No guidance is provided on when to use this tool versus alternatives. The phrase 'various filtering options' is vague and does not specify contexts, prerequisites, or exclusions. The sibling 'get_flight_eta' is not mentioned, missing an opportunity to clarify usage scenarios.

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/sunsetcoder/flightradar24-mcp-server'

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