Skip to main content
Glama

Matdata – Swedish food composition data

Top foods by nutrient

top_foods
Read-only

Foods with the most (or least) of a nutrient per 100 g or per 100 kcal. Nutrient codes: ENERC_KCAL, PROT, FAT, FASAT, FAMS, FAPU, N3, CHO, SUGAR, SUGAD, SUGFR, FIBT, WHOLET, NACL, NA, CHORL, VITA, CARTB, VITD, VITE, THIA, RIBF, NIAEQ, VITB6, FOL, VITB12, VITC, CA, P, K, MG, FE, ZN, SE, ID.

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": "top_foods"
  }
}

Input Schema

NameRequiredDescriptionDefault
perNoBasis (default 100g)
dietNoOptional diet filter
langNo
limitNoMax results (default 15)
orderNodesc = highest first (default)
everydayNoExclude spices, supplements, stock etc. (default true)
nutrientYesNutrient code, e.g. PROT, FIBT, FE, VITD

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare a read-only, closed-world lookup, so safety is covered. The description adds nothing beyond that: it doesn't say what the results look like, whether the 'everyday' default silently drops spices/supplements, or how ordering interacts with the limit.

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 purpose in the first sentence, followed by the code list. The nutrient enumeration is long but functionally necessary since the schema lacks it; no filler prose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and seven parameters, the description covers the input side but leaves the return shape unexplained (does a result include the nutrient value, rank, food name, language-dependent name?). Covers the minimum for a ranking query but not fully.

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 already 86%, so a 3 is the baseline; the description earns a bump by enumerating all 35+ valid nutrient codes, which the schema only hints at with four examples. It also restates the per-100g/100kcal basis, which is already in the enum and adds nothing.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific operation: listing foods ranked by highest or lowest content of a named nutrient, with the basis ('per 100 g or per 100 kcal') made explicit. That scope separates it from compare_foods and search_foods, though the description never names those siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

Usage is implied by the 'most (or least)' framing and the per-100g/100kcal basis, but there is no explicit when-to-use guidance and no mention of when to pick this over compare_foods or get_reference_values. The agent must infer the routing itself.

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