google-flights-mcp-server 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +129 -0
- package/build/index.js +31 -0
- package/package.json +49 -0
- package/shared/flights-client/flights-client.d.ts +23 -0
- package/shared/flights-client/flights-client.js +522 -0
- package/shared/flights-client/types.d.ts +100 -0
- package/shared/flights-client/types.js +1 -0
- package/shared/index.d.ts +7 -0
- package/shared/index.js +8 -0
- package/shared/logging.d.ts +9 -0
- package/shared/logging.js +24 -0
- package/shared/resources.d.ts +3 -0
- package/shared/resources.js +43 -0
- package/shared/server.d.ts +54 -0
- package/shared/server.js +33 -0
- package/shared/tools/find-airport-code.d.ts +38 -0
- package/shared/tools/find-airport-code.js +63 -0
- package/shared/tools/get-date-grid.d.ts +82 -0
- package/shared/tools/get-date-grid.js +106 -0
- package/shared/tools/search-flights.d.ts +140 -0
- package/shared/tools/search-flights.js +171 -0
- package/shared/tools.d.ts +5 -0
- package/shared/tools.js +32 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ListResourcesRequestSchema, ReadResourceRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { getAllToolNames } from './tools.js';
|
|
3
|
+
export function registerResources(server) {
|
|
4
|
+
server.setRequestHandler(ListResourcesRequestSchema, async () => {
|
|
5
|
+
return {
|
|
6
|
+
resources: [
|
|
7
|
+
{
|
|
8
|
+
uri: 'google-flights://config',
|
|
9
|
+
name: 'Server Configuration',
|
|
10
|
+
description: 'Current server configuration and available tools.',
|
|
11
|
+
mimeType: 'application/json',
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
17
|
+
const { uri } = request.params;
|
|
18
|
+
if (uri === 'google-flights://config') {
|
|
19
|
+
const config = {
|
|
20
|
+
server: {
|
|
21
|
+
name: 'google-flights-mcp-server',
|
|
22
|
+
transport: 'stdio',
|
|
23
|
+
},
|
|
24
|
+
availableTools: getAllToolNames(),
|
|
25
|
+
notes: [
|
|
26
|
+
'No API key required — uses public Google Flights data.',
|
|
27
|
+
'Rate limiting is applied automatically (1.5s between requests).',
|
|
28
|
+
'Prices may vary based on currency and region.',
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
contents: [
|
|
33
|
+
{
|
|
34
|
+
uri: 'google-flights://config',
|
|
35
|
+
mimeType: 'application/json',
|
|
36
|
+
text: JSON.stringify(config, null, 2),
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
throw new Error(`Resource not found: ${uri}`);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
|
+
import type { SearchFlightsOptions, SearchFlightsResult, GetDateGridOptions, DateGridResult, AirportResult } from './flights-client/types.js';
|
|
3
|
+
export interface IFlightsClient {
|
|
4
|
+
searchFlights(options: SearchFlightsOptions): Promise<SearchFlightsResult>;
|
|
5
|
+
getDateGrid(options: GetDateGridOptions): Promise<DateGridResult>;
|
|
6
|
+
findAirportCode(query: string): Promise<AirportResult[]>;
|
|
7
|
+
}
|
|
8
|
+
export type FlightsClientFactory = () => IFlightsClient;
|
|
9
|
+
export declare class GoogleFlightsClient implements IFlightsClient {
|
|
10
|
+
searchFlights(options: SearchFlightsOptions): Promise<SearchFlightsResult>;
|
|
11
|
+
getDateGrid(options: GetDateGridOptions): Promise<DateGridResult>;
|
|
12
|
+
findAirportCode(query: string): Promise<AirportResult[]>;
|
|
13
|
+
}
|
|
14
|
+
export interface CreateMCPServerOptions {
|
|
15
|
+
version: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function createMCPServer(options: CreateMCPServerOptions): {
|
|
18
|
+
server: Server<{
|
|
19
|
+
method: string;
|
|
20
|
+
params?: {
|
|
21
|
+
[x: string]: unknown;
|
|
22
|
+
_meta?: {
|
|
23
|
+
[x: string]: unknown;
|
|
24
|
+
progressToken?: string | number | undefined;
|
|
25
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
26
|
+
taskId: string;
|
|
27
|
+
} | undefined;
|
|
28
|
+
} | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
method: string;
|
|
32
|
+
params?: {
|
|
33
|
+
[x: string]: unknown;
|
|
34
|
+
_meta?: {
|
|
35
|
+
[x: string]: unknown;
|
|
36
|
+
progressToken?: string | number | undefined;
|
|
37
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
38
|
+
taskId: string;
|
|
39
|
+
} | undefined;
|
|
40
|
+
} | undefined;
|
|
41
|
+
} | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
[x: string]: unknown;
|
|
44
|
+
_meta?: {
|
|
45
|
+
[x: string]: unknown;
|
|
46
|
+
progressToken?: string | number | undefined;
|
|
47
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
48
|
+
taskId: string;
|
|
49
|
+
} | undefined;
|
|
50
|
+
} | undefined;
|
|
51
|
+
}>;
|
|
52
|
+
registerHandlers: (server: Server, clientFactory?: FlightsClientFactory) => Promise<void>;
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=server.d.ts.map
|
package/shared/server.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
|
+
import { registerResources } from './resources.js';
|
|
3
|
+
import { createRegisterTools } from './tools.js';
|
|
4
|
+
import { searchFlights, getDateGrid, findAirportCode } from './flights-client/flights-client.js';
|
|
5
|
+
export class GoogleFlightsClient {
|
|
6
|
+
async searchFlights(options) {
|
|
7
|
+
return searchFlights(options);
|
|
8
|
+
}
|
|
9
|
+
async getDateGrid(options) {
|
|
10
|
+
return getDateGrid(options);
|
|
11
|
+
}
|
|
12
|
+
async findAirportCode(query) {
|
|
13
|
+
return findAirportCode(query);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export function createMCPServer(options) {
|
|
17
|
+
const server = new Server({
|
|
18
|
+
name: 'google-flights-mcp-server',
|
|
19
|
+
version: options.version,
|
|
20
|
+
}, {
|
|
21
|
+
capabilities: {
|
|
22
|
+
resources: {},
|
|
23
|
+
tools: {},
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
const registerHandlers = async (server, clientFactory) => {
|
|
27
|
+
const factory = clientFactory || (() => new GoogleFlightsClient());
|
|
28
|
+
registerResources(server);
|
|
29
|
+
const registerTools = createRegisterTools(factory);
|
|
30
|
+
registerTools(server);
|
|
31
|
+
};
|
|
32
|
+
return { server, registerHandlers };
|
|
33
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
+
import type { FlightsClientFactory } from '../server.js';
|
|
4
|
+
export declare const FindAirportCodeSchema: z.ZodObject<{
|
|
5
|
+
query: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
query: string;
|
|
8
|
+
}, {
|
|
9
|
+
query: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function findAirportCodeTool(_server: Server, clientFactory: FlightsClientFactory): {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
inputSchema: {
|
|
15
|
+
type: "object";
|
|
16
|
+
properties: {
|
|
17
|
+
query: {
|
|
18
|
+
type: string;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
required: string[];
|
|
23
|
+
};
|
|
24
|
+
handler: (args: unknown) => Promise<{
|
|
25
|
+
content: {
|
|
26
|
+
type: string;
|
|
27
|
+
text: string;
|
|
28
|
+
}[];
|
|
29
|
+
isError?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
content: {
|
|
32
|
+
type: string;
|
|
33
|
+
text: string;
|
|
34
|
+
}[];
|
|
35
|
+
isError: boolean;
|
|
36
|
+
}>;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=find-airport-code.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const FindAirportCodeSchema = z.object({
|
|
3
|
+
query: z
|
|
4
|
+
.string()
|
|
5
|
+
.min(1)
|
|
6
|
+
.describe('Search query: city name, airport name, or partial IATA code (e.g., "San Francisco", "Heathrow", "LAX")'),
|
|
7
|
+
});
|
|
8
|
+
export function findAirportCodeTool(_server, clientFactory) {
|
|
9
|
+
return {
|
|
10
|
+
name: 'find_airport_code',
|
|
11
|
+
description: `Look up airport IATA codes by city name, airport name, or partial code.
|
|
12
|
+
|
|
13
|
+
Use this to find the correct airport code before calling search_flights or get_date_grid.
|
|
14
|
+
|
|
15
|
+
Returns matching airports with their IATA code, full name, city, and country.`,
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: 'object',
|
|
18
|
+
properties: {
|
|
19
|
+
query: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'City name, airport name, or partial code (e.g., "San Francisco", "Heathrow", "LAX")',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
required: ['query'],
|
|
25
|
+
},
|
|
26
|
+
handler: async (args) => {
|
|
27
|
+
try {
|
|
28
|
+
const parsed = FindAirportCodeSchema.parse(args);
|
|
29
|
+
const client = clientFactory();
|
|
30
|
+
const results = await client.findAirportCode(parsed.query);
|
|
31
|
+
if (results.length === 0) {
|
|
32
|
+
return {
|
|
33
|
+
content: [
|
|
34
|
+
{
|
|
35
|
+
type: 'text',
|
|
36
|
+
text: JSON.stringify({
|
|
37
|
+
query: parsed.query,
|
|
38
|
+
results: [],
|
|
39
|
+
message: `No airports found matching "${parsed.query}". Try a different spelling or a broader search.`,
|
|
40
|
+
}),
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
content: [
|
|
47
|
+
{
|
|
48
|
+
type: 'text',
|
|
49
|
+
text: JSON.stringify({ query: parsed.query, results }),
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
56
|
+
return {
|
|
57
|
+
content: [{ type: 'text', text: `Error finding airport code: ${message}` }],
|
|
58
|
+
isError: true,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
+
import type { FlightsClientFactory } from '../server.js';
|
|
4
|
+
export declare const GetDateGridSchema: z.ZodObject<{
|
|
5
|
+
origin: z.ZodString;
|
|
6
|
+
destination: z.ZodString;
|
|
7
|
+
departure_date: z.ZodOptional<z.ZodString>;
|
|
8
|
+
trip_type: z.ZodDefault<z.ZodEnum<["one_way", "round_trip"]>>;
|
|
9
|
+
seat_class: z.ZodDefault<z.ZodEnum<["economy", "premium_economy", "business", "first"]>>;
|
|
10
|
+
adults: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
currency: string;
|
|
14
|
+
origin: string;
|
|
15
|
+
destination: string;
|
|
16
|
+
trip_type: "one_way" | "round_trip";
|
|
17
|
+
seat_class: "economy" | "premium_economy" | "business" | "first";
|
|
18
|
+
adults: number;
|
|
19
|
+
departure_date?: string | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
origin: string;
|
|
22
|
+
destination: string;
|
|
23
|
+
currency?: string | undefined;
|
|
24
|
+
departure_date?: string | undefined;
|
|
25
|
+
trip_type?: "one_way" | "round_trip" | undefined;
|
|
26
|
+
seat_class?: "economy" | "premium_economy" | "business" | "first" | undefined;
|
|
27
|
+
adults?: number | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
export declare function getDateGridTool(_server: Server, clientFactory: FlightsClientFactory): {
|
|
30
|
+
name: string;
|
|
31
|
+
description: string;
|
|
32
|
+
inputSchema: {
|
|
33
|
+
type: "object";
|
|
34
|
+
properties: {
|
|
35
|
+
origin: {
|
|
36
|
+
type: string;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
destination: {
|
|
40
|
+
type: string;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
departure_date: {
|
|
44
|
+
type: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
trip_type: {
|
|
48
|
+
type: string;
|
|
49
|
+
enum: string[];
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
seat_class: {
|
|
53
|
+
type: string;
|
|
54
|
+
enum: string[];
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
adults: {
|
|
58
|
+
type: string;
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
currency: {
|
|
62
|
+
type: string;
|
|
63
|
+
description: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
required: string[];
|
|
67
|
+
};
|
|
68
|
+
handler: (args: unknown) => Promise<{
|
|
69
|
+
content: {
|
|
70
|
+
type: string;
|
|
71
|
+
text: string;
|
|
72
|
+
}[];
|
|
73
|
+
isError?: undefined;
|
|
74
|
+
} | {
|
|
75
|
+
content: {
|
|
76
|
+
type: string;
|
|
77
|
+
text: string;
|
|
78
|
+
}[];
|
|
79
|
+
isError: boolean;
|
|
80
|
+
}>;
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=get-date-grid.d.ts.map
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const GetDateGridSchema = z.object({
|
|
3
|
+
origin: z.string().min(3).max(3).describe('Origin airport IATA code (e.g., "SFO")'),
|
|
4
|
+
destination: z.string().min(3).max(3).describe('Destination airport IATA code (e.g., "LAX")'),
|
|
5
|
+
departure_date: z
|
|
6
|
+
.string()
|
|
7
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/)
|
|
8
|
+
.optional()
|
|
9
|
+
.describe('Anchor date for the grid in YYYY-MM-DD. The grid shows prices around this date. Defaults to 7 days from now.'),
|
|
10
|
+
trip_type: z.enum(['one_way', 'round_trip']).default('one_way').describe('Trip type'),
|
|
11
|
+
seat_class: z
|
|
12
|
+
.enum(['economy', 'premium_economy', 'business', 'first'])
|
|
13
|
+
.default('economy')
|
|
14
|
+
.describe('Cabin class'),
|
|
15
|
+
adults: z.number().int().min(1).max(9).default(1).describe('Number of adult passengers'),
|
|
16
|
+
currency: z
|
|
17
|
+
.string()
|
|
18
|
+
.min(3)
|
|
19
|
+
.max(3)
|
|
20
|
+
.default('USD')
|
|
21
|
+
.describe('Currency code for prices (e.g., "USD", "EUR")'),
|
|
22
|
+
});
|
|
23
|
+
export function getDateGridTool(_server, clientFactory) {
|
|
24
|
+
return {
|
|
25
|
+
name: 'get_date_grid',
|
|
26
|
+
description: `Get a date-price grid for a route showing the lowest flight price for each day.
|
|
27
|
+
|
|
28
|
+
Returns an array of dates with their lowest prices, plus the overall cheapest date. Great for deal-hunting when the user has flexibility on travel dates — call this first to find the cheapest day, then use search_flights on that date.
|
|
29
|
+
|
|
30
|
+
The grid typically covers ~60 days around the anchor date.`,
|
|
31
|
+
inputSchema: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: {
|
|
34
|
+
origin: { type: 'string', description: 'Origin airport IATA code (e.g., "SFO")' },
|
|
35
|
+
destination: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
description: 'Destination airport IATA code (e.g., "LAX")',
|
|
38
|
+
},
|
|
39
|
+
departure_date: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
description: 'Anchor date in YYYY-MM-DD. Grid shows prices around this date. Default: 7 days from now.',
|
|
42
|
+
},
|
|
43
|
+
trip_type: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
enum: ['one_way', 'round_trip'],
|
|
46
|
+
description: 'Trip type (default: one_way)',
|
|
47
|
+
},
|
|
48
|
+
seat_class: {
|
|
49
|
+
type: 'string',
|
|
50
|
+
enum: ['economy', 'premium_economy', 'business', 'first'],
|
|
51
|
+
description: 'Cabin class (default: economy)',
|
|
52
|
+
},
|
|
53
|
+
adults: {
|
|
54
|
+
type: 'number',
|
|
55
|
+
description: 'Number of adult passengers (default: 1)',
|
|
56
|
+
},
|
|
57
|
+
currency: {
|
|
58
|
+
type: 'string',
|
|
59
|
+
description: 'Currency code for prices (default: USD)',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
required: ['origin', 'destination'],
|
|
63
|
+
},
|
|
64
|
+
handler: async (args) => {
|
|
65
|
+
try {
|
|
66
|
+
const parsed = GetDateGridSchema.parse(args);
|
|
67
|
+
const client = clientFactory();
|
|
68
|
+
const result = await client.getDateGrid(parsed);
|
|
69
|
+
if (result.date_grid.length === 0) {
|
|
70
|
+
return {
|
|
71
|
+
content: [
|
|
72
|
+
{
|
|
73
|
+
type: 'text',
|
|
74
|
+
text: JSON.stringify({
|
|
75
|
+
query: { origin: parsed.origin, destination: parsed.destination },
|
|
76
|
+
date_grid: [],
|
|
77
|
+
cheapest: null,
|
|
78
|
+
currency: parsed.currency,
|
|
79
|
+
message: 'No date grid data available. This may happen for certain routes or date ranges.',
|
|
80
|
+
}),
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
content: [
|
|
87
|
+
{
|
|
88
|
+
type: 'text',
|
|
89
|
+
text: JSON.stringify({
|
|
90
|
+
query: { origin: parsed.origin, destination: parsed.destination },
|
|
91
|
+
...result,
|
|
92
|
+
}),
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
99
|
+
return {
|
|
100
|
+
content: [{ type: 'text', text: `Error getting date grid: ${message}` }],
|
|
101
|
+
isError: true,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
+
import type { FlightsClientFactory } from '../server.js';
|
|
4
|
+
export declare const SearchFlightsSchema: z.ZodObject<{
|
|
5
|
+
origin: z.ZodString;
|
|
6
|
+
destination: z.ZodString;
|
|
7
|
+
departure_date: z.ZodString;
|
|
8
|
+
return_date: z.ZodOptional<z.ZodString>;
|
|
9
|
+
trip_type: z.ZodDefault<z.ZodEnum<["one_way", "round_trip"]>>;
|
|
10
|
+
seat_class: z.ZodDefault<z.ZodEnum<["economy", "premium_economy", "business", "first"]>>;
|
|
11
|
+
adults: z.ZodDefault<z.ZodNumber>;
|
|
12
|
+
children: z.ZodDefault<z.ZodNumber>;
|
|
13
|
+
infants_in_seat: z.ZodDefault<z.ZodNumber>;
|
|
14
|
+
infants_on_lap: z.ZodDefault<z.ZodNumber>;
|
|
15
|
+
max_stops: z.ZodDefault<z.ZodEnum<["any", "nonstop", "1", "2"]>>;
|
|
16
|
+
sort_by: z.ZodDefault<z.ZodEnum<["best", "price", "duration", "departure", "arrival"]>>;
|
|
17
|
+
max_results: z.ZodDefault<z.ZodNumber>;
|
|
18
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
19
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
sort_by: "best" | "price" | "duration" | "departure" | "arrival";
|
|
22
|
+
max_stops: "any" | "nonstop" | "1" | "2";
|
|
23
|
+
currency: string;
|
|
24
|
+
origin: string;
|
|
25
|
+
destination: string;
|
|
26
|
+
departure_date: string;
|
|
27
|
+
trip_type: "one_way" | "round_trip";
|
|
28
|
+
seat_class: "economy" | "premium_economy" | "business" | "first";
|
|
29
|
+
adults: number;
|
|
30
|
+
children: number;
|
|
31
|
+
infants_in_seat: number;
|
|
32
|
+
infants_on_lap: number;
|
|
33
|
+
max_results: number;
|
|
34
|
+
offset: number;
|
|
35
|
+
return_date?: string | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
origin: string;
|
|
38
|
+
destination: string;
|
|
39
|
+
departure_date: string;
|
|
40
|
+
sort_by?: "best" | "price" | "duration" | "departure" | "arrival" | undefined;
|
|
41
|
+
max_stops?: "any" | "nonstop" | "1" | "2" | undefined;
|
|
42
|
+
currency?: string | undefined;
|
|
43
|
+
return_date?: string | undefined;
|
|
44
|
+
trip_type?: "one_way" | "round_trip" | undefined;
|
|
45
|
+
seat_class?: "economy" | "premium_economy" | "business" | "first" | undefined;
|
|
46
|
+
adults?: number | undefined;
|
|
47
|
+
children?: number | undefined;
|
|
48
|
+
infants_in_seat?: number | undefined;
|
|
49
|
+
infants_on_lap?: number | undefined;
|
|
50
|
+
max_results?: number | undefined;
|
|
51
|
+
offset?: number | undefined;
|
|
52
|
+
}>;
|
|
53
|
+
export declare function searchFlightsTool(_server: Server, clientFactory: FlightsClientFactory): {
|
|
54
|
+
name: string;
|
|
55
|
+
description: string;
|
|
56
|
+
inputSchema: {
|
|
57
|
+
type: "object";
|
|
58
|
+
properties: {
|
|
59
|
+
origin: {
|
|
60
|
+
type: string;
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
destination: {
|
|
64
|
+
type: string;
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
departure_date: {
|
|
68
|
+
type: string;
|
|
69
|
+
description: string;
|
|
70
|
+
};
|
|
71
|
+
return_date: {
|
|
72
|
+
type: string;
|
|
73
|
+
description: string;
|
|
74
|
+
};
|
|
75
|
+
trip_type: {
|
|
76
|
+
type: string;
|
|
77
|
+
enum: string[];
|
|
78
|
+
description: string;
|
|
79
|
+
};
|
|
80
|
+
seat_class: {
|
|
81
|
+
type: string;
|
|
82
|
+
enum: string[];
|
|
83
|
+
description: string;
|
|
84
|
+
};
|
|
85
|
+
adults: {
|
|
86
|
+
type: string;
|
|
87
|
+
description: string;
|
|
88
|
+
};
|
|
89
|
+
children: {
|
|
90
|
+
type: string;
|
|
91
|
+
description: string;
|
|
92
|
+
};
|
|
93
|
+
infants_in_seat: {
|
|
94
|
+
type: string;
|
|
95
|
+
description: string;
|
|
96
|
+
};
|
|
97
|
+
infants_on_lap: {
|
|
98
|
+
type: string;
|
|
99
|
+
description: string;
|
|
100
|
+
};
|
|
101
|
+
max_stops: {
|
|
102
|
+
type: string;
|
|
103
|
+
enum: string[];
|
|
104
|
+
description: string;
|
|
105
|
+
};
|
|
106
|
+
sort_by: {
|
|
107
|
+
type: string;
|
|
108
|
+
enum: string[];
|
|
109
|
+
description: string;
|
|
110
|
+
};
|
|
111
|
+
max_results: {
|
|
112
|
+
type: string;
|
|
113
|
+
description: string;
|
|
114
|
+
};
|
|
115
|
+
offset: {
|
|
116
|
+
type: string;
|
|
117
|
+
description: string;
|
|
118
|
+
};
|
|
119
|
+
currency: {
|
|
120
|
+
type: string;
|
|
121
|
+
description: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
required: string[];
|
|
125
|
+
};
|
|
126
|
+
handler: (args: unknown) => Promise<{
|
|
127
|
+
content: {
|
|
128
|
+
type: string;
|
|
129
|
+
text: string;
|
|
130
|
+
}[];
|
|
131
|
+
isError: boolean;
|
|
132
|
+
} | {
|
|
133
|
+
content: {
|
|
134
|
+
type: string;
|
|
135
|
+
text: string;
|
|
136
|
+
}[];
|
|
137
|
+
isError?: undefined;
|
|
138
|
+
}>;
|
|
139
|
+
};
|
|
140
|
+
//# sourceMappingURL=search-flights.d.ts.map
|