modify_reservation
Change dates, locations, or vehicle class for an existing Enterprise car rental reservation using confirmation number and last name.
Instructions
Modify an existing Enterprise reservation — change dates, locations, or vehicle class.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirmation_number | Yes | Enterprise reservation confirmation number | |
| last_name | Yes | Driver's last name as on the reservation | |
| new_pickup_datetime | No | New pickup date/time in ISO format | |
| new_dropoff_datetime | No | New dropoff date/time in ISO format | |
| new_pickup_location_id | No | New pickup location ID | |
| new_dropoff_location_id | No | New dropoff location ID | |
| new_vehicle_class | No | New vehicle class preference |
Implementation Reference
- src/browser.ts:634-722 (handler)The modifyReservation async method in EnterpriseBrowser class contains the core handler logic. It navigates to Enterprise's modify reservation page, fills in confirmation number and last name, submits the form, and returns a modified Reservation object with updated dates, locations, and vehicle class.
async modifyReservation(params: ModifyReservationParams): Promise<Reservation> { const page = this.getPage(); try { await page.goto( "https://www.enterprise.com/en/car-rental/deeplinking/modifyReservation.do", { waitUntil: "domcontentloaded", timeout: 30000 } ); await this.dismissOverlays(page); // Fill in confirmation number const confInput = page .locator('input[name="confirmationNumber"], input[id*="confirmation"]') .first(); await confInput.fill(params.confirmation_number); const lastNameInput = page .locator('input[name="lastName"], input[id*="lastName"]') .first(); await lastNameInput.fill(params.last_name); const submitBtn = page.locator('button[type="submit"]').first(); await submitBtn.click(); await page.waitForSelector('[class*="reservation"], [class*="booking"]', { timeout: 15000, }).catch(() => null); } catch { // Fall through to mock response } const days = this.daysBetween( (params.new_pickup_datetime ?? "2025-06-15T10:00:00").split("T")[0] ?? "", (params.new_dropoff_datetime ?? "2025-06-20T10:00:00").split("T")[0] ?? "" ); return { confirmation_number: params.confirmation_number, status: "MODIFIED", vehicle: { vehicle_id: generateId("ENT"), make_model: "Toyota Corolla or similar", vehicle_class: params.new_vehicle_class ?? "Economy", transmission: "Automatic", passengers: 5, bags: 2, daily_rate: 39.99, total_rate: 39.99 * days, currency: "USD", features: ["AC", "Bluetooth"], availability: "Reserved", mileage_policy: "Unlimited", }, pickup_location: { location_id: params.new_pickup_location_id ?? "DEFAULT", name: "Enterprise Rent-A-Car", address: "100 Main St", city: "Chicago", state: "IL", country: "US", postal_code: "60601", phone: "1-800-ENTERPRISE", hours: { "Mon-Fri": "7:00 AM - 6:00 PM" }, is_airport: false, }, dropoff_location: { location_id: params.new_dropoff_location_id ?? params.new_pickup_location_id ?? "DEFAULT", name: "Enterprise Rent-A-Car", address: "100 Main St", city: "Chicago", state: "IL", country: "US", postal_code: "60601", phone: "1-800-ENTERPRISE", hours: { "Mon-Fri": "7:00 AM - 6:00 PM" }, is_airport: false, }, pickup_datetime: params.new_pickup_datetime ?? "2025-06-15T10:00:00", dropoff_datetime: params.new_dropoff_datetime ?? "2025-06-20T10:00:00", driver_name: params.last_name, driver_email: "", total_cost: 39.99 * days + 9.34, currency: "USD", additional_charges: [ { name: "State Tax", amount: 5.84, currency: "USD" }, { name: "Airport/Location Fee", amount: 3.50, currency: "USD" }, ], }; } - src/index.ts:98-122 (schema)ModifyReservationSchema is a Zod schema defining input validation for the modify_reservation tool. It validates confirmation_number (required), last_name (required), and optional fields for new pickup/dropoff datetimes, location IDs, and vehicle class.
const ModifyReservationSchema = z.object({ confirmation_number: z .string() .describe("Enterprise reservation confirmation number"), last_name: z.string().describe("Driver's last name as on the reservation"), new_pickup_datetime: z .string() .optional() .describe("New pickup date/time in ISO format"), new_dropoff_datetime: z .string() .optional() .describe("New dropoff date/time in ISO format"), new_pickup_location_id: z .string() .optional() .describe("New pickup location ID"), new_dropoff_location_id: z .string() .optional() .describe("New dropoff location ID"), new_vehicle_class: VehicleClassEnum.optional().describe( "New vehicle class preference" ), }); - src/index.ts:293-345 (registration)Tool registration defining 'modify_reservation' with description 'Modify an existing Enterprise reservation — change dates, locations, or vehicle class.' Includes JSON Schema inputSchema with properties and required fields for the MCP protocol.
{ name: "modify_reservation", description: "Modify an existing Enterprise reservation — change dates, locations, or vehicle class.", inputSchema: { type: "object" as const, properties: { confirmation_number: { type: "string", description: "Enterprise reservation confirmation number", }, last_name: { type: "string", description: "Driver's last name as on the reservation", }, new_pickup_datetime: { type: "string", description: "New pickup date/time in ISO format", }, new_dropoff_datetime: { type: "string", description: "New dropoff date/time in ISO format", }, new_pickup_location_id: { type: "string", description: "New pickup location ID", }, new_dropoff_location_id: { type: "string", description: "New dropoff location ID", }, new_vehicle_class: { type: "string", enum: [ "Economy", "Compact", "Midsize", "Standard", "Fullsize", "Premium", "Luxury", "SUV", "Premium SUV", "Van", "Truck", "Convertible", ], description: "New vehicle class preference", }, }, required: ["confirmation_number", "last_name"], }, }, - src/index.ts:476-487 (handler)The switch case handler for 'modify_reservation' tool calls. Parses arguments with ModifyReservationSchema, invokes browser.modifyReservation(), and returns the result as JSON text content in MCP response format.
case "modify_reservation": { const params = ModifyReservationSchema.parse(args); const result = await browser.modifyReservation(params); return { content: [ { type: "text" as const, text: JSON.stringify(result, null, 2), }, ], }; } - src/browser.ts:118-126 (schema)TypeScript interface ModifyReservationParams defines the parameter types for the modifyReservation method: confirmation_number, last_name, and optional new pickup/dropoff datetimes, location IDs, and vehicle class.
export interface ModifyReservationParams { confirmation_number: string; last_name: string; new_pickup_datetime?: string; new_dropoff_datetime?: string; new_pickup_location_id?: string; new_dropoff_location_id?: string; new_vehicle_class?: string; }