Get tag effects: journal tags against the next night
get_tag_effectsDoes the night after a session with a given tag (log_session tags) look different from the night after a session without it?
Instructions
Does the night after a session with a given tag (log_session tags) look different from the night after a session without it? Per tag and per metric (sleepDurationS, sleepScore, hrv, recoveryMorning: the same per-night values as get_baselines) it compares the nights that followed a day with a tagged session with the nights that followed other training days, over the days nights ending the day before date (default 90, 30-180, date default today; the night that led into date itself may still be recording and is left out). A day without a session is a rest day and is in neither group; a session with no journal entry counts as untagged; a day with several sessions is ONE night, tagged when any of its sessions is; tags match ignoring case. Output: { date, from, to, nights, sessionDays, thresholds, journal: { entries, ignored }, tags: [{ tag, taggedSessions, taggedNights, untaggedNights, verdict, metrics: { : { nTagged, nControl (nights with a value), taggedMedian, controlMedian, medianDiff (tagged minus control), meanDiff, controlIqr, noiseThreshold, verdict } }, statement (one sentence with n, the minimum and 'an association, not a cause') }], notes, errors }, tags with most tagged nights first. HONEST VERDICTS: a metric's verdict is 'insufficient' unless there are at least 15 tagged AND 15 untagged nights with a value for it; then 'tagged-higher' / 'tagged-lower' only when |medianDiff| is LARGER than noiseThreshold = 3 * 1.25 * (controlIqr / 1.35) * sqrt(1/nTagged + 1/nControl) (3 standard errors of the difference of two medians, the spread from the untagged nights' own IQR; equal counts as within noise; compared as printed, rounded), else 'within-noise'. 4 metrics are tested per tag, so a tag's verdict is 'differs' when ANY is higher or lower ('within-noise', or 'insufficient' when all are): with no real difference a simulation flags about 9% of tags at 15 nights per group, 5% at 20 and 3% at 30, and 11% to 22% when nights are correlated 0.3, so treat one 'differs' as a lead, not a finding. It reports an ASSOCIATION in the user's own data and NEVER a cause: say so when you present it, and state n and the thresholds (they are in the result). Consecutive days are not independent samples. A session that starts after midnight counts on its own calendar day. Needs no tags to run: without any it says how to add them. Reads Suunto's workout, sleep and recovery lists (one request each) and the local journal; writes nothing. An unreadable journal file is an error. In demo mode the synthetic sessions carry the tags 'strength' and 'long-run'. Read-only.
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_tag_effects"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | Only this tag (ignoring case). Omit for every tag found on a session in the window. | |
| date | No | The day after the last night to read, YYYY-MM-DD (default today). | |
| days | No | How many nights the window covers, ending the day before `date` (default 90). |