mfp_create_food
Create a custom food entry with nutrition per serving in MyFitnessPal, enabling logging when search finds no match. Specify macros and optional nutrients; private by default.
Instructions
Create a new custom food in the MyFitnessPal database (via the v2 API).
Use this when a food is not already in MyFitnessPal (mfp_search_food returns
nothing suitable) and you want it available to log. All nutrition values are
entered PER ONE serving_size (e.g. serving_size='125 g' with the numbers
for a 125 g portion).
On success the new food's id is returned as mfp_id; pass it to
mfp_add_food_to_diary to log the food (it may take a short moment to also
surface in mfp_search_food). Calling this repeatedly creates duplicate foods.
IMPORTANT: share_public=True submits the food to MyFitnessPal's shared public database and is IRREVERSIBLE -- public foods can no longer be edited or deleted. Leave it False (default) to create a private food you can later delete.
Args: params: CreateFoodInput containing: - description (str): Food name (required) - brand (str, optional): Brand/manufacturer - calories, fat, carbs, protein (float): Core macros per serving (required) - saturated_fat, polyunsaturated_fat, monounsaturated_fat, trans_fat, fiber, sugar, sodium, potassium, cholesterol, vitamin_a, vitamin_c, calcium, iron (float, optional): Additional nutrients per serving - serving_size (str): Serving-size label, e.g. '1 Serving', '125 g' (default '1 Serving') - servings_per_container (float): Servings per container (default 1.0) - share_public (bool): Submit to the public database; irreversible (default False)
Returns: str: JSON confirmation including the new food's mfp_id
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |