Skip to main content
Glama

usda-mcp-server

Server Details

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

Status
Healthy
Last Tested
Transport
Streamable HTTP
URL
Repository
cyanheads/usda-mcp-server
GitHub Stars
1
Server Listing
usda-mcp-server

Glama MCP Gateway

Connect through Glama MCP Gateway for full control over tool access and complete visibility into every call.

MCP client
Glama
MCP server

Full call logging

Every tool call is logged with complete inputs and outputs, so you can debug issues and audit what your agents are doing.

Tool access control

Enable or disable individual tools per connector, so you decide what your agents can and cannot do.

Managed credentials

Glama handles OAuth flows, token storage, and automatic rotation, so credentials never expire on your clients.

Usage analytics

See which tools your agents call, how often, and when, so you can understand usage patterns and catch anomalies.

100% free. Your data is private.
Tool DescriptionsA

Average 4.6/5 across 5 of 5 tools scored.

Server CoherenceA
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.

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
basisYesThe common scaling basis applied to all nutrient values.
foodsYesThe compared foods, in the same order as the values arrays below.
nutrientsYesNutrient 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.
Behavior5/5

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

Besides the readOnlyHint annotation, the description discloses that output is a structured markdown table, that all values scale to a gram basis, that missing FDC IDs are silently skipped, and that only too_few_foods is thrown when fewer than 2 are valid. This goes well beyond the annotations and adds useful behavioral context.

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?

Four sentences, each with a distinct purpose: main function, output format, use cases, defaults and error handling. It is front-loaded with the primary verb and avoids any wasted words.

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 that an output schema exists, the description still covers return format, scaling, default nutrients, error behavior, and references to sibling tools. The description is self-sufficient for a complex comparison tool, with no significant gaps.

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 input schema already provides 100% coverage with detailed descriptions for every parameter, including the default nutrient list and the unit limitation. The description reinforces these (e.g., 'Omit nutrients[] to use defaults') but does not add substantial new information beyond what the schema already states.

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 opens with 'Compare nutrients side-by-side for 2–5 foods', a specific verb and resource scope. It further distinguishes from siblings by giving usage examples like 'spinach vs kale iron' and clarifies it is a comparison tool, not a retrieval (get) or search tool.

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 explicitly says 'Best for' use cases, which indicates when to use. It also directs users to 'usda_search_foods to discover IDs' and 'usda_list_nutrients to look up other IDs', naming alternatives and providing actionable guidance for related tools.

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
fdcIdYesFDC ID of the food.
dataTypeYesFDC 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.
nutrientsYesNutrient values for this food, per 100g or scaled to the requested quantity.
brandOwnerNoBrand owner. Branded items only.
allPortionsNoAll named portions for this food.
descriptionYesFull 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.
Behavior5/5

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

Beyond the readOnlyHint annotation, the description explains key behaviors: per-100g default, optional scaling to specified portions, serving-weight interpretation, and nutrient filtering. It also clarifies the output as scaled nutrient values without contradictions to the annotation, adding substantial transparency.

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 concise yet comprehensive, front-loading the main purpose and then layering usage details. Each sentence adds value: ID discovery, scaling examples, and optimization tip. No wasted words 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 4 parameters and complex scaling/filtering behavior, the description covers all essential aspects: what is returned, how to scale portions, how to filter nutrients, and how to find IDs. The presence of an output schema and read-only annotation further complete the picture, so the description is fully adequate.

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?

The input schema already provides detailed descriptions for all parameters (100% coverage). The description adds a concrete example (quantity=200, unit='g') and explains the 'serving' unit's meaning, enriching the parameter semantics beyond the schema. However, much of what it says repeats schema content, so it does not fully transcend the 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 clearly states the tool gets the full nutrient profile for one food by FDC ID, using a specific verb and resource. It distinguishes from siblings by emphasizing 'one food' and referencing usda_search_foods for ID discovery, setting it apart from get_foods or compare_foods.

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?

It explicitly instructs to use usda_search_foods for discovering FDC IDs, which is a clear prerequisite. It also provides guidance on using nutrients[] to reduce response size and scaling via quantity/unit, though it does not explicitly contrast with usda_get_foods for multiple foods or compare_foods for comparisons. Overall, good practical guidance.

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
foodsYesSuccessfully fetched foods.
failedYesIDs that returned no data. Check these with usda_search_foods to verify they exist.
Behavior4/5

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

Annotations already declare readOnlyHint=true, and the description adds meaningful behavioral details: per-100g units, no portion scaling, and failed IDs reported in failed[] rather than aborting the batch. This provides valuable context beyond the structured annotations.

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 with a distinct purpose: main function, efficiency rationale, unit caveat, and error handling. It is front-loaded and avoids 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?

With an output schema present and only two parameters, the description covers batch behavior, failure handling, and units, making it sufficient for an agent to invoke correctly. It also names related tools for alternative use cases.

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 have descriptions in the schema (fdcIds and nutrients), so schema coverage is 100%. The description reinforces the recommendation to use nutrients[] but doesn't add new parameter-level semantics 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?

Description states 'Fetch nutrient profiles for 2–20 foods in a single API call,' providing a specific verb, resource, and batch scope. It also distinguishes from siblings by mentioning usda_compare_foods and usda_get_food.

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?

Explicitly notes this is more efficient than calling usda_get_food N times and names usda_compare_foods as the alternative for side-by-side tables. Also recommends using the nutrients[] filter, giving clear context for when to use.

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
nutrientsYesNutrient reference entries matching the requested category, or all if category is omitted.
Behavior4/5

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

Annotations already indicate read-only and closed world. The description adds valuable behavioral context beyond annotations: the data is static, so it can be called once and cached. This goes beyond what annotations provide and helps the agent plan efficient usage.

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 earning its place: first defines the tool's output, second gives a concrete use case, third provides a performance-relevant tip. No filler, front-loaded with the core purpose.

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 simple list tool with one optional parameter, output schema, and readOnly annotation, the description fully covers purpose, usage, and static nature. There is nothing missing for an agent to select and invoke this tool correctly.

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?

Schema coverage is 100% with a detailed enum and description. The description repeats the 'filter by category' behavior and adds 'narrow results,' but adds little new meaning beyond the well-documented parameter. Baseline of 3 is appropriate for high schema coverage.

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 opens with a specific verb+resource: 'Look up the FDC nutrient reference table' and enumerates exactly what it returns (IDs, names, SR reference numbers, units, categories). It clearly distinguishes itself from sibling food-search tools by focusing on the nutrient reference table.

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?

Explicitly states when to use: 'resolve a nutrient name to its FDC ID before passing it to the nutrients[] filter on other tools.' Also explains the optional category filter and advises reuse due to static data, giving clear usage context without needing to name alternatives.

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
foodsYesFoods matching the search query.
totalHitsYesTotal number of foods matching the query across all pages.
totalCountYesTotal foods matching the query across all pages.
totalPagesYesTotal number of pages available.
currentPageYesCurrent page number (1-based).
Behavior4/5

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

Annotations declare readOnlyHint and openWorldHint, and the description adds meaningful nuance: the nutrient preview is "not guaranteed complete," and dataType defaults are conditional on brandOwner. This goes beyond the annotations to reveal behavior that could affect interpretation of results.

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 moderately long but every sentence serves a purpose: purpose, return value, sibling links, default behavior, and branded search examples. It is front-loaded and well-organized, though slightly dense for scanning.

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?

With an output schema present, the description focuses on usage scenarios, defaults, and alternatives, which it covers thoroughly. It does not mention pagination behavior but the schema already documents pageSize and pageNumber, so that gap is acceptable.

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 baseline is 3. The description adds value by explaining the interplay between dataType and brandOwner, and by mentioning that UPC/GTIN codes can be used as queries for branded products — context not fully present in the schema descriptions.

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 opens with a specific verb and resource: "Search USDA FoodData Central foods by keyword." It clearly states what is returned (matching foods with FDC IDs and a nutrient preview) and differentiates from siblings by directing users to usda_get_food for full profiles and usda_compare_foods for comparisons.

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?

Explicit guidance is given for using the returned fdcId with usda_get_food and usda_compare_foods. It also explains when dataType defaults to SR Legacy vs Branded, when to set dataType to Branded, and how brandOwner narrows results — providing clear context for selection.

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

Discussions

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

Related MCP Servers

  • F
    license
    -
    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

View all MCP Servers

Try in Browser

Your Connectors

Sign in to create a connector for this server.