Skip to main content
Glama
variflight
by variflight

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

NameRequiredDescriptionDefault
anumYesAircraft 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

  • 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 }; } });
  • Zod input schema for the tool: requires 'anum' as string with description.
    anum: z.string() .describe("Aircraft number like B2021, B2022, B2023, etc.")
  • OpenAlService method implementing the core logic: makes API request to 'realtimeLocation' endpoint with 'anum' parameter.
    async getRealtimeLocationByAnum(anum) { return this.makeRequest('realtimeLocation', { anum }); }
  • TypeScript type definition for the service method.
    getRealtimeLocationByAnum(anum: string): Promise<any>;

Other Tools

Related 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/variflight/variflight-mcp'

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