usda-mcp
The server provides USDA-accurate nutrition data and deterministic macro calculations for meal planning. It operates offline with no API keys.
Search and browse foods: Use
list_foodsto browse or filter by category (proteins, carbs, fats, vegetables), tags (e.g., "lean", "whole_food"), or dietary exclusions (e.g., vegan, gluten). Useget_foodto look up a specific food by name with case-insensitive and partial-name matching, retrieving full nutritional details.Calculate exact macros: Use
calculate_macrosto get precise protein, carbs, fat, and calories for a given amount of any food, with intelligent unit conversion (grams, ounces, tablespoons, cups).Filter by dietary restrictions: Use
filter_by_dietto get all foods compatible with a specific diet or allergy (e.g., vegan, vegetarian, dairy, shellfish). Only valid labels are accepted.Build meals hitting macro targets: Use
build_mealto generate meal combinations (one protein, one carb, one fat) that exactly meet target protein, carb, and fat amounts, using a deterministic linear solver. Supports dietary exclusions, optional vegetables, and tolerance settings.Discover valid filters: Use
list_available_tagsto get the real-time set of tags, dietary labels, categories, and units used in the database, ensuring accurate filtering.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@usda-mcpGive me a high-protein vegan dinner at 40g protein, 30g carb, 15g fat."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
usda-mcp
An MCP server that gives Claude a USDA-accurate food database and deterministic macro math — so it looks nutrition numbers up instead of recalling them, and calculates portions in Python instead of doing mental arithmetic.
Ask "build me a high-protein vegan dinner at 40g protein, 30g carb, 15g fat" and you get an answer whose numbers are exactly right, because a linear solver produced them.
You: high protein vegan dinner, 40g protein / 30g carb / 15g fat
Claude: 147 g Beans (Dry) ....... 37.5g pro, 0g carb, 1.5g fat
5 oz Sweet Potato ...... 2.5g pro, 30g carb, 0g fat
0.96 tbsp Olive Oil .... 0g pro, 0g carb, 13.5g fat
-----------------------------------------------------------
Total .................. 40.0g pro, 30.0g carb, 15.0g fat — 415 kcalWhy this exists
LLMs are unreliable at two things this domain depends on: recalling specific nutrition values, and arithmetic. Ask a model for the macros in 6 oz of chicken breast and you get a plausible number that is often wrong by 15–20%.
This server removes both failure modes. It contains no AI logic at all — no model calls, no embeddings, no semantic search. It is a database and a pile of arithmetic. The calling model does the reasoning ("what counts as light?", "what goes with salmon?") and this server supplies every number.
Related MCP server: cronometer-mcp
Install
Requires uv (or any Python 3.10+ environment). Nothing else — no API key, no network access, no external services. It runs fully offline.
Add this to your Claude Desktop config:
macOS — ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"usda-mcp": {
"command": "uvx",
"args": ["usda-mcp"]
}
}
}Windows — %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"usda-mcp": {
"command": "uvx",
"args": ["usda-mcp"]
}
}
}Restart Claude Desktop. You should see six tools appear under the tools icon.
git clone https://github.com/Asquarer02/usda-mcp
cd usda-mcp
uv sync
uv run usda-mcp # serves MCP over stdioThen point the config at the checkout:
{
"mcpServers": {
"usda-mcp": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/usda-mcp", "run", "usda-mcp"]
}
}
}Tools
Tool | What it does |
| Browse or filter the database by category, descriptive tags, or dietary exclusions. |
| Look up one food by name, tolerant of casing and missing qualifiers. |
| Scale a food to a real portion, converting units where physically valid. |
| Every food compatible with one restriction ( |
| Solve for portions of one protein + one carb + one fat that hit macro targets. |
| The real filter vocabulary, so the model never guesses a label that doesn't exist. |
Example prompts
"What are the macros in 6 oz of chicken breast?"
"Give me a high-protein vegan dinner at 40g protein, 30g carb, 15g fat."
"Show me every lean protein that isn't fish or shellfish."
"I have 25g of protein left today and no carbs — what should I eat?"
"Build three different 500-calorie gluten-free lunches."
What the tools actually return
get_food("salmon") — loose name, resolved:
{
"name": "Salmon", "category": "proteins", "unit": "oz",
"pro": 6.5, "carb": 0, "fat": 3.5,
"tags": ["fatty_fish", "omega3"],
"exclude_for": ["vegetarian", "vegan", "fish", "seafood"],
"calories_per_unit": 57.5
}calculate_macros("Chicken Breast (Cooked)", 6, "oz") — the database stores this food per
gram, so the ounces are converted before scaling:
{
"food": "Chicken Breast (Cooked)",
"amount": 6.0, "unit": "oz",
"amount_in_native_units": 170.0971, "native_unit": "g",
"protein_g": 54.6, "carb_g": 0.0, "fat_g": 5.51, "calories": 268.0
}How it works
Calories are derived, never stored. The dataset holds only protein, carb and fat, and
calories come from the Atwater factors (4/4/9) in one function. There is no second source
of truth to drift.
build_meal is a solver, not a search. One protein, one carb and one fat with three
macro targets is a 3×3 linear system; it's solved by Cramer's rule for every combination in
the database — all 164,150 of them. The scan is cheap enough to run exhaustively on every
call, so there are no heuristics, sampling or early exits to reason about. Fits are
exact, not "within tolerance".
Exactness turns out to be the easy part. For a 40/30/15 target, 77,026 combinations hit it exactly, including useless ones like 0.02 tbsp of ghee. So solutions are filtered for realistic portion sizes and ranked by how normal the servings look. Ties break on database order, so the same request always returns the same meal.
Impossible requests are reported, not faked. Ask for 200g of protein with zero carbs and
zero fat and you get exact_match: false, the closest achievable combination, and the real
per-macro error — never a fabricated fit.
Bad input gets a usable error, never silence. Every failure explains itself:
{
"error": "unit_mismatch",
"message": "Cannot convert 'g' to 'tbsp': 'g' is a mass unit and 'tbsp' is a volume unit.
This database does not store densities, so mass and volume are not interchangeable.",
"food": "Extra Virgin Olive Oil",
"native_unit": "tbsp",
"hint": "Extra Virgin Olive Oil is stored per 'tbsp'. Retry with unit='tbsp', or with any
unit in the same measurement family."
}Grams to tablespoons needs a density this dataset doesn't carry, so the conversion is refused rather than guessed. A wrong answer here would silently corrupt every number downstream.
Similarly, filter_by_diet("keto") returns an error rather than the whole database:
keto isn't a label in the data, so filtering on it would remove nothing while looking
like it worked.
The data
236 hand-curated entries across proteins (67), carbs (70), fats (35) and vegetables (64),
with macros matching USDA FoodData Central values. Each entry carries descriptive tags
(lean, omega3, whole_food) and exclude_for dietary/allergen labels (vegan,
gluten, shellfish). 90 distinct tags and 38 exclusion labels are in use.
Macros are stored per the unit that's natural for each food — grams for meat, ounces for
fish, tablespoons for oils, large for eggs, container for yogurt cups. calculate_macros
handles the conversion; list_available_tags reports the real vocabulary.
The test suite guards the dataset itself: unique names, non-negative macros, consistent tag casing, and units the converter can classify.
Not medical or dietary advice. These are reference values for general meal planning. Real foods vary by brand, cut, and preparation. Consult a qualified professional for clinical or therapeutic dietary decisions.
Development
uv sync
uv run pytest # 346 tests
uv run ruff check .
uv run ruff format .The layout separates concerns so the logic is testable without an MCP client:
src/usda_mcp/
├── server.py # tool definitions and docstrings only
├── nutrition.py # calories, unit conversion, lookup, filtering
├── meal_builder.py # the deterministic solver
└── food_database.py # the data, and nothing elseTool docstrings are treated as a deliverable rather than decoration — they're the entire interface the calling model sees, so they state exact enum values, which units convert, and what every failure returns. A test enforces that they stay substantial.
Roadmap
Live USDA FoodData Central lookups — an optional
search_usdatool backed by the official API for foods outside the curated set, behind the same tool interface. Would require an API key and unit normalisation, so it's deliberately out of v1.Per-food micronutrients (fibre, sodium, saturated fat).
Multi-meal daily planning against a calorie budget.
Contributing
Issues and PRs welcome. Adding foods is the easiest contribution — append an entry to the
right category in src/usda_mcp/food_database.py with USDA-sourced macros per unit, and
tests/test_database.py will verify it.
See CONTRIBUTING.md for setup, the data format, and the design principles worth preserving.
License
MIT — see LICENSE.
Available Tools
6 toolsbuild_mealA
Build meals of one protein, one carb and one fat that hit macro targets exactly.
A deterministic solver, not a guess: it treats the three foods as a 3x3 linear system and solves for the portion of each, scanning every combination in the database. Results whose portions are exact but unrealistic are discarded, and the remainder ranked by how normal the serving sizes look.
Args: target_protein: Target grams of protein for the meal. target_carb: Target grams of carbohydrate. target_fat: Target grams of fat. exclude_tags: Dietary and allergen labels to avoid, matched against each food's "exclude_for", e.g. ["vegan"] or ["gluten", "dairy"]. Call list_available_tags for valid values. tolerance: Only consulted when NO exact fit exists, to decide whether the closest attempt counts as near enough. 0.15 means +/-15% per macro. include_vegetable: Add a low-calorie vegetable side. Its macros are subtracted from the targets before solving, so the totals still land on the targets exactly. max_results: How many ranked meals to return (default 3).
Returns: {"exact_match", "within_tolerance", "tolerance", "meals": [...], "targets", "candidates_evaluated", "message"}.
Each meal carries "items" (each with name, amount, unit and its own macros),
"totals", and "relative_error" per macro. When "exact_match" is true the
totals equal the targets and relative_error is zero.
When no combination fits, "exact_match" and "within_tolerance" are both false,
"meals" holds the single closest attempt, and "message" states how far off it
is. Report that shortfall to the user -- do NOT present it as a successful fit
or adjust the numbers to look closer.
Report the returned amounts and totals verbatim. They are already exact.
| Name | Required | Description | Default |
|---|---|---|---|
| tolerance | No | ||
| target_fat | Yes | ||
| max_results | No | ||
| target_carb | Yes | ||
| exclude_tags | No | ||
| target_protein | Yes | ||
| include_vegetable | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description fully discloses the tool's behavior. It explains the deterministic solver approach ('treats the three foods as a 3x3 linear system'), the filtering of unrealistic portions ('portions are exact but unrealistic are discarded'), ranking logic, and tolerance semantics. It also discloses the behavior when no exact fit exists, including the return of the closest attempt and an explicit instruction not to misrepresent results. This is thorough and goes beyond typical annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a one-line summary, an 'Args' section, a 'Returns' section, and a usage note. It is concise for the complexity involved, with every sentence contributing meaningful information. The front-loaded purpose sentence and clear headings make it easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (7 parameters, algorithm, edge cases), the description is exceptionally complete. It explains the solving approach, parameter behaviors, return schema, and handling of failures. The output schema exists, but the description still enriches it with guidance on reporting results verbatim and not modifying numbers. This is a comprehensive, self-contained description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, making the description's parameter explanations essential. The description defines each parameter with practical detail: target macros, exclude_tags (with example), tolerance (with interpretation), include_vegetable (explaining its effect on calculation), and max_results. This adds meaning far beyond the schema's bare titles.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Build meals of one protein, one carb and one fat that hit macro targets exactly.' It uses a specific verb ('build'), names the resource ('meals'), and specifies the unique constraint (exact macro targets). This distinguishes it from sibling tools like get_food or calculate_macros, which operate on individual foods or calculations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides strong usage context: it explains when the tool is appropriate (building meals to exact macro targets), references a sibling tool for valid values ('Call list_available_tags for valid values'), and instructs the agent on how to handle unsuccessful fits ('Report that shortfall to the user -- do NOT present it as a successful fit or adjust the numbers to look closer'). This gives explicit guidance on when and how to use the tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
calculate_macrosA
Calculate exact macros and calories for a specific portion of one food.
All arithmetic happens in Python. Do not compute these numbers yourself.
Args:
name: The food name. Resolved the same way as get_food.
amount: How much of the food, as a number, e.g. 150 or 2.5.
unit: The unit amount is expressed in, e.g. "g", "oz", "cup", "tbsp".
Case-insensitive and plural-tolerant ("grams" and "Gram" both work).
The unit is converted to the food's native unit when both belong to the
same family: mass (g, kg, oz, lb) or volume (ml, tsp, tbsp, fl_oz,
quarter_cup, cup). Conversion is REFUSED across families -- grams to
tablespoons needs a density this database does not store -- and refused
for countable units ("large", "slice", "container", "scoop", "half",
"cake", "medium"), which have no fixed mass.Returns: {"food", "amount", "unit", "protein_g", "carb_g", "fat_g", "calories", ...} with calories derived as protein4 + carb4 + fat*9.
On an unknown food: {"error": "food_not_found", "suggestions": [...]}.
On an impossible conversion: {"error": "unit_mismatch", "native_unit": ...}
naming the unit the food is actually stored in -- retry with that unit.
Negative amounts return {"error": "invalid_amount"}.
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| unit | Yes | ||
| amount | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It thoroughly explains internal behavior: arithmetic in Python, unit conversion rules and refusals (cross-family, countable units), calorie derivation formula, and exact error outputs (food_not_found, unit_mismatch, invalid_amount). The negative-amount behavior is also disclosed. This is exemplary transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long but tightly structured with Args and Returns sections. Every sentence earns its place: the arithmetic warning, parameter details, conversion rules, return structure, and error handling are all necessary for correct use. No fluff or redundancy. Front-loaded with the core purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a calculation tool with three parameters and no annotations, the description is fully complete. It covers all inputs, outputs (including sample response), edge cases (unknown food, impossible conversion, negative amounts), and the internal calorie formula. Even without an output schema shown, the example return structure provides clarity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must fully compensate. It does: name is defined as resolved like get_food, amount is described as a number with examples, and unit is extensively explained including case-insensitivity, plural tolerance, and conversion rules. Every parameter gets detailed semantics well beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb and resource: 'Calculate exact macros and calories for a specific portion of one food.' This clearly distinguishes it from siblings like get_food (which looks up food info) and build_meal (which assembles meals). The purpose is unmistakable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not explicitly say 'when not to use' or compare against alternatives, but it provides strong contextual guidance: 'All arithmetic happens in Python. Do not compute these numbers yourself' implies this is the tool for macro calculations. It also references sibling get_food for name resolution, establishing a relationship. Clear enough, though exclusions are not spelled out.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
filter_by_dietA
List every food compatible with one dietary restriction or allergy.
A convenience wrapper over list_foods that excludes any food whose "exclude_for"
field contains diet_type.
Args: diet_type: A single dietary or allergen label, e.g. "vegan", "vegetarian", "gluten", "dairy", "shellfish", "nuts", "soy". This must be a value that actually occurs in the data -- call list_available_tags to see the full list. A plausible-sounding but absent label such as "keto" excludes nothing and would silently return the entire database, so unknown labels are rejected instead.
Returns: {"diet_type", "count", "foods": [...]} across all four categories, each food carrying calories_per_unit.
On an unrecognised label: {"error": "unknown_diet_type", "valid_diet_types":
[...]}, so that an excluded-nothing result is never mistaken for a filtered one.
| Name | Required | Description | Default |
|---|---|---|---|
| diet_type | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden for behavioral disclosure. It clearly explains the exclusion logic, the rejection of unknown labels, and the exact error format. It even explains the rationale for rejection (to avoid confusing an unfiltered result with a filtered one), giving complete transparency beyond the input schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear Args and Returns sections. Every sentence adds value: the purpose, the filtering mechanism, the validation requirement, and the error behavior. It is detailed but not bloated, front-loaded with the main purpose, and easy to scan.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having only one parameter and no annotations, the description fully covers the tool's behavior: what it does, how it filters, what output to expect, and how errors are handled. The return format is explained even though an output schema exists, and the reference to list_available_tags provides necessary external context. No gaps are apparent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description must fully explain diet_type. It does this thoroughly: defines it as a single dietary/allergen label, provides concrete examples, states the requirement that it must exist in the data, references list_available_tags for the full list, and describes the behavior for absent labels. This adds significant meaning beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb+resource: 'List every food compatible with one dietary restriction or allergy.' It explicitly positions itself as a convenience wrapper over list_foods and explains the filtering criterion (exclude_for field contains diet_type), clearly distinguishing it from sibling tools like list_foods and list_available_tags.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description states when to use this tool ('convenience wrapper over list_foods') and directs the agent to call list_available_tags for valid diet_type values, which is an explicit alternative. It also warns against using invalid labels, effectively saying 'do not use with unverified labels' and explains the consequence (silent full database return). This covers both when and when-not.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_foodA
Look up a single food by name and return its full entry with derived calories.
Matching is case-insensitive and tolerant: "chicken breast" resolves "Chicken Breast (Cooked)". A loose match is only accepted when it identifies exactly one food -- "cottage cheese" matches three different products, so it is reported as not-found WITH those three as suggestions rather than guessing.
Args: name: The food name, e.g. "Salmon", "greek yogurt (0% fat)", "Whole Egg".
Returns:
The full entry: name, category, unit, pro, carb, fat, tags, exclude_for,
calories_per_unit. All macro figures are per ONE unit of that food.
On no match, returns {"error": "food_not_found", "suggestions": [...]} rather
than raising or returning nothing. Retry with a suggested name verbatim.
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does an excellent job. It discloses case-insensitive matching, tolerant matching rules, the ambiguity policy for multiple matches, the exact return format, and the no-match error format with suggestions. It even instructs the caller to retry with a suggested name verbatim. This is far beyond typical description depth.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-organized with a one-sentence summary, a short matching-behavior paragraph, an Args section, and a Returns section. Every sentence adds useful information—no filler or repetition. The length is justified by the important edge-case behavior that must be communicated.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having an output schema available, the description still clarifies return semantics and the error structure, which is helpful for planning. The matching rules, ambiguous-name handling, and examples make the tool self-contained. For a one-parameter lookup tool, this is complete and leaves minimal ambiguity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema only defines 'name' as a string with no description, so the description must compensate and does so thoroughly. It explains what the parameter means ('The food name'), provides concrete examples including a formatted one ('greek yogurt (0% fat)'), and clarifies matching tolerance. This gives the agent everything needed to construct valid invocations.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb and resource: 'Look up a single food by name and return its full entry with derived calories.' This clearly distinguishes the tool from siblings like list_foods (listing many) and calculate_macros (computing macros separately). It leaves no doubt about the tool's core function.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description clearly conveys when to use this tool: when you need one food's details by name. It does not explicitly mention alternative tools or when not to use it, but the 'single food' framing and the listed sibling names provide enough context for a competent agent. A direct alternative comparison would lift this to 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_available_tagsA
Return the real filter vocabulary present in the database.
Computed from the data at call time, never hardcoded. Call this before using
tags or exclude_tags on any other tool: it is the difference between
filtering on a label that exists and one that merely sounds plausible.
Returns: {"tags": [...], "exclude_for": [...], "categories": [...], "units": [...]}.
"tags" are descriptive labels on a food ("lean", "whole_food", "omega3") and
are matched with OR logic by list_foods.
"exclude_for" are dietary and allergen labels ("vegan", "gluten", "shellfish")
used by exclude_tags and filter_by_diet. The two vocabularies are different --
"dairy" appears in both and means different things in each.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It reveals that the vocabulary is computed at call time rather than hardcoded, and it exposes a non-obvious nuance: the same word (e.g., 'dairy') can have different meanings across the two vocabularies. This goes beyond a simple list and prevents misuse.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a clear opening statement, a specific usage directive, and a bulleted breakdown of return keys with concrete examples. Every sentence adds value, and the length is justified by the need to explain the subtle distinction between vocabulary types.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple metadata tool with no params and an output schema, the description is remarkably complete. It includes dynamic computation behavior, when to invoke the tool, the full return structure, and semantic differences between tag categories. The agent can use the tool correctly and interpret results without additional information.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, and the input schema is empty, so there is no parameter semantics to clarify. The description instead explains the output structure and meaning, which is appropriate for a parameterless tool. This aligns with the baseline of 4 for 0-param tools.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'Return' and a well-defined resource ('real filter vocabulary present in the database'), making the tool's purpose immediately clear. It distinguishes itself from siblings like list_foods and filter_by_diet by focusing on the vocabulary itself, not the foods or filters.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly instructs the agent to call this tool before using `tags` or `exclude_tags` on any other tool, and explains the consequence of not doing so. It also clarifies how the two vocabularies (tags vs. exclude_for) are used by different sibling tools, providing clear when-to-use context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_foodsA
List foods from the database, with derived calories, optionally filtered.
Args:
category: Restrict to one category. Must be exactly one of "proteins",
"carbs", "fats", "vegetables". Omit to search every category.
tags: Keep a food if it carries AT LEAST ONE of these tags (an OR match, not
AND). Tags are descriptive, e.g. "lean", "whole_food", "high_protein".
Call list_available_tags for the complete real vocabulary.
exclude_tags: Drop a food if ANY of these appear in its "exclude_for" field.
These are dietary and allergen labels, e.g. "vegan", "gluten", "dairy",
"shellfish" -- NOT the same vocabulary as tags.
Returns:
{"count": int, "foods": [...]} where each food carries name, category, unit,
pro, carb, fat, tags, exclude_for and a derived calories_per_unit. Macro
values are per ONE of the food's own unit -- note this varies per food
(grams, ounces, tbsp, "large", "container"). To scale a food to a real
portion, use calculate_macros rather than multiplying yourself.
On an invalid category, returns {"error": "invalid_category", ...} listing
the valid values. An empty "foods" list means the filters genuinely matched
nothing, not that the request was malformed.
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | ||
| category | No | ||
| exclude_tags | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description fully carries the burden and does so thoroughly. It discloses OR vs AND matching for tags and exclude_tags, distinct vocabularies, behavior on invalid category (returns error with valid values), the meaning of an empty result, and the caveat about per-unit macros and recommending calculate_macros for scaling.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a concise one-sentence summary, followed by Args and Returns sections. Despite its length, every sentence contributes critical details (filter semantics, return shape, edge cases) and it is front-loaded with the primary purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is complete for a tool with 3 parameters and no annotations. It covers return format (count and foods with fields), error handling for invalid category, empty result semantics, unit variation, and cross-tool guidance. The output schema exists, but the description still explains the derived calories and scaling caveat, making it self-sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the description adds rich meaning for all three parameters: category restrictions with exact allowed values, tags OR-match semantics and vocabulary source, and exclude_tags with its own distinct vocabulary and behavior (drop if ANY appear). It also provides examples and clarifies the relationship between tags and exclude_tags.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description begins with 'List foods from the database, with derived calories, optionally filtered,' which is a specific verb+resource statement. It clearly distinguishes from siblings like get_food (single food) and calculate_macros (portion scaling) by focusing on listing with optional filters.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear context for using filters and points to alternatives: 'To scale a food to a real portion, use calculate_macros rather than multiplying yourself' and 'Call list_available_tags for the complete real vocabulary.' However, it does not explicitly mention when to use this tool over filter_by_diet or get_food, so it lacks explicit exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
v0.1.0- First observed
build_meal - First observed
calculate_macros - First observed
filter_by_diet - First observed
get_food - First observed
list_available_tags - First observed
list_foods
TDQS
Scored across 6 tools
Each tool targets a distinct operation: single food lookup, filtered listing, portion calculation, dietary filtering, meal building, and tag vocabulary. No two tools overlap in purpose, and the descriptions make their boundaries clear.
All tool names follow a consistent verb_noun snake_case pattern (get_, list_, calculate_, filter_by_, build_). The verbs are clear and uniform, making the names predictable and easy to navigate.
Six tools is well-scoped for a food database server, covering lookup, listing, calculation, dietary filtering, meal construction, and available vocabulary. Each tool has a clear role, with no redundancy or bloat.
The tool set covers the full lifecycle of nutritional queries: fetching single foods, listing with filters, scaling portions, filtering by diet, building meals, and discovering valid filter values. There are no obvious dead ends or missing operations for the stated domain.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Unlock the power of food transparency with our Open Food Facts MCP server. Easily look up any food
MCP tools for Malawian food search, clinical nutrition calculators, and RAG-backed guidance.
MCP server exposing supplements database used by iNutriPlan.com
MCP server giving Claude AI access to 22+ NYC public-record databases for real estate due diligence
Related MCP Servers
- FlicenseNot gradedqualityFmaintenanceA Model Context Protocol server that enables Claude to search and access detailed nutritional information from the USDA's FoodData Central database.11-
- AlicenseAqualityBmaintenanceAn MCP server that provides access to Cronometer nutrition data, enabling users to pull food logs, macro and micronutrient summaries, and biometric data into Claude or Cursor. It supports daily nutrition tracking and raw CSV exports by interfacing with the Cronometer web protocol.2717MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for USDA nutrition data lookup, meal logging, and daily macro tracking.15MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that lets you log meals through Claude (and soon ChatGPT) in plain language, using India's official food composition data (IFCT 2017) plus USDA, enabling accurate calorie and macro tracking for Indian dishes with household units and photo logging.421AGPL 3.0