Skip to main content
Glama

calculate_meal

Read-only

Computes total calories, protein, fat, and carbohydrates for a meal from food names and portion weights in grams.

Instructions

Total calories, protein, fat and carbs for a meal, e.g. [{"food": "Гречка варена", "grams": 200}, {"food": "Куряча грудка варена", "grams": 150}].

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": {
      "items": "<items>"
    },
    "name": "calculate_meal"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsYes

Output Schema

NameRequiredDescriptionDefault
fatYes
kcalYes
carbsYes
itemsYes
proteinYes
not_foundYes
total_gramsYes
calories_fromYesShare of calories from protein/fat/carbs (4/9/4 kcal per gram)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

The annotations already state readOnlyHint=true and openWorldHint=false, so the agent knows this is a side-effect-free, closed-domain operation, which is the main behavioral risk to cover for a calculator. The description adds nothing beyond the annotations about failure behavior (unknown food names, portions exceeding limits); it notes the Ukrainian food-name convention only implicitly through the example. With annotations carrying the safety profile, a 3 is appropriate.

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?

One front-loaded clause plus a compact concrete example, with no filler. The only wasted opportunity is that the leading fragment starts with a noun phrase ('Total calories...') rather than an imperative verb, but the content is tight.

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?

An output schema exists, so return values needn't be explained, and a single required parameter keeps the surface small. Still, for a tool whose whole input is a nested list, the description gives no guidance on edge cases such as unknown foods, empty lists, or portion caps, which an agent would want before calling it.

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?

The schema reports 0% description coverage at the top level; only the nested MealItem fields are documented. The description compensates partly by showing the exact expected array shape and that food names are given in Ukrainian, but it never mentions the 5000g maximum, the requirement that grams be positive, or the units, leaving those limits to the schema.

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?

The description names a specific computation (total calories, protein, fat, carbs) over a specific resource (a meal's item list), which is enough to distinguish it from the search/list siblings in the catalog. It stops short of explicitly naming an alternative tool, but the verb and output make the purpose unambiguous.

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 inline example implicitly signals usage: you pass a list of food-and-gram pairs and get aggregated macros back. There is no explicit when-to-use vs when-not guidance, nor any mention of what to do when a food is unknown or not in a database; the agent must infer that this tool aggregates a set of foods that were presumably selected via the siblings.

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