Custom Foods reference

Create, update and delete the user's own foods, with macros per 100 g or 100 ml.

The DailyGoal API is not available on the Free plan. It works with a paid plan or during a free trial. See plans.

Operations

save_custom_food

POST https://api.dailygoal.fit/v1/custom-foods

MCP tool save_custom_food · Changes data · Destructive · Accepts Idempotency-Key

Create a custom food, or update one by passing its id. Replaces every field, with macros in grams per 100 g (or 100 ml) and one serving's size. Use it for foods search_foods cannot find. It records nothing eaten: call log_food_entry with the returned id to log the food.

Input

FieldTypeDescription
idoptionalstringThe custom food to update, from a previous save_custom_food or search_foods. Omit it to create a new custom food.
namestringFood name, for example 'Greek yoghurt 2%'.
brandNameoptionalstringBrand, if any. Blank or omitted means no brand.
proteinnumberProtein in grams per 100 g, or per 100 ml when servingSizeUnit is ml.
carbsnumberCarbohydrate in grams per 100 g or 100 ml.
fatnumberFat in grams per 100 g or 100 ml.
alcoholoptionalnumberAlcohol in grams per 100 g or 100 ml. Defaults to 0.
servingSizenumberSize of one serving, in servingSizeUnit, for example 150.
servingSizeUnit"g" | "ml"Unit of servingSize and of the per-100 macro values.
servingSizeTextoptionalstringLabel for one serving, for example '1 pot'. Blank or omitted means '1 serving'.
idempotency_keyoptionalstringOptional. A unique value for this create, for example a UUID. Retrying with the same key and arguments within 24 hours returns the first result instead of creating a duplicate.

Output

FieldTypeDescription
createdbooleanTrue when this call created the custom food, false when it updated one.
customFoodobject
customFood.idstringCustom food id. Pass it to log_food_entry as the custom food id.
customFood.namestring
customFood.brandNameoptionalstring
customFood.proteinnumberGrams per 100 g or 100 ml.
customFood.carbsnumberGrams per 100 g or 100 ml.
customFood.fatnumberGrams per 100 g or 100 ml.
customFood.alcoholnumberGrams per 100 g or 100 ml.
customFood.caloriesnumberKilocalories per 100 g or 100 ml, calculated from the macros.
customFood.servingSizenumber
customFood.servingSizeUnitstringg or ml. Foods created by the in-app assistant can also use count units such as item.
customFood.servingSizeTextstring

Example request

REST
curl -X POST "https://api.dailygoal.fit/v1/custom-foods" \
  -H "Authorization: Bearer $DAILYGOAL_API_TOKEN" \
  -H "Idempotency-Key: 3f1c9a52-7d4e-4b8a-9e21-5c6d7e8f9a01" \
  -H "Content-Type: application/json" \
  -d '{"name":"Greek yoghurt 2%","protein":9.9,"carbs":3.9,"fat":2,"servingSize":150,"servingSizeUnit":"g","servingSizeText":"1 pot"}'
MCP tools/call
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "save_custom_food",
    "arguments": {
      "name": "Greek yoghurt 2%",
      "protein": 9.9,
      "carbs": 3.9,
      "fat": 2,
      "servingSize": 150,
      "servingSizeUnit": "g",
      "servingSizeText": "1 pot"
    }
  }
}

Example response

Synthetic data. REST returns this object as the body; MCP returns it as structuredContent.

json
{
  "created": true,
  "customFood": {
    "id": "j572k9d3m6q8x1v4n7r0t2w5b8y3h6ca",
    "name": "Greek yoghurt 2%",
    "protein": 9.9,
    "carbs": 3.9,
    "fat": 2,
    "alcohol": 0,
    "calories": 73.2,
    "servingSize": 150,
    "servingSizeUnit": "g",
    "servingSizeText": "1 pot"
  }
}

Errors

delete_custom_food

DELETE https://api.dailygoal.fit/v1/custom-foods

MCP tool delete_custom_food · Changes data · Destructive

Delete one of the user's custom foods from their library. It fails with conflict while diary entries or saved meals still use the food. To remove something the user logged, use delete_food_entry instead.

Input

FieldTypeDescription
idstringThe custom food to delete: an id from search_foods with kind custom_food, or from save_custom_food.

Output

FieldTypeDescription
idstring
deletedtrue

Example request

REST
curl -X DELETE "https://api.dailygoal.fit/v1/custom-foods?id=j572k9d3m6q8x1v4n7r0t2w5b8y3h6ca" \
  -H "Authorization: Bearer $DAILYGOAL_API_TOKEN"
MCP tools/call
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "delete_custom_food",
    "arguments": {
      "id": "j572k9d3m6q8x1v4n7r0t2w5b8y3h6ca"
    }
  }
}

Example response

Synthetic data. REST returns this object as the body; MCP returns it as structuredContent.

json
{
  "id": "j572k9d3m6q8x1v4n7r0t2w5b8y3h6ca",
  "deleted": true
}

Errors