Skip to main content
Glama

Log food from database

log_food_from_database
Idempotent

Log a food from search_food_database / lookup_barcode results with exact macros scaled to the eaten amount (the preferred path when a photo shows a barcode: lookup_barcode first). meal_type is optional: when the user didn't say, Heza picks it from the local time eaten. Give either food_id (when the result had one) or the full food object copied from the result, plus grams (or servings when serving_size_g is known).

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

Input Schema

NameRequiredDescriptionDefault
dateNoLocal date YYYY-MM-DD (or 'today'/'yesterday'). Defaults to today in the user's timezone.
foodNoThe result object from search_food_database or lookup_barcode, unchanged
nameNoOptional display name override
gramsNo
notesNo
food_idNofood_id from a search result (cached/custom foods)
servingsNo
logged_atNoHH:MM (local) or ISO datetime
meal_typeNoOmit when the user didn't say: picked from the local time eaten
idempotency_keyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare write, non-destructive, idempotent, open-world semantics, so the description only needs added context — and it supplies the scaling behavior (macros scaled to eaten amount) and the auto-resolution of meal_type, both of which affect the resulting record. It does not explain duplicate-handling behavior or what the caller gets back, though the idempotentHint covers part of that ground.

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, purpose front-loaded, no filler. The final sentence is dense with chained parentheticals ("either food_id ... or the full food object ... plus grams (or servings ...)") which slightly slows parsing but each clause carries real routing value.

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 10-parameter write tool with a nested food object and no output schema, the description covers the decisions an agent must make: source tool, identifier form, quantity form, and meal_type handling. Gaps are the return shape and duplicate/idempotency consequences, which are the only things an agent would still have to probe for.

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 60%, and the description compensates by explaining the food_id-vs-food-object alternatives, the grams-vs-servings choice keyed to serving_size_g, and meal_type's omission default. It leaves notes, name override, logged_at, and idempotency_key entirely to the schema, which is acceptable given several already carry 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 ("Log a food") and pins the data source to search_food_database / lookup_barcode results with macros scaled to the eaten amount. That source-binding plus the barcode-photo routing tells an agent how this differs from a manual log_food or the search/lookup tools themselves.

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 explicit sequencing ("the preferred path when a photo shows a barcode: lookup_barcode first"), an optionality rule for meal_type ("when the user didn't say, Heza picks it from the local time eaten"), and a conditional input rule ("Give either food_id ... or the full food object copied from the result, plus grams (or servings when serving_size_g is known)"). Both alternatives and the conditions selecting them are named.

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