Convert a measurement
convert_unitsConvert one cooking amount between units, using ingredient density for volume↔weight (e.g. 1 cup flour → grams). Pure calculation: reads and writes nothing. For a whole recipe use get_recipe units=metric instead. Returns {from, to, amount, unit}, e.g. {from: "1 cup", to: "120 g", amount: 120, unit: "g"}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Target system: us or metric | |
| unit | Yes | Source unit, e.g. "cup", "tbsp", "oz", "g", "ml", "°F" | |
| amount | Yes | Quantity: number or fraction text, e.g. 1.5, "1 1/2", "3/4" | |
| ingredient | No | Ingredient for density-based volume↔weight, e.g. "flour", "sugar"; optional |