Skip to main content
Glama

log_meal

Add a meal to the user's food diary: one or more food items, each with an optional quantity and macros, plus an optional meal label, date, note and provenance source. The reply names the new entry's id and local_date, which identify it for a later edit or deletion. A restaurant meal's numbers depend most on the restaurant, the specific menu item, its size and its add-ons (cheese, fries, sauce, dressing); a bare dish name is logged as a typical serving. When the user names one of their saved recipes ("my chicken and rice", "half my chili"), send their words as one item's name, with any amount in quantity; Forkmate logs the recipe's own foods and numbers in its place. All calorie and macro values, including carbohydrates, are estimates from USDA FoodData Central, Open Food Facts, the user's own entry or an AI assistant's estimate — approximate, not lab-measured or specific to a package or batch, and not suitable for insulin dosing (including carb counting for a meal bolus), blood-glucose prediction or any other medical decision.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
atNoISO-8601 instant the meal was eaten; defaults to now.
mealNoWhich meal of the day this was.
noteNoOptional free-text note stored with the meal, e.g. 'post-run'.
saidNoOptional. The user's own words describing this meal, verbatim (e.g. 'a pint of IPA and wings at the bar'). Only the meal description — not other parts of the conversation.
itemsYesThe foods in this meal, one entry per food.
sourceNoOptional provenance for these items: the `source` label of the food-database candidate they came from ('USDA', 'Open Food Facts', 'Forkmate' or 'product label'), or 'estimate'. Defaults to 'estimate'; unrecognized values are recorded as an estimate.
local_dateNoYYYY-MM-DD diary date; defaults to the user's local date (from their timezone).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
entryYesOne diary entry: a meal with its foods.
day_totalsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / said
      Added value: +{
      +  "description": "Optional. The user's own words describing this meal, verbatim (e.g. 'a pint of IPA and wings at the bar'). Only the meal description — not other parts of the conversation.",
      +  "maxLength": 300,
      +  "type": "string"
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / source / description
      Previous value: -"Optional provenance for these items: the `source` label of the food-database candidate they came from ('USDA', 'Open Food Facts' or 'Forkmate'), or 'estimate'. Defaults to 'estimate'; unrecognized values are recorded as an estimate."New value: +"Optional provenance for these items: the `source` label of the food-database candidate they came from ('USDA', 'Open Food Facts', 'Forkmate' or 'product label'), or 'estimate'. Defaults to 'estimate'; unrecognized values are recorded as an estimate."
    • changedInput schema / properties / source / enum
      Previous value: -[
      -  "USDA",
      -  "Open Food Facts",
      -  "Forkmate",
      -  "estimate"
      -]New value: +[
      +  "USDA",
      +  "Open Food Facts",
      +  "Forkmate",
      +  "product label",
      +  "estimate"
      +]
  3. Changed6 schema fields changed
    • changedInput schema / properties / source / description
      Previous value: -"Optional provenance for these items, e.g. 'usda' or 'off' for a food-database result. Defaults to 'client' (an estimate); unrecognized values are recorded as 'client'."New value: +"Optional provenance for these items: the `source` label of the food-database candidate they came from ('USDA', 'Open Food Facts' or 'Forkmate'), or 'estimate'. Defaults to 'estimate'; unrecognized values are recorded as an estimate."
    • changedInput schema / properties / source / enum
      Previous value: -[
      -  "client",
      -  "usda",
      -  "off",
      -  "usda-index",
      -  "mfp-import",
      -  "manual",
      -  "chain-menu"
      -]New value: +[
      +  "USDA",
      +  "Open Food Facts",
      +  "Forkmate",
      +  "estimate"
      +]
    • removedOutput schema / properties / entry / properties / created_at
      Removed value: -{
      -  "type": "string"
      -}
    • addedOutput schema / properties / entry / properties / id / description
      Added value: +"Identifies the entry for a later edit or deletion."
    • removedOutput schema / properties / entry / properties / items / items / properties / source
      Removed value: -{
      -  "description": "Where the macros came from (e.g. usda, off, client).",
      -  "type": "string"
      -}
    • addedOutput schema / properties / entry / properties / items / items / properties / unknown_macros
      Added value: +{
      +  "description": "Macros missing from the source data: shown as 0 but unknown, not a real zero.",
      +  "items": {
      +    "enum": [
      +      "protein_g",
      +      "carb_g",
      +      "fat_g"
      +    ],
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "day_totals": {
      +      "properties": {
      +        "caffeine_mg": {
      +          "type": "number"
      +        },
      +        "entry_count": {
      +          "type": "integer"
      +        },
      +        "fluid_ml": {
      +          "type": "number"
      +        },
      +        "local_date": {
      +          "description": "A local date, YYYY-MM-DD.",
      +          "type": "string"
      +        },
      +        "totals": {
      +          "description": "Calories and macros. Estimates, not lab-measured; not for insulin dosing.",
      +          "properties": {
      +            "carb_g": {
      +              "type": "number"
      +            },
      +            "fat_g": {
      +              "type": "number"
      +            },
      +            "kcal": {
      +              "type": "number"
      +            },
      +            "protein_g": {
      +              "type": "number"
      +            }
      +          },
      +          "required": [
      +            "kcal",
      +            "protein_g",
      +            "carb_g",
      +            "fat_g"
      +          ],
      +          "type": "object"
      +        }
      +      },
      +      "required": [
      +        "local_date",
      +        "entry_count",
      +        "totals"
      +      ],
      +      "type": "object"
      +    },
      +    "entry": {
      +      "description": "One diary entry: a meal with its foods.",
      +      "properties": {
      +        "at": {
      +          "description": "ISO-8601 UTC instant the food was eaten.",
      +          "type": "string"
      +        },
      +        "created_at": {
      +          "type": "string"
      +        },
      +        "id": {
      +          "type": "string"
      +        },
      +        "items": {
      +          "items": {
      +            "properties": {
      +              "caffeine_mg": {
      +                "type": "number"
      +              },
      +              "fluid_ml": {
      +                "type": "number"
      +              },
      +              "macros": {
      +                "description": "Calories and macros. Estimates, not lab-measured; not for insulin dosing.",
      +                "properties": {
      +                  "carb_g": {
      +                    "type": "number"
      +                  },
      +                  "fat_g": {
      +                    "type": "number"
      +                  },
      +                  "kcal": {
      +                    "type": "number"
      +                  },
      +                  "protein_g": {
      +                    "type": "number"
      +                  }
      +                },
      +                "required": [],
      +                "type": "object"
      +              },
      +              "name": {
      +                "type": "string"
      +              },
      +              "quantity": {
      +                "type": "string"
      +              },
      +              "source": {
      +                "description": "Where the macros came from (e.g. usda, off, client).",
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "name"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "local_date": {
      +          "description": "A local date, YYYY-MM-DD.",
      +          "type": "string"
      +        },
      +        "meal": {
      +          "description": "breakfast, lunch, dinner or snack, when set.",
      +          "type": "string"
      +        },
      +        "note": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "id",
      +        "at",
      +        "local_date",
      +        "items"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "entry",
      +    "day_totals"
      +  ],
      +  "type": "object"
      +}
  5. Changed10 schema fields changed
    • addedInput schema / properties / items / description
      Added value: +"The foods in this meal, one entry per food."
    • addedInput schema / properties / items / items / properties / barcode / description
      Added value: +"The package's UPC/EAN barcode, when the food came from a barcode lookup."
    • addedInput schema / properties / items / items / properties / macros / description
      Added value: +"Estimated nutrition for the portion eaten. Omitted fields are looked up from the food databases."
    • addedInput schema / properties / items / items / properties / macros / properties / carb_g / description
      Added value: +"Total carbohydrate for the whole portion eaten, in grams."
    • addedInput schema / properties / items / items / properties / macros / properties / fat_g / description
      Added value: +"Total fat for the whole portion eaten, in grams."
    • addedInput schema / properties / items / items / properties / macros / properties / kcal / description
      Added value: +"Energy for the whole portion eaten, in kilocalories (not per 100 g)."
    • addedInput schema / properties / items / items / properties / macros / properties / protein_g / description
      Added value: +"Protein for the whole portion eaten, in grams."
    • addedInput schema / properties / items / items / properties / name / description
      Added value: +"What the food is, e.g. 'scrambled eggs' or 'Greek yogurt, plain'."
    • addedInput schema / properties / meal / description
      Added value: +"Which meal of the day this was."
    • addedInput schema / properties / note / description
      Added value: +"Optional free-text note stored with the meal, e.g. 'post-run'."
  6. Changed5 schema fields changed
    • changedInput schema / properties / items / items / properties / caffeine_mg / description
      Previous value: -"Optional caffeine content of this item, in milligrams (e.g. ~95 for a mug of brewed coffee). Include it for caffeinated drinks/foods when known; omit if unknown."New value: +"Optional caffeine content of this item, in milligrams (e.g. ~95 for a mug of brewed coffee)."
    • changedInput schema / properties / items / items / properties / fluid_ml / description
      Previous value: -"Optional fluid/hydration volume of this item, in millilitres (e.g. 240 for an 8 oz cup). Include it for drinks when known; omit if unknown."New value: +"Optional fluid/hydration volume of this item, in millilitres (e.g. 240 for an 8 oz cup)."
    • changedInput schema / properties / items / items / properties / quantity / description
      Previous value: -"Portion as the user stated it, e.g. '3' or '1 cup'. When logging a search_foods/lookup_barcode candidate you scaled by its serving, write it as 'N × <serving_label> (<total_g> g)' to match the web app's diary — e.g. a candidate with serving_grams 48 and serving_label '1 frank', eaten ×2, becomes macros = the per-100 g figures × 0.96 (96 g total), quantity '2 × 1 frank (96 g)', and `source` set to that candidate's source. This field is a DISPLAY LABEL ONLY — you must still send the already-scaled macros; the server never re-scales them."New value: +"Portion as a display label, e.g. '3', '1 cup' or '2 × 1 frank (96 g)'. Display only: the server stores macros exactly as sent and does not re-scale them."
    • changedInput schema / properties / local_date / description
      Previous value: -"YYYY-MM-DD diary date; defaults to the user's local date (from their timezone). Pass this to log a meal on a different day."New value: +"YYYY-MM-DD diary date; defaults to the user's local date (from their timezone)."
    • changedInput schema / properties / source / description
      Previous value: -"Optional provenance for these items. After search_foods/lookup_barcode, pass the candidate's source class (e.g. 'usda' or 'off') so the diary shows it's grounded. Defaults to 'client' (your own estimate). Unrecognized values are recorded as 'client'."New value: +"Optional provenance for these items, e.g. 'usda' or 'off' for a food-database result. Defaults to 'client' (an estimate); unrecognized values are recorded as 'client'."
  7. Changed1 schema field changed
    • changedInput schema / properties / source / enum
      Previous value: -[
      -  "client",
      -  "usda",
      -  "off",
      -  "usda-index",
      -  "mfp-import",
      -  "manual"
      -]New value: +[
      +  "client",
      +  "usda",
      +  "off",
      +  "usda-index",
      +  "mfp-import",
      +  "manual",
      +  "chain-menu"
      +]
  8. Changed1 schema field changed
    • changedInput schema / properties / items / items / properties / quantity / description
      Previous value: -"Portion as stated, e.g. '3' or '1 cup'."New value: +"Portion as the user stated it, e.g. '3' or '1 cup'. When logging a search_foods/lookup_barcode candidate you scaled by its serving, write it as 'N × <serving_label> (<total_g> g)' to match the web app's diary — e.g. a candidate with serving_grams 48 and serving_label '1 frank', eaten ×2, becomes macros = the per-100 g figures × 0.96 (96 g total), quantity '2 × 1 frank (96 g)', and `source` set to that candidate's source. This field is a DISPLAY LABEL ONLY — you must still send the already-scaled macros; the server never re-scales them."
  9. Changed2 schema fields changed
    • addedInput schema / properties / items / items / properties / caffeine_mg
      Added value: +{
      +  "description": "Optional caffeine content of this item, in milligrams (e.g. ~95 for a mug of brewed coffee). Include it for caffeinated drinks/foods when known; omit if unknown.",
      +  "type": "number"
      +}
    • addedInput schema / properties / items / items / properties / fluid_ml
      Added value: +{
      +  "description": "Optional fluid/hydration volume of this item, in millilitres (e.g. 240 for an 8 oz cup). Include it for drinks when known; omit if unknown.",
      +  "type": "number"
      +}
  10. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.