Skip to main content
Glama
Asquarer02
by Asquarer02

list_foods

Search and filter the USDA food database by category, tags, and dietary exclusions. Get macros and derived calories per unit for each food.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagsNo
categoryNo
exclude_tagsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters5/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Asquarer02/usda-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server