Skip to main content
Glama

Server Details

Search foods, compare nutrients, and look up the full USDA FoodData Central database.

If you are the author of this connector, you can claim ownership with GitHub, an HTTP challenge, or a DNS record. Claimed connector authors can inspect health checks, view analytics, and manage their listing.
Status
Healthy
Last Tested
Transport
Streamable HTTP
URL
Repository
cyanheads/usda-mcp-server
GitHub Stars
1
Server Listing
usda-mcp-server

Available Tools

5 tools
usda_compare_foodsCompare USDA FoodsA
Read-only
Inspect

Compare nutrients side-by-side for 2–5 foods. Returns a structured table — one row per nutrient, one column per food — formatted as markdown. Best for "spinach vs kale iron" or "which has more protein?" questions. Omit nutrients[] to use the 12 most common defaults (energy, protein, fat, saturated fat, carbs, fiber, sugars, sodium, potassium, calcium, iron, vitamin C); provide nutrients[] with specific FDC IDs to compare different nutrients. All values are scaled to the same gram basis (default 100g). If one or more FDC IDs are not found, the comparison proceeds with the valid foods — only throws too_few_foods when fewer than 2 IDs return data.

ParametersJSON Schema
NameRequiredDescriptionDefault
unitNoUnit for quantity. Default "g". Does not support "serving" (use a fixed gram basis for consistent comparison).g
fdcIdsYesFDC IDs to compare — 2 to 5 foods. Use usda_search_foods to discover IDs.
quantityNoGram basis for comparison. All values scaled to this amount. Must be positive. Default 100.
nutrientsNoNutrient IDs to include in the comparison. Defaults to the 12 most common: energy (1008), protein (1003), total fat (1004), saturated fat (1258), carbohydrate (1005), fiber (1079), total sugars (2000), sodium (1093), potassium (1092), calcium (1087), iron (1089), vitamin C (1162). Use usda_list_nutrients to look up other IDs.

Output Schema

ParametersJSON Schema
NameRequiredDescription
basisNoThe common scaling basis applied to all nutrient values.
errorNoPresent when the call failed. Absent on success.
foodsNoThe compared foods, in the same order as the values arrays below.
nutrientsNoNutrient rows — one entry per requested nutrient, with per-food values in the values[] array.
missingDataNoFoods or food+nutrient pairs where data was unavailable. Absent when all data was present.

TDQS

A5/5.0
Behavior5/5

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

Discloses output format (structured markdown table), scalar scaling to a gram basis, default nutrient list, and error handling (fallback behavior with invalid FDC IDs, only throwing too_few_foods). This adds substantial behavioral context beyond the readOnlyHint annotation, fully informing the agent of expected outcomes and edge cases.

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

Conciseness5/5

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

Two paragraphs of dense but efficient prose, front-loaded with purpose and output format, then usage examples, defaults, scaling, and error behavior. Every sentence adds information, with no filler or repetition.

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?

For a tool with 4 parameters and an output schema, the description covers all essential aspects: purpose, use cases, default behavior, parameter customization, scaling, and error handling. It references sibling tools for ID discovery, leaving nothing an agent needs to call it correctly.

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

Parameters5/5

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

Schema already covers all parameters (100% coverage), but the description adds valuable context: how to omit nutrients to use defaults, which defaults are included (listing them), how to discover FDC IDs (referencing sibling tools), and limitations of the unit parameter (no 'serving'). This enriches parameter understanding beyond the schema.

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?

Clearly states the tool compares nutrients side-by-side for 2–5 foods and returns a markdown table. Distinguishes itself from siblings like usda_get_food (single food retrieval) and usda_search_foods (searching) by focusing on comparison, making the purpose unambiguous.

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?

Provides explicit use cases ('spinach vs kale iron' or 'which has more protein?') and describes behavior when IDs are missing (proceeds with valid foods, throws only when fewer than 2). While it doesn't list exclusions, the sibling tools are clearly different, and the examples make when-to-use obvious.

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

usda_get_foodGet USDA FoodA
Read-only
Inspect

Get the full nutrient profile for one food by FDC ID. Returns all available nutrients (or a filtered subset via the nutrients[] param) with optional per-portion scaling. Use usda_search_foods to discover FDC IDs. Provide quantity + unit to scale all nutrient values from per-100g to the specified portion (e.g. quantity=200, unit="g" → per-200g values). Use unit="serving" to scale to the food's first defined portion weight. Narrow nutrients[] to specific IDs to reduce response size for focused queries.

ParametersJSON Schema
NameRequiredDescriptionDefault
unitNoUnit for quantity. "serving" uses the food's first defined portion weight. Required when quantity is provided.
fdcIdYesFDC ID of the food. Use usda_search_foods to discover IDs.
quantityNoAmount of food to scale nutrient values to. Must be positive. When provided, unit is required. Omit for per-100g values (FDC database native basis).
nutrientsNoFilter to specific nutrient IDs (e.g. [1003, 1004, 1005, 1008] for protein, fat, carbs, energy). Use usda_list_nutrients to look up IDs. Omit to return all available nutrients.

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNoPresent when the call failed. Absent on success.
fdcIdNoFDC ID of the food.
dataTypeNoFDC data source: SR Legacy, Foundation, Survey (FNDDS), or Branded.
scaledToNoScaling basis when quantity+unit were provided. Absent when returning per-100g values.
brandNameNoBrand name. Branded items only.
nutrientsNoNutrient values for this food, per 100g or scaled to the requested quantity.
brandOwnerNoBrand owner. Branded items only.
allPortionsNoAll named portions for this food.
descriptionNoFull USDA food name (e.g. "Chicken, broilers or fryers, breast, meat only, raw").
ingredientsNoIngredient list from label. Branded items only.
servingInfoNoFirst available portion definition, if present.
foodCategoryNoUSDA food category (e.g. "Poultry Products"). Absent for some branded items.
publicationDateNoDate this food entry was published in FDC.

TDQS

A4.4/5.0
Behavior4/5

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

Annotations provide readOnlyHint=true, and the description does not contradict it. The description adds substantial behavioral details beyond annotations: per-portion scaling mechanics, the meaning of unit='serving', the default per-100g basis, and the effect of omitting quantity. These are valuable behavioral specifications an agent needs to call correctly.

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?

The description is a single, logically organized paragraph that front-loads the primary purpose and then layers supporting details: scaling, serving, and nutrient filtering. Every sentence conveys useful information without fluff. It is slightly longer than necessary but remains tight given the breadth of behavior covered.

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?

For a read-only, single-food retrieval tool, the description is remarkably complete. It covers the return scope, filtering, scaling semantics, serving interpretation, and default behavior. It points to the correct sibling for ID discovery and implicitly differentiates from plural retrieval. There is no missing critical information for an agent to invoke correctly, especially with a rich output schema available.

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 all parameters are described in the schema. The description enriches these with practical semantics: fdcId discovery via search, quantity/unit scaling requirements, 'serving' behavior, and nutrient ID lookup via usda_list_nutrients. It goes beyond the schema's mechanical descriptions to explain usage context.

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 a specific verb and resource: 'Get the full nutrient profile for one food by FDC ID.' It clearly distinguishes from siblings like usda_get_foods (plural) by emphasizing 'one food' and mentions the optional filtering via nutrients[]. The primary function is unambiguous and stands apart from search, list, and compare tools.

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

Usage Guidelines4/5

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

Explicitly routes to usda_search_foods for discovering FDC IDs and explains when to use nutrient filtering to reduce response size. It does not explicitly mention when to prefer usda_compare_foods or usda_get_foods, but the singular-versus-plural distinction is implicit. Missing explicit exclusions, but the core usage is well-defined.

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

usda_get_foodsGet USDA Foods (Batch)A
Read-only
Inspect

Fetch nutrient profiles for 2–20 foods in a single API call. More efficient than calling usda_get_food N times when you already have multiple FDC IDs. All values are per 100g (no portion scaling). Use the nutrients[] filter to limit response size — strongly recommended for batch calls. For side-by-side comparison with a formatted table, use usda_compare_foods instead. Failed IDs (not found or no data) are reported in the failed[] array rather than aborting the entire batch.

ParametersJSON Schema
NameRequiredDescriptionDefault
fdcIdsYesFDC IDs to fetch — 2 to 20 IDs. Use usda_search_foods to discover IDs.
nutrientsNoFilter to specific nutrient IDs (e.g. [1003, 1004, 1005, 1008]). Strongly recommended — full profiles can be large. Use usda_list_nutrients to look up IDs.

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNoPresent when the call failed. Absent on success.
foodsNoSuccessfully fetched foods.
failedNoIDs that returned no data. Check these with usda_search_foods to verify they exist.

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses key behavioral details: values are per 100g with no portion scaling, and failed IDs are returned in a failed[] array rather than aborting the batch. It also strongly recommends the nutrients filter to limit response size. This adds meaningful context beyond annotations and does not contradict them.

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

Conciseness5/5

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

The description is four sentences, each carrying essential information: core purpose, efficiency rationale, unit context, filter recommendation, alternative routing, and failure behavior. No redundancy; front-loaded with the primary action.

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

Completeness4/5

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

The description covers the critical aspects: batch scope, units, failure handling, and recommended filter. An output schema exists (which would explain the success response shape), so its absence here is acceptable. Minor gaps like rate limits or behavior when all IDs fail are not covered, but these are not essential for correct invocation.

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

Parameters3/5

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

Both parameters are fully described in the schema (100% coverage), so the baseline is 3. The description reinforces the nutrients recommendation and adds efficiency context, but does not introduce additional format or semantic details for the parameters beyond what the schema already provides.

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?

The description states a specific verb ('Fetch'), resource ('nutrient profiles'), and scope ('2–20 foods in a single API call'). It explicitly distinguishes itself from siblings by noting efficiency over usda_get_food and directing to usda_compare_foods for formatted tables, and references usda_search_foods and usda_list_nutrients for ID discovery.

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?

It clearly tells when to use this tool (batch of multiple FDC IDs, more efficient than repeated calls) and points to an alternative (usda_compare_foods for side-by-side tables). It also reinforces the recommended nutrients filter and warns against large responses. The 2–20 range is stated explicitly, covering the main constraint.

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

usda_list_nutrientsList USDA NutrientsA
Read-only
Inspect

Look up the FDC nutrient reference table — all tracked nutrients with their numeric IDs, names, SR reference numbers, units, and categories. Use to resolve a nutrient name (e.g. "vitamin C") to its FDC ID (1162) before passing it to the nutrients[] filter on other tools. Filter by category (macronutrients, vitamins, minerals, lipids, amino_acids, or other) to narrow results. The data is static — call once and reuse the IDs.

ParametersJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter to a nutrient category. Omit to return all ~150 tracked nutrients. Options: macronutrients, vitamins, minerals, lipids, amino_acids, other.

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNoPresent when the call failed. Absent on success.
nutrientsNoNutrient reference entries matching the requested category, or all if category is omitted.

TDQS

A4.3/5.0
Behavior4/5

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

Annotations provide readOnlyHint=true and openWorldHint=false, so the description doesn't need to cover safety. It adds useful behavioral context: the data is static, so results can be cached and reused. This goes beyond the annotations and helps the agent plan calls efficiently.

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

Conciseness5/5

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

Three sentences, each with a distinct purpose: what it does, how to use it, and a caching hint. The most important information (purpose and usage) is front-loaded, followed by a practical note. No filler or redundancy.

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?

For a tool with only one optional parameter and an output schema, the description is complete. It covers the purpose, usage context, filtering options, and data characteristics. 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.

Parameters3/5

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

The schema covers 100% of the parameters, with a clear enum and description for 'category'. The description repeats the enum options and adds 'narrow results', but doesn't add new meaning beyond the schema. Baseline of 3 applies since schema does the heavy lifting.

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?

The description clearly states the verb ('Look up') and resource ('the FDC nutrient reference table'), and specifies exactly what it returns (numeric IDs, names, SR reference numbers, units, categories). It distinguishes itself from the food-related siblings by focusing on nutrients, and even provides a concrete example ('vitamin C' → 1162).

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

Usage Guidelines4/5

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

The description explicitly says 'Use to resolve a nutrient name ... before passing it to the nutrients[] filter on other tools,' which gives clear when-to-use guidance. It also suggests filtering by category and notes the static nature ('call once and reuse'). It doesn't explicitly mention when not to use it, but the context with siblings makes the differentiation obvious.

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

usda_search_foodsSearch USDA FoodsA
Read-only
Inspect

Search USDA FoodData Central foods by keyword. Returns matching foods with FDC IDs and a preview of key nutrients (energy, protein, fat, carbs — not guaranteed complete). Use the returned fdcId with usda_get_food for the full nutrient profile, or usda_compare_foods for side-by-side comparisons. When dataType is omitted, defaults to SR Legacy (common whole foods with complete profiles) — or to Branded when brandOwner is set, since only Branded records carry one. Set dataType to ["Branded"] for packaged products, or include a UPC/GTIN code as the query. Pass brandOwner (e.g. "General Mills") to narrow branded results.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch terms — food name, ingredient, or UPC/GTIN code for branded products. Examples: "chicken breast raw", "banana", "012345678901".
dataTypeNoFDC data sources to search. Omitting this defaults to ["SR Legacy"] (common whole foods, complete nutrient profiles), or to ["Branded"] when brandOwner is set. Include "Branded" for packaged products. Multiple values allowed.
pageSizeNoNumber of results per page. Default 10, maximum 50.
brandOwnerNoFilter branded results by brand owner name (e.g. "General Mills", "Kraft"). Only Branded records carry one, so setting this defaults dataType to ["Branded"] unless dataType is given explicitly.
pageNumberNoPage number (1-based). Use with totalPages to paginate.
foodCategoryNoFilter by USDA food category (e.g. "Poultry Products", "Vegetables and Vegetable Products"). Case-sensitive.

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNoPresent when the call failed. Absent on success.
foodsNoFoods matching the search query.
totalHitsNoTotal number of foods matching the query across all pages.
totalCountNoTotal foods matching the query across all pages.
totalPagesNoTotal number of pages available.
currentPageNoCurrent page number (1-based).

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint and openWorldHint, and the description is consistent with them (no contradiction). It adds valuable behavior beyond annotations: it warns that the nutrient preview is 'not guaranteed complete,' explains the default dataType logic (SR Legacy vs Branded based on brandOwner), and notes that only Branded records carry a brandOwner. This transparency about data completeness and default behavior exceeds what annotations alone provide.

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?

The description is dense with information but not bloated. It front-loads the core purpose and return value, then moves to downstream tool usage and defaults. Each sentence contributes new guidance. Slightly long but efficient; a score of 4 reflects that it could be slightly tightened without losing essential details.

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?

Given the output schema exists and the description already notes the returned nutrient preview (energy, protein, fat, carbs) and FDC IDs, an agent has enough to understand the call result. The description also covers defaults and edge cases (UPC codes, brandOwner) that are not evident from the schema alone. Nothing needed for correct invocation 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 description coverage is 100%, so the baseline is 3. The description adds meaningful enhancements: it explains how the query parameter can also accept UPC/GTIN codes, and it details the interaction between dataType and brandOwner (that setting brandOwner defaults dataType to ['Branded'] unless explicitly overridden). This goes beyond the schema's static field descriptions, justifying a score above baseline.

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?

The description states a specific verb ('Search'), a precise resource ('USDA FoodData Central foods'), and the input ('by keyword'). It also explains what is returned (matching foods with FDC IDs and a nutrient preview), and explicitly distinguishes itself from sibling tools by naming usda_get_food and usda_compare_foods as follow-ups. This fully establishes the tool's unique role.

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?

The description provides explicit routing: 'Use the returned fdcId with usda_get_food for the full nutrient profile, or usda_compare_foods for side-by-side comparisons.' It also clarifies when to set dataType to ['Branded'] and how to use UPC/GTIN codes or brandOwner filters. These guidelines directly address selection against alternative tools and appropriate usage contexts, leaving no ambiguity.

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

Frequently Asked Questions

Discussions

No comments yet. Be the first to start the discussion!

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides intelligent access to the USDA nutrition database through AI assistants, enabling users to search foods, compare nutritional content, find foods high in specific nutrients, and query authoritative nutrition data across 7,146+ food items through natural language.
    1
Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4.7/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: search for foods, retrieve single or batch nutrient profiles, compare foods side-by-side, and look up nutrient reference data. The descriptions explicitly cross-reference when to use which tool, eliminating ambiguity.

Naming Consistency5/5

All tool names follow a consistent 'usda_<verb>_<noun>' pattern, with verbs like search, get, get, list, compare. Plural/singular usage correctly reflects whether the tool handles one or many items, and the naming is predictable and readable.

Tool Count5/5

Five tools is well-scoped for a USDA food data server, covering search, retrieval (single and batch), comparison, and nutrient metadata lookup. Each tool earning its place with no redundancy or bloat.

Completeness5/5

The tool set fully covers the domain of querying USDA FoodData Central: discovery via search, detailed retrieval via get_food/get_foods, comparison via compare_foods, and reference data via list_nutrients. No obvious gaps exist for read-only access.