Convert units
convert_unitsConvert one cooking amount between units: within volume or weight exactly, or between volume and weight using a built-in density for flour, sugar, brown sugar, butter, water, milk, rice, oats, cocoa or honey. Use for questions like 'how many grams is 2 cups of flour'. Do NOT use to change serving counts (use scale_recipe).
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": {
"value": "<value>",
"from": "<from>",
"to": "<to>"
},
"name": "convert_units"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Unit to convert to, e.g. 'g'; same supported units as from | |
| from | Yes | Unit to convert from, e.g. 'cup'. Supported: tsp, tbsp, cup, fl_oz, ml, l, pint, quart, gallon (volume); g, kg, oz, lb (weight); each (count). Common spellings like 'cups', 'grams', 'tablespoon' also work | |
| value | Yes | Amount to convert, zero or positive, e.g. 2 | |
| ingredient | No | Ingredient name, required only for volume <-> weight; must contain one of flour, sugar, brown sugar, butter, water, milk, rice, oats, cocoa, honey (e.g. 'all-purpose flour') |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Canonical target unit, e.g. 'g' | |
| from | Yes | Canonical source unit, e.g. 'cup' | |
| value | Yes | Amount that was converted | |
| method | Yes | 'linear' for same-dimension, 'density' for volume <-> weight | |
| result | Yes | Converted amount (4 significant digits) | |
| display | Yes | Readable conversion, e.g. '2 cups flour = 250 g (approx.)' | |
| density_note | No | Density used (density method only) |