Skip to main content
Glama

metri: Calorie & Macro Tracker

Save batch

metri_save_batch
Destructive

Save one batch: a single preparation the user actually cooked, for example a pot of soup or a tray of lasagna, not a reusable recipe. Without foodId, create a batch from name and components. With foodId, correct that batch: fields you omit keep their values, and every diary item of the batch follows the change. Cooking the dish again is a new batch, not a correction.

Each component is a saved non-batch food by foodId, or an inline food with name and nutritionPer100g. Components replace the whole list, so to change one, read the batch with metri_search_foods by foodId, edit the list and send all of it back.

outputWeightGrams is the finished weight of the whole batch. Pass null when it was not weighed; never estimate it. Without it, the batch can only be logged as a fraction. Changing it keeps the grams of items logged in grams and recomputes their fraction; items logged as a fraction keep their fraction. It cannot be cleared to null while items are logged in grams.

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

Input Schema

NameRequiredDescriptionDefault
nameNoBatch name. Required when creating a batch.
foodIdNoThe batch to correct. Omit to create a batch.
componentsNoThe complete component list. Required when creating a batch; when correcting, it replaces the whole list and omitting it keeps the current one.
outputWeightGramsNoFinished weight of the whole batch, or null when it was not weighed.

Output Schema

NameRequiredDescriptionDefault
foodIdYes
warningsNo
nutritionPer100gNo
totalBatchNutritionYes
consumedFractionOfBatchYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only flag destructiveHint=true and idempotentHint=false; the description supplies the substance behind that—components replace the whole list rather than merging, omitted fields are preserved, and every diary item of the batch follows the change. The outputWeightGrams rules (never estimate, cannot clear to null while grams are logged) are non-obvious side-effect behavior an agent could not infer from structured fields.

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 purpose and the create/correct split before edge cases, and nearly every sentence carries operational content. It is dense but long, and the outputWeightGrams paragraph could be tightened without losing the rules.

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 destructive, non-idempotent tool with all-optional top-level parameters (required set depends on mode), the description covers both modes, replacement semantics, the atomic follow-on effect on diary items, and the null-weight constraint. An output schema exists, so return values need no explanation.

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?

Although schema coverage is 100%, the description adds semantics the schema does not: foodId-overrides-name and foodId-overrides-nutrition precedence, the read-edit-resend-all workflow for replacing one component, and the gram-vs-fraction recompute rule when outputWeightGrams changes. This is genuine meaning beyond the parameter descriptions.

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?

States a specific verb and resource ('Save one batch') and immediately disambiguates it from a reusable recipe, which is the key sibling distinction (metri_save_food). It then splits the two operating modes—create without foodId, correct with foodId—so an agent knows exactly which behavior it is invoking.

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?

Explicitly says when to create vs. correct, that re-cooking the dish is a new batch rather than a correction, and directs the agent to read the batch via metri_search_foods before editing components. It stops short of naming the recipe-save sibling as the alternative for reusable foods, leaving that as an implicit contrast.

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