Skip to main content
Glama

Compare foods

compare_foods
Read-onlyIdempotent

Compare 2-6 foods side by side on the same nutrients per 100 g. Select specific nutrients or use the default set of energy, fat, saturated fat, carbohydrates, sugar, fibre, protein, and salt.

Instructions

Compare 2-6 foods side by side on the same nutrients (per 100 g). Defaults to the nutrition declaration set: energy, fat, saturated fat, carbohydrates, sugar, fibre, protein, salt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numbersYesFood numbers to compare.
languageNoLanguage for food and nutrient names: 'en' (English) or 'sv' (Swedish). Defaults to the server setting.
nutrientsNoNutrients to include, by code (e.g. 'PROT', 'ENERC_KCAL', 'VITD') or name fragment (e.g. 'iron', 'vitamin b'). Omit for the default set.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, and open-world behavior. The description adds meaningful context not in the annotations: the comparison is per 100 g, uses a fixed nutrient set by default, and supports 2–6 foods. This is sufficient supplemental behavioral disclosure for a safe read-only operation.

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?

Two sentences with no redundancy. The primary action and constraints are front-loaded, and the default set is compactly listed. Every sentence earns its place.

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

Completeness4/5

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

For a simple read-only comparison tool with fully described parameters and a default nutrient set, the description covers the essential context an agent needs. No output schema exists, but the tool's return is straightforward, and no critical behavior like error handling or authentication is needed given the read-only annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema covers all parameters with descriptions, so the bar is met by the schema itself. The description adds the default nutrient set and per-100 g basis, which enriches the 'nutrients' parameter's meaning, but it does not explain parameter syntax or relationships beyond what the schema already states.

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 action (compare), the resource (foods), and the scope (2-6 foods, same nutrients per 100 g). It also lists the default nutrient set, which sets it apart from sibling tools like get_food and search_foods, whose purposes are singular retrieval or search.

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?

The description implies when to use the tool—when a side-by-side comparison of foods is desired—but it does not explicitly state when not to use it or point to alternatives like get_food for a single food's data. The usage guidance is present but not fully explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.