Skip to main content
Glama

Save food

save_food
DestructiveIdempotent

Save an ingredient or packaged product to the user's food library, or update a saved one (by id, or the same name and brand). Values are per 100 g or per serving. Returns the saved values per 100 g and per serving.

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": {
      "name": "<name>",
      "calories": "<calories>"
    },
    "name": "save_food"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoA saved food's id, to update it
perNoWhether the values below are per 100 g or per serving (serving_g needed)100g
nameYese.g. 'Kesar Badam Protein'
typeNoproduct: packaged or branded; ingredient: raw or generic (rice, chicken breast). Default: product when a brand is given
brandNoe.g. 'SuperYou'
fat_gNo
notesNo
microsNoPer 100 g or per serving like the rest. On an update, replaces the saved micros when passed
pack_gNoNet weight of the pack now open (tub, loaf, jar), to count what is left of it; same as open_pack
sourceNolabel: read from the pack's nutrition label; database: a food-composition table; estimate: your own estimate
carbs_gNo
fibre_gNo
caloriesYesNew food: required. Update: every value left out keeps what is saved
protein_gNo
serving_gNoWeight of one serving in grams, e.g. 36 for one scoop
serving_labelNoe.g. '1 scoop', '1 slice'
pack_opened_onNoWith pack_g: the day it was opened. Default today

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true; the description earns credit by explaining WHY — an update is matched on id or on identical name+brand, so a call can silently overwrite an existing library entry. It also discloses the return shape (values per 100 g and per serving) even though no output schema exists. It does not say what happens to fields omitted on an update (the schema covers that) or spell out permission/auth needs.

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?

Three sentences, front-loaded with purpose, then update matching, then units and return value — no filler. The final sentence ('Returns the saved values per 100 g and per serving') partially repeats the units statement in the second-to-last sentence, a small redundancy.

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 17-parameter, nested-object mutation tool with no output schema, the description covers the essentials an agent needs: create-vs-update semantics, the matching key, unit basis for the values, and the return shape. Gaps are minor and mostly covered by the schema's own field descriptions.

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?

At 71% schema coverage the baseline is middling, but the description adds real meaning: it clarifies that all supplied numeric values are interpreted per 100 g or per serving, which frames the 'per' and 'serving_g' parameters, and it explains the id/name+brand matching key used by the optional 'id' parameter. It still leaves many of the 17 parameters (type, source, pack_g, serving_label, micros) entirely 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 gives a specific verb and resource — saving an ingredient or packaged product to the user's food library — and covers both create and update paths. It does not explicitly distinguish itself from save_recipe or list_foods, so sibling differentiation is left implicit in the word 'food'.

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 selection rule between the two modes: create a new entry, or update an existing one either by 'id' or by matching 'the same name and brand'. That is genuinely useful when-to-use context. It stops short of naming alternatives or exclusions (e.g. use save_recipe for recipes, list_foods to check what exists).

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