Skip to main content
Glama
BACH-AI-Tools

Flightradar24 MCP Server

get_flight_summary_count

Count flights matching specific criteria within a defined time range using Flightradar24 data. Specify date/time parameters plus additional search filters like flight numbers, airports, or aircraft types.

Instructions

Returns the number of flights for a given flight summary query. IMPORTANT: flight_datetime_from and flight_datetime_to are required, and at least one additional search parameter should be provided.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flight_datetime_fromYesStart datetime (YYYY-MM-DDTHH:MM:SSZ). Requires flight_datetime_to. Cannot be used with flight_ids.
flight_datetime_toYesEnd datetime (YYYY-MM-DDTHH:MM:SSZ). Requires flight_datetime_from. Cannot be used with flight_ids.
flightsNoFlight numbers (comma-separated values, max 15).
callsignsNoFlight callsigns (comma-separated values, max 15).
registrationsNoAircraft registration numbers (comma-separated values, max 15).
painted_asNoAircraft painted in an airline's livery (ICAO code, comma-separated, max 15).
operating_asNoAircraft operating under an airline's call sign (ICAO code, comma-separated, max 15).
airportsNoAirports (IATA/ICAO/ISO 3166-1 alpha-2) or countries. Use format: [direction:]<code>.
routesNoFlights between airports/countries (e.g., SE-US, ESSA-JFK). Max 15.
aircraftNoAircraft ICAO type codes (comma-separated, max 15).

Implementation Reference

  • The main handler function for the 'get_flight_summary_count' tool. Validates input parameters, cleans them, calls the FR24 client method, logs the result, and returns the flight summary count in a formatted text response or an error.
    async (params: z.infer<typeof flightSummaryCountToolParamsSchema>) => {
      try {
        validateHasRequiredParams(params, ['flight_datetime_from', 'flight_datetime_to']);
        const cleaned = cleanParams(params);
        const result = await fr24Client.getFlightSummaryCount(cleaned);
        console.log(`Flight summary count result: ${JSON.stringify(result, null, 2)}`);
        return {
          content: [{
            type: 'text' as const,
            text: `Flight summary count: ${result.record_count}`
          }]
        };
      } catch (error) {
        return {
          content: [{ 
            type: 'text' as const,
            text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`
          }],
          isError: true
        };
      }
    }
  • Zod schema defining the input parameters for the get_flight_summary_count tool, including required date range and optional filters.
    const flightSummaryCountToolParamsSchema = z.object({
      flight_datetime_from: z.string().min(1).describe('Start datetime (YYYY-MM-DDTHH:MM:SSZ). Requires flight_datetime_to. Cannot be used with flight_ids.'),
      flight_datetime_to: z.string().min(1).describe('End datetime (YYYY-MM-DDTHH:MM:SSZ). Requires flight_datetime_from. Cannot be used with flight_ids.'),
      flights: z.string().min(1).optional().describe('Flight numbers (comma-separated values, max 15).'),
      callsigns: z.string().min(1).optional().describe('Flight callsigns (comma-separated values, max 15).'),
      registrations: z.string().min(1).optional().describe('Aircraft registration numbers (comma-separated values, max 15).'),
      painted_as: z.string().min(1).optional().describe("Aircraft painted in an airline's livery (ICAO code, comma-separated, max 15)."),
      operating_as: z.string().min(1).optional().describe("Aircraft operating under an airline's call sign (ICAO code, comma-separated, max 15)."),
      airports: z.string().min(1).optional().describe('Airports (IATA/ICAO/ISO 3166-1 alpha-2) or countries. Use format: [direction:]<code>.'),
      routes: z.string().min(1).optional().describe('Flights between airports/countries (e.g., SE-US, ESSA-JFK). Max 15.'),
      aircraft: z.string().min(1).optional().describe('Aircraft ICAO type codes (comma-separated, max 15).')
    });
  • src/server.ts:336-362 (registration)
    MCP server.tool registration for 'get_flight_summary_count', including name, description, schema reference, and inline handler function.
    server.tool(
      'get_flight_summary_count',
      'Returns the number of flights for a given flight summary query. IMPORTANT: flight_datetime_from and flight_datetime_to are required, and at least one additional search parameter should be provided.',
      flightSummaryCountToolParamsSchema.shape,
      async (params: z.infer<typeof flightSummaryCountToolParamsSchema>) => {
        try {
          validateHasRequiredParams(params, ['flight_datetime_from', 'flight_datetime_to']);
          const cleaned = cleanParams(params);
          const result = await fr24Client.getFlightSummaryCount(cleaned);
          console.log(`Flight summary count result: ${JSON.stringify(result, null, 2)}`);
          return {
            content: [{
              type: 'text' as const,
              text: `Flight summary count: ${result.record_count}`
            }]
          };
        } catch (error) {
          return {
            content: [{ 
              type: 'text' as const,
              text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`
            }],
            isError: true
          };
        }
      }
    );
  • FR24Client helper method that performs the actual API request to retrieve the flight summary count.
    async getFlightSummaryCount(params: Record<string, any>): Promise<RecordCountResponse> {
      return this.makeRequest<RecordCountResponse>('/flight-summary/count', params);
    }
Behavior2/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 of behavioral disclosure. It mentions that certain parameters are 'required' and provides a constraint ('at least one additional search parameter'), which adds some behavioral context. However, it doesn't describe other important traits like whether this is a read-only operation (implied by 'returns'), potential rate limits, authentication needs, error handling, or the format of the returned count (e.g., integer, JSON structure). For a tool with no annotations, this is a significant gap in transparency.

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

Conciseness4/5

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

The description is concise and front-loaded, with the core purpose stated first ('Returns the number of flights for a given flight summary query.') followed by an important usage note. It consists of two sentences that earn their place by clarifying requirements, with no redundant or vague language. However, it could be slightly improved by integrating the purpose and constraints more seamlessly.

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 complexity (10 parameters, no output schema, no annotations), the description is moderately complete. It covers the purpose and basic usage constraints, but lacks details on behavioral aspects (e.g., safety, performance) and output format. Since there's no output schema, the description should ideally hint at what 'number of flights' means (e.g., a simple integer count or structured response), but it doesn't, leaving gaps for an agent to infer.

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 schema description coverage is 100%, meaning all parameters are well-documented in the input schema itself (e.g., formats like 'YYYY-MM-DDTHH:MM:SSZ', constraints like 'max 15'). The description adds minimal value beyond the schema by emphasizing that the datetime parameters are required and that at least one additional parameter is needed, but it doesn't provide new semantic details about the parameters. Given the high schema coverage, 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.

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: 'Returns the number of flights for a given flight summary query.' It specifies the verb ('returns'), resource ('number of flights'), and scope ('flight summary query'). However, it doesn't explicitly differentiate from sibling tools like 'get_historic_flights_count' or 'get_live_flights_count', which also return flight counts but for different contexts.

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 provides some usage guidance by stating that 'flight_datetime_from and flight_datetime_to are required, and at least one additional search parameter should be provided.' This implies when to use it (for flight summary queries with datetime constraints). However, it doesn't explicitly mention when to use this tool versus alternatives like 'get_flight_summary_full' (which likely returns detailed data) or other count tools for historic/live flights, leaving the context somewhat implied rather than explicit.

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/BACH-AI-Tools/fr24api-mcp'

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