road-trip-cost-calculator
Estimate the total cost of a road trip from fuel, lodging, food, attractions, and tolls. Supports both imperial (miles + MPG + $/gallon) and metric (km + L/100km + per-liter) inputs. Returns total cost, fuel-only subtotal, per-person split, and cost per mile/km.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"distance": "<distance>",
"fuel_economy": "<fuel_economy>",
"fuel_price": "<fuel_price>",
"duration_days": "<duration_days>"
},
"name": "road-trip-cost-calculator"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tolls | No | Optional total toll cost for the trip (in the same currency). Defaults to 0. Pulled out as its own line so the fuel subtotal stays a pure miles-per-gallon math. | |
| distance | Yes | Round-trip driving distance. Use the unit specified by `unit_system` — miles for 'imperial', kilometers for 'metric'. For a one-way drive, double the one-way distance. | |
| travelers | No | Number of travelers. Defaults to 1 when omitted. Used to compute per-person cost and to scale the food subtotal (food_per_day × travelers × duration_days). Lodging, fuel, attractions, and tolls are billed once per trip. | |
| fuel_price | Yes | Fuel price in local currency units. Dollars per gallon for 'imperial' (US average ~$3.50/gal mid-2025), or per liter for 'metric' (EU average ~€1.65/L). | |
| attractions | No | Total budget for attractions, activities, and entry tickets across the whole trip (in the same currency). Defaults to 0. Already a per-group total — not multiplied by travelers. | |
| unit_system | No | Which unit set the distance and fuel-economy inputs are in. 'imperial' = miles + MPG + $/gallon (default); 'metric' = kilometers + L/100km + price per liter. | |
| food_per_day | No | Average food cost per traveler per day, in the same currency as `fuel_price`. Defaults to 0 when omitted. Multiplied by `duration_days` AND `travelers` for the subtotal. | |
| fuel_economy | Yes | Fuel economy. Higher-is-better when `unit_system` is 'imperial' (MPG, miles per gallon — e.g. 28 for an average US sedan). Lower-is-better when `unit_system` is 'metric' (L/100km — e.g. 8.4 for an average European car). | |
| duration_days | Yes | Trip duration in whole days, including the departure day and return day. A weekend trip (leave Sat, return Sun) is 2 days; a week-long trip is 7. | |
| lodging_nights | No | Override for the number of paid lodging nights. Useful when you booked a night before departure or the return is an overnight drive. When omitted, the engine uses max(duration_days − 1, 0). | |
| lodging_per_night | No | Average lodging cost per night, in the same currency as `fuel_price`. Defaults to 0 when omitted (sleeping at home or with hosts). The engine bills lodging for (duration_days − 1) nights by default; override with `lodging_nights` if you booked differently. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fuel_used | Yes | Total fuel consumed for the trip — gallons when `unit_system` is 'imperial', liters when 'metric'. Rounded to two decimals. | |
| per_person | Yes | total_cost ÷ travelers, rounded to cents. | |
| total_cost | Yes | Total trip cost in the input currency, rounded to cents. | |
| unit_system | Yes | Unit system echoed from the input. | |
| cost_per_mile | Yes | total_cost ÷ distance — the all-in cost per unit of distance. Per mile for 'imperial', per kilometer for 'metric'. Rounded to cents. | |
| food_subtotal | Yes | Food cost: food_per_day × travelers × duration_days. | |
| fuel_subtotal | Yes | Fuel-only subtotal — what gas costs you for the round trip. | |
| lodging_nights | Yes | Number of paid lodging nights actually billed. | |
| tolls_subtotal | Yes | Tolls subtotal, echoed from the input. | |
| lodging_subtotal | Yes | Lodging cost across all paid nights. | |
| attractions_subtotal | Yes | Attractions/activities subtotal, echoed from the input. |