Skip to main content
Glama
BACH-AI-Tools

Flightradar24 MCP Server

get_flight_tracks

Retrieve positional track data for a specific flight using its Flightradar24 ID to monitor its route and location history.

Instructions

Returns positional tracks of a specific flight. REQUIRED: flight_id must be provided and non-empty.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flight_idYesFlightradar24 ID of the flight (hexadecimal).

Implementation Reference

  • The MCP tool handler function for 'get_flight_tracks'. It receives parameters, calls FR24Client.getFlightTracks, formats the response with flight ID and JSON stringified tracks, or returns an error message.
    flightTracksSchema.shape,
    async (params: z.infer<typeof flightTracksSchema>) => {
      try {
        console.log(`Raw params received by handler: ${JSON.stringify(params)}`);
        const result = await fr24Client.getFlightTracks(params);
        const flightId = Array.isArray(result) && result.length > 0 ? result[0].fr24_id : 'unknown';
        return {
          content: [{
            type: 'text' as const,
            text: `Found track points for flight ${flightId}:\n${JSON.stringify(result, null, 2)}`
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: 'text' as const,
            text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`
          }],
          isError: true
        };
      }
    }
  • Zod input schema for the 'get_flight_tracks' tool, validating a required 'flight_id' string parameter.
    const flightTracksSchema = z.object({
      flight_id: z.string().min(1).describe('Flightradar24 ID of the flight (hexadecimal).')
    });
  • src/server.ts:364-389 (registration)
    Registration of the 'get_flight_tracks' tool via server.tool(), including name, description, input schema reference, and inline handler function.
    server.tool(
      'get_flight_tracks',
      'Returns positional tracks of a specific flight. REQUIRED: flight_id must be provided and non-empty.',
      flightTracksSchema.shape,
      async (params: z.infer<typeof flightTracksSchema>) => {
        try {
          console.log(`Raw params received by handler: ${JSON.stringify(params)}`);
          const result = await fr24Client.getFlightTracks(params);
          const flightId = Array.isArray(result) && result.length > 0 ? result[0].fr24_id : 'unknown';
          return {
            content: [{
              type: 'text' as const,
              text: `Found track points for flight ${flightId}:\n${JSON.stringify(result, null, 2)}`
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: 'text' as const,
              text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`
            }],
            isError: true
          };
        }
      }
    );
  • Supporting method in FR24Client class that handles the API call to fetch flight tracks data from '/flight-tracks' endpoint.
    async getFlightTracks(params: FlightTracksQueryParams): Promise<FlightTracksResponse[]> {
      return this.makeRequest<FlightTracksResponse[]>('/flight-tracks', params);
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior2/5

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

With no annotations, the description carries full burden for behavioral disclosure. It only states the return type and re-emphasizes the required parameter, both already inferable from the name and schema. No info on error handling, rate limits, or output structure.

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?

Two sentences, front-loaded with the core purpose. The second sentence is slightly redundant but concise and does not harm clarity.

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?

The tool is simple with one parameter, but without an output schema or annotations, the description should explain what 'tracks' includes (e.g., lat/lon, timestamps). The current description is minimally viable but leaves a gap in expected return content.

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 coverage is 100%, with flight_id described as a hexadecimal Flightradar24 ID. The description adds no new semantic meaning, only the non-empty reminder which duplicates schema's required and minLength constraints.

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?

Description uses specific verb 'Returns' and resource 'positional tracks of a specific flight', clearly distinguishing it from sibling tools like get_flight_summary_* and get_historic_flight_events_*. The REQUIRED note reinforces the specific-flight scope.

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?

Provides context that flight_id is mandatory, but this is a parameter constraint, not guidance on when to choose this tool over alternatives. No exclusions or alternatives are mentioned, so usage is 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.