Skip to main content
Glama

Rank foods by nutrient

find_foods_by_nutrient
Read-onlyIdempotent

Ranks foods by how much of one nutrient they carry per 100 g.

The default list is lab-measured foods. Branded products are included only when data_type is Branded. Amounts that cannot fit in 100 g, and potassium above the potassium-chloride ceiling, are left out. Per-100 g ranking favors foods eaten in small amounts, such as spices and dried herbs; the category filter narrows the list to one food group. Results are paged, and pagination.next_offset is null on the last page.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "nutrient": "<nutrient>"
    },
    "name": "find_foods_by_nutrient"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoResults per page, 1-100. Defaults to 20.
offsetNoResults to skip, from pagination.next_offset. Defaults to 0.
categoryNoUSDA food category, matched as a substring, e.g. Vegetables or Legumes.
nutrientYesNutrient to rank by.
data_typeNoOne USDA dataset. Foundation and SR Legacy are unbranded whole foods, Branded is packaged products, and Survey (FNDDS) is prepared dishes. Omitted, all four are searched.
min_amountNoMinimum amount per 100 g.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare this a safe, idempotent read, and the description adds substantial behavior beyond them: silent exclusion of amounts that cannot fit in 100 g, a potassium ceiling, and the default single-dataset scope. It also flags the per-100 g bias toward spices and dried herbs and states that pagination.next_offset is null on the last page, which directly shapes how an agent interprets 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?

Front-loaded with the core operation, then caveats and pagination in a logical order; every sentence carries information and none is padding. It is slightly dense at five sentences, but nothing reads as filler.

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 six-parameter filtered/ranked list tool with a full output schema and read-only annotations, the description covers dataset defaults, inclusion rules, ranking bias, and pagination termination. Nothing an agent needs in order to call it correctly is missing, and return-value details are rightly delegated to the output schema.

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 the baseline is 3, but the description adds meaning the schema does not: omitting data_type searches all four datasets, while the default result set is unbranded whole foods. It also frames category as narrowing to a single food group, reinforcing the substring-match semantics.

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 opening sentence gives a specific verb and resource — ranking foods by a single nutrient's amount per 100 g — with a stated normalization basis. That is distinct from siblings like search_foods (retrieval) or compare_foods (side-by-side), so an agent can select it without inspecting the schema.

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 clearly states the default dataset scope (lab-measured foods) and the switch needed to see branded products (data_type=Branded), plus how the category filter narrows the result set. It does not name alternative tools or state when a different tool would be preferable, so it stops short of full routing guidance.

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.

Resources