Skip to main content
Glama

MALAI

Log food

malai_log_food

MALAI: Log food or drink the user says they ate into their MALAI food log, from their own words, e.g. "2 boiled eggs", "a protein shake", "half my chicken rice bowl". Use whenever the user says they ate, drank, or want to log something. Step 1: call with text only; MALAI returns matching options from its food database and the user's saved recipes. Step 2: confirm the right option with the user (or pick the clear best match), then call again with itemId, itemType and amount/unit. Returns what was logged and today's updated protein. Pass requestId on step 2 so a retry never logs twice. The returned entryId identifies the entry.

Input Schema

NameRequiredDescriptionDefault
mealNoMeal time, if the user said it.
textYesWhat the user ate, in their words, e.g. "2 boiled eggs".
unitNoUnit for amount. Defaults to serving.
amountNoHow much: number of servings, or grams/ml when unit is g/ml. Defaults to 1 serving.
itemIdNoExact item from an earlier MALAI result (options or logWith). Requires itemType.
itemTypeNoType of itemId.
requestIdNoA unique id you create for this log (e.g. a UUID). Send the same id when retrying so the food is never logged twice.
consumedAtNoWhen they ate it, ISO 8601. Defaults to now.
recommendationIdNoPass through from malai_suggest_next_meal logWith, if logging a suggestion.

Output Schema

NameRequiredDescriptionDefault
noteYes
entryNoThe logged entry, when logged is true.
queryNo
todayNo
loggedYesTrue when an entry was written. False means choose an option and call again.
messageNo
optionsNoMatches to confirm with the user; pass the chosen itemId and itemType back.
instructionNo
needsChoiceNo

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?

Goes well beyond the annotations by explaining the two-phase behavior (lookup returns matching foods and saved recipes, then a second call commits the log), what is returned (the logged item, today's updated protein, an entryId), and the retry-safety contract via requestId. The requestId guidance complements rather than contradicts idempotentHint=false, since idempotency is caller-supplied rather than intrinsic.

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?

Front-loads purpose, then the when-to-use trigger, then the workflow in numbered steps, then return/idempotency notes. Despite being longer than most descriptions, every sentence carries operational information with no 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 9-parameter mutation tool with an output schema and annotations, the description supplies the missing pieces: the multi-call workflow, how to disambiguate a match, the retry contract, and what identifiers come back. Nothing an agent needs to invoke it correctly is absent.

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 adds real meaning: it explains the relationship between text (step 1) and itemId/itemType (step 2), and why requestId must be reused on retries. It adds little about meal, amount/unit, or consumedAt beyond what the schema already documents.

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 food/drink into the MALAI food log) and gives concrete input examples ("2 boiled eggs", "a protein shake"). It is clearly distinguishable from siblings like malai_get_food_log (reading) and malai_search_foods (searching) without opening any schema.

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?

Gives an explicit trigger ("Use whenever the user says they ate, drank, or want to log something") and a detailed two-step protocol: text-only lookup first, then confirm with the user and call again with itemId/itemType/amount. It does not name the adjacent sibling tools (malai_search_foods, malai_get_saved_recipes) as alternatives or state when to prefer them over this tool, so the routing is slightly incomplete.

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