Save food
save_foodSave an ingredient or packaged product to the user's food library, or update a saved one (by id, or the same name and brand). Values are per 100 g or per serving. Returns the saved values per 100 g and per serving.
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>",
"calories": "<calories>"
},
"name": "save_food"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | A saved food's id, to update it | |
| per | No | Whether the values below are per 100 g or per serving (serving_g needed) | 100g |
| name | Yes | e.g. 'Kesar Badam Protein' | |
| type | No | product: packaged or branded; ingredient: raw or generic (rice, chicken breast). Default: product when a brand is given | |
| brand | No | e.g. 'SuperYou' | |
| fat_g | No | ||
| notes | No | ||
| micros | No | Per 100 g or per serving like the rest. On an update, replaces the saved micros when passed | |
| pack_g | No | Net weight of the pack now open (tub, loaf, jar), to count what is left of it; same as open_pack | |
| source | No | label: read from the pack's nutrition label; database: a food-composition table; estimate: your own estimate | |
| carbs_g | No | ||
| fibre_g | No | ||
| calories | Yes | New food: required. Update: every value left out keeps what is saved | |
| protein_g | No | ||
| serving_g | No | Weight of one serving in grams, e.g. 36 for one scoop | |
| serving_label | No | e.g. '1 scoop', '1 slice' | |
| pack_opened_on | No | With pack_g: the day it was opened. Default today |