Skip to main content
Glama

get_airport_info_light

Retrieve airport details including name, ICAO, and IATA codes by providing an airport code to access aviation information from Flightradar24 data.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesAirport IATA or ICAO code.

Implementation Reference

  • The handler function that executes the tool logic: destructures the 'code' param, fetches airport info via FR24Client, returns formatted JSON text or error.
    async (params: z.infer<typeof airportInfoLightSchema>) => { const { code } = params; try { console.log(`Raw params received by handler: ${JSON.stringify(params)}`); const airport = await fr24Client.getAirportInfoLight(code); return { content: [{ type: 'text' as const, text: `Airport information (light):\n${JSON.stringify(airport, null, 2)}` }] }; } catch (error) { return { content: [{ type: 'text' as const, text: `Error fetching light airport info for ${code}: ${error instanceof Error ? error.message : 'Unknown error'}` }], isError: true }; } }
  • Zod input schema defining the required 'code' parameter for the tool.
    const airportInfoLightSchema = z.object({ code: z.string().min(1).describe('Airport IATA or ICAO code.') });
  • src/server.ts:418-443 (registration)
    Registration of the tool using McpServer.tool() with name, description, schema, and handler.
    server.tool( 'get_airport_info_light', 'Returns airport name, ICAO and IATA codes. REQUIRED: code must be provided and non-empty.', airportInfoLightSchema.shape, async (params: z.infer<typeof airportInfoLightSchema>) => { const { code } = params; try { console.log(`Raw params received by handler: ${JSON.stringify(params)}`); const airport = await fr24Client.getAirportInfoLight(code); return { content: [{ type: 'text' as const, text: `Airport information (light):\n${JSON.stringify(airport, null, 2)}` }] }; } catch (error) { return { content: [{ type: 'text' as const, text: `Error fetching light airport info for ${code}: ${error instanceof Error ? error.message : 'Unknown error'}` }], isError: true }; } } );
  • Helper method in FR24Client that makes the API request to fetch light airport information.
    async getAirportInfoLight(code: string): Promise<AirportInfoLight> { return this.makeRequest<AirportInfoLight>(`/static/airports/${code}/light`); }
  • TypeScript interface defining the structure of the AirportInfoLight output.
    export interface AirportInfoLight { name: string; iata: string; icao: string; }

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