Skip to main content
Glama

Food: nutrition, ingredients and recalls

check_food
Read-only

Returns nutrition for a food from its barcode (UPC/EAN, via Open Food Facts) or its name (USDA FoodData Central): calories, protein, fat, saturated fat, carbs, sugars, fiber and sodium per 100 g or 100 ml, per serving and for gram amounts when the source uses grams, with % Daily Value from the FDA's reference values. Volume-based foods are not converted to grams without a density. Barcodes also return ingredients, allergens and Nutri-Score. When a brand is known, FDA recall reports matching it are included. A list of items (name or barcode with grams or servings, or menu items with per-serving numbers) plus optional daily targets returns the sum, % Daily Value and what remains of each target. Applies to food nutrition, ingredients or meal totals. A recall-only question is outside this result. Results are nutrition numbers and are not a statement that a food is healthy or safe. Not medical or diet advice. Medicines and cosmetics are outside this result.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "check_food"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsNoMeal items. The result is their sum.
queryNoFood name, with brand when known, e.g. 'Chobani plain Greek yogurt' or 'banana'
fdc_idNoA USDA FoodData Central id from an earlier result's alternatives
barcodeNoUPC or EAN printed under the bars, 8 to 14 digits
targetsNoThe person's own daily or meal targets, for what's left
amount_gNoAmount eaten in grams, to scale the values
amount_mlNoAmount of a drink in millilitres, when the source reports per 100 ml

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / amount_ml
      Added value: +{
      +  "description": "Amount of a drink in millilitres, when the source reports per 100 ml",
      +  "exclusiveMinimum": 0,
      +  "maximum": 5000,
      +  "type": "number"
      +}
    • addedInput schema / properties / items / items / properties / amount_ml
      Added value: +{
      +  "description": "Millilitres, when the source reports per 100 ml",
      +  "exclusiveMinimum": 0,
      +  "maximum": 5000,
      +  "type": "number"
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / items / description
      Previous value: -"For a meal: each food or menu item; divux adds them up"New value: +"Meal items. The result is their sum."
    • changedInput schema / properties / items / items / properties / nutrients / description
      Previous value: -"Per-serving numbers you read on a restaurant's or brand's own nutrition page, instead of a lookup"New value: +"Per-serving numbers from a restaurant or brand nutrition page, in place of a lookup"
  3. Changed2 schema fields changed
    • addedInput schema / properties / items
      Added value: +{
      +  "description": "For a meal: each food or menu item; divux adds them up",
      +  "items": {
      +    "properties": {
      +      "amount_g": {
      +        "exclusiveMinimum": 0,
      +        "maximum": 5000,
      +        "type": "number"
      +      },
      +      "barcode": {
      +        "maxLength": 20,
      +        "type": "string"
      +      },
      +      "fdc_id": {
      +        "exclusiveMinimum": 0,
      +        "maximum": 9007199254740991,
      +        "type": "integer"
      +      },
      +      "name": {
      +        "description": "Item name, e.g. 'Chipotle chicken burrito bowl'",
      +        "maxLength": 100,
      +        "type": "string"
      +      },
      +      "nutrients": {
      +        "description": "Per-serving numbers you read on a restaurant's or brand's own nutrition page, instead of a lookup",
      +        "properties": {
      +          "added_sugars_g": {
      +            "maximum": 2000,
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          "carbs_g": {
      +            "maximum": 2000,
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          "fat_g": {
      +            "maximum": 1000,
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          "fiber_g": {
      +            "maximum": 500,
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          "kcal": {
      +            "maximum": 10000,
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          "protein_g": {
      +            "maximum": 1000,
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          "sat_fat_g": {
      +            "maximum": 1000,
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          "sodium_mg": {
      +            "maximum": 50000,
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          "sugars_g": {
      +            "maximum": 2000,
      +            "minimum": 0,
      +            "type": "number"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "query": {
      +        "description": "Food name to look up, with brand when known",
      +        "maxLength": 100,
      +        "type": "string"
      +      },
      +      "servings": {
      +        "description": "How many servings; default 1",
      +        "exclusiveMinimum": 0,
      +        "maximum": 20,
      +        "type": "number"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "maxItems": 12,
      +  "type": "array"
      +}
    • addedInput schema / properties / targets
      Added value: +{
      +  "description": "The person's own daily or meal targets, for what's left",
      +  "properties": {
      +    "carbs_g": {
      +      "exclusiveMinimum": 0,
      +      "maximum": 2000,
      +      "type": "number"
      +    },
      +    "fat_g": {
      +      "exclusiveMinimum": 0,
      +      "maximum": 1000,
      +      "type": "number"
      +    },
      +    "fiber_g": {
      +      "exclusiveMinimum": 0,
      +      "maximum": 500,
      +      "type": "number"
      +    },
      +    "kcal": {
      +      "exclusiveMinimum": 0,
      +      "maximum": 10000,
      +      "type": "number"
      +    },
      +    "protein_g": {
      +      "exclusiveMinimum": 0,
      +      "maximum": 1000,
      +      "type": "number"
      +    },
      +    "sodium_mg": {
      +      "exclusiveMinimum": 0,
      +      "maximum": 50000,
      +      "type": "number"
      +    },
      +    "sugars_g": {
      +      "exclusiveMinimum": 0,
      +      "maximum": 2000,
      +      "type": "number"
      +    }
      +  },
      +  "type": "object"
      +}
  4. Added

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly, non-destructive and openWorld, so the safety profile is covered; the description nonetheless adds real behavior: upstream data sources, that volume-based foods are not converted without a density, that %DV comes from FDA reference values, and that results are not a health or safety statement. It does not discuss failure modes such as a barcode missing from Open Food Facts, which keeps it below a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the two lookup paths and their unit conventions, then the meal-sum behavior, then scope and disclaimers in descending priority. It is a single dense block and the two closing disclaimer sentences partially overlap, costing a little efficiency, but no sentence is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With seven parameters, nested item objects and no output schema, the description carries the return-shape burden itself and does so: it enumerates the returned nutrients, %DV, ingredients, allergens, Nutri-Score and recall inclusion, plus the summed totals and remainders. Nothing an agent needs to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds meaning the schema does not: items may be per-serving restaurant numbers or lookups with grams/servings, targets produce a remainder per nutrient, and the result is the sum across items. That clarifies how items, targets and partial-day arithmetic interact, which the schema alone does not convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States the specific verb and resource (nutrition numbers for a food) plus every lookup path: barcode via Open Food Facts, name via USDA FoodData Central, and multi-item meal totals. It also distinguishes itself from recall-only, medicine and cosmetic questions, so an agent can route correctly without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit inclusion rule ('Applies to food nutrition, ingredients or meal totals') and explicit exclusions ('A recall-only question is outside this result', 'Medicines and cosmetics are outside this result'), which map onto check_recalls, check_medicine and check_cosmetic. The conditions that select this tool versus those are stated, not inferred.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources