Skip to main content
Glama
variflight

Variflight Tripmatch MCP Server

Official
by variflight

getFlightAndTrainTransferInfo

Retrieve flight and train transfer details by entering departure and arrival city IATA codes along with the departure date in YYYY-MM-DD format. Use this tool to plan multi-modal travel connections.

Instructions

Get flight and train transfer info by departure city and arrival city and departure date. Date format: YYYY-MM-DD. IMPORTANT: For today's date, you MUST use getTodayDate tool instead of hardcoding any date. Airport codes should be IATA 3-letter codes.

Input Schema

NameRequiredDescriptionDefault
arrcityYesArrival airport IATA 3-letter code (e.g. SHA for Shanghai, LAX for Los Angeles)
depcityYesDeparture airport IATA 3-letter code (e.g. BJS for Beijing, CAN for Guangzhou)
depdateYesFlight date in YYYY-MM-DD format. IMPORTANT: If user input only cotains month and date, you should use getTodayDate tool to get the year. For today's date, use getTodayDate tool instead of hardcoding

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "arrcity": { "description": "Arrival airport IATA 3-letter code (e.g. SHA for Shanghai, LAX for Los Angeles)", "maxLength": 3, "minLength": 3, "pattern": "^[A-Z]{3}$", "type": "string" }, "depcity": { "description": "Departure airport IATA 3-letter code (e.g. BJS for Beijing, CAN for Guangzhou)", "maxLength": 3, "minLength": 3, "pattern": "^[A-Z]{3}$", "type": "string" }, "depdate": { "description": "Flight date in YYYY-MM-DD format. IMPORTANT: If user input only cotains month and date, you should use getTodayDate tool to get the year. For today's date, use getTodayDate tool instead of hardcoding", "pattern": "^\\d{4}-\\d{2}-\\d{2}$", "type": "string" } }, "required": [ "depdate", "depcity", "arrcity" ], "type": "object" }

Implementation Reference

  • MCP tool handler function that invokes the flight service to get transfer info and formats the response.
    }, async ({ depcity, arrcity, depdate }) => { try { const flights = await flightService.getTransferInfo(depcity, arrcity, depdate); return { content: [ { type: "text", text: JSON.stringify(flights, null, 2) } ] }; } catch (error) { console.error('Error searching flights by number:', error); return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true }; } });
  • Zod input schema defining parameters for the tool: depdate, depcity, arrcity.
    depdate: z.string() .regex(/^\d{4}-\d{2}-\d{2}$/) .describe("Flight date in YYYY-MM-DD format. IMPORTANT: If user input only cotains month and date, you should use getTodayDate tool to get the year. For today's date, use getTodayDate tool instead of hardcoding"), depcity: z.string() .length(3) .regex(/^[A-Z]{3}$/) .describe("Departure airport IATA 3-letter code (e.g. BJS for Beijing, CAN for Guangzhou)"), arrcity: z.string() .length(3) .regex(/^[A-Z]{3}$/) .describe("Arrival airport IATA 3-letter code (e.g. SHA for Shanghai, LAX for Los Angeles)"),
  • dist/index.js:95-95 (registration)
    Registers the tool with MCP server, including name, description, schema, and handler.
    server.tool("getFlightAndTrainTransferInfo", "Get flight and train transfer info by departure city and arrival city and departure date. Date format: YYYY-MM-DD. IMPORTANT: For today's date, you MUST use getTodayDate tool instead of hardcoding any date. Airport codes should be IATA 3-letter codes. ", {
  • Helper method in OpenAlService that makes the API request to the 'transfer' endpoint for flight and train transfer information.
    async getTransferInfo(depcity, arrcity, depdate) { return this.makeRequest('transfer', { depcity, arrcity, depdate, "fromMCP": 1 }); }

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