Skip to main content
Glama

lookup_barcode

Read-only

Look up a packaged food by its UPC/EAN barcode in Open Food Facts. Returns macros per 100 g, a source label ('Open Food Facts'), and, when known, serving_grams/serving_label for one household serving. 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
upcYesUPC/EAN barcode, digits only (8–14 digits).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
candidatesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / candidates / items / properties / provenance / description
      Previous value: -"Chain-menu citation: the chain, its data date, its published page, the assumed build and a caveat."New value: +"Citation: the chain or a product label's brand, its data date, its published page, the assumed build and a caveat."
  2. Changed7 schema fields changed
    • addedOutput schema / properties / candidates / items / properties / provenance
      Added value: +{
      +  "description": "Chain-menu citation: the chain, its data date, its published page, the assumed build and a caveat.",
      +  "properties": {
      +    "as_of": {
      +      "description": "A local date, YYYY-MM-DD.",
      +      "type": "string"
      +    },
      +    "assumed_build": {
      +      "type": "string"
      +    },
      +    "caveat": {
      +      "type": "string"
      +    },
      +    "chain": {
      +      "type": "string"
      +    },
      +    "source_url": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "chain",
      +    "as_of"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / candidates / items / properties / serving / description
      Added value: +"The basis the macros are for, e.g. '100 g'."
    • addedOutput schema / properties / candidates / items / properties / serving_approx
      Added value: +{
      +  "description": "serving_grams is estimated from a drink's volume.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / candidates / items / properties / source / description
      Added value: +"Where the figures came from, as a label."
    • addedOutput schema / properties / candidates / items / properties / source / enum
      Added value: +[
      +  "USDA",
      +  "Open Food Facts",
      +  "Forkmate",
      +  "your entry",
      +  "estimate"
      +]
    • addedOutput schema / properties / candidates / 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"
      +}
    • changedOutput schema / properties / candidates / items / required
      Previous value: -[
      -  "name",
      -  "macros",
      -  "source"
      -]New value: +[
      +  "name",
      +  "serving",
      +  "macros",
      +  "source"
      +]
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "candidates": {
      +      "items": {
      +        "description": "A food match. Macros are PER 100 g — scale to the portion before logging.",
      +        "properties": {
      +          "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": [
      +              "kcal",
      +              "protein_g",
      +              "carb_g",
      +              "fat_g"
      +            ],
      +            "type": "object"
      +          },
      +          "name": {
      +            "type": "string"
      +          },
      +          "serving": {
      +            "type": "string"
      +          },
      +          "serving_grams": {
      +            "type": "number"
      +          },
      +          "serving_label": {
      +            "type": "string"
      +          },
      +          "source": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "name",
      +          "macros",
      +          "source"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "candidates"
      +  ],
      +  "type": "object"
      +}
  4. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.