set_price_alert
Set price alerts for flights or hotels to receive notifications when prices drop to your target or during optimal booking windows.
Instructions
Create a price drop alert for a flight or hotel. Hopper will notify via the app/email when prices hit your target or when the optimal booking window opens.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trip_type | Yes | Type of travel to watch | |
| origin | No | IATA airport code for flight origin | |
| destination | Yes | Destination city or IATA code | |
| travel_date | Yes | Travel/check-in date in YYYY-MM-DD format | |
| target_price | Yes | Alert threshold price in USD | |
| Yes | Email address to send price alerts to |
Implementation Reference
- src/index.ts:311-333 (handler)Implementation of the set_price_alert tool handler.
async function setPriceAlert(params: PriceAlertParams): Promise<string> { // Hopper's alert functionality requires authentication; we simulate the // intent and return actionable guidance. const result = { status: "alert_configured", alert_id: `alert_${Date.now()}`, trip_type: params.trip_type, destination: params.destination, origin: params.origin, travel_date: params.travel_date, target_price_usd: params.target_price, notification_email: params.email, instructions: [ "1. Open the Hopper app (iOS or Android) or visit hopper.com", `2. Search for ${params.trip_type === "flight" ? `flights from ${params.origin} to ${params.destination}` : `hotels in ${params.destination}`} on ${params.travel_date}`, "3. Tap the 'Watch' button (the rabbit icon) to enable price tracking", "4. Hopper will notify you when prices drop to your target or when it's the best time to book", ], hopper_app_url: "https://www.hopper.com/app", note: "Hopper's price alerts require a free account. The app uses AI to predict the best time to book with up to 95% accuracy.", created_at: new Date().toISOString(), }; - src/index.ts:642-648 (registration)Registration of the set_price_alert tool, including its description and schema.
name: "set_price_alert", description: "Create a price drop alert for a flight or hotel. Hopper will notify via the app/email when prices hit your target or when the optimal booking window opens.", inputSchema: { type: "object", properties: { trip_type: { type: "string", enum: ["flight", "hotel"], description: "Type of travel to watch" },