Skip to main content
Glama

Log Food

log_food
Idempotent

Add foods to the user's diary. Use when the user asks to log something. Each item is a food_id from a food search and a food_measure_id from that food's measures: quantity counts that measure, so 3 of a "medium" measure is three medium potatoes. All items are logged, or none if one is invalid.

For a drink, "oz" means fluid ounces: the fl oz measure, not ounces, which is weight. "A serving" is the serving measure: on a recipe, servings is one of the portions the whole recipe makes.

Logging a food already in that meal with the same measure adds to the same entry. The result lists each food and amount logged, and any insights the app noted.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "date": "<date>",
      "meal": "<meal>",
      "items": "<items>",
      "request_id": "<request_id>"
    },
    "name": "log_food"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateYesThe day, YYYY-MM-DD.
mealYes
itemsYesThe foods to log, up to 30.
request_idYesA new unique string for this action. Reuse it only when retrying the same action.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Beyond the annotations, the description discloses transactional behavior ('All items are logged, or none if one is invalid') and duplicate-merge behavior ('Logging a food already in that meal with the same measure adds to the same entry'), plus a sketch of the return payload. These are real behavioral facts an agent could not infer from readOnlyHint/idempotentHint. It does not cover failure modes or error semantics, keeping it below a 5.

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?

Front-loaded with purpose, then rules in descending order of importance. Every sentence carries information, but the measure-disambiguation sentences are dense and unbroken, which makes the block slightly harder to scan than it needs to be.

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 mutation tool with no output schema, the description covers the atomicity guarantee, the merge-on-duplicate rule, the measure semantics that are the main source of user error, and what the result contains. Nothing essential to calling it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 75% schema coverage, the description still meaningfully extends parameter meaning: it explains that quantity counts the chosen food_measure_id ('3 of a medium measure is three medium potatoes'), and disambiguates 'oz' as fl oz versus weight ounces and 'a serving' versus 'servings' on a recipe. That is exactly the semantic gap the raw integer IDs leave open.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Add foods to the user's diary.' An agent immediately knows this is a write operation on the food diary. It stops short of naming siblings such as log_favorite_meal or copy_meal, which also write diary entries, so the differentiation is left implicit.

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?

'Use when the user asks to log something' is a usable trigger, but there is no explicit when-not guidance and no routing to log_favorite_meal or copy_meal, which are plausible alternatives for logging pre-composed sets of foods. Usage is implied rather than fully specified.

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