Skip to main content
Glama

Search USDA Foods

usda_search_foods
Read-only

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.

Input Schema

TableJSON 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

TableJSON Schema
NameRequiredDescriptionDefault
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.

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.