Skip to main content
Glama
io.github.rwestergren/cronometer-api-mcp

io.github.rwestergren/cronometer-api-mcp

by rwestergren

get_food_log

Read-onlyIdempotent

Retrieve food diary entries for a single day or the last N calendar days, including meal groups, servings, calories, and nutrient summaries.

Instructions

Get diary entries for one day or the last N calendar days.

Prefer relative inputs for relative questions, rather than dates calculated from conversation history. For calorie/nutrient totals without individual entries, prefer get_daily_nutrition(days=N).

Returns every food entry logged for the day. Each "Serving" entry is enriched (best-effort) with the food's name, source, serving_size, servings, and that food's own nutrient profile scaled to the amount eaten. Non-food entries (exercise, biometrics) carry their own name.

serving_size defines one portion: quantity units weighing grams in total. servings is how many of those portions were consumed. For example, serving_size={quantity: 2, unit: "cookies", grams: 30} with servings=1 means two cookies eaten; servings=0.5 means one cookie eaten. The size uses the entry's selected measure, or the food's default as a fallback. For serving-based recipes, serving_size.grams is null because the API uses reference-serving counts instead of gram weights. An invalid serving_size.quantity is reported as null.

Every diary entry carries diary_group: {group, name}, the meal slot it sits in (e.g. {"group": 4, "name": "Dinner"}). Group names are customizable per account, so read the meal from this field rather than inferring it from the entry's order or time. name is null for a group number the account doesn't define. See get_diary_groups for the full list.

A busy day in "full" detail can be ~170,000 characters, which can exceed a client's output limit. Use detail="compact" (and/or food_id) to keep the response small.

Note: the per-entry "nutrients" are each food's individual contribution, which is distinct from the day-level nutrition_summary aggregate below.

Also returns a top-level energy_summary field with pre-computed values most relevant to the user:

  • total_target_kcal: daily calorie target dynamically adjusted for expenditure and weight goal (equivalent to Cronometer's "Total Target" in the Energy Summary screen)

  • consumed_kcal: total calories consumed

  • remaining_kcal: calories remaining to stay on target (total_target_kcal - consumed_kcal). Always report this when summarizing the user's day. Prefer this over manually deriving values from the burn breakdown fields.

Also returns a nutrition_summary field with consumed totals for every nutrient the user tracks in Cronometer (macros plus any tracked micronutrients such as saturated fat, cholesterol, or omega-3/6):

  • macros: flat macro totals (energy, protein, carbs, net_carbs, fat, fiber, alcohol)

  • nutrients: the full list of tracked nutrients with amounts and units

Args: date: Inclusive end date: YYYY-MM-DD, today, yesterday, or N days ago. Defaults to today in the account timezone, resolved at call time. days: Number of calendar days, 1–31 (default 1). Includes the end date; days=3 includes today, date='yesterday', days=3 excludes today. detail: "full" (default) returns every entry as described above. "compact" replaces each diary entry with a small object without per-entry nutrient arrays: entry_id (the servingId, noteId, exerciseId or biometricId that remove_food_entry takes), type, name, food_id, measure_id, grams, servings, time, order (raw), diary_group ({group, name}, as above), kcal, protein_g, carbs_g, fat_g, sodium_mg. Notes also carry their text. grams is passed through as-is (null stays null; for serving-based recipes it is a serving count). Values that cannot be derived are null. energy_summary and nutrition_summary are unchanged. Applies to each day. food_id: Only entries for this Cronometer food ID (non-food entries are excluded). It narrows the diary list only; energy_summary and nutrition_summary still describe the whole day. Applies in both detail modes and to each day.

One day returns the usual date/diary/summaries. Multiple days return start_date, end_date, and a days list of those objects, oldest first.

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

Input Schema

NameRequiredDescriptionDefault
dateNo
daysNo
detailNofull
food_idNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.2.7
    • addedInput schema / properties / detail
      Added value: +{
      +  "default": "full",
      +  "enum": [
      +    "full",
      +    "compact"
      +  ],
      +  "title": "Detail",
      +  "type": "string"
      +}
    • addedInput schema / properties / food_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Food Id"
      +}
  2. Changed1 schema field changedv0.2.4
    • addedInput schema / properties / days
      Added value: +{
      +  "default": 1,
      +  "maximum": 31,
      +  "minimum": 1,
      +  "title": "Days",
      +  "type": "integer"
      +}
  3. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), yet the description adds substantial behavioral context: best-effort enrichment of Serving entries, ~170,000-character worst-case payloads that can exceed client output limits, null semantics for unrivable values and invalid serving_size.quantity, and the caveat that per-entry nutrients differ from the day-level aggregate.

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?

Structure is strong and front-loaded: purpose and routing first, then return shape, then parameter behavior. It is lengthy, and a few passages (the energy_summary bullet list, the serving_size cookie example) are verbose, though each still conveys semantics the schema and output schema do not.

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 4-parameter tool with no schema descriptions and a rich return payload, the description covers input formats, storage-level fields, fallback behavior, single- vs multi-day response shapes, and size hazards. Nothing an agent needs to call 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?

Schema description coverage is 0%, so the description carries the full burden and does: accepted date formats (YYYY-MM-DD, today, yesterday, N days ago) with account-timezone defaulting, days range 1-31 with inclusive-end semantics and a worked example, the compact-mode field list, and the clarification that food_id narrows only the entry list.

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 opening sentence gives a specific verb (Get) plus the resource and its scope (diary entries for one day or the last N calendar days). It immediately distinguishes itself from the sibling that returns aggregates by naming get_daily_nutrition(days=N) as the alternative for totals.

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?

Explicit routing guidance is given: prefer relative inputs over dates computed from conversation history, use get_daily_nutrition for totals without entries, consult get_diary_groups for the group list, and use detail="compact" and/or food_id when output size is a concern. Each alternative is tied to the condition that selects it.

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