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"}.
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": {
"amount": "<amount>",
"unit": "<unit>",
"to": "<to>"
},
"name": "convert_units"
}
}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 |