Skip to main content
Glama

Create a private product

create_food

Save a product from its nutrition label into your own foods to log it by weight or servings. It remains private and never goes to the shared catalog.

Instructions

Save a product in the user's own foods from its nutrition label, e.g. a bar the catalog does not have, to log it by weight or by its servings. Only the user sees it; it never goes to the shared catalog. Values are per 100 g (100 ml with unit ml), as the label gives them: when it gives only a serving's, scale them to 100 g. Energy in kcal, not kJ. Returns food_id and measures, its measures as get_food_measures lists them (null when it could not be read back). Log it with add_food: food_id, food_type PRODUCT, and unit g (ml) with the amount, or a measure_id with the count. Each call creates another product: when one fails with anything but a validation or rate_limit error, look for it with get_my_foods before creating it again.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe product's name, e.g. 'Baton owsiany'.
unitNoml for a drink whose label gives values per 100 ml.g
brandNoIts brand, if the label has one.
fat_gYesFat in g in 100 g (100 ml for a drink), as the label gives it.
salt_gNoSalt in g.
barcodeNoThe 8 to 14 digits under the bars. Only the user sees it; find_by_barcode then finds this product.
fiber_gNoFibre in g.
servingsNoIts servings, each name once, e.g. [{'name': 'bar', 'weight': 45}]; add_food then logs them by measure_id.
sugars_gNoOf which sugars, in g; at most carbohydrate_g.
protein_gYesProtein in g in 100 g (100 ml for a drink), as the label gives it.
energy_kcalYesEnergy in kcal, not kJ, in 100 g (100 ml for a drink), as the label gives it.
carbohydrate_gYesCarbohydrate in g in 100 g (100 ml for a drink), as the label gives it.
saturated_fat_gNoOf which saturated fat, in g; at most fat_g.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
dataNo
errorNodescribe_error() of what went wrong; docs/AGENTS.md, Results and errors.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover only the mutation/idempotency profile; the description adds real behavioral context beyond them: visibility scope (private, never shared), the per-100 g normalization requirement and the scaling rule when the label gives serving values, kcal-not-kJ, and the explicit warning that every call creates a new product. It also names the return payload (food_id, measures).

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?

Purpose and scope are front-loaded, and every sentence carries information (visibility, units, return value, logging, retry). It is dense and packs several distinct instructions into long sentences, which slightly hurts scanability but nothing is filler.

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 13-parameter mutation tool with nested servings and an output schema, the description covers the intent, the unit/normalization convention, visibility, the downstream logging path, and failure recovery. An agent can call it correctly without further inference.

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?

Schema coverage is 100%, so the baseline is 3, but the description supplies cross-parameter semantics the schema states only per-field: values are always per 100 g (100 ml with unit ml) and must be scaled when the label gives a serving's values, plus the mappings to add_food via unit vs measure_id. It stops short of describing optional fields like sugars/fiber/salt relationships.

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 a product in the user's own foods from its nutrition label') and immediately scopes it against the shared catalog ('Only the user sees it; it never goes to the shared catalog'), which separates it from catalog-facing siblings like search_food and update_food.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives the triggering situation ('a bar the catalog does not have'), the follow-up workflow (log with add_food, food_type PRODUCT, unit g/ml), and a concrete retry rule ('when one fails with anything but a validation or rate_limit error, look for it with get_my_foods before creating it again'). Alternatives and exclusions are both covered.

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