Skip to main content
Glama
variflight

Variflight Tripmatch MCP Server

Official
by variflight

getFutureWeatherByAirport

Retrieve 3-day weather forecasts for airports using IATA codes to plan travel and anticipate conditions at destinations.

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

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

Implementation Reference

  • dist/index.js:186-209 (registration)
    Registration of the 'getFutureWeatherByAirport' MCP tool, including description, Zod input schema, and inline handler function that delegates to flightService.getAirportWeather.
    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
            };
        }
    });
  • Helper method in OpenAlService that calls the 'futureAirportWeather' API endpoint with the airport code and type=1.
    async getAirportWeather(airport) {
        return this.makeRequest('futureAirportWeather', {
            "code": airport,
            "type": "1"
        });
    }
  • Core helper method in OpenAlService that performs POST requests to the configured API base URL with endpoint and params.
    async makeRequest(endpoint, params) {
        const url = new URL(config.api.baseUrl);
        const request_body = {
            endpoint: endpoint,
            params: params
        };
        const response = await fetch(url.toString(), {
            method: 'post',
            headers: {
                'X-VARIFLIGHT-KEY': config.api.apiKey || '',
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(request_body),
        });
        if (!response.ok) {
            throw new Error(`API request failed: ${response.status} ${response.statusText}`);
        }
        return response.json();
    }
  • Zod schema definition for the 'airport' input parameter validating IATA 3-letter 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)")
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does (get weather for 3 days) and the input format (IATA code), but doesn't describe behavioral traits like rate limits, authentication needs, error handling, or what the output looks like (e.g., format, units, or structure). For a tool with no annotations, this leaves significant gaps in understanding how it behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with the core purpose stated first. It uses two sentences efficiently: one for the main function and one for input details. There's no unnecessary repetition or fluff, though it could be slightly more structured (e.g., separating usage notes).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (a weather query tool with no output schema and no annotations), the description is incomplete. It covers the input but lacks crucial context: no information on output format (e.g., what data is returned, units), error cases, or behavioral constraints. Without annotations or an output schema, the description should compensate more to be complete for agent use.

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?

The input schema has 100% description coverage, with the parameter 'airport' fully documented in the schema (including pattern and examples). The description adds minimal value beyond the schema by reiterating the IATA code requirement and providing the same examples. Since schema coverage is high, the baseline is 3, and the description doesn't significantly enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get airport future weather for 3days (today、tomorrow、the day after tomorrow) by airport IATA 3-letter code.' It specifies the verb ('Get'), resource ('airport future weather'), and scope ('3days'), but doesn't explicitly differentiate from sibling tools like 'getFlightPriceByCities' or 'searchFlightsByNumber', which are unrelated to weather. The purpose is clear but sibling differentiation is only implicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any prerequisites, exclusions, or related tools (e.g., whether there are other weather tools or if this is the only one). The context is implied (need airport weather for 3 days), but there's no explicit usage context or comparison to siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/tripmatch-mcp'

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