Create Product
create_productCreate custom food products from per-100 g/ml label values and return a product_id for logging consumed items; search first to avoid duplicates.
Instructions
Create a custom product (e.g. a restaurant dish or a brand missing in search) from label values per 100 g/ml. Returns its product_id for add_user_consumed_item. Search first: creating duplicates clutters the database.
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": {
"name": "<name>",
"category": "<category>",
"energy_per_100": "<energy_per_100>",
"protein_per_100": "<protein_per_100>",
"fat_per_100": "<fat_per_100>",
"carb_per_100": "<carb_per_100>"
},
"name": "create_product"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Product name as it will show in search and the diary | |
| category | Yes | Product category | |
| producer | No | Brand / producer / restaurant | |
| servings | No | Named servings, e.g. [{"serving": "slice", "amount": 25}] | |
| base_unit | No | Base unit: grams (g) or milliliters (ml) | g |
| is_private | No | Private products are visible only to this user | |
| fat_per_100 | Yes | Fat in g per 100 g/ml | |
| carb_per_100 | Yes | Carbohydrates in g per 100 g/ml | |
| energy_per_100 | Yes | Energy in kcal per 100 g (or 100 ml), as on the label | |
| protein_per_100 | Yes | Protein in g per 100 g/ml | |
| extra_nutrients_per_100 | No | Other nutrients by Yazio key, e.g. {"nutrient.sugar": 5, "nutrient.dietaryfiber": 2, "nutrient.saturated": 1.5, "nutrient.salt": 0.8}; same scale as the main values |