Skip to main content
Glama
edgargalvan

mise-en-place

by edgargalvan

search_foods

Search USDA FoodData Central for food matches by plain-language query, returning ranked candidates to identify the correct fdc_id for nutrition lookups.

Instructions

Search USDA FoodData Central for candidate foods matching a plain-language query (e.g. "chicken breast", "greek yogurt"). Returns ranked candidates: generic (Foundation, SR Legacy) before branded, always. Raises only if nothing at all matches -- never returns an empty list.

This is the ONLY way to find a valid fdc_id. Never invent, recall, or reuse an fdc_id from memory or an earlier conversation: call this tool first, read the returned descriptions, and choose the one that actually matches what the user meant. Pass this exact query string as query to get_nutrition or get_nutrition_batch so the server can verify your chosen fdc_id was really one of these results. Each candidate carries a source field ("usda" or "off") -- pass it through as NutritionRequest.source unchanged; fdc_id itself always goes in the same field either way.

A returned candidate can still fail to fetch (USDA's own search index can be ahead of its detail records, especially for newer Foundation entries) -- if get_nutrition/get_nutrition_batch reports that id as failed, do not give up: try the next candidate from this same list. A failed fetch on its own is not evidence the food itself doesn't exist.

Open Food Facts fallback: set expect_branded=True when the ingredient names or clearly implies a specific commercial product (a brand name, "Mission Carb Balance," "Nature's Own keto bun," or a stated attribute like "low-carb"/"keto" you suspect USDA does not carry under that name) -- the same judgment X-7 already asks you to make about when to search using a stated attribute, extended one step further. When set, this also searches Open Food Facts (a free, crowdsourced, barcode-indexed database) and reserves a slice of limit for any candidate that passes a real plausibility gate (no impossible or self-contradictory nutrition values) -- still fundamentally less trustworthy than a USDA record, anyone can edit an entry, and get_nutrition always attaches a caveat naming this plainly. Leave it False (the default) for a plainly generic ingredient (eggs, potato, olive oil, chicken breast) -- Open Food Facts is a packaged-goods database and has nothing to offer a commodity food, so trying it there is pure latency with no upside. USDA alone is still searched every time regardless of this flag, and Open Food Facts is still tried as a last resort if USDA returns literally nothing even when this flag is False, so a real zero- result case is never silently unhandled just because you forgot to set it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
queryYes
expect_brandedNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so thoroughly. It discloses ranking order, exception behavior, potential fetch failures, source trustworthiness, Open Food Facts caveats, and the always-tried USDA fallback, leaving little ambiguity about tool behavior.

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 well-organized and front-loaded with purpose and usage, but it is somewhat verbose and repeats fallback and trust caveats in multiple places. It remains valuable and focused, though trimming redundant sentences would improve conciseness.

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 tool's moderate complexity and the lack of parameter descriptions in the schema, the description covers all essential operational aspects: matching, ranking, error behavior, source selection, failure retry guidance, and fallback logic. The mention of the output schema means return-value explanation is unnecessary, and the description still clarifies key response characteristics.

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?

Even though the schema provides only names and defaults, the description richly explains all three parameters: query should be the exact string passed through, limit reserves slices for candidates, and expect_branded has nuanced semantics for when to enable Open Food Facts. This far exceeds what the bare schema 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 clearly identifies the tool as a USDA FoodData Central search for candidate foods matching a plain-language query, with a specific verb and resource. It also distinguishes this search tool from nutrition lookup and recipe siblings by stating it returns ranked candidates and raises only when nothing matches.

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 states this is the only way to obtain a valid fdc_id and instructs the agent to call it before any nutrition lookup. It also gives detailed when-to/when-not-to guidance for the expect_branded flag, including fallback behavior when USDA returns nothing.

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/edgargalvan/mise-en-place'

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