getFlightTransferInfo
Retrieve flight transfer details using departure and arrival airport codes (IATA format) and the departure date in YYYY-MM-DD format. Ideal for planning connected flights or identifying transfer options for specific travel dates.
Instructions
Get flight 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
| Name | Required | Description | Default |
|---|---|---|---|
| arrcity | Yes | Arrival airport IATA 3-letter code (e.g. SHA for Shanghai, LAX for Los Angeles) | |
| depcity | Yes | Departure airport IATA 3-letter code (e.g. BJS for Beijing, CAN for Guangzhou) | |
| depdate | Yes | 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 |
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
- dist/services/openalService.js:43-49 (handler)Core implementation of getFlightTransferInfo: calls makeRequest API with 'transfer' endpoint using depcity, arrcity, depdate.async getFlightTransferInfo(depcity, arrcity, depdate) { return this.makeRequest('transfer', { depcity, arrcity, depdate }); }
- dist/index.js:96-127 (registration)MCP tool registration for 'getFlightTransferInfo', including description, Zod input schema, and wrapper handler that delegates to OpenAlService and formats JSON response.server.tool("getFlightTransferInfo", "Get flight 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. ", { 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)"), }, async ({ depcity, arrcity, depdate }) => { try { const flights = await flightService.getFlightTransferInfo(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 }; } });
- dist/services/openalService.d.ts:5-5 (schema)TypeScript declaration/signature for the getFlightTransferInfo method in OpenAlService.getFlightTransferInfo(depcity: string, arrcity: string, depdate: string): Promise<any>;