Skip to main content
Glama

Search Foods

search_foods
Read-only

Search Nutriely's food catalog and the user's own foods. name uses the same search as the app, so it handles typos, word order and accents: "adazu tomato" finds "Chips, Tomato, ĀDAŽU". Combine it with barcode, category or nutrient conditions in filters, or use those on their own.

Food names are in English: translate name to English first, whatever language the user speaks, and keep brands as printed. A name in another language can find nothing, or something unrelated: "sel" (French for salt) finds "Selenium".

filters is a condition tree:

  • Nutrient: {"kind": "nutrient", "code": "FE", "operator": ">", "value": 3} (nutrient codes as in the components list; operators =, !=, >, >=, <, <=, plus "missing"/"present" with no value)

  • Food field: {"kind": "field", "field": "categoryCode", "operator": "=", "value": "VEGFRESH"}

  • Group: {"group": "and", "conditions": [node, node]} ("and" or "or", nestable)

Generic and restaurant foods: search the food itself, without the brand or restaurant ("french fries", not "Hesburger fries"), and log the catalog's generic version. When a specific name finds nothing ("ribeye"), search the broader food ("beef steak") or its category: the closest catalog foods are the next step, not a web search. No match for a composed dish or sauce means it can be built from its ingredients as a recipe, not that it's missing.

Foods with the same variant.group are versions of one food, like raw and boiled, or a cheese's fat levels. is_default marks the usual version.

Values are per the food's serving size. Energy (ENERC) is in kJ: divide by 4.184 for kcal, which US labels and users call calories. Use minimal for short lists of ids and names.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "search_foods"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoWhat to search for, in English, as you would type it in the app.
typeNoFilter by type.
limitNoPage size.
offsetNoSkip this many results.
barcodeNoExact barcode.
filtersNoCondition tree, see the tool description.
minimalNoReturn only id, name, type and category.
category_codeNoCategory code from list_categories.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare this as a safe, read-only, non-destructive search. The description adds substantial behavior beyond that: fuzzy matching tolerates typos, word order, and accents; non-English names can produce misleading matches; generic/restaurant foods should be searched without brands; variant groups and is_default identify food versions; and energy is returned in kJ with a conversion note.

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 long but front-loads the core purpose and then moves through name behavior, filters, food-matching strategy, variants, and units in a logical order. Most sentences carry useful information, though a few could be tightened or more clearly separated for scanning.

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 search tool with no output schema, the description covers the important return semantics: values are per serving, variant groups identify versions of the same food, is_default marks the usual version, and minimal produces a short list. Together with the fully documented schema, an agent has enough context to invoke it correctly.

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 coverage is 100%, but the description materially extends it. It explains the `name` search semantics, provides concrete syntax and node types for the nested `filters` tree, describes how to combine filters, and clarifies that `minimal` returns only ids and names.

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 first sentence states a specific verb and resource: search Nutriely's food catalog and the user's own foods. It immediately clarifies name matching behavior and filter combinations, so an agent can distinguish this search tool from nutrient-specific siblings without opening 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 Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit usage rules: translate names to English, combine name with filters or use filters alone, search generic foods without brand/restaurant names, and fall back to broader foods or recipes when no match is found. These are concrete when-to-use and when-not-to-use instructions, not vague hints.

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