Skip to content

Add add_biometric tool to record weight, body fat and other readings - #78

Open
paultristanwagner wants to merge 2 commits into
rwestergren:mainfrom
paultristanwagner:log-biometrics
Open

paultristanwagner wants to merge 2 commits into
rwestergren:mainfrom
paultristanwagner:log-biometrics

Conversation

@paultristanwagner

Copy link
Copy Markdown

All code in this PR was written by an AI agent (Claude Opus 5.5) working with me; I directed it and tested the results on my own account. Feel free to take, change or drop any part of it.

Part of #73.

Adds an add_biometric tool to record a weight, body fat or any other
metric list_biometrics offers. Reading them (get_biometrics) already
worked.

The app records them with POST /api/v2/add_biometric:

{"biometric": {"biometricId": 0, "type": "Biometric", "metricId": 1,
               "unitId": 1, "amount": 80.0, "day": …, "order": 1, …},
 "auth": {…}, "config": {"call_version": 1}}

Verified against the live API on 1900-01-02:

  • the value is stored in the unit given (weight in lbs stays in lbs)
  • several readings of one metric can share a day, and get_biometrics
    then reports their average
  • a reading on an earlier day doesn't change the profile's current
    weight

Readings appear in get_diary as "type": "Biometric" entries. Deleting
them needs the v3 delete with the entry keyed by id
(#74).

Changes:

  • client: add_biometric(metric_id, unit_id, amount, day), rejecting
    negative or non-finite amounts.
  • server: add_biometric tool. Its description names the ids for
    weight and body fat.
  • README: tool table row.

https://claude.ai/code/session_01MCJFDo71qoSqTRtcGfkpXJ

The app records biometrics with /api/v2/add_biometric (biometricId 0 for
a new reading, metric and unit ids from get_metrics). Verified against the
live API: the value is stored in the unit given, several readings of one
metric can share a day, and a reading on an earlier day doesn't change the
profile weight.

Claude-Session: https://claude.ai/code/session_01MCJFDo71qoSqTRtcGfkpXJ

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant