Skip to main content
Glama

portionBatch

Read-onlyIdempotent

Split a cooked batch into per-eater portions sized by remaining needs, fixed grams, macro targets, or reserves, returning exact weights, macros, and the deciding rule.

Instructions

Split a cooked batch into portions that are sized per eater rather than divided equally. Each portion carries its own rule: solve for what an eater still needs today, take a fixed weight, hit a macro target, take the remainder, or set food aside for later. Returns each portion's weight and macros, which constraint decided the weight, and where the other targets landed. Asking for more than the batch holds is an error, never a silent scale-down. Weights are rounded to the gram for reporting, so adding up the portions can differ from the batch by a gram; allocatedG and leftoverG carry the exact figures.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eatersNoRequired for solveForRemaining. When given, every portion also reports how it lands against that eater's remaining targets.
portionsYes
cookedBasisNoDefaults to measured. 'estimated' means the cooked weight came from a yield table, which caps the confidence of every portion at medium.
totalMacrosYesMacros of the whole cooked batch.
totalCookedGYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
byEaterYes
portionsYes
warningsYes
leftoverGYesZero whenever one of the rules is 'remainder'.
allocatedGYes
per100gCookedYes
leftoverMacrosYes

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?

Annotations already declare readOnlyHint=true and idempotentHint=true, so the core safety profile is covered. The description adds valuable behavioral context beyond those: over-allocation is an error rather than a silent scale-down, and weights are rounded for reporting with exact figures carried in allocatedG and leftoverG. This is useful transparency that the annotations do not 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?

The description is a single focused paragraph with no filler. The main purpose is front-loaded, followed by the rule types and then the two critical behavioral caveats. Every sentence earns its place, and the length is appropriate for the complexity of the tool.

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 the complexity of the input schema and the fact that an output schema exists, the description is reasonably complete. It covers the portioning rules, return contents, error handling, and rounding behavior. It does not mention any prerequisites or data-flow dependencies (e.g., computeBatchMacros feeding this tool), but those are not essential for correct invocation.

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?

With schema description coverage at 60%, the description compensates well for the least obvious parameter, the `rule` field, by explaining the five modes (solve for remaining, fixed weight, macro target, remainder, reserve). It also clarifies that each portion is independently sized. It does not deeply elaborate on totalMacros or totalCookedG, but those are self-explanatory from 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 states a specific verb and resource: 'Split a cooked batch into portions' and immediately contrasts it with equal division. It enumerates the five portioning rules, making its function unambiguous and clearly distinct from siblings like computeBatchMacros 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?

The description implies when to use the tool (when you need per-eater portioning with individual rules) but never explicitly names alternatives or conditions for choosing another tool. It does not provide when-not-to-use guidance, so an agent must infer the boundary from the purpose alone.

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