add_custom_food
Create a custom food in Cronometer by entering the nutrients you know per serving (1–94). Unknown nutrients stay blank, and the returned food_id lets you log it.
Instructions
Create a custom food with any nutrients you have, from 1 to all 94.
Amounts are for one whole serving, each in that nutrient's own unit. Call list_nutrients for the accepted names and their units. Only pass the nutrients you actually know: a nutrient you leave out stays blank in Cronometer, while passing 0 states the food contains none of it, and the app treats those differently. An unrecognised name is an error, so nothing is silently dropped from a food that then looks complete.
Two label conveniences: energy_kj is converted to calories, salt_g to sodium. Pass either one or its underlying nutrient, not both.
After creation, use the returned food_id with add_food_entry to log it.
Args: name: Food name. nutrients: Nutrient name to amount per serving, e.g. {"energy": 250, "protein": 12.5, "vitamin_c": 30, "b12_cobalamin": 1.2}. serving_name: Name for the serving size (default "1 serving"). serving_grams: Weight of one serving in grams (default 100). label_type: "AMERICAN_2016" or "EUROPEAN". notes: Free-text note stored on the food.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| notes | No | ||
| nutrients | Yes | ||
| label_type | No | AMERICAN_2016 | |
| serving_name | No | 1 serving | |
| serving_grams | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |