Skip to main content
Glama

computeBatchMacros

Read-onlyIdempotent

Calculate total macros for a batch from ingredient nutrition sources and weights. Missing ingredients are flagged with candidate matches, and totals are marked incomplete as partial sums.

Instructions

Total the macros of a whole batch from its ingredients. Each ingredient needs a nutrition source and a weight. Any ingredient missing either is returned in unresolved with candidate matches and is never dropped or approximated: the totals then carry isComplete false and are a partial sum.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ingredientsYes
suggestCandidatesNoDefaults to true. Costs one food search per unresolved ingredient.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
budgetYes
totalsYesA partial sum when isComplete is false. Unresolved items are never dropped.
coverageYesLets the caller tell a missing pinch of salt from a missing 500 g of meat.
warningsYes
totalRawGYesSum of the resolved ingredient weights only.
isCompleteYes
unresolvedYes
ingredientsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Beyond the readOnly/openWorld/idempotent annotations, the description adds valuable behavior: unresolved ingredients are returned with candidate matches, totals are partial with isComplete false, and results are never dropped or approximated. This meaningfully enriches what the annotations alone convey.

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?

Three tight sentences: the first states the core purpose, and the next two pack essential caveats about unresolved ingredients and partial totals. There is no filler or repetition of schema details.

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?

Given a detailed input schema, an output schema, and safety annotations, the description covers the key invocation semantics: prerequisites, unresolved handling, and partial-sum behavior. It does not discuss candidate-search cost or suggestCandidates, but the schema already documents those, so the remaining gap is primarily the implicit sibling-tool guidance.

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?

The description maps the core semantics of ingredients to 'nutrition source' and 'weight', and explains the consequence of missing either. With only 50% schema description coverage, this is useful added meaning, though it leaves suggestCandidates and the quantity/unit interplay to the schema.

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 opens with a precise verb and resource: 'Total the macros of a whole batch from its ingredients.' It clearly scopes the tool to batch-level aggregation, distinguishing it from single-food tools like getFoodMacros and from planning/portioning tools like portionBatch or planBatchSize.

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?

It gives clear preconditions: each ingredient needs a nutrition source and a weight, and unresolved ingredients are never dropped or approximated. However, it does not explicitly state when to choose this tool over siblings such as getFoodMacros or parseIngredientLine, nor does it name any exclusions or alternatives.

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