math_fuel_consumption_calculator
Convert fuel economy between US mpg, UK mpg, L/100km, and km/L. Estimate trip fuel cost from distance, consumption, and price.
Instructions
Fuel Consumption Calculator. Convert a fuel-economy figure between US mpg, UK (Imperial) mpg, L/100km, and km/L, or estimate the fuel and money a trip will cost given distance, vehicle consumption, and a per-litre or per-gallon fuel price. Returns the converted value (convertConsumption) or litres needed plus total cost in the price's native currency (tripCost). Use this for fuel-economy and trip-cost math; use math_unit_converter instead for general length / volume / speed unit conversion, and math_running_pace_converter for pace and speed. Pure local arithmetic: read-only, non-destructive, deterministic, contacts no external service, and is rate-limited.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operation | Yes | "convertConsumption" converts one economy value between units (needs value, fromUnit, toUnit). "tripCost" estimates trip fuel and cost (needs distance, distanceUnit, consumption, consumptionUnit, pricePerUnit, priceUnit). | convertConsumption |
| value | No | convertConsumption only: the fuel-economy value to convert, expressed in fromUnit. Must be greater than zero for mpg_us, mpg_uk, and km_per_l. | |
| fromUnit | No | convertConsumption only: unit of the input value. mpg_us=miles per US gallon, mpg_uk=miles per Imperial gallon, l_per_100km=litres per 100km, km_per_l=kilometres per litre. | |
| toUnit | No | convertConsumption only: unit to convert the value into. Same four enum values as fromUnit. | |
| distance | No | tripCost only: trip distance, expressed in distanceUnit. | |
| distanceUnit | No | tripCost only: unit of distance. km=kilometres, mi=miles. | |
| consumption | No | tripCost only: the vehicle fuel economy, expressed in consumptionUnit. Must be greater than zero. | |
| consumptionUnit | No | tripCost only: unit of the consumption figure. Same four enum values as fromUnit. | |
| pricePerUnit | No | tripCost only: fuel price per volume unit, expressed in priceUnit currency and volume. | |
| priceUnit | No | tripCost only: currency + volume the price refers to. Determines the output currency (USD/EUR/GBP) and the volume (US gallon, UK gallon, or litre) pricePerUnit is multiplied by. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operation | No | Echoes the operation that was run (defaults to convertConsumption when omitted). | |
| data | No | convertConsumption returns fromUnit/toUnit/fromValue/toValue/formattedFrom/formattedTo. tripCost returns distance/consumption/fuelNeeded/totalCost/pricePerUnit/currency and formatted strings. |