getRealtimeLocationByAnum
Track the real-time location of a flight using its aircraft registration number (e.g., B2021, B2022). Input the aircraft number to retrieve accurate flight position data.
Instructions
Get flight realtime location by aircraft number. aircraft number should be Aircraft registration numberlike B2021, B2022, B2023, etc. if aircraft number is unknown, you shuold try to request it using searchFlightsByNumber tool
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| anum | Yes | Aircraft number like B2021, B2022, B2023, etc. |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"anum": {
"description": "Aircraft number like B2021, B2022, B2023, etc.",
"type": "string"
}
},
"required": [
"anum"
],
"type": "object"
}
Implementation Reference
- dist/index.js:170-189 (handler)MCP tool handler: accepts 'anum' parameter, fetches realtime location via flightService, returns formatted JSON response or error.}, async ({ anum }) => { try { const realtimeLocation = await flightService.getRealtimeLocationByAnum(anum); return { content: [ { type: "text", text: JSON.stringify(realtimeLocation, null, 2) } ] }; } catch (error) { console.error('Error getting realtime location by anum:', error); return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true }; } });
- dist/index.js:167-189 (registration)Registers the 'getRealtimeLocationByAnum' tool with MCP server, including description, input schema, and handler.server.tool('getRealtimeLocationByAnum', 'Get flight realtime location by aircraft number. aircraft number should be Aircraft registration numberlike B2021, B2022, B2023, etc. if aircraft number is unknown, you shuold try to request it using searchFlightsByNumber tool', { anum: z.string() .describe("Aircraft number like B2021, B2022, B2023, etc.") }, async ({ anum }) => { try { const realtimeLocation = await flightService.getRealtimeLocationByAnum(anum); return { content: [ { type: "text", text: JSON.stringify(realtimeLocation, null, 2) } ] }; } catch (error) { console.error('Error getting realtime location by anum:', error); return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true }; } });
- dist/index.js:168-169 (schema)Zod input schema for the tool: requires 'anum' as string with description.anum: z.string() .describe("Aircraft number like B2021, B2022, B2023, etc.")
- dist/services/openalService.js:50-54 (helper)OpenAlService method implementing the core logic: makes API request to 'realtimeLocation' endpoint with 'anum' parameter.async getRealtimeLocationByAnum(anum) { return this.makeRequest('realtimeLocation', { anum }); }
- dist/services/openalService.d.ts:6-6 (schema)TypeScript type definition for the service method.getRealtimeLocationByAnum(anum: string): Promise<any>;