Skip to main content
Glama
variflight
by variflight

getFutureWeatherByAirport

Retrieve 3-day weather forecasts for any airport using its IATA 3-letter code. Plan travel and operations with accurate weather predictions for today, tomorrow, and the following day.

Instructions

Get airport future weather for 3days (today、tomorrow、the day after tomorrow) by airport IATA 3-letter code. Airport codes should be IATA 3-letter codes (e.g. PEK for Beijing, SHA for Shanghai, CAN for Guangzhou, HFE for Hefei).

Input Schema

NameRequiredDescriptionDefault
airportYesAirport IATA 3-letter code (e.g. PEK for Beijing, SHA for Shanghai, CAN for Guangzhou, HFE for Hefei)

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "airport": { "description": "Airport IATA 3-letter code (e.g. PEK for Beijing, SHA for Shanghai, CAN for Guangzhou, HFE for Hefei)", "pattern": "^[A-Z]{3}$", "type": "string" } }, "required": [ "airport" ], "type": "object" }

Implementation Reference

  • Inline tool handler function that invokes flightService.getAirportWeather(airport), formats the response as MCP content, and handles errors.
    }, async ({ airport }) => { try { const weather = await flightService.getAirportWeather(airport); return { content: [ { type: "text", text: JSON.stringify(weather, null, 2) } ] }; } catch (error) { console.error('Error getting airport weather:', error); return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true }; } });
  • Zod input schema validating the 'airport' parameter as a 3-letter uppercase IATA code.
    airport: z.string() .regex(/^[A-Z]{3}$/) .describe("Airport IATA 3-letter code (e.g. PEK for Beijing, SHA for Shanghai, CAN for Guangzhou, HFE for Hefei)")
  • dist/index.js:211-234 (registration)
    Full server.tool registration including name, description, input schema, and inline handler.
    server.tool('getFutureWeatherByAirport', 'Get airport future weather for 3days (today、tomorrow、the day after tomorrow) by airport IATA 3-letter code. Airport codes should be IATA 3-letter codes (e.g. PEK for Beijing, SHA for Shanghai, CAN for Guangzhou, HFE for Hefei).', { airport: z.string() .regex(/^[A-Z]{3}$/) .describe("Airport IATA 3-letter code (e.g. PEK for Beijing, SHA for Shanghai, CAN for Guangzhou, HFE for Hefei)") }, async ({ airport }) => { try { const weather = await flightService.getAirportWeather(airport); return { content: [ { type: "text", text: JSON.stringify(weather, null, 2) } ] }; } catch (error) { console.error('Error getting airport weather:', error); return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true }; } });
  • OpenAlService method implementing the core API call to retrieve future weather data for the airport using the 'futureAirportWeather' endpoint.
    async getAirportWeather(airport) { return this.makeRequest('futureAirportWeather', { "code": airport, "type": "1" }); }

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