Skip to main content
Glama

fitatu-api

PyPI Python Status License CI Fitatu MCP on mcprush

An unofficial Python client for the API of Fitatu, the calorie counter, built to be driven by AI agents and scripts. It reads and writes the food diary, activities, body measurements and water, reads and sets goals, and reads summaries and the food catalog. FitatuTools turns the diary into tools a language model can call. The session handling follows python-garminconnect: log in once, keep one session file, let the client refresh it.

Unofficial. This project is not affiliated with or endorsed by Fitatu Sp. z o.o. The API was reverse-engineered from the Fitatu apps and can change without notice. Automated access may break Fitatu's Terms of Service; check them, and use the library only with your own account and at your own risk. The MIT licence covers this code, not the Fitatu service, its API or its data.

Install

Python 3.11 or newer; the only dependency is requests (and tzdata on Windows).

pip install fitatu-api                                     # the library and the fitatu-api command
pip install "fitatu-api[mcp]"                              # plus fitatu-mcp, the MCP server
pip install "git+https://github.com/Jezue/fitatu_library"   # unreleased changes from main

To work on the library or run its tests offline, clone it instead: git clone https://github.com/Jezue/fitatu_library && cd fitatu_library && pip install -e ".[dev]".

Related MCP server: fatsecret-mcp-server

Quick start

fitatu-api login   # asks for e-mail and password, writes ~/.fitatu/session.json

Signed up with Apple or Facebook? Then the account has no password: copy the session from the web app with fitatu-api import-session instead, as described under Authentication & session file.

from datetime import date

from fitatu_api import FitatuApiClient

with FitatuApiClient.from_session() as client:  # closes the HTTP connections at the end
    user_id = client.auth.fitatu_user_id
    today = date.today()

    day = client.planner.get_day(user_id, today)
    for meal_key, meal in day["dietPlan"].items():
        for row in meal["items"]:
            print(meal_key, row["name"], row["energy"], row["planDayDietItemId"])

    egg = client.search_food("jajko kurze", limit=1)[0]  # search rows carry the id as foodId
    added = client.planner.add_product_to_day_meal(
        user_id, today, meal_type="breakfast", product_id=egg["foodId"],
        measure_id=egg["measure"]["measureId"], measure_quantity=2,  # 2 of the hit's measure
    )
    print("added row", added["row_id"])

How writes, row ids and removals work: docs/PLANNER.md.

To copy a catering diet's menu into the diary (safe to run again), use catering_sync.py from the repository: Importing a catering menu.

For AI agents

FitatuTools exposes 47 tools (read the day, search food, log food, weight, water, workouts, private recipes and products, ...) with JSON Schema inputs and read-only / destructive / idempotent annotations. call() never raises: it returns {"ok": true, "data": ...} or {"ok": false, "error": {"error_type", "message", "retryable", "hint", ...}}, so the model can read what went wrong. SYSTEM_PROMPT is the recommended system prompt: the rules the model needs on top of the tool descriptions (read before writing, users' own meal names, data.ok, confirmations). The model asks get_today for the date, in the account's time zone.

import json

import anthropic

from fitatu_api import FitatuTools
from fitatu_api.agent import READ_ONLY_TOOLS, SYSTEM_PROMPT, anthropic_tools  # openai_tools() for OpenAI

client = anthropic.Anthropic()
messages = [{"role": "user", "content": "How many kcal did I eat today?"}]
# Only the read tools, as this loop runs tool calls without asking the user: call() refuses
# any other tool, which the model can still name.
with FitatuTools.from_session(tools=READ_ONLY_TOOLS) as tools:
    while True:
        response = client.messages.create(
            model="claude-opus-5-5",
            max_tokens=16000,
            system=SYSTEM_PROMPT,
            tools=anthropic_tools(READ_ONLY_TOOLS),
            messages=messages,
        )
        messages.append({"role": "assistant", "content": response.content})
        if response.stop_reason != "tool_use":
            break
        results = [
            {
                "type": "tool_result",
                "tool_use_id": block.id,
                "content": json.dumps(tools.call(block.name, block.input)),
            }
            for block in response.content
            if block.type == "tool_use"
        ]
        messages.append({"role": "user", "content": results})
if response.stop_reason != "end_turn":  # max_tokens or refusal: the answer is cut or missing
    raise RuntimeError(f"the model stopped early: {response.stop_reason}")
print("".join(block.text for block in response.content if block.type == "text"))

The write tools (log food, update, move, copy and delete rows, weight, water, workouts, private recipes and products) need a loop that asks the user before destructive calls; it is in docs/AGENTS.md, with the tool table, the calls never to expose (session tokens, catalog writes), how to make writes safe to repeat, what to do per error_type, the OpenAI variant, long-running hosts, and how to try the tools without an account against the offline test backend.

MCP

fitatu-mcp serves the same tools to Claude Code, Claude Desktop and other MCP hosts over stdio, with SYSTEM_PROMPT as its instructions and three Polish slash commands (podsumowanie_dnia, przeglad_tygodnia, zaloguj_posilek):

pipx install "fitatu-api[mcp]"
fitatu-api login
claude mcp add fitatu --scope user -- fitatu-mcp   # fitatu-mcp --read-only: the read tools only

fitatu-mcp --http serves the same tools over HTTP, with a token, for n8n, another computer or Docker (the repository has a Dockerfile): docs/AGENTS.md.

Without an account, fitatu-mcp --demo (or FitatuTools.demo()) serves a small made-up diary kept in memory. For Claude Desktop, each GitHub release has fitatu-<version>.mcpb, installed with a double click (log in with fitatu-api login first). Without installing anything, uvx --from "fitatu-api[mcp]" fitatu-mcp runs the server. It is listed in the MCP Registry as io.github.Jezue/fitatu-api (server.json). For Hermes Agent and other hosts that read Agent Skills, skills/fitatu-diary/SKILL.md tells the agent how to set the server up and use its tools well.

The host's permission prompt is the confirmation step, so keep it on for the destructive tools. Claude Desktop, uvx and what the server does: docs/AGENTS.md.

What it covers

Area

Client (FitatuApiClient)

Agent tools

Food diary

client.planner: read a day, add products, recipes, custom rows and search hits, update, move, copy, remove; the day's note

get_day, add_food, add_foods, add_custom_item, update_item, move_item, copy_meal, preview_removal, remove_items, set_note

Activities

planner.add_activity / remove_activity, client.activities (catalog, search, recent)

search_activity, add_activity, remove_activity

Foods

search_food, get_product_details, get_recipe, recipe catalog and its search, client.foods (favourites, recent)

search_food, search_recipes, get_recipe, find_by_barcode, get_food_measures, get_recent_foods, get_favorite_foods, set_favorite

The user's own foods

search_user_food, create_product, update_product, delete_product, create_recipe, update_recipe, delete_recipe

get_my_foods; create_food, update_food, delete_food and the recipe tools for the user's own private foods only

Measurements

client.measurements: weight and body sizes per day, history, charts

get_weight_history, get_body_measurements, get_measurement_history, log_weight, log_measurements

Water

client.water

get_water, set_water

Summary and export

client.summary: range totals, nutrient per day, top products, diary export

get_range_summary, get_progress, get_top_foods, get_report, get_shopping_list (worked out from the planned rows)

Fasting and habits

client.fasting (schemes, eating periods per day), client.habits (catalog, the user's habits, good days); read only

get_fasting, get_habits, get_good_days

Goals and settings

client.user_settings: targets, BMR/TMR, profile

get_targets, set_targets (the manual or automatic goal, macro split, glass size), get_profile (height, weight, goal, BMI, Premium; nothing that identifies the user)

Catalog writes

create_recipe(shared=True), set_product_proposal, duplicate cleanup

none, on purpose

FitatuLibrary, which wraps most of these as *_via_api methods that return {"status": ...} instead of raising, is deprecated and will be removed in 1.0: for results that never raise use FitatuTools ({"ok": true, "data": ...}), otherwise the client. Every public call with its stability is listed in docs/API_REFERENCE.md.

Free and Premium accounts

Free account

Premium

Diary: read, log, update, move, copy, remove food, notes, activities, water, weight, body measurements

✅

✅

Search, barcode, food measures, recipe search by words and max_energy_kcal, recipes in full, private recipes and products, favourites, recent foods

✅

✅

Recipe search filters (min_protein_g, max_carbohydrate_g, max_cooking_time, diets, meal) and premium catalog recipes (get_recipe, get_food_measures, add_food, add_foods; the shopping list leaves out their ingredients)

❌ "needs Fitatu Premium": the tools follow the app

✅

Goals: read and set (get_targets, set_targets), progress (get_progress), reports (get_report), range totals (get_range_summary)

✅ (progress: a request per day, at most 31 days)

✅

Weight and body measurement history, profile, fasting and habits (read), shopping list

✅

✅

Top foods (get_top_foods, summary.get_top_products())

❌ 403: needs Fitatu Premium

✅

Diary export (fitatu-api export, summary.export_diary())

❌ 403: "needs Fitatu Premium"

✅

Protein / fat / carbohydrate day by day (summary.get_nutrient_by_day(); energy works on both)

❌ 403 (get_progress reads around it)

✅

Nearly everything works on an account without Fitatu Premium. Fitatu answers 403 without it to (checked live 2026-10-15):

  • summary.get_nutrient_by_day() for protein, fat and carbohydrate (energy works on any account);

  • summary.get_top_products(), and so the get_top_foods tool;

  • summary.export_diary(), and so fitatu-api export, which then says so in one line.

Fitatu serves the recipe search filters and premium catalog recipes to any account, but its app keeps them for Premium, and so do the tools: they check the account's accessControl flags and answer a forbidden error without them. The client itself does not check.

get_progress and get_report work on every account: when the macros' day-by-day route is refused, they read each day's own summary instead (a request per day, at most 31 days), and get_report gives top_foods null with a top_foods_note. A free account's macro goals are a range (target_min below target_max); on a Premium account a one-day summary gave the two equal (the day-by-day route get_progress reads there agrees, checked live). It takes a manual goal and its own macro split too (set_targets, checked live 2026-10-15); with a split, its macro goals are single numbers. fitatu-api doctor says whether the account has a premium plan. See Free and Premium accounts in docs/AGENTS.md for the tools.

Command line

fitatu-api (also python -m fitatu_api) works on the session file, $FITATU_SESSION or ~/.fitatu/session.json:

fitatu-api login            # or import-session, see Authentication & session file below
fitatu-api status           # the session: file, user id, host, token expiry; sends nothing
fitatu-api doctor           # checks the session, the clock and the client version with Fitatu
fitatu-api logout           # deletes the session file after asking (--yes: without asking)
fitatu-api tools            # the agent tools: name, read / write / destructive, what it does
fitatu-api tools --json     # the same tools in the Anthropic API format, anthropic_tools()
fitatu-api call get_day '{"date": "2026-10-14"}'
fitatu-api export --from 2026-10-01 --to 2026-10-14 --format csv -o diary.csv  # needs Fitatu Premium

status prints where the session comes from (the file and its permissions, or $FITATU_SESSION_JSON), the user id, API host, locales, when the bearer token expires and whether there is a refresh token, without sending anything; --check also reads the profile once. doctor checks the setup with Fitatu, one ok / WARN / FAIL line each: the session file's permissions, the refresh token (it refreshes the bearer once and saves it, as any refresh does), this computer's clock against the fresh token's issue time, a profile read, whether a premium plan runs (not until when, nor its price), and whether Fitatu's web app is still at the version the library sends (GET /upgrade-application/WEB/<version>); it exits with 1 when a check failed and prints no token, user id or home directory, so its output can go into a bug report. logout deletes the session file; stop fitatu-mcp and other processes that use it first, as they would write their refreshed tokens back. Fitatu has no call the library knows of that revokes tokens. None of these commands prints a token. fitatu-api --version prints the version.

call runs one tool through FitatuTools.call() and prints its envelope as JSON; the exit status is 0 when ok is true and 1 when it is false. Only the read tools (READ_ONLY_TOOLS) run unless --allow-writes is given. export saves Fitatu's diary export (csv, xls, pdf or txt) to a new file readable only by you (0600); it does not replace an existing file without --overwrite, and a range with nothing logged writes no file and exits with 1. fitatu-api COMMAND --help describes each command. Logs go to stderr, from WARNING unless fitatu-api --log-level DEBUG COMMAND or FITATU_LOG_LEVEL says otherwise (see Privacy & logging).

Authentication & session file

fitatu-api login [--email ADDRESS] [-o PATH] [--base-url URL] (also python -m fitatu_api login) logs in, reads your profile for the account's locales and timezone, and writes the session file. It reads FITATU_EMAIL and FITATU_PASSWORD when they are set and prompts otherwise. Accounts without a password use fitatu-api import-session (below).

  • Where. fitatu-api login, fitatu-api import-session, FitatuApiClient.from_session(), FitatuTools.from_session() and the deprecated FitatuLibrary.from_session() use the same file: the path you pass (-o for the CLI), else $FITATU_SESSION, else $FITATU_SESSION_PATH, else ~/.fitatu/session.json. A missing file raises FitatuAuthError telling you to run fitatu-api login.

  • What. JSON with bearer_token, refresh_token, fitatu_user_id, base_url (the region's API host), app_locale, app_searchlocale, app_storagelocale, app_timezone and a schema version. The client's identity (API key, app version, ...) is not stored; it comes from the library.

  • Permissions. The file is written owner-only (0600), in a directory created 0700, through a temporary file that replaces it, so a reader never sees half a session. It holds live tokens: treat it like a password.

  • Tokens. Checked live on 2026-10-13: the bearer token is a JWT that lives one hour. The refresh token is an opaque string that Fitatu does not rotate: POST /token/refresh returns a new bearer token and the same refresh token, which keeps working, and older bearer tokens stay valid until they expire. POST /login answers a wrong e-mail or password with 422, not 401.

  • Refresh and write-back. The client refreshes the bearer token 60 seconds before it expires (from the JWT exp) and once after a 401, one refresh at a time. The tokens are merged into the session file, so the next process starts with them; a process that shares the file picks up a pair another one saved, e.g. after fitatu-api login ran again. Pass persist_tokens=False to keep the file untouched. A pair of another account (a login to another account with the same file) is not picked up: the running client keeps its own tokens and stops writing to the file, so that login stays. When a token fresh from Fitatu already looks expired, the computer's clock runs fast: the client then logs one warning and refreshes only after a 401.

  • Logging in again. When Fitatu rejects the refresh token, calls raise FitatuAuthError (error_type auth). Run fitatu-api login (or import-session) again; a running client picks the new pair up from the file the next time it needs a refresh.

  • Accounts without a password. Accounts created with Apple or Facebook (Apple's "Hide my e-mail" addresses included) have no password for fitatu-api login. Copy the session from the web app instead:

    1. Log in at https://www.fitatu.com/app/ with Apple or Facebook.

    2. Open the browser's developer console on that page and run the line below. It copies only the tokens and your user id; the web app's localStorage.user also holds your e-mail, nickname and more.

      copy(JSON.stringify((u => ({token: u.token, refresh_token: u.refresh_token, id: u.id}))(JSON.parse(localStorage.user))))
    3. On macOS run pbpaste | fitatu-api import-session. On Linux or Windows paste it into a file, run fitatu-api import-session < file (PowerShell: Get-Content file | fitatu-api import-session) and delete the file.

    import-session [-o PATH] [--base-url URL] reads the JSON from stdin (a session file of this library works too), checks both tokens with Fitatu by refreshing the bearer once (so the saved one is good for an hour), reads the account's locales and timezone like login and writes the session file the same way. Nothing else from the input is saved. The token is a full account credential: do not paste it anywhere else.

  • Containers and cron. Where no writable session file fits, put the session JSON itself in FITATU_SESSION_JSON: fitatu-api login --print (or import-session --print) prints it to stdout instead of writing a file, for a secret store. from_session() without a path takes it before any file, and keeps the tokens it refreshes in memory: Fitatu does not rotate the refresh token, so the same value works for every run until the refresh token itself expires (how long it lives is not known yet) or you log in again.

  • Facade (deprecated). FitatuLibrary.from_session() loads the same file and writes refreshed tokens back to it. FitatuLibrary(session_data, session_path=...) does the same for a session dict, and copies the current pair into session_data after every call.

  • From Python. FitatuApiClient.login(email, password, token_store_path=path) logs in and merges the whole session into path.

Regions & headers

The API host is the session's base_url, else the host of the account's storage locale: pl_PL becomes https://pl-pl.fitatu.com/api, de_DE becomes https://de-de.fitatu.com/api. fitatu-api login logs in on https://pl-pl.fitatu.com/api and stores the storage locale's host; with --base-url it logs in there and stores that URL.

Group

Headers

Notes

Required

API-Key, API-Secret, Authorization: Bearer <jwt>

The key and secret are static app values (403 without them); Authorization is needed on user routes (401).

Semantic

APP-SearchLocale, APP-Locale, APP-StorageLocale, APP-Timezone

APP-SearchLocale and the locale query parameter change search results. The others describe the user. All four come from the session, which login() fills from the profile; a session without them sends the pl_PL / Europe/Warsaw defaults.

Identification

APP-OS, APP-Version, APP-UUID, API-Cluster, User-Agent

Only identify the client. The library always sends one constant web-app profile (WEB_CLIENT_PROFILE in constants.py), never stored in sessions.

If Fitatu changes what the web app sends (its version, or the API key and secret) before a release of the library follows, set FITATU_CLIENT_PROFILE to a JSON object with the keys of WEB_CLIENT_PROFILE to change, e.g. FITATU_CLIENT_PROFILE='{"app_version": "4.14.0"}'. Any other key or a value that is not plain text is refused with a FitatuValidationError (fitatu-mcp then does not start). fitatu-api doctor says whether the version is still the newest.

Login (POST /login with _username and _password) and refresh (POST /token/refresh with {"refresh_token": ...}) go through the same request path and send the same headers, without Authorization; at login the locale headers are still the pl_PL defaults. There is no request signing, and Firebase App Check is not enforced; the library does not send it.

Credentials only go to https hosts under fitatu.com: any other base_url or absolute URL raises FitatuValidationError before a request is made, and Authorization is only sent to URLs under base_url or https://fitatu.com/api. Redirects are not followed: a 3xx answer is a FitatuApiError, so a request body never goes on to another host.

Errors, retries, rate limits

The library's errors are FitatuApiError subclasses. describe_error(exc) turns any exception into the JSON-safe dict that FitatuTools.call() (and the deprecated FitatuLibrary) return.

Exception

Raised when

error_type

FitatuValidationError (also a ValueError)

An argument is invalid; nothing was sent.

validation

FitatuNotFoundError

The id, meal or row you named is not there: the library found that in what it read (the message lists what is there), or the server answered 404 (status_code 404).

not_found

FitatuAuthError

401 after a refresh, a rejected refresh token, no session file, or a wrong e-mail or password at login (Fitatu answers 422); hint then points to import-session.

auth

FitatuRateLimitError

429 after retries; retry_after holds the server's wait in seconds.

rate_limit

FitatuConnectionError

No HTTP response (DNS, timeout, connection reset).

network

FitatuMaintenanceError

Fitatu's technical-break header; display_from / display_to.

maintenance

FitatuPlannerSyncError

The day sync answered 202 but rejected a day; results has the per-day errors.

sync_rejected

FitatuPremiumRequiredError

A tool for what the Fitatu app keeps for Premium, on an account without it; nothing was sent for it.

forbidden

FitatuApiError

Any other HTTP error: status_code, body, codename (e.g. NUMBER_OF_USES_EXCEEDED).

forbidden (403), validation (400/409/422), server

Messages read METHOD /path -> status CODENAME: server message. In describe_error()'s message the user id is <user> (GET /diet-plan/<user>/days -> 403), and with user_id= (which FitatuTools.call() passes) wherever else it appears, so a result does not carry it to the model provider. A 403 whose body is an HTML page comes from a firewall in front of the API (e.g. Cloudflare), not from Fitatu's premium or key checks, and its hint says so. Any other exception, such as a TypeError raised inside the library, is unexpected: a bug to report, since FitatuTools.call() checks the arguments first.

Retries: network errors, 429, 500/502/503/504 and Cloudflare's 520 to 524 are retried for GET, HEAD and OPTIONS, and for writes marked idempotent: the day sync (all planner writes; it upserts by row id), water.set_day, measurements.set_day, measurements.delete_day and foods.set_favorite. Other writes (catalog writes, settings, login, refresh) are sent once. Up to retry_max_attempts=3 attempts with exponential backoff from retry_base_delay_seconds=0.5. A Retry-After of up to 30 seconds is honoured; a longer one is not waited for, and the error is raised at once (FitatuRateLimitError with retry_after for a 429). During a technical break nothing is retried or refreshed. Inside with client.time_limit(seconds): the requests end within that time in all: a retry whose wait would leave it less than 2 seconds is not made, each request's timeout is cut to the time left, and a request with no time left is not sent (FitatuConnectionError). FitatuTools runs every call in one of 45 seconds (call_timeout).

Most writes make several requests, which counts when you budget against 429s: the tools read the day before every diary write, and updates, moves, removals and activity writes read it again afterwards to set ok. Requests per agent tool call, before retries and token refreshes:

Requests

Tools

0

get_today

1

the other read tools; set_water; set_favorite; preview_removal and remove_items with dry_run; delete_recipe of a recipe already deleted, delete_food of a product already deleted

2

get_range_summary, get_profile, get_fasting (3 when the settings name the scheme by id), get_habits, find_by_barcode (1 without a product hit), add_food for a recipe in portions (plus 1 for the Premium flags, the first such call in 10 minutes; without Fitatu Premium 1 more, as it reads the recipe first), add_custom_item, log_weight, delete_recipe, set_targets, create_food, delete_food; add_foods, plus 1 for each item with unit or measure_id and, without Fitatu Premium, for each recipe in portions (and 1 for the Premium flags as for add_food); create_recipe, plus 1 for each ingredient; search_recipes with a filter but max_energy_kcal, and get_recipe and get_food_measures of a premium recipe, the first such call on a FitatuTools in 10 minutes (it reads the account's Premium flags; 1 afterwards)

3

add_food with unit or measure_id (reads the food first), log_measurements (reads the size unit from the profile), copy_meal within a day, remove_items, add_activity, remove_activity, set_note, update_food; update_recipe, plus 1 for each new ingredient

4

update_item, move_item within a day, copy_meal to another day

5

get_progress (any range up to 62 days; without Fitatu Premium, see below)

6

move_item to another day

8

get_report (one more for every further 41 weigh-ins in the range)

1 a day

get_shopping_list, plus 1 for each recipe planned in the range (and 1 for the Premium flags when one is premium); get_progress and get_report without Fitatu Premium, plus 1 for the range (none for a single day) and get_report's weigh-ins, and the first such call on a FitatuTools in 10 minutes 1 more, which Fitatu refuses

Privacy & logging

The library logs through the standard logging module and configures no handlers. The fitatu-api command and fitatu-mcp log to stderr, never stdout (which carries the command's result, or the MCP protocol): the library from WARNING, or from the level that --log-level DEBUG|INFO|WARNING|ERROR (for fitatu-api before the command, e.g. fitatu-api --log-level DEBUG call get_today) or FITATU_LOG_LEVEL sets; other libraries from WARNING.

  • INFO (fitatu_api.client): auth events as JSON lines: login (user id), token refresh start, success and failure, and clear_auth, with a non-secret state snapshot (user id, locales, timezone, host, token expiry, whether tokens are present).

  • WARNING (fitatu_api.client): fitatu.request.error for a request that failed for good on a network error, a 429 or a 5xx, after its retries; fitatu.auth.clock_skew (a token fresh from Fitatu looks expired, so the local clock is off; refreshing ahead of expiry stops) and fitatu.auth.store_other_account (the session file now holds another account's tokens; the client keeps its own). From fitatu_api.agent, fitatu_api.facade and fitatu_api.mcp_server, a call whose result reports an unexpected error (with the traceback), an auth or a maintenance error: get_day failed (auth): .... From fitatu_api.auth, a token store (usually the session file) that could not be read. From fitatu_api.mcp_server under --http, each request refused for its token, with the client's address (never the token); uvicorn adds its start and stop lines.

  • DEBUG (fitatu_api.client): every request as JSON lines: fitatu.request.start (method, path, query parameters such as search phrases), fitatu.request.retry before each retry's wait (the failed attempt, delay_seconds, and the reason: the status or the network error's type), then fitatu.request.ok or fitatu.request.error (status, attempt, elapsed_ms since the start, and the first 300 characters of an error body; a 4xx stays at DEBUG, since the caller gets it as an exception and some, such as a 404, are expected). From fitatu_api.planner, one line per planner write (user id, day, meal, food id, a custom row's name and kcal); from the tool layers, every other error a result reports. Paths contain the user id and dates.

Request bodies, passwords and tokens are never logged: values under keys containing token, secret, password or authorization are replaced with [redacted], and the auth context keeps tokens and the API secret out of its repr. Error messages carry up to 200 characters of the server's message; the full response body is in exc.body, which describe_error() and the error results of FitatuTools (and the deprecated FitatuLibrary) leave out. A token that is not a valid header value (e.g. pasted with a newline) is reported without quoting it.

Testing

pip install -e ".[dev]"
pytest -q

The suite runs offline. tests/fixtures/api_recording.json holds real API responses (scrubbed of personal data) for the day sync, measurements, summaries, search and settings; tests/fake_server.py is a fake backend built from them, and tests/test_recorded_contract.py fails if the fake drifts from the recording. How the recording is made and refreshed: tests/fixtures/README.md.

The live suite (tests/test_live_all.py) runs against a real account and writes to it:

FITATU_RUN_LIVE_TESTS=1 pytest tests/test_live_all.py

It uses the session file that fitatu-api login wrote (or $FITATU_SESSION) and saves refreshed tokens back to it; with $FITATU_SESSION_JSON set, that session is used instead and refreshed tokens are not saved. Optional: FITATU_LIVE_DAY (after today; default a year from today), FITATU_LIVE_MEAL_KEY (snack), FITATU_LIVE_PRODUCT_ID, FITATU_LIVE_RECIPE_ID, FITATU_LIVE_MEASUREMENT_DAY (2020-01-01; skipped if it has a measurement) and FITATU_LIVE_RUN_WRITE_ACCOUNT=1.

Each test deletes exactly the rows it added on FITATU_LIVE_DAY and fails if one is left; a day on or before today is refused. Water and the note on that day are set back, and the weight and measurements written on FITATU_LIVE_MEASUREMENT_DAY are deleted. -k ReadOnly runs only the tests that read. Logging catalog foods adds them to the account's recent foods, which is not undone. With FITATU_LIVE_RUN_WRITE_ACCOUNT=1 the suite also changes and restores the water glass size and the daily goals (Fitatu keeps the restored goals as a new version from today), and creates, then deletes, a private product and two private recipes (one through the tools, logged on FITATU_LIVE_DAY and removed) and a private product through the tools (logged on FITATU_LIVE_DAY, changed, removed). Product and recipe deletes are soft, so like the recent foods they are not fully undone: they stay on the account, marked deleted and hidden from your foods and searches. The full list is in the module docstring of tests/test_live_all.py. Never point FITATU_LIVE_DAY at a day with entries you care about.

scripts/check_contract.py tells, reading only, whether the live API still answers with the structure the recording holds: it prints route and key names, never values, and exits 1 when a key is gone, a type changed or a route fails. The Live contract workflow runs it and the read-only live tests every Monday with a throwaway account's session in the FITATU_SESSION_JSON secret, and skips without it: CONTRIBUTING.md.

scripts/eval_agent.py scores how well a Claude model uses the tools on the demo diary (29 tasks in Polish and English; needs ANTHROPIC_API_KEY and costs API usage, so CI does not run it): docs/AGENTS.md.

Documentation

Bugs and questions: GitHub issues. Security problems are reported privately: SECURITY.md. Setup, checks and rules for pull requests: CONTRIBUTING.md.

License

MIT, see LICENSE. It covers this code only, not the Fitatu service, its API or the data it returns.

Available Tools

47 tools
add_activityLog a workoutA

Log a workout from the activity catalog; returns its row_id. Fitatu stores energy_kcal as given and does not compute it (see search_activity). Each call adds an activity unless row_id is reused. data.ok says a re-read shows it.

Inputs: date (required), minutes (required), activity_id (required), energy_kcal (required), +1 more. Returns: ok, data, error

add_custom_itemLog a custom foodA

Log a food that is not in the catalog, by name and the nutrition of the whole amount eaten; returns its row_id. Each call adds a row unless row_id is reused. When the user gives only kcal, estimate protein_g, fat_g and carbohydrate_g for that food and tell the user they are estimates; an omitted one counts as 0 g.

Inputs: date (required), meal (required), name (required), energy_kcal (required), +5 more. Returns: ok, data, error

add_foodLog a foodA

Log a catalog food in a meal; returns its row_id. food_id and food_type come from a search_food, search_recipes, find_by_barcode, get_recent_foods, get_favorite_foods or get_my_foods hit, create_food's food_id (PRODUCT) or create_recipe's recipe_id (RECIPE). For a PRODUCT give either unit 'g' or 'ml' with quantity in grams or millilitres, or measure_id (from the hit or get_food_measures) with quantity = how many of that measure. A RECIPE is logged in portions unless measure_id names another of its measures; unit is for products only. A premium recipe needs Fitatu Premium: without it a forbidden error. A measure_id the food does not have is refused before anything is written (that check reads the food once), and the error lists its measures. Each call adds a row unless row_id is reused. The row is not read back: data.ok says the sync accepted it, so read get_day to check what was logged. The result names the measure the row was stored in (measure_id, measure_name, measure_quantity): grams of a food without a gram measure are stored as a count of another one (70 g as 2 portions of 35 g), and update_item's quantity counts that measure.

Inputs: date (required), meal (required), food_id (required), quantity (required), +5 more. Returns: ok, data, error

add_foodsLog several foodsA

Log several catalog foods in one meal with one write, e.g. a whole breakfast. Each item takes food_id, food_type, quantity and measure_id or unit as add_food does, and is checked the same way before anything is written (one read per item with measure_id or unit): when one is wrong, nothing is logged and the error names it as items[index]. Returns the rows (row_id, food_id, measure_id, measure_name, measure_quantity) in the order of items; they are not read back, data.ok says the sync accepted them. Each call adds rows unless row_id is reused.

Inputs: date (required), meal (required), items (required), eaten, +1 more. Returns: ok, data, error

copy_mealCopy a mealA

Copy the food rows of a meal, or only row_ids of it, to another meal and/or day in one write, e.g. 'the same breakfast as yesterday' or 'plan this lunch for tomorrow'. Products and recipes keep their measure and quantity, custom rows their name and nutrition; rows of other types are not copied and are listed in skipped. Returns the copies' row_ids (remove_items with them undoes the copy); data.ok says a re-read shows them all. Each call adds rows unless row_id is reused.

Inputs: to_date (required), from_date (required), from_meal (required), eaten, +3 more. Returns: ok, data, error

create_foodCreate a private productA

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.

Inputs: name (required), fat_g (required), protein_g (required), energy_kcal (required), +9 more. Returns: ok, data, error

create_recipeCreate a private recipeA

Save a private recipe in the user's own foods from catalog products, e.g. their usual smoothie, so it can be logged as one food. Only the user sees it; it never goes to the shared catalog. Each ingredient takes food_id, quantity and unit or measure_id as add_food does, is a PRODUCT, and is checked the same way before anything is written: when one is wrong, nothing is created and the error names it as ingredients[index]. Returns recipe_id and per_serving, its portion measure as get_food_measures lists it (weight_g, energy_kcal, protein_g, fat_g, carbohydrate_g of one serving; null when the recipe could not be read back). Log it with add_food: food_id recipe_id, food_type RECIPE, quantity the servings eaten. Each call creates another recipe: when one fails with anything but a validation, not_found or rate_limit error, look for it with get_my_foods before creating it again.

Inputs: name (required), ingredients (required), servings, description. Returns: ok, data, error

delete_foodDelete a private productA
DestructiveIdempotent

Delete one of the user's own products: create_food's food_id or a get_my_foods PRODUCT hit's food_id. Any other product (a catalog one or another user's) is refused before anything is changed (that check reads it). Rows already logged with it keep their name and values. Fitatu keeps a deleted product marked deleted, out of the user's foods and searches; deleting it again gives data.ok true with already_deleted true. previous holds what create_food takes to make it again (under a new food_id).

Inputs: food_id (required). Returns: ok, data, error

delete_recipeDelete a private recipeA
DestructiveIdempotent

Delete one of the user's own private recipes: create_recipe's recipe_id or a get_my_foods RECIPE hit's food_id. Any other recipe (a catalog recipe, a shared one or another user's) is refused before anything is changed (that check reads the recipe). Fitatu keeps a deleted recipe marked deleted, out of the user's foods and searches; deleting it again gives data.ok true with already_deleted true.

Inputs: recipe_id (required). Returns: ok, data, error

find_by_barcodeFind a product by barcodeA
Read-onlyIdempotent

Find the catalog product with a barcode (the EAN or UPC digits printed under the bars), or the user's own product with it (create_food's barcode). Returns it in the same shape as a search_food hit, for add_food and get_food_measures. A barcode that no product has is not_found: then search_food by the product's name.

Inputs: barcode (required). Returns: ok, data, error

get_body_measurementsRead body measurement changesA
Read-onlyIdempotent

Read how the user's body measurements changed over a period: per body_part (neck, chest, waist, stomach, hips, thigh, calf, biceps, fat_percentage) the first and last value of the period (start_value, end_value) and the difference. Sizes are in the user's size unit (cm unless changed in the app), fat_percentage in %. Parts with nothing logged are left out. Pass from_date and to_date to choose the period; without them the server picks it. Body weight is get_weight_history.

Inputs: to_date, from_date. Returns: ok, data, error

get_dayRead a diary dayA
Read-onlyIdempotent

Read one diary day: per meal its meal_key (the slot other tools take), meal_name (the name the user gave it) and every logged food (row_id, food_type, product_id or recipe_id, name, measure_id, measure_name and measure_quantity, weight in g, energy in kcal, protein/fat/carbohydrate/fiber/sugars/salt in g, eaten); per-meal and day totals; and logged activities (row_id, name, energy in kcal burned); note, the user's own text for the day (null without one), and tags_ids, the ids of its note tags. What the user ate is eaten_totals (rows ticked as eaten); when it is 0 but totals is not, the rows are logged without the tick, so use totals and say so. totals counts every row, planned or eaten. Burned energy is not subtracted. Read the day first to get the row_ids that update_item, move_item and remove_items take. A PRODUCT or RECIPE row's product_id or recipe_id is the food_id that add_food takes, with its food_type, measure_id and measure_quantity as quantity.

Inputs: date (required). Returns: ok, data, error

get_fastingRead intermittent fastingA
Read-onlyIdempotent

Read the user's intermittent fasting (post przerywany) for a range of up to 62 days: days lists each day with fasting, its eating_periods (when the user ate, from and to as times of day) next to expected (the eating windows of the scheme); a day without fasting is not listed. scheme is the fasting scheme in the user's settings (type, e.g. 16_08_hours or 5_2_days, week_days and start_date as Fitatu gives them), null when none is set.

Inputs: to_date (required), from_date (required). Returns: ok, data, error

get_favorite_foodsList favourite foodsB
Read-onlyIdempotent

List the user's favourite products and recipes, in the same shape as search_food hits.

Inputs: limit. Returns: ok, data, error

get_food_measuresList a food's measuresA
Read-onlyIdempotent

List the measures a food can be logged in: measure_id, name (e.g. 'g', 'portion', 'piece'), weight_g or capacity_ml, energy_kcal and protein_g, fat_g, carbohydrate_g of one measure (a macro is null when the food's details do not give it; a product the user created with unit ml gives a serving's ml as weight_g). Pass measure_id and a quantity of that measure to add_food. A premium recipe needs Fitatu Premium: without it a forbidden error.

Inputs: food_id (required), food_type (required). Returns: ok, data, error

get_good_daysList the good daysA
Read-onlyIdempotent

List the days the app's summary marks as good days (Fitatu's own rule decides which), oldest first, with their count. Pass from_date and/or to_date to keep only a period; without them, every good day there is.

Inputs: to_date, from_date. Returns: ok, data, error

get_habitsRead the user's habitsA
Read-onlyIdempotent

Read the habits the user took up in the app (e.g. drinking water every day): per habit its habit_id, name, length_days (how long it runs), days_done and checked_days (the days ticked), enrolled_date and completed. available lists the other habits the app offers (habit_id, name, length_days, premium).

Inputs: no named parameters. Returns: ok, data, error

get_measurement_historyRead a body size historyA
Read-onlyIdempotent

List the logged values of one body measurement as {date, value}, newest first: value in the user's size unit (cm unless changed in the app), fat_percentage in %. Days without that measurement are left out. Pass from_date and to_date to choose the period; without to_date it stops at today, so give it for later days; without either it lists the newest entries up to limit. The first and last value of every part over a period is get_body_measurements; body weight is get_weight_history.

Inputs: body_part (required), limit, to_date, from_date. Returns: ok, data, error

get_my_foodsList the user's own foodsA
Read-onlyIdempotent

List the foods the user created, their own recipes (create_recipe) and products (create_food), in the same shape as search_food hits: a RECIPE hit's food_id is what update_recipe and delete_recipe take, a PRODUCT hit's what update_food and delete_food take.

Inputs: limit, phrase. Returns: ok, data, error

get_profileRead the user's profileA
Read-onlyIdempotent

Read what the user's goals are computed from, for advice: height_cm, weight_kg (the current weight in the profile; a weigh-in logged for today updates it), start_weight_kg and target_weight_kg, bmi (from height_cm and weight_kg), goal (lose, maintain or gain) with pace_kg_per_week, pal (the activity level: TMR = BMR x pal), sex (male, female or null), age in years, and premium: active (whether the account has Fitatu Premium) and end_date. kg and cm whatever units the user chose in the app; a value is null when the profile lacks it. The daily goals are get_targets, the weigh-ins get_weight_history.

Inputs: no named parameters. Returns: ok, data, error

get_progressCheck progress against goalsA
Read-onlyIdempotent

Progress against the user's goals, day by day, for one day or a range of up to 62 days: per day and for energy, protein, fat and carbohydrate, logged (every row, planned or eaten; null when nothing is logged that day), the goal (target in kcal for energy; target_min and target_max in g for a macro, which is on target between the two) and left (the goal minus logged, a macro's from target_max; negative when over). totals gives the whole range: logged, eaten (only rows ticked as eaten) and the goal summed over the days. Works on every account; without Fitatu Premium it reads each day on its own, so it covers at most 31 days, and each day has eaten too. Answers 'what is left today', 'did I hit protein' and how each day went; a summary of a week or month with weight and top foods, or of a longer range, is get_report (over 31 days without Fitatu Premium, get_range_summary).

Inputs: to_date (required), from_date (required). Returns: ok, data, error

get_range_summarySummarize a date rangeA
Read-onlyIdempotent

Read Fitatu's own summary of a date range, as the app's Summary tab shows it: nutrition (energy in kcal; protein, fat, carbohydrate, fiber, sugars, salt in g) counts every logged row, ticked as eaten or not, like get_day's totals; eaten_nutrition the same for the rows ticked as eaten only; activity_energy is kcal burned. Both are totals over the whole range, not daily averages: divide by the number of days for one. For goals and what is left per day, use get_progress.

Inputs: to_date (required), from_date (required). Returns: ok, data, error

get_recent_foodsList recently logged foodsA
Read-onlyIdempotent

List foods the user recently logged in a meal, most used first, in the same shape as search_food hits. Handy for 'my usual breakfast'.

Inputs: meal (required), limit. Returns: ok, data, error

get_recipeRead a recipeA
Read-onlyIdempotent

Read one recipe in full, from the catalog or the user's own: name, servings (how many servings the ingredients make), ingredients for the whole recipe (food_id, food_type, quantity, measure_id, name, measure_name and weight_g; create_recipe and update_recipe take only the first four: drop the rest), description (the steps), per_serving (its portion measure as get_food_measures lists it: weight_g, energy_kcal, protein_g, fat_g and carbohydrate_g of one serving; null when it has none), cooking_time and preparation_time in minutes as the catalog gives them, meals (the meal types it suits), tags (e.g. vegan, keto, polish), rating, premium, deleted, and own: whether it is the user's private recipe, which update_recipe and delete_recipe take. A premium recipe needs Fitatu Premium: without it a forbidden error.

Inputs: recipe_id (required). Returns: ok, data, error

get_reportWeekly or monthly reportA
Read-onlyIdempotent

A weekly or monthly report (or one of any range) in one call. nutrition: for energy, protein, fat and carbohydrate the range's totals, logged (every row, planned or eaten) and eaten (rows ticked as eaten), and daily: logged averaged over days_logged (the days with anything logged) next to the average daily goal (target for energy, target_min and target_max for a macro). weight: the first and last weigh-in of the range (date, value in the user's weight unit) and the change; null without one. top_foods: the 5 foods with the most energy and the 5 with the most protein, as get_top_foods gives them. Without Fitatu Premium, top_foods is null (top_foods_note says why) and the range is at most 31 days; get_range_summary gives the totals of a longer one.

Inputs: to_date (required), from_date (required). Returns: ok, data, error

get_shopping_listMake a shopping listA
Read-onlyIdempotent

A shopping list for a range of up to 14 days, worked out from the rows planned in the diary and not ticked as eaten. products sums them per product and measure (product_id, name, measure_name, quantity of that measure, weight_g; weight_g is null when a row does not give it), with the ingredients of each planned recipe added for its portions; recipes lists those recipes (date, meal, recipe_id, name, portions, and expanded false when its ingredients could not be read or it is a premium recipe on an account without Fitatu Premium, so they are missing from products); other_items lists custom and other rows as they are. It cannot know what the user already has at home, pack sizes or anything not planned in the diary: say so. Start at today ("this week" is today to Sunday): rows on past days not ticked as eaten were usually eaten anyway. One request per day and one per recipe.

Inputs: to_date (required), from_date (required). Returns: ok, data, error

get_targetsRead the daily goalsA
Read-onlyIdempotent

Read the user's daily goals for a day: energy in kcal, protein/fat/carbohydrate as grams and percent of energy, and BMR/TMR in kcal. date is the day asked for; settings_since is when these goals took effect (an earlier day is normal).

Inputs: date (required). Returns: ok, data, error

get_todayGet today's dateA
Read-onlyIdempotent

Today's date in the user's time zone: date (YYYY-MM-DD), timezone and weekday. Call it when the user says today, yesterday, tomorrow, this week or a weekday, and count from it.

Inputs: no named parameters. Returns: ok, data, error

get_top_foodsRank foods by a nutrientA
Read-onlyIdempotent

The foods that gave the user the most of a nutrient over a date range, most first: name, amount (kcal for energy, g otherwise, summed over the range) and per100 (the food's own amount per 100 g; null for a custom item). A recipe may be listed as its ingredients. Answers 'where does my sugar come from'. Premium only: on an account without Fitatu Premium, Fitatu refuses it (a forbidden error); tell the user, do not retry.

Inputs: to_date (required), from_date (required), limit, nutrient. Returns: ok, data, error

get_waterRead the water drunkA
Read-onlyIdempotent

Read how much water the user drank on a day (water_ml), the day's goal (target_ml) and the size of one glass in the user's settings (glass_ml); each is null when unknown.

Inputs: date (required). Returns: ok, data, error

get_weight_historyRead the weight historyA
Read-onlyIdempotent

List logged body weights as {date, value, difference, direction}, newest first: value in the user's weight unit (kg unless changed in the app), difference from the previous entry, direction the weight goal (1 gain, -1 lose, 0 keep). Pass from_date and to_date to choose the period; without them it lists the newest entries up to limit, however old (there is no default period). For the change over a long period, get_report.

Inputs: limit, to_date, from_date. Returns: ok, data, error

log_measurementsLog body measurementsA
DestructiveIdempotent

Save body measurements for a day: sizes in the user's size unit (cm unless changed in the app), fat_percentage in %. Only the values given are replaced; the day's other measurements and its weight are kept. Body weight is log_weight. data.ok says the server accepted it.

Inputs: date (required), calf, hips, neck, +6 more. Returns: ok, data, error

log_weightLog body weightA
DestructiveIdempotent

Save the user's body weight for a day in kg, replacing a weight already saved for that day; other body measurements of that day are kept. data.ok says the server accepted it.

Inputs: date (required), weight_kg (required). Returns: ok, data, error

move_itemMove a logged foodA
Destructive

Move a logged food row to another meal and/or day. The moved row gets a new row_id, returned here; the old one is gone. data.ok says a re-read confirms both.

Inputs: date (required), row_id (required), to_meal (required), to_date. Returns: ok, data, error

preview_removalPreview a removalA
Read-onlyIdempotent

Show what remove_items would delete, without deleting anything: would_remove lists each food row with what it is (meal, meal_name, row_id, name, food_type, food_id, measure_id, measure_name, measure_quantity, energy in kcal, protein/fat/carbohydrate in g, eaten), as remove_items' removed does; missing lists the ids that are not food rows on the day. data.ok is false when one is missing. Call it before remove_items and name the foods to the user, not their row_ids.

Inputs: date (required), row_ids (required). Returns: ok, data, error

remove_activityRemove a workoutA
DestructiveIdempotent

Delete a logged activity by row_id (activities[].row_id in get_day, or from add_activity). An id that is not an activity on the day (already deleted, or a food row's row_id) gives data.ok false, reason item_not_found and a message listing the day's activities, so repeating the call is safe; the result's top-level ok only says the call ran.

Inputs: date (required), row_id (required). Returns: ok, data, error

remove_itemsRemove logged foodsA
DestructiveIdempotent

Delete logged food rows from a day by row_id (meals[].items[].row_id in get_day). removed lists each deleted row with what it was (meal, meal_name, row_id, name, food_type, food_id, measure_id, measure_name, measure_quantity, energy in kcal, protein/fat/carbohydrate in g, eaten), enough to add it again: with add_food, or with add_custom_item from its name and nutrition when food_id is null (a custom row); failed lists the rows still there. Ids that are not food rows on the day (already deleted, or an activity's row_id) are listed in missing, so repeating the call is safe. Preview a removal with preview_removal, which only reads; dry_run does the same here. data.ok is false when a row was missing or failed; the result's top-level ok only says the call ran.

Inputs: date (required), row_ids (required), dry_run. Returns: ok, data, error

search_activitySearch activitiesA
Read-onlyIdempotent

Search the activity (workout) catalog, e.g. 'bieganie' (running) or 'rower' (cycling). Each hit has activity_id for add_activity, name, and energy_kcal: the catalog's estimate for the effort in energy_for (e.g. '5 km w 00:30:00') for an average person. Scale it to what the user did to get the energy_kcal that add_activity needs.

Inputs: phrase (required), limit. Returns: ok, data, error

search_foodSearch the food catalogA
Read-onlyIdempotent

Search the Fitatu food catalog (Polish names work best). Each hit has food_id and type (PRODUCT or RECIPE) for add_food and get_food_measures, name, brand, its default measure (measure_id, name, weight_g or capacity_ml of one measure) with energy_kcal for one such measure, times_used (how often the user logged it; null when the server does not say) and favorite (whether it is one of the user's favourites). A barcode belongs in find_by_barcode. With locale, the hits come from that country's catalog (foods the user logged before show up too) and can be logged like any other.

Inputs: phrase (required), limit, locale. Returns: ok, data, error

search_recipesSearch recipe ideasA
Read-onlyIdempotent

Search the Fitatu recipe catalog for meal ideas, e.g. phrase 'kurczak' with max_energy_kcal 500 for a chicken dinner of at most 500 kcal, or diets ['vegan'], meal 'breakfast' and max_cooking_time 10 for a quick vegan breakfast. The filters are per portion and all apply together; all but max_energy_kcal need Fitatu Premium (without it a forbidden error: tell the user, search by phrase and max_energy_kcal instead). Each hit is shaped like a search_food hit of type RECIPE (food_id, name, energy_kcal and measure of one portion) plus cooking_time and preparation_time as the catalog gives them, rating, and premium: whether the app keeps the recipe for Fitatu Premium (get_recipe and get_food_measures read it only with Premium). get_recipe gives a hit's ingredients and steps. Log one with add_food: food_type RECIPE, quantity the portions.

Inputs: meal, diets, limit, phrase, +4 more. Returns: ok, data, error

set_favoriteAdd or remove a favouriteA
Idempotent

Add a catalog food to the user's favourites, or remove it with favorite false. food_id and food_type come from search_food, get_recent_foods or get_favorite_foods. Repeating it is safe. The server applies it asynchronously, so get_favorite_foods may not show the change for a moment. data.ok says the server accepted it.

Inputs: food_id (required), food_type (required), favorite. Returns: ok, data, error

set_noteWrite the day's noteA
DestructiveIdempotent

Replace the user's note for a diary day (get_day's note) with note; an empty note deletes it. The day's note tags are kept, and so is everything else of the day. data.previous is the note before ('' when there was none), to put it back; data.ok says a re-read shows the new note.

Inputs: date (required), note (required). Returns: ok, data, error

set_targetsSet the daily goalsA
DestructiveIdempotent

Change the user's daily goals from today on; earlier days keep theirs. energy_kcal sets a manual calorie goal. protein_pct, fat_pct and carbohydrate_pct set the macro split as whole percent of the energy, all three summing to 100; the grams follow from the energy. With energy_kcal alone the current split stays, or 20/30/50 when the account has none (say so); the percentages alone keep the current energy, as a manual goal. automatic true goes back to the goal Fitatu calculates from the user's profile, with no energy_kcal or percentages. water_glass_ml is the glass size water is counted in (get_water's glass_ml). Returns the goals now in effect as get_targets gives them, plus automatic, glass_ml and previous: the arguments that put back what this call changed, with no water_glass_ml when there was no glass size (that cannot be put back). data.ok says Fitatu's reply shows the change.

Inputs: fat_pct, automatic, energy_kcal, protein_pct, +2 more. Returns: ok, data, error

set_waterSet the water drunkA
DestructiveIdempotent

Set the total water drunk on a day in ml. It replaces the day's total instead of adding to it: to add some, read get_water and send the sum. For glasses, multiply by get_water's glass_ml (ask the user for the size when it is null). data.ok says the server accepted it.

Inputs: date (required), water_ml (required). Returns: ok, data, error

update_foodChange a private productA
DestructiveIdempotent

Change one of the user's own products (create_food's food_id or a get_my_foods PRODUCT hit's food_id): any value create_food takes but unit; what is not given stays as it is, and servings replaces the list. Any other product is refused before anything is changed (that check reads it). Fitatu usually changes the product in place (replaced_food_id null), and rows already logged with it then show the new values too. It may save the change as a new product instead (seen after a rename or new servings): food_id is then the new id and replaced_food_id the old, retired one, and rows logged before keep the old values. Before changing a product the user has logged, tell them their logged rows may change. Returns measures as create_food does and previous, which update_food takes on food_id to undo the change. data.ok says the server accepted it.

Inputs: food_id (required), name, brand, fat_g, +9 more. Returns: ok, data, error

update_itemChange a logged foodA
Destructive

Change a logged food row: its quantity (in the row's own measure, see measure_name and measure_quantity in get_day) and/or eaten. Nothing else can be changed: for another food, or a custom row's name or nutrition, remove the row and add it again. Activities cannot be updated: remove and add them again. data.ok says a re-read shows the change; data.previous is the row's quantity and eaten before it, to undo the change.

Inputs: date (required), row_id (required), eaten, quantity. Returns: ok, data, error

update_recipeChange a private recipeA
DestructiveIdempotent

Change one of the user's own private recipes (create_recipe's recipe_id or a get_my_foods RECIPE hit's food_id): its name, ingredients (the whole new list, each as create_recipe takes it and checked the same way), servings and/or description; what is not given stays as it is. Any other recipe is refused before anything is changed (that check reads the recipe). Returns per_serving as create_recipe does, and previous (name, servings, description, ingredients), which update_recipe takes to undo the change. data.ok says the server accepted it.

Inputs: recipe_id (required), name, servings, description, +1 more. Returns: ok, data, error

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 47 tools

    Disambiguation4/5

    Most tools target a clearly distinct resource and action (add_food vs add_foods vs add_custom_item vs add_activity, get_day vs get_progress), and the descriptions explicitly cross-reference the right sibling tool. However, the report family (get_range_summary, get_progress, get_report, get_top_foods) and the measurement family (get_weight_history, get_body_measurements, get_measurement_history) overlap enough that only the very long descriptions prevent misselection.

    Naming Consistency5/5

    Every name is snake_case with a predictable verb_noun shape: get_*, add_*, update_*, remove_*, set_*, create_*, delete_*, search_*, find_*, move_*, copy_*, log_*, preview_*. No camelCase or vague verbs break the pattern.

    Tool Count3/5

    At 47 tools this is heavy, and several reads (three summary/report tools, three measurement-history tools) add surface redundancy. It is defensible given the breadth of the Fitatu domain (diary, foods, recipes, activities, body data, water, fasting, habits, goals, notes, reports), but it sits well above the comfortable 3-15 range.

    Completeness5/5

    Coverage is unusually thorough: full CRUD for user foods and private recipes, add/remove for diary rows and activities, reads and writes for weight, measurements, water, targets, notes and favourites, plus search, barcode lookup, meal copy/move, shopping list and multiple report views. No obvious lifecycle gap for the stated domain.

    Maintenance

    ActivityActive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers