foodos-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| FDC_API_KEY | Yes | Required for anything that reads USDA data. No default key ships in this repository. | |
| FOODOS_CONTACT | No | Contact address sent in the User-Agent, as Open Food Facts asks. | repository URL |
| FOODOS_CACHE_DIR | No | Where cached lookups live. | platform cache directory |
| FOODOS_LOG_LEVEL | No | Debug, info, warn, error or silent. Always goes to stderr, because stdout carries the protocol. | info |
| FDC_HOURLY_BUDGET | No | Requests an hour before the server refuses to make more. Set to change the ceiling. | 800 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| parseRecipeA | Read a recipe from a web page. Returns its title, ingredient lines as written, declared servings and instructions, taken from the schema.org data the page publishes for machines. Fails clearly when a page has no structured data rather than guessing at the markup. |
| parseIngredientLineA | Split one ingredient line into quantity, unit, ingredient and preparation note. Reports what is ambiguous instead of resolving it: '1 medium onion' comes back flagged as a size descriptor, never as a weight in grams. |
| searchFoodA | Search USDA FoodData Central for a food. Prefer Foundation and SR Legacy results for whole ingredients: they are laboratory-analysed and carry portion weights. Use Branded only for packaged products. Show the user the candidates and let them choose; do not pick silently. |
| getFoodMacrosA | Per-100 g macros for one USDA food id, with its portion weights. Also reports which energy nutrient was used, since Foundation foods report Atwater factors rather than a plain energy value. |
| lookupBarcodeA | Per-100 g macros for a packaged product from Open Food Facts. Community-contributed label transcriptions, so confidence is medium rather than high. |
| toGramsA | Convert an amount to grams. Mass units are exact. A volume or a count needs either the food's own USDA portion weights, which you get by passing fdcId, or a sourced density row. When neither is available the answer is unresolved with candidates attached, because a cup of flour and a cup of honey do not weigh the same. |
| computeBatchMacrosA | Total the macros of a whole batch from its ingredients. Each ingredient needs a nutrition source and a weight. Any ingredient missing either is returned in unresolved with candidate matches and is never dropped or approximated: the totals then carry isComplete false and are a partial sum. |
| setCookedYieldA | Convert batch totals into per-100 g cooked values. Pass the measured cooked weight when you have it. Failing that, pass a yield factor you measured yourself, or a yieldHint to look one up in the bundled USDA tables. A hint matching several rows returns unresolved with candidates rather than choosing one. Note that rice and dried legumes gain weight: their yield factors are above 1. |
| portionBatchA | Split a cooked batch into portions that are sized per eater rather than divided equally. Each portion carries its own rule: solve for what an eater still needs today, take a fixed weight, hit a macro target, take the remainder, or set food aside for later. Returns each portion's weight and macros, which constraint decided the weight, and where the other targets landed. Asking for more than the batch holds is an error, never a silent scale-down. Weights are rounded to the gram for reporting, so adding up the portions can differ from the batch by a gram; allocatedG and leftoverG carry the exact figures. |
| planBatchSizeA | Work out how much to cook, from an explicit list of who is eating and how much each takes. Size slots by weight or by macros where you can. Sizing a slot as a count of the recipe's declared servings always warns, because 'serves 4' is the author's claim about their own portions and not a measurement of a household meal. Returns the arithmetic so it can be checked. |
| scaleRecipeA | Scale a raw ingredient list. Scaling to a macro target needs the recipe's current totals, from computeBatchMacros: this server does not infer what a recipe contains. Amounts in discrete units such as eggs are reported when they land on a fraction, never rounded here. |
| shoppingListA | Aggregate raw quantities across recipes, grouped by USDA food category, with what you have on hand subtracted. Two ingredients merge only when they resolve to the same food. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| portionABatch | Walk through a whole batch: read the recipe, resolve every ingredient, weigh the cooked result, then split it into portions sized per eater. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| yield-factors | Every cooking yield this server can apply, with the citation for each row. Inspect it to see exactly what a yield estimate was based on. |
| densities | Every density this server can use to turn a volume into a weight, each citing the USDA food and portion it came from. |
| rate-limit-status | How much of the hourly FoodData Central budget is left, when it frees up, and how the cache is doing. Check this before starting a batch with many unresolved ingredients. |
TDQS
Scored across 12 tools
Most tools target distinct pipeline stages—food lookup, parsing, conversion, batch math, portioning, scaling, and shopping—so an agent can generally select by input and output. The only mild ambiguities are getFoodMacros vs lookupBarcode (both expose per-100g macros) and planBatchSize vs portionBatch (both reason about eaters), but the descriptions state the identifier/source and pre-cook/post-cook differences clearly.
All tool names use camelCase and most follow a clear verb+object convention: parseRecipe, searchFood, computeBatchMacros, scaleRecipe. shoppingList is a bare noun and toGrams uses a preposition rather than a verb, so the pattern is consistent in style but not perfectly uniform.
Twelve tools is an appropriate, well-scoped size for a food/macro meal-planning server. Each tool covers one distinct operation with no redundant clusters, and the set is large enough to span a full workflow without feeling bloated.
The server covers the complete recipe-to-shopping lifecycle: finding foods, parsing recipe and ingredient input, converting to grams, computing batch macros, accounting for cooked yield, portioning, scaling, and aggregating a shopping list. Dependent tools explicitly reference the outputs they need, and unresolved results return candidates instead of dead-ending.