@thebriangao/totem 1.4.4 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (763) hide show
  1. package/.dev.vars.example +5 -0
  2. package/.dockerignore +5 -0
  3. package/.env.example +29 -20
  4. package/CHANGELOG.md +99 -1
  5. package/CONTRIBUTING.md +48 -116
  6. package/Dockerfile +46 -12
  7. package/README.md +172 -498
  8. package/SECURITY.md +36 -59
  9. package/TOOLS.md +448 -311
  10. package/WHOOP.md +497 -2659
  11. package/assets/brand/SOURCES.md +38 -0
  12. package/assets/brand/totem.png +0 -0
  13. package/assets/brand/totem.svg +13 -0
  14. package/assets/fonts/Manrope-OFL.txt +93 -0
  15. package/assets/fonts/manrope-latin.woff2 +0 -0
  16. package/dist/build_info.js +5 -0
  17. package/dist/build_info.js.map +1 -0
  18. package/dist/cli/app.js +675 -0
  19. package/dist/cli/app.js.map +1 -0
  20. package/dist/cli/auth.js +297 -0
  21. package/dist/cli/auth.js.map +1 -0
  22. package/dist/cli/auth_flow.js +268 -0
  23. package/dist/cli/auth_flow.js.map +1 -0
  24. package/dist/cli/browser_login.js +368 -0
  25. package/dist/cli/browser_login.js.map +1 -0
  26. package/dist/cli/clients.js +403 -0
  27. package/dist/cli/clients.js.map +1 -0
  28. package/dist/cli/deploy_record.js +96 -0
  29. package/dist/cli/deploy_record.js.map +1 -0
  30. package/dist/cli/index.js +39 -575
  31. package/dist/cli/index.js.map +1 -1
  32. package/dist/cli/links.js +28 -0
  33. package/dist/cli/links.js.map +1 -0
  34. package/dist/cli/logo.js +63 -0
  35. package/dist/cli/logo.js.map +1 -0
  36. package/dist/cli/setup.js +1157 -1017
  37. package/dist/cli/setup.js.map +1 -1
  38. package/dist/cli/spawn.js +80 -0
  39. package/dist/cli/spawn.js.map +1 -0
  40. package/dist/cli/sys.js +219 -0
  41. package/dist/cli/sys.js.map +1 -0
  42. package/dist/cli/ui.js +712 -463
  43. package/dist/cli/ui.js.map +1 -1
  44. package/dist/cli/update.js +425 -282
  45. package/dist/cli/update.js.map +1 -1
  46. package/dist/cloudflare/token_store.js +48 -0
  47. package/dist/cloudflare/token_store.js.map +1 -0
  48. package/dist/cloudflare/worker.js +155 -0
  49. package/dist/cloudflare/worker.js.map +1 -0
  50. package/dist/data/behaviors.js +2733 -617
  51. package/dist/data/behaviors.js.map +1 -1
  52. package/dist/data/endpoint_catalog.js +2681 -0
  53. package/dist/data/endpoint_catalog.js.map +1 -0
  54. package/dist/data/exercises.js +373 -4859
  55. package/dist/data/exercises.js.map +1 -1
  56. package/dist/data/garments.js +19 -0
  57. package/dist/data/garments.js.map +1 -0
  58. package/dist/data/sports.js +219 -208
  59. package/dist/data/sports.js.map +1 -1
  60. package/dist/lib/activity_list.js +123 -0
  61. package/dist/lib/activity_list.js.map +1 -0
  62. package/dist/lib/activity_records.js +195 -0
  63. package/dist/lib/activity_records.js.map +1 -0
  64. package/dist/lib/activity_results.js +44 -0
  65. package/dist/lib/activity_results.js.map +1 -0
  66. package/dist/lib/activity_types.js +164 -0
  67. package/dist/lib/activity_types.js.map +1 -0
  68. package/dist/lib/brand.js +63 -0
  69. package/dist/lib/brand.js.map +1 -0
  70. package/dist/lib/clock.js +24 -0
  71. package/dist/lib/clock.js.map +1 -0
  72. package/dist/lib/coach_session.js +345 -0
  73. package/dist/lib/coach_session.js.map +1 -0
  74. package/dist/lib/concurrency.js.map +1 -1
  75. package/dist/lib/dates.js +19 -0
  76. package/dist/lib/dates.js.map +1 -1
  77. package/dist/lib/env_file.js +195 -0
  78. package/dist/lib/env_file.js.map +1 -0
  79. package/dist/lib/health_plans_write.js +44 -0
  80. package/dist/lib/health_plans_write.js.map +1 -0
  81. package/dist/lib/heart_rate.js +34 -0
  82. package/dist/lib/heart_rate.js.map +1 -0
  83. package/dist/lib/highlight.js +81 -0
  84. package/dist/lib/highlight.js.map +1 -0
  85. package/dist/lib/install_links.js +47 -0
  86. package/dist/lib/install_links.js.map +1 -0
  87. package/dist/lib/instant.js +50 -0
  88. package/dist/lib/instant.js.map +1 -0
  89. package/dist/lib/journal_behaviors.js +382 -0
  90. package/dist/lib/journal_behaviors.js.map +1 -0
  91. package/dist/lib/lift_catalog.js +218 -0
  92. package/dist/lib/lift_catalog.js.map +1 -0
  93. package/dist/lib/lift_history.js +66 -0
  94. package/dist/lib/lift_history.js.map +1 -0
  95. package/dist/lib/lift_sets.js +146 -0
  96. package/dist/lib/lift_sets.js.map +1 -0
  97. package/dist/lib/lift_tool.js +20 -0
  98. package/dist/lib/lift_tool.js.map +1 -0
  99. package/dist/lib/profile_settings.js +101 -0
  100. package/dist/lib/profile_settings.js.map +1 -0
  101. package/dist/lib/screen_content.js +44 -0
  102. package/dist/lib/screen_content.js.map +1 -0
  103. package/dist/lib/timezone.js +48 -6
  104. package/dist/lib/timezone.js.map +1 -1
  105. package/dist/lib/walk.js +6 -1
  106. package/dist/lib/walk.js.map +1 -1
  107. package/dist/lib/weight_readings.js +61 -0
  108. package/dist/lib/weight_readings.js.map +1 -0
  109. package/dist/projections/activities.js +193 -0
  110. package/dist/projections/activities.js.map +1 -0
  111. package/dist/projections/alarm_schedule.js +102 -0
  112. package/dist/projections/alarm_schedule.js.map +1 -0
  113. package/dist/projections/coach.js +203 -0
  114. package/dist/projections/coach.js.map +1 -0
  115. package/dist/projections/community.js +165 -0
  116. package/dist/projections/community.js.map +1 -0
  117. package/dist/projections/health_features.js +167 -0
  118. package/dist/projections/health_features.js.map +1 -0
  119. package/dist/projections/hormonal_insights.js +239 -0
  120. package/dist/projections/hormonal_insights.js.map +1 -0
  121. package/dist/projections/journal_v2.js +157 -0
  122. package/dist/projections/journal_v2.js.map +1 -0
  123. package/dist/projections/lift_cards.js +115 -0
  124. package/dist/projections/lift_cards.js.map +1 -0
  125. package/dist/projections/lift_exercise_v2.js +131 -0
  126. package/dist/projections/lift_exercise_v2.js.map +1 -0
  127. package/dist/projections/lift_library_v2.js +67 -0
  128. package/dist/projections/lift_library_v2.js.map +1 -0
  129. package/dist/projections/lift_sessions.js +211 -0
  130. package/dist/projections/lift_sessions.js.map +1 -0
  131. package/dist/projections/memory.js +95 -0
  132. package/dist/projections/memory.js.map +1 -0
  133. package/dist/projections/milestones.js +119 -0
  134. package/dist/projections/milestones.js.map +1 -0
  135. package/dist/projections/profile_v2.js +150 -0
  136. package/dist/projections/profile_v2.js.map +1 -0
  137. package/dist/projections/settings_v2.js +153 -0
  138. package/dist/projections/settings_v2.js.map +1 -0
  139. package/dist/projections/sleep.js +4 -21
  140. package/dist/projections/sleep.js.map +1 -1
  141. package/dist/projections/v2/calendar.js +43 -0
  142. package/dist/projections/v2/calendar.js.map +1 -0
  143. package/dist/projections/v2/core_common.js +86 -0
  144. package/dist/projections/v2/core_common.js.map +1 -0
  145. package/dist/projections/v2/core_home.js +136 -0
  146. package/dist/projections/v2/core_home.js.map +1 -0
  147. package/dist/projections/v2/core_sleep_need.js +23 -0
  148. package/dist/projections/v2/core_sleep_need.js.map +1 -0
  149. package/dist/projections/v2/day.js +92 -0
  150. package/dist/projections/v2/day.js.map +1 -0
  151. package/dist/projections/v2/heart_rate.js +54 -0
  152. package/dist/projections/v2/heart_rate.js.map +1 -0
  153. package/dist/projections/v2/history.js +140 -0
  154. package/dist/projections/v2/history.js.map +1 -0
  155. package/dist/projections/v2/now.js +39 -0
  156. package/dist/projections/v2/now.js.map +1 -0
  157. package/dist/projections/v2/recovery.js +77 -0
  158. package/dist/projections/v2/recovery.js.map +1 -0
  159. package/dist/projections/v2/sleep.js +218 -0
  160. package/dist/projections/v2/sleep.js.map +1 -0
  161. package/dist/projections/v2/strain.js +39 -0
  162. package/dist/projections/v2/strain.js.map +1 -0
  163. package/dist/projections/v2/stress.js +92 -0
  164. package/dist/projections/v2/stress.js.map +1 -0
  165. package/dist/projections/v2/trend.js +205 -0
  166. package/dist/projections/v2/trend.js.map +1 -0
  167. package/dist/projections/weekly_plan.js +66 -0
  168. package/dist/projections/weekly_plan.js.map +1 -0
  169. package/dist/projections/weight_readings.js +57 -0
  170. package/dist/projections/weight_readings.js.map +1 -0
  171. package/dist/projections/workout.js +37 -15
  172. package/dist/projections/workout.js.map +1 -1
  173. package/dist/schemas/activities.js +123 -0
  174. package/dist/schemas/activities.js.map +1 -0
  175. package/dist/schemas/alarm_schedule.js +62 -0
  176. package/dist/schemas/alarm_schedule.js.map +1 -0
  177. package/dist/schemas/coach.js +76 -8
  178. package/dist/schemas/coach.js.map +1 -1
  179. package/dist/schemas/community.js +70 -0
  180. package/dist/schemas/community.js.map +1 -0
  181. package/dist/schemas/health.js +36 -0
  182. package/dist/schemas/health.js.map +1 -0
  183. package/dist/schemas/hormonal_insights.js +90 -0
  184. package/dist/schemas/hormonal_insights.js.map +1 -0
  185. package/dist/schemas/journal.js +4 -0
  186. package/dist/schemas/journal.js.map +1 -1
  187. package/dist/schemas/journal_v2.js +106 -0
  188. package/dist/schemas/journal_v2.js.map +1 -0
  189. package/dist/schemas/memory.js +42 -0
  190. package/dist/schemas/memory.js.map +1 -0
  191. package/dist/schemas/milestones.js +39 -0
  192. package/dist/schemas/milestones.js.map +1 -0
  193. package/dist/schemas/profile_v2.js +60 -0
  194. package/dist/schemas/profile_v2.js.map +1 -0
  195. package/dist/schemas/settings_v2.js +56 -0
  196. package/dist/schemas/settings_v2.js.map +1 -0
  197. package/dist/schemas/sleep.js +8 -1
  198. package/dist/schemas/sleep.js.map +1 -1
  199. package/dist/schemas/strength.js +10 -1
  200. package/dist/schemas/strength.js.map +1 -1
  201. package/dist/schemas/strength_v2.js +190 -0
  202. package/dist/schemas/strength_v2.js.map +1 -0
  203. package/dist/schemas/v2/calendar.js +8 -0
  204. package/dist/schemas/v2/calendar.js.map +1 -0
  205. package/dist/schemas/v2/core_common.js +42 -0
  206. package/dist/schemas/v2/core_common.js.map +1 -0
  207. package/dist/schemas/v2/day.js +73 -0
  208. package/dist/schemas/v2/day.js.map +1 -0
  209. package/dist/schemas/v2/now.js +25 -0
  210. package/dist/schemas/v2/now.js.map +1 -0
  211. package/dist/schemas/v2/recovery.js +35 -0
  212. package/dist/schemas/v2/recovery.js.map +1 -0
  213. package/dist/schemas/v2/sleep.js +44 -0
  214. package/dist/schemas/v2/sleep.js.map +1 -0
  215. package/dist/schemas/v2/strain.js +16 -0
  216. package/dist/schemas/v2/strain.js.map +1 -0
  217. package/dist/schemas/v2/stress.js +20 -0
  218. package/dist/schemas/v2/stress.js.map +1 -0
  219. package/dist/schemas/v2/trend.js +42 -0
  220. package/dist/schemas/v2/trend.js.map +1 -0
  221. package/dist/schemas/weekly_plan.js +31 -0
  222. package/dist/schemas/weekly_plan.js.map +1 -0
  223. package/dist/schemas/weight.js +28 -0
  224. package/dist/schemas/weight.js.map +1 -0
  225. package/dist/scripts/build_behaviors.js +114 -0
  226. package/dist/scripts/build_behaviors.js.map +1 -0
  227. package/dist/scripts/cognito_bootstrap.js +9 -277
  228. package/dist/scripts/cognito_bootstrap.js.map +1 -1
  229. package/dist/scripts/gen_activity_catalogs.js +104 -0
  230. package/dist/scripts/gen_activity_catalogs.js.map +1 -0
  231. package/dist/server-admin.js +156 -0
  232. package/dist/server-admin.js.map +1 -0
  233. package/dist/server-http.js +270 -48
  234. package/dist/server-http.js.map +1 -1
  235. package/dist/server.js +136 -23
  236. package/dist/server.js.map +1 -1
  237. package/dist/tools/annotations.js +15 -0
  238. package/dist/tools/annotations.js.map +1 -0
  239. package/dist/tools/define.js +31 -0
  240. package/dist/tools/define.js.map +1 -0
  241. package/dist/tools/register.js +59 -94
  242. package/dist/tools/register.js.map +1 -1
  243. package/dist/tools/resources.js +70 -0
  244. package/dist/tools/resources.js.map +1 -0
  245. package/dist/tools/slim_schema.js +90 -0
  246. package/dist/tools/slim_schema.js.map +1 -0
  247. package/dist/tools/v2/activity_delete.js +63 -17
  248. package/dist/tools/v2/activity_delete.js.map +1 -1
  249. package/dist/tools/v2/activity_edit.js +396 -0
  250. package/dist/tools/v2/activity_edit.js.map +1 -0
  251. package/dist/tools/v2/activity_log.js +152 -0
  252. package/dist/tools/v2/activity_log.js.map +1 -0
  253. package/dist/tools/v2/calendar.js +19 -21
  254. package/dist/tools/v2/calendar.js.map +1 -1
  255. package/dist/tools/v2/coach_ask.js +74 -110
  256. package/dist/tools/v2/coach_ask.js.map +1 -1
  257. package/dist/tools/v2/coach_history.js +120 -0
  258. package/dist/tools/v2/coach_history.js.map +1 -0
  259. package/dist/tools/v2/community.js +124 -0
  260. package/dist/tools/v2/community.js.map +1 -0
  261. package/dist/tools/v2/cycle.js +63 -15
  262. package/dist/tools/v2/cycle.js.map +1 -1
  263. package/dist/tools/v2/cycle_log.js +289 -32
  264. package/dist/tools/v2/cycle_log.js.map +1 -1
  265. package/dist/tools/v2/day.js +126 -24
  266. package/dist/tools/v2/day.js.map +1 -1
  267. package/dist/tools/v2/health.js +116 -0
  268. package/dist/tools/v2/health.js.map +1 -0
  269. package/dist/tools/v2/hr_zones_set.js +134 -34
  270. package/dist/tools/v2/hr_zones_set.js.map +1 -1
  271. package/dist/tools/v2/journal.js +75 -17
  272. package/dist/tools/v2/journal.js.map +1 -1
  273. package/dist/tools/v2/journal_log.js +306 -65
  274. package/dist/tools/v2/journal_log.js.map +1 -1
  275. package/dist/tools/v2/lift_exercise.js +125 -22
  276. package/dist/tools/v2/lift_exercise.js.map +1 -1
  277. package/dist/tools/v2/lift_exercise_set.js +291 -0
  278. package/dist/tools/v2/lift_exercise_set.js.map +1 -0
  279. package/dist/tools/v2/lift_library.js +51 -12
  280. package/dist/tools/v2/lift_library.js.map +1 -1
  281. package/dist/tools/v2/lift_log.js +309 -72
  282. package/dist/tools/v2/lift_log.js.map +1 -1
  283. package/dist/tools/v2/lift_sessions.js +248 -0
  284. package/dist/tools/v2/lift_sessions.js.map +1 -0
  285. package/dist/tools/v2/lift_template.js +232 -0
  286. package/dist/tools/v2/lift_template.js.map +1 -0
  287. package/dist/tools/v2/memory.js +45 -0
  288. package/dist/tools/v2/memory.js.map +1 -0
  289. package/dist/tools/v2/memory_set.js +107 -0
  290. package/dist/tools/v2/memory_set.js.map +1 -0
  291. package/dist/tools/v2/milestones.js +50 -0
  292. package/dist/tools/v2/milestones.js.map +1 -0
  293. package/dist/tools/v2/now.js +49 -0
  294. package/dist/tools/v2/now.js.map +1 -0
  295. package/dist/tools/v2/preferences.js +51 -0
  296. package/dist/tools/v2/preferences.js.map +1 -0
  297. package/dist/tools/v2/preferences_set.js +388 -0
  298. package/dist/tools/v2/preferences_set.js.map +1 -0
  299. package/dist/tools/v2/profile.js +54 -22
  300. package/dist/tools/v2/profile.js.map +1 -1
  301. package/dist/tools/v2/profile_update.js +167 -55
  302. package/dist/tools/v2/profile_update.js.map +1 -1
  303. package/dist/tools/v2/raw.js +91 -34
  304. package/dist/tools/v2/raw.js.map +1 -1
  305. package/dist/tools/v2/recovery.js +37 -23
  306. package/dist/tools/v2/recovery.js.map +1 -1
  307. package/dist/tools/v2/sleep.js +52 -16
  308. package/dist/tools/v2/sleep.js.map +1 -1
  309. package/dist/tools/v2/smart_alarm.js +54 -20
  310. package/dist/tools/v2/smart_alarm.js.map +1 -1
  311. package/dist/tools/v2/smart_alarm_set.js +264 -86
  312. package/dist/tools/v2/smart_alarm_set.js.map +1 -1
  313. package/dist/tools/v2/strain.js +15 -15
  314. package/dist/tools/v2/strain.js.map +1 -1
  315. package/dist/tools/v2/stress.js +17 -15
  316. package/dist/tools/v2/stress.js.map +1 -1
  317. package/dist/tools/v2/trend.js +56 -20
  318. package/dist/tools/v2/trend.js.map +1 -1
  319. package/dist/tools/v2/weekly_plan.js +30 -0
  320. package/dist/tools/v2/weekly_plan.js.map +1 -0
  321. package/dist/tools/v2/weekly_plan_set.js +134 -0
  322. package/dist/tools/v2/weekly_plan_set.js.map +1 -0
  323. package/dist/tools/v2/weight.js +56 -0
  324. package/dist/tools/v2/weight.js.map +1 -0
  325. package/dist/tools/v2/weight_log.js +188 -0
  326. package/dist/tools/v2/weight_log.js.map +1 -0
  327. package/dist/tools/v2/workouts.js +159 -25
  328. package/dist/tools/v2/workouts.js.map +1 -1
  329. package/dist/version.js +6 -0
  330. package/dist/version.js.map +1 -0
  331. package/dist/whoop/bff.js +94 -0
  332. package/dist/whoop/bff.js.map +1 -0
  333. package/dist/whoop/client.js +392 -18
  334. package/dist/whoop/client.js.map +1 -1
  335. package/dist/whoop/cognito.js +106 -79
  336. package/dist/whoop/cognito.js.map +1 -1
  337. package/dist/whoop/connect_page.js +165 -0
  338. package/dist/whoop/connect_page.js.map +1 -0
  339. package/dist/whoop/consent_font.js +287 -0
  340. package/dist/whoop/consent_font.js.map +1 -0
  341. package/dist/whoop/consent_logos.js +22 -0
  342. package/dist/whoop/consent_logos.js.map +1 -0
  343. package/dist/whoop/consent_page.js +291 -0
  344. package/dist/whoop/consent_page.js.map +1 -0
  345. package/dist/whoop/constants.js +5 -1
  346. package/dist/whoop/constants.js.map +1 -1
  347. package/dist/whoop/device.js +4 -4
  348. package/dist/whoop/device.js.map +1 -1
  349. package/dist/whoop/errors.js +85 -4
  350. package/dist/whoop/errors.js.map +1 -1
  351. package/dist/whoop/init_timezone.js +57 -17
  352. package/dist/whoop/init_timezone.js.map +1 -1
  353. package/dist/whoop/installation.js +15 -10
  354. package/dist/whoop/installation.js.map +1 -1
  355. package/dist/whoop/json_out.js +52 -6
  356. package/dist/whoop/json_out.js.map +1 -1
  357. package/dist/whoop/oauth_provider.js +81 -78
  358. package/dist/whoop/oauth_provider.js.map +1 -1
  359. package/dist/whoop/token_lock.js +331 -0
  360. package/dist/whoop/token_lock.js.map +1 -0
  361. package/dist/whoop/token_manager.js +536 -42
  362. package/dist/whoop/token_manager.js.map +1 -1
  363. package/dist/whoop/token_store.js +303 -36
  364. package/dist/whoop/token_store.js.map +1 -1
  365. package/dist/whoop/units.js +28 -0
  366. package/dist/whoop/units.js.map +1 -0
  367. package/package.json +29 -13
  368. package/scripts/build-mcpb.mjs +72 -0
  369. package/scripts/embed-consent-font.mjs +34 -0
  370. package/scripts/readme-media.ts +195 -0
  371. package/scripts/tools-md.ts +89 -0
  372. package/scripts/whoop-md.ts +119 -0
  373. package/src/build_info.ts +4 -0
  374. package/src/cli/app.ts +696 -0
  375. package/src/cli/auth.ts +350 -0
  376. package/src/cli/auth_flow.ts +356 -0
  377. package/src/cli/browser_login.ts +402 -0
  378. package/src/cli/clients.ts +467 -0
  379. package/src/cli/deploy_record.ts +100 -0
  380. package/src/cli/index.ts +41 -583
  381. package/src/cli/links.ts +43 -0
  382. package/src/cli/logo.ts +64 -0
  383. package/src/cli/setup.ts +1147 -979
  384. package/src/cli/spawn.ts +88 -0
  385. package/src/cli/sys.ts +267 -0
  386. package/src/cli/ui.ts +778 -436
  387. package/src/cli/update.ts +436 -274
  388. package/src/cloudflare/runtime.d.ts +27 -0
  389. package/src/cloudflare/token_store.ts +57 -0
  390. package/src/cloudflare/worker.ts +174 -0
  391. package/src/data/behaviors.ts +2760 -622
  392. package/src/data/endpoint_catalog.ts +2695 -0
  393. package/src/data/exercises.ts +379 -4861
  394. package/src/data/garments.ts +28 -0
  395. package/src/data/sports.ts +239 -211
  396. package/src/lib/activity_list.ts +150 -0
  397. package/src/lib/activity_records.ts +213 -0
  398. package/src/lib/activity_results.ts +51 -0
  399. package/src/lib/activity_types.ts +176 -0
  400. package/src/lib/brand.ts +71 -0
  401. package/src/lib/clock.ts +16 -0
  402. package/src/lib/coach_session.ts +434 -0
  403. package/src/lib/dates.ts +18 -0
  404. package/src/lib/env_file.ts +191 -0
  405. package/src/lib/health_plans_write.ts +53 -0
  406. package/src/lib/heart_rate.ts +42 -0
  407. package/src/lib/highlight.ts +71 -0
  408. package/src/lib/install_links.ts +61 -0
  409. package/src/lib/instant.ts +54 -0
  410. package/src/lib/journal_behaviors.ts +453 -0
  411. package/src/lib/lift_catalog.ts +258 -0
  412. package/src/lib/lift_history.ts +75 -0
  413. package/src/lib/lift_sets.ts +164 -0
  414. package/src/lib/lift_tool.ts +25 -0
  415. package/src/lib/profile_settings.ts +102 -0
  416. package/src/lib/screen_content.ts +40 -0
  417. package/src/lib/timezone.ts +44 -8
  418. package/src/lib/walk.ts +4 -1
  419. package/src/lib/weight_readings.ts +82 -0
  420. package/src/projections/activities.ts +199 -0
  421. package/src/projections/alarm_schedule.ts +98 -0
  422. package/src/projections/coach.ts +218 -0
  423. package/src/projections/community.ts +187 -0
  424. package/src/projections/health_features.ts +191 -0
  425. package/src/projections/hormonal_insights.ts +277 -0
  426. package/src/projections/journal_v2.ts +173 -0
  427. package/src/projections/lift_cards.ts +131 -0
  428. package/src/projections/lift_exercise_v2.ts +147 -0
  429. package/src/projections/lift_library_v2.ts +77 -0
  430. package/src/projections/lift_sessions.ts +250 -0
  431. package/src/projections/memory.ts +100 -0
  432. package/src/projections/milestones.ts +133 -0
  433. package/src/projections/profile_v2.ts +166 -0
  434. package/src/projections/settings_v2.ts +179 -0
  435. package/src/projections/sleep.ts +7 -21
  436. package/src/projections/v2/calendar.ts +48 -0
  437. package/src/projections/v2/core_common.ts +95 -0
  438. package/src/projections/v2/core_home.ts +177 -0
  439. package/src/projections/v2/core_sleep_need.ts +37 -0
  440. package/src/projections/v2/day.ts +162 -0
  441. package/src/projections/v2/heart_rate.ts +73 -0
  442. package/src/projections/v2/history.ts +153 -0
  443. package/src/projections/v2/now.ts +59 -0
  444. package/src/projections/v2/recovery.ts +120 -0
  445. package/src/projections/v2/sleep.ts +281 -0
  446. package/src/projections/v2/strain.ts +63 -0
  447. package/src/projections/v2/stress.ts +111 -0
  448. package/src/projections/v2/trend.ts +242 -0
  449. package/src/projections/weekly_plan.ts +79 -0
  450. package/src/projections/weight_readings.ts +57 -0
  451. package/src/projections/workout.ts +36 -17
  452. package/src/schemas/activities.ts +136 -0
  453. package/src/schemas/alarm_schedule.ts +70 -0
  454. package/src/schemas/coach.ts +98 -8
  455. package/src/schemas/community.ts +77 -0
  456. package/src/schemas/health.ts +36 -0
  457. package/src/schemas/hormonal_insights.ts +108 -0
  458. package/src/schemas/journal.ts +4 -0
  459. package/src/schemas/journal_v2.ts +112 -0
  460. package/src/schemas/memory.ts +48 -0
  461. package/src/schemas/milestones.ts +48 -0
  462. package/src/schemas/profile_v2.ts +63 -0
  463. package/src/schemas/settings_v2.ts +63 -0
  464. package/src/schemas/sleep.ts +9 -1
  465. package/src/schemas/strength.ts +10 -1
  466. package/src/schemas/strength_v2.ts +210 -0
  467. package/src/schemas/v2/calendar.ts +8 -0
  468. package/src/schemas/v2/core_common.ts +50 -0
  469. package/src/schemas/v2/day.ts +79 -0
  470. package/src/schemas/v2/now.ts +25 -0
  471. package/src/schemas/v2/recovery.ts +38 -0
  472. package/src/schemas/v2/sleep.ts +46 -0
  473. package/src/schemas/v2/strain.ts +16 -0
  474. package/src/schemas/v2/stress.ts +20 -0
  475. package/src/schemas/v2/trend.ts +45 -0
  476. package/src/schemas/weekly_plan.ts +36 -0
  477. package/src/schemas/weight.ts +53 -0
  478. package/src/scripts/build_behaviors.ts +116 -0
  479. package/src/scripts/cognito_bootstrap.ts +10 -249
  480. package/src/scripts/gen_activity_catalogs.ts +121 -0
  481. package/src/server-admin.ts +171 -0
  482. package/src/server-http.ts +290 -53
  483. package/src/server.ts +130 -26
  484. package/src/tools/annotations.ts +25 -0
  485. package/src/tools/define.ts +53 -0
  486. package/src/tools/register.ts +64 -94
  487. package/src/tools/resources.ts +92 -0
  488. package/src/tools/slim_schema.ts +102 -0
  489. package/src/tools/v2/activity_delete.ts +61 -23
  490. package/src/tools/v2/activity_edit.ts +378 -0
  491. package/src/tools/v2/activity_log.ts +154 -0
  492. package/src/tools/v2/calendar.ts +22 -21
  493. package/src/tools/v2/coach_ask.ts +83 -119
  494. package/src/tools/v2/coach_history.ts +140 -0
  495. package/src/tools/v2/community.ts +137 -0
  496. package/src/tools/v2/cycle.ts +78 -20
  497. package/src/tools/v2/cycle_log.ts +291 -40
  498. package/src/tools/v2/day.ts +126 -25
  499. package/src/tools/v2/health.ts +114 -0
  500. package/src/tools/v2/hr_zones_set.ts +132 -45
  501. package/src/tools/v2/journal.ts +78 -23
  502. package/src/tools/v2/journal_log.ts +321 -69
  503. package/src/tools/v2/lift_exercise.ts +135 -27
  504. package/src/tools/v2/lift_exercise_set.ts +272 -0
  505. package/src/tools/v2/lift_library.ts +57 -21
  506. package/src/tools/v2/lift_log.ts +325 -83
  507. package/src/tools/v2/lift_sessions.ts +255 -0
  508. package/src/tools/v2/lift_template.ts +229 -0
  509. package/src/tools/v2/memory.ts +54 -0
  510. package/src/tools/v2/memory_set.ts +110 -0
  511. package/src/tools/v2/milestones.ts +59 -0
  512. package/src/tools/v2/now.ts +61 -0
  513. package/src/tools/v2/preferences.ts +61 -0
  514. package/src/tools/v2/preferences_set.ts +403 -0
  515. package/src/tools/v2/profile.ts +56 -26
  516. package/src/tools/v2/profile_update.ts +151 -60
  517. package/src/tools/v2/raw.ts +89 -36
  518. package/src/tools/v2/recovery.ts +44 -25
  519. package/src/tools/v2/sleep.ts +57 -18
  520. package/src/tools/v2/smart_alarm.ts +62 -24
  521. package/src/tools/v2/smart_alarm_set.ts +240 -90
  522. package/src/tools/v2/strain.ts +19 -16
  523. package/src/tools/v2/stress.ts +22 -17
  524. package/src/tools/v2/trend.ts +58 -20
  525. package/src/tools/v2/weekly_plan.ts +38 -0
  526. package/src/tools/v2/weekly_plan_set.ts +132 -0
  527. package/src/tools/v2/weight.ts +61 -0
  528. package/src/tools/v2/weight_log.ts +193 -0
  529. package/src/tools/v2/workouts.ts +156 -26
  530. package/src/version.ts +5 -0
  531. package/src/whoop/bff.ts +84 -0
  532. package/src/whoop/client.ts +448 -18
  533. package/src/whoop/cognito.ts +110 -99
  534. package/src/whoop/connect_page.ts +183 -0
  535. package/src/whoop/consent_font.ts +289 -0
  536. package/src/whoop/consent_logos.ts +24 -0
  537. package/src/whoop/consent_page.ts +326 -0
  538. package/src/whoop/constants.ts +5 -1
  539. package/src/whoop/device.ts +4 -4
  540. package/src/whoop/errors.ts +89 -4
  541. package/src/whoop/init_timezone.ts +57 -16
  542. package/src/whoop/installation.ts +16 -7
  543. package/src/whoop/json_out.ts +51 -6
  544. package/src/whoop/oauth_provider.ts +84 -91
  545. package/src/whoop/token_lock.ts +345 -0
  546. package/src/whoop/token_manager.ts +580 -53
  547. package/src/whoop/token_store.ts +341 -32
  548. package/src/whoop/units.ts +35 -0
  549. package/wrangler.jsonc +17 -0
  550. package/assets/banner.svg +0 -38
  551. package/dist/data/endpoints.js +0 -320
  552. package/dist/data/endpoints.js.map +0 -1
  553. package/dist/lib/format.js +0 -22
  554. package/dist/lib/format.js.map +0 -1
  555. package/dist/lib/stats.js +0 -32
  556. package/dist/lib/stats.js.map +0 -1
  557. package/dist/projections/calendar.js +0 -33
  558. package/dist/projections/calendar.js.map +0 -1
  559. package/dist/projections/communities.js +0 -105
  560. package/dist/projections/communities.js.map +0 -1
  561. package/dist/projections/cycle.js +0 -81
  562. package/dist/projections/cycle.js.map +0 -1
  563. package/dist/projections/hr_zones.js +0 -35
  564. package/dist/projections/hr_zones.js.map +0 -1
  565. package/dist/projections/journal.js +0 -56
  566. package/dist/projections/journal.js.map +0 -1
  567. package/dist/projections/leaderboard.js +0 -37
  568. package/dist/projections/leaderboard.js.map +0 -1
  569. package/dist/projections/lift_exercise.js +0 -22
  570. package/dist/projections/lift_exercise.js.map +0 -1
  571. package/dist/projections/lift_history.js +0 -133
  572. package/dist/projections/lift_history.js.map +0 -1
  573. package/dist/projections/lift_library.js +0 -71
  574. package/dist/projections/lift_library.js.map +0 -1
  575. package/dist/projections/lift_progression.js +0 -138
  576. package/dist/projections/lift_progression.js.map +0 -1
  577. package/dist/projections/lift_prs.js +0 -20
  578. package/dist/projections/lift_prs.js.map +0 -1
  579. package/dist/projections/live_hr.js +0 -19
  580. package/dist/projections/live_hr.js.map +0 -1
  581. package/dist/projections/live_state.js +0 -23
  582. package/dist/projections/live_state.js.map +0 -1
  583. package/dist/projections/live_stress.js +0 -11
  584. package/dist/projections/live_stress.js.map +0 -1
  585. package/dist/projections/performance_assessment.js +0 -15
  586. package/dist/projections/performance_assessment.js.map +0 -1
  587. package/dist/projections/profile.js +0 -59
  588. package/dist/projections/profile.js.map +0 -1
  589. package/dist/projections/recovery.js +0 -131
  590. package/dist/projections/recovery.js.map +0 -1
  591. package/dist/projections/sleep_need.js +0 -32
  592. package/dist/projections/sleep_need.js.map +0 -1
  593. package/dist/projections/smart_alarm.js +0 -45
  594. package/dist/projections/smart_alarm.js.map +0 -1
  595. package/dist/projections/strain.js +0 -128
  596. package/dist/projections/strain.js.map +0 -1
  597. package/dist/projections/stress.js +0 -86
  598. package/dist/projections/stress.js.map +0 -1
  599. package/dist/projections/today.js +0 -129
  600. package/dist/projections/today.js.map +0 -1
  601. package/dist/projections/trend.js +0 -149
  602. package/dist/projections/trend.js.map +0 -1
  603. package/dist/projections/workouts.js +0 -37
  604. package/dist/projections/workouts.js.map +0 -1
  605. package/dist/schemas/calendar.js +0 -12
  606. package/dist/schemas/calendar.js.map +0 -1
  607. package/dist/schemas/communities.js +0 -51
  608. package/dist/schemas/communities.js.map +0 -1
  609. package/dist/schemas/compare.js +0 -15
  610. package/dist/schemas/compare.js.map +0 -1
  611. package/dist/schemas/leaderboard.js +0 -25
  612. package/dist/schemas/leaderboard.js.map +0 -1
  613. package/dist/schemas/live.js +0 -26
  614. package/dist/schemas/live.js.map +0 -1
  615. package/dist/schemas/performance.js +0 -12
  616. package/dist/schemas/performance.js.map +0 -1
  617. package/dist/schemas/profile.js +0 -39
  618. package/dist/schemas/profile.js.map +0 -1
  619. package/dist/schemas/recovery.js +0 -27
  620. package/dist/schemas/recovery.js.map +0 -1
  621. package/dist/schemas/settings.js +0 -26
  622. package/dist/schemas/settings.js.map +0 -1
  623. package/dist/schemas/sleep_need.js +0 -15
  624. package/dist/schemas/sleep_need.js.map +0 -1
  625. package/dist/schemas/smart_alarm.js +0 -36
  626. package/dist/schemas/smart_alarm.js.map +0 -1
  627. package/dist/schemas/strain.js +0 -24
  628. package/dist/schemas/strain.js.map +0 -1
  629. package/dist/schemas/stress.js +0 -16
  630. package/dist/schemas/stress.js.map +0 -1
  631. package/dist/schemas/today.js +0 -38
  632. package/dist/schemas/today.js.map +0 -1
  633. package/dist/schemas/trend.js +0 -50
  634. package/dist/schemas/trend.js.map +0 -1
  635. package/dist/schemas/womens_health.js +0 -23
  636. package/dist/schemas/womens_health.js.map +0 -1
  637. package/dist/tools/v2/activity_create.js +0 -64
  638. package/dist/tools/v2/activity_create.js.map +0 -1
  639. package/dist/tools/v2/behavior_impact.js +0 -36
  640. package/dist/tools/v2/behavior_impact.js.map +0 -1
  641. package/dist/tools/v2/communities.js +0 -60
  642. package/dist/tools/v2/communities.js.map +0 -1
  643. package/dist/tools/v2/compare.js +0 -67
  644. package/dist/tools/v2/compare.js.map +0 -1
  645. package/dist/tools/v2/endpoints.js +0 -28
  646. package/dist/tools/v2/endpoints.js.map +0 -1
  647. package/dist/tools/v2/hidden_metric.js +0 -28
  648. package/dist/tools/v2/hidden_metric.js.map +0 -1
  649. package/dist/tools/v2/hr_zones.js +0 -24
  650. package/dist/tools/v2/hr_zones.js.map +0 -1
  651. package/dist/tools/v2/journal_autopop.js +0 -19
  652. package/dist/tools/v2/journal_autopop.js.map +0 -1
  653. package/dist/tools/v2/journal_catalog.js +0 -44
  654. package/dist/tools/v2/journal_catalog.js.map +0 -1
  655. package/dist/tools/v2/leaderboard.js +0 -79
  656. package/dist/tools/v2/leaderboard.js.map +0 -1
  657. package/dist/tools/v2/lift_catalog.js +0 -47
  658. package/dist/tools/v2/lift_catalog.js.map +0 -1
  659. package/dist/tools/v2/lift_custom_exercise.js +0 -108
  660. package/dist/tools/v2/lift_custom_exercise.js.map +0 -1
  661. package/dist/tools/v2/lift_history.js +0 -39
  662. package/dist/tools/v2/lift_history.js.map +0 -1
  663. package/dist/tools/v2/lift_progression.js +0 -30
  664. package/dist/tools/v2/lift_progression.js.map +0 -1
  665. package/dist/tools/v2/lift_prs.js +0 -21
  666. package/dist/tools/v2/lift_prs.js.map +0 -1
  667. package/dist/tools/v2/lift_template_save.js +0 -83
  668. package/dist/tools/v2/lift_template_save.js.map +0 -1
  669. package/dist/tools/v2/live_hr.js +0 -21
  670. package/dist/tools/v2/live_hr.js.map +0 -1
  671. package/dist/tools/v2/live_state.js +0 -21
  672. package/dist/tools/v2/live_state.js.map +0 -1
  673. package/dist/tools/v2/live_stress.js +0 -22
  674. package/dist/tools/v2/live_stress.js.map +0 -1
  675. package/dist/tools/v2/performance_assessment.js +0 -38
  676. package/dist/tools/v2/performance_assessment.js.map +0 -1
  677. package/dist/tools/v2/sleep_need.js +0 -21
  678. package/dist/tools/v2/sleep_need.js.map +0 -1
  679. package/dist/tools/v2/sports_catalog.js +0 -26
  680. package/dist/tools/v2/sports_catalog.js.map +0 -1
  681. package/dist/tools/v2/symptom_log.js +0 -72
  682. package/dist/tools/v2/symptom_log.js.map +0 -1
  683. package/dist/tools/v2/today.js +0 -30
  684. package/dist/tools/v2/today.js.map +0 -1
  685. package/dist/tools/v2/workout.js +0 -23
  686. package/dist/tools/v2/workout.js.map +0 -1
  687. package/dist/whoop/build_lift_body.js +0 -67
  688. package/dist/whoop/build_lift_body.js.map +0 -1
  689. package/dist/whoop/session_state.js +0 -34
  690. package/dist/whoop/session_state.js.map +0 -1
  691. package/dist/whoop/types.js +0 -82
  692. package/dist/whoop/types.js.map +0 -1
  693. package/src/data/endpoints.ts +0 -319
  694. package/src/lib/format.ts +0 -27
  695. package/src/lib/stats.ts +0 -35
  696. package/src/projections/calendar.ts +0 -46
  697. package/src/projections/communities.ts +0 -135
  698. package/src/projections/cycle.ts +0 -85
  699. package/src/projections/hr_zones.ts +0 -43
  700. package/src/projections/journal.ts +0 -55
  701. package/src/projections/leaderboard.ts +0 -49
  702. package/src/projections/lift_exercise.ts +0 -29
  703. package/src/projections/lift_history.ts +0 -140
  704. package/src/projections/lift_library.ts +0 -70
  705. package/src/projections/lift_progression.ts +0 -138
  706. package/src/projections/lift_prs.ts +0 -23
  707. package/src/projections/live_hr.ts +0 -21
  708. package/src/projections/live_state.ts +0 -28
  709. package/src/projections/live_stress.ts +0 -13
  710. package/src/projections/performance_assessment.ts +0 -19
  711. package/src/projections/profile.ts +0 -71
  712. package/src/projections/recovery.ts +0 -133
  713. package/src/projections/sleep_need.ts +0 -36
  714. package/src/projections/smart_alarm.ts +0 -70
  715. package/src/projections/strain.ts +0 -131
  716. package/src/projections/stress.ts +0 -95
  717. package/src/projections/today.ts +0 -166
  718. package/src/projections/trend.ts +0 -149
  719. package/src/projections/workouts.ts +0 -36
  720. package/src/schemas/calendar.ts +0 -13
  721. package/src/schemas/communities.ts +0 -56
  722. package/src/schemas/compare.ts +0 -17
  723. package/src/schemas/leaderboard.ts +0 -26
  724. package/src/schemas/live.ts +0 -31
  725. package/src/schemas/performance.ts +0 -13
  726. package/src/schemas/profile.ts +0 -40
  727. package/src/schemas/recovery.ts +0 -28
  728. package/src/schemas/settings.ts +0 -30
  729. package/src/schemas/sleep_need.ts +0 -16
  730. package/src/schemas/smart_alarm.ts +0 -40
  731. package/src/schemas/strain.ts +0 -25
  732. package/src/schemas/stress.ts +0 -17
  733. package/src/schemas/today.ts +0 -39
  734. package/src/schemas/trend.ts +0 -53
  735. package/src/schemas/womens_health.ts +0 -26
  736. package/src/tools/v2/activity_create.ts +0 -74
  737. package/src/tools/v2/behavior_impact.ts +0 -39
  738. package/src/tools/v2/communities.ts +0 -65
  739. package/src/tools/v2/compare.ts +0 -83
  740. package/src/tools/v2/endpoints.ts +0 -32
  741. package/src/tools/v2/hidden_metric.ts +0 -33
  742. package/src/tools/v2/hr_zones.ts +0 -29
  743. package/src/tools/v2/journal_autopop.ts +0 -26
  744. package/src/tools/v2/journal_catalog.ts +0 -48
  745. package/src/tools/v2/leaderboard.ts +0 -92
  746. package/src/tools/v2/lift_catalog.ts +0 -48
  747. package/src/tools/v2/lift_custom_exercise.ts +0 -117
  748. package/src/tools/v2/lift_history.ts +0 -52
  749. package/src/tools/v2/lift_progression.ts +0 -34
  750. package/src/tools/v2/lift_prs.ts +0 -26
  751. package/src/tools/v2/lift_template_save.ts +0 -89
  752. package/src/tools/v2/live_hr.ts +0 -26
  753. package/src/tools/v2/live_state.ts +0 -26
  754. package/src/tools/v2/live_stress.ts +0 -27
  755. package/src/tools/v2/performance_assessment.ts +0 -44
  756. package/src/tools/v2/sleep_need.ts +0 -26
  757. package/src/tools/v2/sports_catalog.ts +0 -32
  758. package/src/tools/v2/symptom_log.ts +0 -78
  759. package/src/tools/v2/today.ts +0 -35
  760. package/src/tools/v2/workout.ts +0 -28
  761. package/src/whoop/build_lift_body.ts +0 -84
  762. package/src/whoop/session_state.ts +0 -41
  763. package/src/whoop/types.ts +0 -89
package/TOOLS.md CHANGED
@@ -1,429 +1,566 @@
1
- # The 48 tools
1
+ # The 41 tools
2
2
 
3
- > Full reference for every tool exposed by [totem](README.md). Each entry has the input shape, source endpoint(s), and output shape. Catalog tools (`whoop_sports_catalog`, `whoop_lift_catalog`, `whoop_journal_catalog`) unlock their gated counterparts — see [README → Bundled catalogs](README.md#bundled-catalogs).
3
+ What totem gives an AI app: 24 tools that read your WHOOP data and 17 that change it.
4
+ This page is written from the tool registry (`npx tsx scripts/tools-md.ts`), so it says exactly what an app sees.
4
5
 
6
+ - **Changes need a yes.** A tool that writes returns a preview of what it would send, and does nothing until it is called again with `confirm: true`. Your app shows you the preview first.
7
+ - **Small by default.** A call with only its required inputs answers in about 1.5 KB. The heavy parts (a hypnogram, every set of every lift, a heart-rate series) come with `include`.
8
+ - **Your time zone.** Times come back in your WHOOP time zone. A time you give without an offset (`2026-11-20T08:00`) is read on your clock too.
5
9
 
6
- Below is every tool with its signature, source endpoints, and notes. Inputs are the zod schema; outputs are described as TypeScript-ish for brevity (full schemas in `src/schemas/`).
10
+ - [Today and any day](#today-and-any-day)
11
+ - [Trends](#trends)
12
+ - [Activities](#activities)
13
+ - [Strength Trainer](#strength-trainer)
14
+ - [Journal](#journal)
15
+ - [WHOOP Coach](#whoop-coach)
16
+ - [Body](#body)
17
+ - [Plans and alarms](#plans-and-alarms)
18
+ - [Health features](#health-features)
19
+ - [Profile, settings and community](#profile-settings-and-community)
20
+ - [Anything else](#anything-else)
7
21
 
8
- ### Snapshots & profile (4)
22
+ ## Today and any day
9
23
 
10
- #### `whoop_today`
11
- Composite snapshot of today: recovery score + state, sleep performance + stages, day strain so far, current activity state, workouts count.
24
+ Scores, sleep, strain, stress and heart rate for a day, or a table of many days.
12
25
 
13
- - **Input:** `{}`
14
- - **Source endpoints (3 parallel):** `GET /home-service/v1/home?date=today`, `GET /developer/v2/activity/sleep?limit=5` (light ~1 KB sleep summary — the full per-minute hypnogram is `whoop_sleep`'s job, not the snapshot's), `GET /activities-service/v1/user-state`
15
- - **Output:** `{date, recovery: {score, state, hrv_ms, rhr_bpm}, sleep: {performance_pct, total_sleep_ms, time_in_bed_ms, efficiency_pct, stages: {rem_ms, light_ms, sws_ms, wake_ms}, started_at, ended_at}, strain: {score, calories, avg_hr_bpm, max_hr_bpm, workouts_count}, current_state: {state, sport_name, started_at}}`
26
+ ### `whoop_now`
16
27
 
17
- #### `whoop_day`
18
- Same composite as `whoop_today` but for any past date. Drops the live state (not relevant for historical days).
28
+ Live snapshot: activity state (idle, workout, sleep…) with sport and minutes so far, when WHOOP last processed strap data and the heart rate at that moment, current stress, and today's recovery, sleep, strain, calories and HRV.
19
29
 
20
- - **Input:** `{date: string}` (required, YYYY-MM-DD)
21
- - **Source:** Same as `whoop_today` minus the user-state fetch
22
- - **Output:** Same as `whoop_today`, with `current_state.*` set to null
30
+ No inputs.
23
31
 
24
- #### `whoop_profile`
25
- Identity + body measurements + privacy state.
32
+ ### `whoop_day`
26
33
 
27
- - **Input:** `{}`
28
- - **Source endpoints (4 parallel):** `/users-service/v2/bootstrap`, `/users-service/v1/hidden-metrics/BODY_COMP`, `/users-service/v1/hidden-metrics/HEALTHSPAN`, `/users-service/v1/stealth-mode`
29
- - **Output:** `{user_id, account_id, email, username, first_name, last_name, birthday, gender, height: {m, cm, ft}, weight: {kg, lb}, city, country, timezone_offset, bio_data: {max_hr_bpm, resting_hr_bpm, min_hr_bpm}, fitness_level, membership: {status, in_effect}, privacy: {stealth_mode, body_comp_hidden, healthspan_hidden}}`
34
+ One cycle day (default today): scores, main sleep, strain, calories, steps, activities and, today, the live state. sleep_plan is today only. hr: heart rate every 10 min, or a window via hr_from/hr_to (1-min steps up to 5 h, 6 s up to 30 min). end_date: a table of daily recovery, HRV, RHR, sleep, strain, calories and HR instead. Scores are null while calibrating. Never reuse the cycle id: sleep edits change it.
30
35
 
31
- #### `whoop_calendar`
32
- Per-day recovery / sleep / strain scores for a month.
36
+ | Input | Type | Notes |
37
+ |---|---|---|
38
+ | `date` | string | |
39
+ | `end_date` | string | Table from date: default 30 days, max 180 |
40
+ | `include` | list of `scores`, `sleep`, `strain`, `activities`, `sleep_plan`, `key_stats`, `hr` | Default scores, sleep, strain, activities |
41
+ | `hr_from` | string | With hr_to, max 48 h |
42
+ | `hr_to` | string | |
33
43
 
34
- - **Input:** `{date?: string}` (any day in the target month; default today)
35
- - **Source endpoints (2 parallel):** `/home-service/v1/calendar/overview?date=`, `/home-service/v1/calendar/recovery?date=`
36
- - **Output:** `{month: "YYYY-MM", days: [{date, recovery_score, recovery_state, sleep_score, day_strain}]}`
44
+ ### `whoop_recovery`
37
45
 
38
- ### Deep dives (3)
46
+ Recovery for a cycle day (default today): score, state and contributors (HRV, RHR, respiratory rate, sleep performance) vs baseline. Today only: Health Monitor (SpO2, skin temperature as a °F deviation from baseline, RR, RHR, HRV). include assessment adds the weekly and monthly performance assessment.
39
47
 
40
- #### `whoop_recovery`
41
- Recovery score + HRV (with baseline) + RHR (with baseline) + respiratory rate + SpO2 + skin temp + sleep performance.
48
+ | Input | Type | Notes |
49
+ |---|---|---|
50
+ | `date` | string | |
51
+ | `include` | list of `assessment` | |
42
52
 
43
- - **Input:** `{date?: string}`
44
- - **Source:** `GET /home-service/v1/deep-dive/recovery?date=`
45
- - **Output:** `{date, score, state, hrv:{ms,baseline_ms,delta_pct}, rhr:{bpm,baseline_bpm,delta_pct}, respiratory_rate, spo2_pct, skin_temp_c, sleep_performance_pct, contributors:[{name,direction,detail}], calibration_state}`. Full schema in `src/schemas/recovery.ts`. (In the current SCORE_GAUGE/CONTRIBUTORS_TILE shape, `contributors` returns `[]` and `calibration_state` returns `null` — the per-metric data lives in the typed `hrv`/`rhr`/`respiratory_rate`/`spo2_pct`/`skin_temp_c`/`sleep_performance_pct` fields above.)
46
- - **Walk shape (new):** `SCORE_GAUGE { id: "RECOVERY_SCORE_GAUGE" }.content.score_display` for the score, `CONTRIBUTORS_TILE { id: "RECOVERY_CONTRIBUTORS_TILE" }.content.metrics[]` for each contributor. Each metric carries `status` (today's value) and `status_subtitle` (baseline — API-provided, not computed). Whoop migrated from `GRAPHING_CARD` tiles to this shape in May 2026; the projection was rewritten on 2026-05-26.
47
- - **Baseline:** unlike the old projection (which computed a 6-day rolling mean), baselines now come straight from the API in `status_subtitle`. Same field on the wire, no client-side math.
48
- - **SpO2 / skin_temp:** populated only on 4.0+ straps. The new contributors tile includes `CONTRIBUTORS_TILE_SPO2` and `CONTRIBUTORS_TILE_SKIN_TEMPERATURE` when present.
53
+ ### `whoop_sleep`
49
54
 
50
- #### `whoop_sleep`
51
- Sleep duration, time in bed, efficiency, performance, consistency, all 4 stages (REM / LIGHT / SWS / AWAKE) with ms + percent, the full hypnogram (per-stage timeline), in-sleep heart rate (avg/min), disturbances.
55
+ Sleep for a cycle day (default today = last night's main sleep) or one sleep or nap by activity_id: window, minutes asleep and in bed, efficiency, stages, disturbances, HR and performance, plus the day's naps (with ids) and tonight's sleep need (today only).
52
56
 
53
- - **Input:** `{date?: string}`
54
- - **Source:** `GET /home-service/v1/deep-dive/sleep/last-night?date=`
55
- - **Output:** `{date, started_at, ended_at, total_sleep_ms, time_in_bed_ms, efficiency_pct, performance_pct, consistency_pct, debt_ms, latency_ms, stages: {rem_ms, rem_pct, light_ms, light_pct, sws_ms, sws_pct, wake_ms, wake_pct}, hypnogram: [{started_at, ended_at, stage}], disturbances, sleep_hr: {avg_bpm, min_bpm}, sleep_hrv_ms, respiratory_rate}`
57
+ | Input | Type | Notes |
58
+ |---|---|---|
59
+ | `date` | string | |
60
+ | `activity_id` | string | |
61
+ | `include` | list of `hypnogram`, `need`, `naps` | Default naps, need |
56
62
 
57
- Note: the underlying endpoint is 848 KB. The projection extracts ~500 chars.
63
+ ### `whoop_strain`
58
64
 
59
- **Partially populated** — `sleep_hrv_ms`, `respiratory_rate`, `debt_ms`, `latency_ms` aren't exposed by this endpoint and return `null`. Everything else **is** populated: the per-stage durations + percentages (REM/light/SWS/wake), the **`hypnogram`** (reconstructed from the per-stage HR-curve points — timed off their clock labels, anchored to the sleep window), and **`sleep_hr`** (avg/min).
65
+ Day strain for a cycle day (default today): score (0–21), target (null while calibrating), contributors vs your 30-day baseline (zone minutes, strength minutes, steps) and the day's CARDIO activities. RECOVERY activities (sauna, meditation) don't count toward strain; see whoop_day.
60
66
 
61
- #### `whoop_strain`
62
- Day strain + HR zone time buckets + steps + strength activity time + workouts count.
67
+ | Input | Type | Notes |
68
+ |---|---|---|
69
+ | `date` | string | |
63
70
 
64
- - **Input:** `{date?: string}`
65
- - **Source:** `GET /home-service/v1/deep-dive/strain?date=`
66
- - **Output:** `{date, score, target: {value, optimal_lower, optimal_upper}, calories, avg_hr_bpm, max_hr_bpm, zone_durations: {zone_0_ms..zone_5_ms}, workouts_count, steps, strength_activity_time_ms}`
67
- - **Strain target:** `target.value` is Whoop's recovery-calibrated daily strain target; `optimal_lower`/`optimal_upper` bound the green zone. The deep-dive response stores these as 0–1 fractions of max strain (21); the projection multiplies by 21 so they're emitted as strain values, not fractions. Lets the AI answer "should I work out today?" with a number.
68
- - **Walk shape (new):** `SCORE_GAUGE { id: "STRAIN_SCORE_GAUGE" }.content.score_display` for the day strain, `CONTRIBUTORS_TILE { id: "STRAIN_CONTRIBUTORS_TILE" }.content.metrics[]` for time-bucket / step / strength-time contributors. `ACTIVITY` items in the same response represent the day's workouts (count = number of these items). Whoop migrated from `GRAPHING_CARD` tiles in May 2026; rewritten 2026-05-26.
69
- - **Removed fields:** `calories`, `avg_hr_bpm`, `max_hr_bpm`, and per-zone (zone_0/2/3/5) granularity are no longer in this deep-dive endpoint. They live per-workout — use `whoop_workout` for HR zone breakdown of a specific activity. The schema fields are kept (returning null) so the shape stays compatible if Whoop adds them back.
70
- - **HR zones:** Whoop now reports only `HR_ZONES_1_3` (low+mid intensity) and `HR_ZONES_4_5` (high intensity) at the day level. We store the 1-3 aggregate in `zone_1_ms` and the 4-5 aggregate in `zone_4_ms`; zones 0/2/3/5 stay null.
71
+ ### `whoop_stress`
71
72
 
72
- ### Trends (2)
73
+ Stress Monitor for a day (default today): state, current level (0–3) and label, min and peak, and minutes in low/medium/high stress. Today's graph covers the last 24 hours. include timeline adds the mean level per 30 minutes.
73
74
 
74
- #### `whoop_trend`
75
- Trend data for any of 25 metrics across up to four windows (week / month / six_month / year). Most metrics return 3 segments; a few (e.g. VO2_MAX) return 2.
75
+ | Input | Type | Notes |
76
+ |---|---|---|
77
+ | `date` | string | |
78
+ | `include` | list of `timeline` | |
76
79
 
77
- - **Input:** `{metric: "HRV" | "RHR" | "RECOVERY" | "DAY_STRAIN" | "CALORIES" | "STEPS" | "AVERAGE_HR" | "HOURS_V_NEED" | "HOURS_V_NEEDED_PERCENT" | "TIME_IN_BED" | "SLEEP_PERFORMANCE" | "SLEEP_EFFICIENCY" | "SLEEP_CONSISTENCY" | "SLEEP_DEBT_POST" | "RESTORATIVE_SLEEP" | "HR_ZONES_1_3" | "HR_ZONES_4_5" | "RESPIRATORY_RATE" | "STRENGTH_ACTIVITY_TIME" | "STRESS" | "STRESS_DURING_SLEEP" | "STRESS_DURING_NON_STRAIN" | "VO2_MAX" | "BODY_COMPOSITION" | "WEIGHT", end_date?: string}`
78
- - **Source:** `GET /progression-service/v3/trends/{metric}?endDate=`
79
- - **Output:** `{metric, end_date, segments: [{label: "week"|"month"|"six_month"|"year", start_date, end_date, avg, min, max, delta_pct, unit, points: [{date, value, value_display}]}], cardio_fitness_level}`
80
+ ## Trends
80
81
 
81
- Heads up: this is one of the larger tools by output size because it returns per-day data points across multiple windows. Use `whoop_compare` if you only need aggregate numbers.
82
+ Averages and changes over weeks and months, and the calendar of scores.
82
83
 
83
- #### `whoop_compare`
84
- Side-by-side comparison of two date windows across recovery / sleep performance / day strain / HRV / RHR.
84
+ ### `whoop_trend`
85
85
 
86
- - **Input:** `{window?: "week" | "month", end_a?: string, end_b?: string, metrics?: string[]}`
87
- - **Source:** 2× `whoop_trend` for each metric in the array
88
- - **Output:** `{window, a: {start_date, end_date}, b: {start_date, end_date}, metrics: [{metric, a_avg, b_avg, delta_abs, delta_pct, unit}]}`
86
+ Trends for 1–5 metrics over a window ending end_date (default today; week = 7 days, month 30, six_month 180): average, previous-window average, change % and direction. HR-zone and strength-time rows are weekly totals. compare_end_date adds a second window and the deltas.
89
87
 
90
- ### Stress + sleep coach (2)
88
+ | Input | Type | Notes |
89
+ |---|---|---|
90
+ | `metrics` (required) | list of `RECOVERY`, `HRV`, `RHR`, `RESPIRATORY_RATE`, `DAY_STRAIN`, `CALORIES`, `STEPS`, `AVERAGE_HR`, `HR_ZONES_1_3`, `HR_ZONES_4_5`, `HR_ZONES_ALL`, `STRENGTH_ACTIVITY_TIME`, `VO2_MAX`, `SLEEP_PERFORMANCE`, `TIME_IN_BED`, `HOURS_V_NEED`, `HOURS_V_NEEDED_PERCENT`, `SLEEP_CONSISTENCY`, `SLEEP_EFFICIENCY`, `RESTORATIVE_SLEEP`, `RESTORATIVE_SLEEP_PERCENT`, `SLEEP_DEBT_POST`, `STRESS`, `STRESS_DURING_SLEEP`, `STRESS_DURING_NON_STRAIN`, `BODY_COMPOSITION`, `WEIGHT` | |
91
+ | `window` | `week`, `month`, `six_month` | |
92
+ | `end_date` | string | |
93
+ | `compare_end_date` | string | |
94
+ | `include_points` | boolean | One value per day or week |
91
95
 
92
- #### `whoop_stress`
93
- Stress for a day: current level (0–3 scale, from the gauge), peak/min, and a downsampled intraday timeline. (`stress_state` on the wire is a string like `"RELAXED"`, not a timeline — the data lives in `gauge` + `stress_graph.graph`.)
96
+ ### `whoop_calendar`
94
97
 
95
- - **Input:** `{date?: string}`
96
- - **Source:** `GET /health-service/v2/stress-bff/{date}`
97
- - **Output:** `{date, current_level, baseline_level, peak_level, min_level, calibration_state, timeline: [{started_at, ended_at, level}]}` — the raw graph has ~700 intraday samples; the timeline is evenly downsampled to ≤48 points (timestamps reconstructed from each sample's local clock label).
98
+ Month grid for one pillar: days has one character per day (days[0] = the 1st): H/M/L = high/medium/low, J = journal entry, '-' = data but no score, '.' = no data. No numbers; whoop_day has a day's scores.
98
99
 
99
- #### `whoop_sleep_need`
100
- Recommended bedtime + sleep need breakdown (baseline + debt + strain + nap credit) + smart-alarm eligibility.
100
+ | Input | Type | Notes |
101
+ |---|---|---|
102
+ | `date` | string | Any day in the month |
103
+ | `pillar` | `recovery`, `strain`, `sleep`, `journal` | |
101
104
 
102
- - **Input:** `{}`
103
- - **Source:** `GET /coaching-service/v2/sleepneed`
104
- - **Output:** `{recommended_time_in_bed, recommended_time_in_bed_minutes, need_breakdown: {baseline_minutes, debt_minutes, strain_minutes, nap_credit_minutes}, next_schedule_day, smart_alarm_eligible, schedule_state}`
105
+ ## Activities
105
106
 
106
- ### Live (3)
107
+ Workouts, naps and sleeps: read them, log new ones, fix or remove them.
107
108
 
108
- #### `whoop_live_hr`
109
- Current heart rate from the strap (if recording).
109
+ ### `whoop_workouts`
110
110
 
111
- - **Input:** `{}`
112
- - **Source:** `GET /health-tab-bff/v1/health-tab` (extracts the LIVE_HR section)
113
- - **Output:** `{current_bpm, hr_zone, is_recording, last_updated_at, show_live_hr}`
114
- - **Caveat:** `is_recording` is false when the strap isn't streaming. `current_bpm` may be null or stale.
111
+ Activities. List: one cycle day (date) or start_date–end_date (≤31 days; default the last 7), pending and unscored included, as rows of id, type, sport, start, minutes, status and CARDIO strain. With activity_id: strain, calories, HR, zones, distance and MSK summary. Sleeps and naps: whoop_sleep.
115
112
 
116
- #### `whoop_live_state`
117
- What you're currently doing — workout, sleep, idle, recovery.
113
+ | Input | Type | Notes |
114
+ |---|---|---|
115
+ | `date` | string | |
116
+ | `start_date` | string | |
117
+ | `end_date` | string | |
118
+ | `activity_id` | string | |
119
+ | `include` | list of `hr` | Detail only |
120
+ | `types` | list of `CARDIO`, `RECOVERY`, `SLEEP` | Default CARDIO, RECOVERY |
121
+ | `sport` | string | Substring of the sport's name |
122
+ | `limit` | integer | |
118
123
 
119
- - **Input:** `{}`
120
- - **Source:** `GET /activities-service/v1/user-state`
121
- - **Output:** `{state: "workout"|"sleep"|"idle"|"recovery"|"unknown", sport_name, sport_id, activity_id, started_at, duration_so_far_ms, tracked_sleep, latest_metrics_at}`
124
+ ### `whoop_activity_log` (changes data)
122
125
 
123
- #### `whoop_live_stress`
124
- Current stress level (cheaper than `whoop_stress` if you don't need the timeline).
126
+ Log a past activity, nap or main sleep over start–end (≥1 min, not in the future); WHOOP scores it from strap data. type is an internal_name ("sauna", "nap", "sleep"), display name or sport_id; a miss returns the closest. Overlaps are refused. A main sleep permanently re-cuts the day's cycles. Previews unless confirm:true.
125
127
 
126
- - **Input:** `{}`
127
- - **Source:** `GET /health-service/v2/stress-bff/{today}` (last point only)
128
- - **Output:** `{current_level, baseline_level, calibration_state, last_updated_at}`
128
+ | Input | Type | Notes |
129
+ |---|---|---|
130
+ | `type` | string | |
131
+ | `sport_id` | integer | Instead of type |
132
+ | `start` (required) | string | |
133
+ | `end` (required) | string | |
134
+ | `gps_enabled` | boolean | |
135
+ | `garment_id` | integer | Strap location id; a miss lists them |
129
136
 
130
- ### Activities (2 read + 2 write + 1 catalog)
137
+ Add `confirm: true` to make the change.
131
138
 
132
- #### `whoop_workouts`
133
- List of recent activities with sport, start, end, duration, strain, HR, calories.
139
+ ### `whoop_activity_edit` (changes data)
134
140
 
135
- - **Input:** `{start?: string, end?: string, sport?: string, limit?: number}`
136
- - **Source:** `GET /developer/v2/activity/workout` (yes, this uses the public-API endpoint — Whoop's iOS app does too)
137
- - **Output:** `Array<{id, sport_name, start, end, duration_ms, strain, avg_hr_bpm, max_hr_bpm, calories, distance_m}>`
141
+ Change an activity's start/end or type (CARDIO↔RECOVERY, nap→main sleep), or a sleep/nap window, by activity_id or sleep_date (that day's main sleep). Omitted bounds keep their value. An overlapping sleep window needs delete_overlapping = exactly the ids the preview lists (WHOOP DELETES them). merge keeps the earliest over the joint window and DELETES the rest. Previews unless confirm:true.
138
142
 
139
- #### `whoop_workout`
140
- Full detail of one activity: HR curve, HR zone durations, calories, distance. Strength workouts include MSK summary (volume + intensity).
143
+ | Input | Type | Notes |
144
+ |---|---|---|
145
+ | `activity_id` | string | |
146
+ | `sleep_date` | string | |
147
+ | `start` | string | |
148
+ | `end` | string | |
149
+ | `type` | string | internal_name, display name or sport_id |
150
+ | `garment_id` | integer | Activities only |
151
+ | `delete_overlapping` | list of string | Overlapping ids from the preview; WHOOP deletes them |
152
+ | `merge` | list of string | Ids to combine with activity_id |
141
153
 
142
- - **Input:** `{activity_id: string}`
143
- - **Source:** `GET /core-details-bff/v1/cardio-details?activityId=` (300 KB response)
144
- - **Output:** `{id, sport_name, start, end, duration_ms, strain, calories, distance_m, avg_hr_bpm, max_hr_bpm, zone_durations: HrZoneDurations, hr_curve: [{at, bpm}], msk: {total_volume_kg, intensity_pct, strain_score, is_strength_workout}}` (`distance_m` is currently always `null` — not extracted from `/cardio-details`)
145
- - **`hr_curve`:** reconstructed from the graph points — bpm from each point's `value_display`, timestamps from `position_x` × the workout window — then evenly downsampled to ≤120 points.
146
- - **Caveat:** a just-created/logged activity stays `score_state: "pending"` until Whoop scores it, and this endpoint returns 400 (`"Cannot view details for a pending activity"`) until then — so don't read details of a workout you just logged for a while.
154
+ Add `confirm: true` to make the change.
147
155
 
148
- #### `whoop_activity_create` ⚠️ WRITE (gated by `whoop_sports_catalog`)
149
- Create a generic activity (manual entry — for when you did something without wearing the strap, or want to add a record after the fact).
156
+ ### `whoop_activity_delete` (changes data)
150
157
 
151
- - **Input:** `{sport_id: number, start: string, end: string, gps_enabled?: boolean, confirm?: boolean}`
152
- - **Source:** `POST /core-details-bff/v0/create-activity`
153
- - **Output (confirm=false):** `{preview: true, will_execute: {...}, set_confirm_true_to_run: true}`
154
- - **Output (confirm=true):** `{created: true, activity_id, cycle_id, start, end, sport_id}`
155
- - **Gate:** rejects until `whoop_sports_catalog` has been called once in the session (token-saving lazy-load — see [Bundled catalogs](#bundled-catalogs)). The tool also rejects unknown `sport_id` values before hitting the API.
156
- - **Caveat:** Whoop rejects activities with < 1 minute duration (422). Common `sport_id` values verified live: `0=Running, 1=Cycling, 17=Basketball, 33=Swimming, 45=Weightlifting, 48=Functional Fitness, 52=Hiking, 63=Walking, 123=Strength Trainer, -1=Activity` (generic). Use `whoop_sports_catalog` to look up the rest of the 203.
158
+ Delete one activity, nap or sleep by activity_id (from whoop_workouts or whoop_sleep) and confirm it's gone. Deleting a main sleep doesn't restore the day's cycles. Previews unless confirm:true.
157
159
 
158
- #### `whoop_activity_delete` ⚠️ WRITE (DESTRUCTIVE)
159
- Delete a workout / activity. Cannot be undone — the activity is removed from Whoop's system.
160
+ | Input | Type | Notes |
161
+ |---|---|---|
162
+ | `activity_id` (required) | string | |
160
163
 
161
- - **Input:** `{activity_id: string, confirm?: boolean}`
162
- - **Source:** `DELETE /core-details-bff/v1/cardio-details?activityId=`
163
- - **Output:** `{deleted: true, activity_id}` (or preview)
164
+ Add `confirm: true` to make the change.
164
165
 
165
- #### `whoop_sports_catalog`
166
- Local lookup over the bundled 203-sport catalog (numeric `sport_id` ↔ display name). Zero network calls. Calling this once unlocks the catalog gate that protects `whoop_activity_create` for the rest of the session.
166
+ ## Strength Trainer
167
167
 
168
- - **Input:** `{search?: string, limit?: number}`
169
- - **Source:** Bundled `src/data/sports.ts` (203-entry catalog generated from `/activities-service/v1/sports/history?countryCode=US`)
170
- - **Output:** `{total_in_catalog: 203, matched, truncated, sports: [{id, name}]}`
168
+ Lifting sessions, exercise history and records, the exercise library, logging lifts and templates.
171
169
 
172
- ### Strength reads (6)
170
+ ### `whoop_lift_sessions`
173
171
 
174
- #### `whoop_lift_prs`
175
- All Strength Trainer personal records across every exercise, with medals.
172
+ Strength sessions, newest first (default last 14 days, max 60): any activity with Strength Trainer sets. Exercises are rows in exercise_cols order: id, set scheme, top set [weight, reps], volume, medal. Unscored sessions list without exercises: include unscored (or activity_id) reads their sets from exercise history, which is slow. Weights are in unit.
176
173
 
177
- - **Input:** `{}`
178
- - **Source:** `GET /weightlifting-service/v3/prs`
179
- - **Output:** `Array<{exercise_id, name, muscle_groups, equipment, pr_value, pr_units, pr_date, medal: "GOLD"|"SILVER"|"BRONZE"|null, custom_exercise}>`
174
+ | Input | Type | Notes |
175
+ |---|---|---|
176
+ | `start_date` | string | |
177
+ | `end_date` | string | |
178
+ | `activity_id` | string | |
179
+ | `limit` | integer | |
180
+ | `include` | list of `sets`, `unscored` | |
180
181
 
181
- #### `whoop_lift_exercise` (gated by `whoop_lift_catalog`)
182
- Single exercise composite: metadata + recent sessions (every set with reps/weight/medal) + your PRs for that exercise.
182
+ ### `whoop_lift_exercise`
183
183
 
184
- - **Input:** `{exercise_id: string}` (use `whoop_lift_catalog` to find IDs)
185
- - **Gate:** rejects until `whoop_lift_catalog` has been called once in the session.
186
- - **Source (3 parallel):** `/v1/exercise/{id}`, `/v3/exercise/{id}/exercise_history`, `/v3/exercise/{id}/personal_records`
187
- - **Output:** `{exercise: {id, name, muscle_groups, equipment, movement_pattern, laterality, custom, volume_input_format, instructions, video_url}, recent_sessions: LiftSession[], personal_records: LiftSession[]}`
184
+ One exercise by exercise_id or name: metadata, workout history, medal records and 1RM (manual entries carry the entry_id whoop_lift_exercise_set takes). With neither: your PR list. Weights are in unit. cursor takes a returned next.
188
185
 
189
- #### `whoop_lift_progression` (gated by `whoop_lift_catalog`)
190
- Volume trend for a single exercise across week / month / 6-month / year windows.
186
+ | Input | Type | Notes |
187
+ |---|---|---|
188
+ | `exercise_id` | string | e.g. BENCHPRESS_BARBELL |
189
+ | `name` | string | Exact name |
190
+ | `include` | list of `history`, `records`, `one_rep_max`, `progression`, `instructions` | Default history, records, one_rep_max |
191
+ | `cursor` | string | |
192
+ | `end_date` | string | For progression |
191
193
 
192
- - **Input:** `{exercise_id: string, end_date?: string}`
193
- - **Gate:** rejects until `whoop_lift_catalog` has been called once in the session.
194
- - **Source:** `GET /progression-service/v3/exercise/{id}?endDate=`
195
- - **Output:** `{exercise_id, end_date, segments: [{label, start_date, end_date, avg_volume, delta_pct, unit, points: [{date, volume, reps, top_weight}]}]}` (per-point `reps` and `top_weight` are currently always `null` — the progression graph only exposes volume)
194
+ ### `whoop_lift_library`
196
195
 
197
- #### `whoop_lift_history`
198
- Recent Strength Trainer workouts with **per-exercise aggregates** (set count, total reps, tonnage, medals). Distinct from `whoop_workouts` which gives a generic activity list with no exercise breakdown.
196
+ Strength Trainer library. No arguments: your templates as [template_key, name] and WHOOP's workouts as [prebuilt_id, title, minutes]. With one of those ids: that workout's exercises, a template's sets as [weight, reps] ([weight, seconds] if timed). search: up to 10 exercises (custom too) by name, muscle or equipment, with the ids whoop_lift_log and whoop_lift_exercise take.
199
197
 
200
- - **Input:** `{limit?: number, end_date?: string}`
201
- - **Source:** Filtered `/developer/v2/activity/workout` + parallel `/cardio-details` for each strength workout
202
- - **Output:** `Array<{activity_id, date, name, duration_ms, strain, msk_total_volume_kg, msk_intensity_pct, exercise_count, set_count, exercises: [{exercise_id, name, set_count, total_reps, tonnage, tonnage_units, achievements, sets: LiftSet[]}]}>`
203
- - **Filter:** matches sport_name against `/weight|strength|powerlift/i` to catch `weightlifting_msk` (Strength Trainer), `weightlifting`, and `powerlifting`. The older `/strength/i` regex matched none of these — fixed 2026-05-26.
204
- - **Walk shape:** `cardio-details.weightlifting_cardio_details.weightlifting_exercises.exercise_summary_carousel.items[]`. First item is the workout aggregate row (skip it via `exercise_id === null`), each subsequent item is one exercise.
205
- - **Per-set detail (set 1: 10 reps @ 200lbs, set 2: ...) is NOT available** in `/cardio-details` — Whoop only exposes exercise-level aggregates here. For per-set numbers across all your workouts, use `whoop_lift_exercise` which hits `/v3/exercise/{id}/exercise_history`. The `sets` array in this response always returns empty `[]`.
198
+ | Input | Type | Notes |
199
+ |---|---|---|
200
+ | `template_key` | integer | |
201
+ | `prebuilt_id` | string | |
202
+ | `search` | string | e.g. "bench barbell" |
206
203
 
207
- #### `whoop_lift_library`
208
- Your saved templates. Returns the list or a single template detail.
204
+ ### `whoop_lift_log` (changes data)
209
205
 
210
- - **Input:** `{template_id?: number}` (omit for list, pass for single)
211
- - **Source:** `/v3/workout-library` (list) OR `/v2/workout-template/{id}` (single)
212
- - **Output (list):** `{mode: "list", my_workouts: [...], whoop_workouts: [...]}`
213
- - **Output (single):** `{mode: "single", template_id, name, exercises: [...]}`
206
+ Log a finished strength workout as a new Strength Trainer activity, or attach the sets to an existing activity (attach_to_activity_id; permanent, WHOOP has no unlink). Weights need unit. Refused: a window overlapping another activity, and weighted sets with 0 reps (WHOOP would award a permanent PR). Previews unless confirm:true.
214
207
 
215
- #### `whoop_lift_catalog`
216
- Local lookup over the bundled 372-exercise catalog. Zero network calls.
208
+ | Input | Type | Notes |
209
+ |---|---|---|
210
+ | `exercises` (required) | list of object | |
211
+ | `unit` | `kg`, `lb` | |
212
+ | `start` | string | Default end minus 30 min |
213
+ | `end` | string | Default now |
214
+ | `name` | string | |
215
+ | `rpe` | integer | |
216
+ | `attach_to_activity_id` | string | |
217
217
 
218
- - **Input:** `{search?: string, muscle?: string, equipment?: string, movement_pattern?: string, laterality?: "BILATERAL"|"LEFT"|"RIGHT"|"ALTERNATING", limit?: number}`
219
- - **Source:** Bundled `src/data/exercises.ts`
220
- - **Output:** `{total_in_catalog: 372, matched, truncated, exercises: [{exercise_id, name, muscle_groups, primary_muscle, equipment, movement_pattern, laterality}]}`
218
+ Add `confirm: true` to make the change.
221
219
 
222
- ### Strength writes (3)
220
+ ### `whoop_lift_template` (changes data)
223
221
 
224
- #### `whoop_lift_log` ⚠️ WRITE (gated by `whoop_lift_catalog`)
225
- Log a finished strength workout. Builds Whoop's full nested `workout_groups → workout_exercises → sets` body shape, denormalizing each exercise from the bundled catalog. Validates that every `exercise_id` exists in `EXERCISES_BY_ID` and fails early with a clear error if not.
222
+ Manage your Strength Trainer templates. create: name and exercises. edit: template_key with a new name and/or exercises (the whole list is replaced). copy: copy_from (your template_key or a WHOOP prebuilt_id) into a new template. delete: template_key. Weights need unit. Keys: whoop_lift_library. Previews unless confirm:true.
226
223
 
227
- - **Input:** `{name?: string, start?: string, end?: string, exercises: [{exercise_id, sets: [{reps, weight?, time_seconds?, strap_location?}]}], confirm?: boolean}`
228
- - **Source:** `POST /weightlifting-service/v2/weightlifting-workout/activity`
229
- - **Output:** `{logged: true, activity_id, exercise_count, set_count, total_volume_kg}` (or preview)
230
- - **Quirks:** Whoop's POST validates `exercise_details.created_at` and `exercise_details.updated_at` as non-empty ISO timestamps. The MCP populates them automatically. Overlapping time windows return 409. Default duration is 30 minutes ending now if `start`/`end` not passed.
224
+ | Input | Type | Notes |
225
+ |---|---|---|
226
+ | `action` (required) | `create`, `edit`, `copy`, `delete` | |
227
+ | `template_key` | integer | |
228
+ | `copy_from` | integer or string | |
229
+ | `name` | string | |
230
+ | `exercises` | list of object | |
231
+ | `unit` | `kg`, `lb` | |
231
232
 
232
- #### `whoop_lift_template_save` ⚠️ WRITE (gated by `whoop_lift_catalog`)
233
- Create or save-as a workout template (e.g. "Push Day", "Heavy Legs").
233
+ Add `confirm: true` to make the change.
234
234
 
235
- - **Input:** `{name: string, base_template_key?: number, exercises: [{exercise_id, sets: [{reps, weight, time_seconds}]}], confirm?: boolean}`
236
- - **Source:** `POST /weightlifting-service/v3/workout-template`
237
- - **Output:** `{created: true, template_id, name, exercise_count}` (or preview)
238
- - **Note:** No delete-template endpoint is wrapped (Whoop's iOS app doesn't expose one either via this URL). Created templates persist.
235
+ ### `whoop_lift_exercise_set` (changes data)
239
236
 
240
- #### `whoop_lift_custom_exercise` ⚠️ WRITE (gated by `whoop_lift_catalog`)
241
- Create a custom exercise based on an existing official one. Use this when you want to log a variant Whoop doesn't have (e.g. "Spoto Press" based on "Bench Press").
237
+ Custom exercises and manual 1RM entries. create_custom / edit_custom take custom; without a linked_exercise it stays untracked (no e1RM, no muscle load). delete_custom is soft: its PR tile stays. set_1rm: value with unit, dated today or up to 6 months back; entry_id (from whoop_lift_exercise) edits an entry. delete_1rm: entry_id or date. Previews unless confirm:true.
242
238
 
243
- - **Input:** `{name: string, push_core_name: string, muscle_groups: enum[], equipment?: enum, movement_pattern?: enum, laterality?: enum, volume_input_format?: "REPS"|"TIME", exercise_type?: "STRENGTH"|"POWER", instructions?: string[], trackable?: boolean, confirm?: boolean}`
244
- - **Source:** `POST /weightlifting-service/v2/custom-exercise`
245
- - **Output:** `{created: true, exercise_id, name}` (or preview)
246
- - **Enum constraints verified live:** `muscle_groups` must be from `{ARMS, BACK, CHEST, CORE, FULL_BODY, LEGS, OTHER, SHOULDERS}` (no GLUTES/HAMSTRINGS/QUADS/BICEPS/TRICEPS/FOREARMS — API rejects those). `movement_pattern` from `{SQUAT, HINGE, HORIZONTAL_PRESS, VERTICAL_PRESS, HORIZONTAL_PULL, VERTICAL_PULL, LUNGE, JUMP, OTHER}` (no OLYMPIC_LIFT/ROTATION/GAIT/CARRY — API rejects those). `equipment` from `{MACHINE, DUMBBELL, BARBELL, BODY, OTHER, KETTLEBELL}`.
247
- - **Note:** The MCP generates the new UUID client-side via `randomUUID().toUpperCase()`. The `push_core_name` parameter MUST be an existing exercise_id in the bundled catalog — Whoop links the custom to its canonical "what kind of movement is this" classifier.
239
+ | Input | Type | Notes |
240
+ |---|---|---|
241
+ | `action` (required) | `create_custom`, `edit_custom`, `delete_custom`, `set_1rm`, `delete_1rm` | |
242
+ | `exercise_id` | string | |
243
+ | `exercise` | string | Or the exact name |
244
+ | `custom` | object | edit_custom keeps omitted fields |
245
+ | `value` | number | |
246
+ | `date` | string | |
247
+ | `entry_id` | string | |
248
+ | `unit` | `kg`, `lb` | |
248
249
 
249
- ### Journal (3 read + 2 write)
250
+ Add `confirm: true` to make the change.
250
251
 
251
- #### `whoop_journal`
252
- Your journal entry for a date — every tracked behavior with its value, magnitude, and resolved title (from the bundled catalog so Claude doesn't have to make a second lookup).
252
+ ## Journal
253
253
 
254
- - **Input:** `{date?: string}`
255
- - **Source:** `GET /journal-service/v3/journals/drafts/mobile/{date}` (NOT the misleadingly-named v2 endpoint, which returns the catalog of *enabled* behaviors instead of the day's entries)
256
- - **Output:** `{date, cycle_id, journal_entry_id, notes, behaviors: [{behavior_tracker_id, title, category, internal_name, answered_yes, magnitude_value, magnitude_label, recorded_at}]}`
254
+ Daily journal answers and what they do to your recovery.
257
255
 
258
- #### `whoop_journal_catalog`
259
- Local lookup over the bundled 308-behavior catalog. Filter by category, magnitude type, or substring search.
256
+ ### `whoop_journal`
260
257
 
261
- - **Input:** `{category?: enum, search?: string, magnitude_type?: "bare"|"boolean"|"magnitude", limit?: number}`
262
- - **Source:** Bundled `src/data/behaviors.ts`
263
- - **Output:** `{total_in_catalog: 308, matched, truncated, behaviors: [{behavior_tracker_id, title, question, internal_name, category, magnitude, status}]}`
264
- - **Categories:** Drugs & Medication, Health & Symptoms, Hormonal Health, Lifestyle, Mental Wellbeing, Nutrition, Recovery, Sleep & Circadian Health, Supplements
258
+ Journal for a date (default today): answered behaviours (yes/no, value, time) and notes. include: unanswered; catalog (your behaviour ids and names, custom too; filter with search or category); magnitudes (ranges and step choices on catalog rows); impact (how behaviours move your recovery). impact_id: one personal impact's detail.
265
259
 
266
- #### `whoop_behavior_impact`
267
- Per-behavior impact analysis — how each tracked behavior has historically moved your recovery / HRV / sleep. Self-discovering: call with **no argument** to list every behavior with its `impact_uuid`, then call again with that UUID for the full breakdown. (The impact UUIDs aren't exposed by any other tool, so the list mode is what makes the detail mode reachable — the numeric `behavior_tracker_id` from the journal catalog is **not** the same id.)
260
+ | Input | Type | Notes |
261
+ |---|---|---|
262
+ | `date` | string | |
263
+ | `include` | list of `unanswered`, `catalog`, `magnitudes`, `impact` | |
264
+ | `search` | string | |
265
+ | `category` | string | e.g. Supplements |
266
+ | `impact_id` | string | |
268
267
 
269
- - **Input:** `{behavior_id?: string}` — omit for the list; pass an `impact_uuid` from that list for the detail.
270
- - **Source:** `GET /behavior-impact-service/v1/impact` (list) OR `GET /behavior-impact-service/v2/impact/details/{impact_uuid}` (detail)
271
- - **Output (list):** `{behaviors: [{impact_uuid, behavior_name, direction: "positive"|"negative"|"neutral"|"insufficient", impact_display, has_sufficient_data}]}`
272
- - **Output (detail):** `{behavior_id, behavior_name, metrics: [{metric, delta_avg, delta_unit, sample_size, direction}], insight}`
273
- - **Caveat:** needs journal history — accounts with little/no logged data return an empty list (every behavior `has_sufficient_data: false`). The `impact_uuid` is per-fetch, so always read it from the live list rather than hardcoding.
268
+ ### `whoop_journal_log` (changes data)
274
269
 
275
- #### `whoop_journal_log` ⚠️ WRITE (gated by `whoop_journal_catalog`)
276
- Save a full journal entry. **Replaces** the existing entry for that date with the new set of behaviors — so read `whoop_journal` first and resend the day's existing entries along with your additions, or they'll be wiped. Use empty `behaviors: []` to clear the entry.
270
+ Log journal answers. Default is a merge: only the listed behaviours change, and a yes row keeps its stored magnitude and time unless you pass new ones (null clears). notes or replace_day:true rewrite the whole day (one date only), keeping current notes and answers unless replaced. Behaviours go by id or name, custom ones included. Previews unless confirm:true.
277
271
 
278
- - **Input:** `{date?: string, behaviors: [{behavior_tracker_id, answered_yes?, magnitude_value?, magnitude_label?}], notes?: string, confirm?: boolean}`
279
- - **Source:** `PUT /journal-service/v2/journals/entries/user/date/{date}`
280
- - **Output:** `{logged: true, date, behaviors_count}` (or preview)
281
- - **Gate:** rejects until `whoop_journal_catalog` has been called once in the session.
282
- - **Validation:** All `behavior_tracker_id` values are also validated against `BEHAVIORS_BY_ID` before the request fires. Unknown IDs fail early.
272
+ | Input | Type | Notes |
273
+ |---|---|---|
274
+ | `date` | string | Default today |
275
+ | `dates` | list of string | Several dates; merge writes only |
276
+ | `behaviors` | list of object | |
277
+ | `unset` | list of integer or string | Ids or names whose answer to clear |
278
+ | `notes` | string | Replaces the day's notes; "" clears them |
279
+ | `replace_day` | boolean | Drops every answer not listed here |
283
280
 
284
- #### `whoop_journal_autopop` ⚠️ WRITE (irreversible)
285
- Trigger Whoop's auto-populate engine — it reads your HealthKit data and workout patterns and suggests journal entries for the day.
281
+ Add `confirm: true` to make the change.
286
282
 
287
- - **Input:** `{cycle_id: number, confirm?: boolean}` (cycle_id from `whoop_journal` or `whoop_today`)
288
- - **Source:** `PUT /autopop-service/v1/autopop/JOURNAL/{cycle_id}`
289
- - **Output:** `{triggered: true, cycle_id}` (or preview)
283
+ ## WHOOP Coach
290
284
 
291
- ### Women's health (1 read + 2 write)
285
+ Ask WHOOP's own Coach, read past conversations and the outlook, manage what it remembers.
292
286
 
293
- #### `whoop_cycle`
294
- Current menstrual cycle status — phase, cycle day, typical cycle length, and predicted next-period / ovulation dates.
287
+ ### `whoop_coach_ask` (changes data)
295
288
 
296
- - **Input:** `{date?: string}`
297
- - **Source:** `GET /womens-health-service/v1/menstrual-cycle-insights?date=` (a `tiles[]` BFF — `phase`/`cycle_day` from the `HEADER_TILE`, `cycle_length` from the `TYPICAL_CYCLE_TILE` stats, predictions derived from the `CALENDAR_TILE` first-day-of-phase markers)
298
- - **Output:** `{date, phase, cycle_day, cycle_length, next_period_predicted_date, ovulation_predicted_date, hormonal_mode, contraception_type, is_pregnant}`
299
- - **Caveats:** requires women's-health tracking enabled on the account — when it isn't, the endpoint still returns 200 and the projection degrades to all-null. `hormonal_mode` / `contraception_type` / `is_pregnant` are account settings this BFF doesn't carry, so they're always null here; `cycle_length` is null until there's enough history; predictions are null when the predicted day falls outside the returned month. **Pass the `date` param** — querying the endpoint without it 404s.
289
+ Ask WHOOP Coach (AI) and wait for the reply (up to ~50 s). One thread per agent per day; thread continues one from whoop_coach_history. Agents daily_outlook and day_in_review generate or open the current cycle's report and take no message. The coach can really create, edit and delete activities when asked (listed in actions); a saved memory shows only in the reply text. Previews unless confirm:true.
300
290
 
301
- #### `whoop_cycle_log` ⚠️ WRITE
302
- Log a period start or ovulation event for a date.
291
+ | Input | Type | Notes |
292
+ |---|---|---|
293
+ | `message` | string | |
294
+ | `agent` | `coach`, `sleep`, `recovery`, `strain`, `stress`, `activity`, `daily_outlook`, `day_in_review` | activity needs activity_id |
295
+ | `activity_id` | string | |
296
+ | `thread` | string | From whoop_coach_history |
297
+ | `new_thread` | boolean | |
298
+ | `image_base64` | string | PNG or JPEG, ≤5 MB |
303
299
 
304
- - **Input:** `{date: string, period?: boolean, period_flow?: number, ovulation?: boolean, confirm?: boolean}`
305
- - **Source:** `PUT /womens-health-service/v1/menstrual-cycle-insights/log`
306
- - **Wire format:** Date encoded as `[YYYY, MM, DD]` integer array (this is Whoop's specific quirk).
307
- - **Output:** `{logged: true, date}` (or preview)
300
+ Add `confirm: true` to make the change.
308
301
 
309
- #### `whoop_symptom_log` ⚠️ WRITE (gated by `whoop_journal_catalog` when `symptoms` is non-empty)
310
- Log women's-health symptoms — cervical mucus, menstruation flow, and additional tracker symptoms.
302
+ ### `whoop_coach_history`
311
303
 
312
- - **Input:** `{date: string, menstruation?: enum, cervical_mucus?: enum, symptoms?: [{behavior_tracker_id, answered_yes?}], confirm?: boolean}`
313
- - **Source:** `POST /womens-health-service/v1/symptom-insights/log/symptoms?requestDate=`
314
- - **Enums (live-verified):**
315
- - `menstruation`: `none, spotting, light_flow, medium_flow, heavy_flow` (all 5 accepted)
316
- - `cervical_mucus`: `vaginal-discharge---egg-white, vaginal-discharge---creamy, vaginal-discharge---sticky, vaginal-discharge---watery, vaginal-discharge---grey` (the triple-hyphen is the actual key format; API rejects `"none"` with 422 — omit the field entirely to clear)
317
- - **Output:** `{logged: true, date, symptoms_count}` (or preview)
318
- - **Gate:** when `symptoms` is empty (you're only logging menstruation/cervical_mucus), no gate; otherwise requires `whoop_journal_catalog` once per session because `symptoms[].behavior_tracker_id` references the behaviors catalog.
304
+ Read WHOOP Coach history. list: conversations (fingerprint, title, agent, day), newest first. transcript: a listed thread's turns, with the actions the coach took. outlook: a day's Daily Outlook or Day in Review, only if it already exists (whoop_coach_ask generates one). To reply, pass a fingerprint to whoop_coach_ask as thread.
319
305
 
320
- ### Coach + performance (2)
306
+ | Input | Type | Notes |
307
+ |---|---|---|
308
+ | `view` | `list`, `transcript`, `outlook` | |
309
+ | `limit` | integer | Default 10 rows, or the 5 newest turns |
310
+ | `cursor` | string | |
311
+ | `fingerprint` | string | transcript: from view list |
312
+ | `kind` | `daily_outlook`, `day_in_review` | |
313
+ | `date` | string | outlook only |
321
314
 
322
- #### `whoop_coach_ask` ⚠️ WRITE (creates artifact)
323
- Ask Whoop Coach a question. Polls up to 30 seconds for the response.
315
+ ### `whoop_memory`
324
316
 
325
- - **Input:** `{message: string, context?: "HOME"|"RECOVERY"|"STRAIN"|"SLEEP"|"STRESS"|"CARDIO_DETAILS"|"WAKE_UP_REPORT", confirm?: boolean}`
326
- - **Source flow:** POST `/ai-conversation-bff/v1/conversation` (create) → POST `/{conv}/turn` (send) → GET `/{conv}/turn/{turn}` (poll)
327
- - **Output:** `{conversation_id, turn_id, response_text, turn_status, polled_iterations, timed_out}` (or preview)
328
- - **Note:** Every ask creates a persistent conversation artifact on your Whoop account. The MCP requires `confirm: true` because of this.
317
+ What WHOOP Coach remembers about you: memories with id, title, summary and ACTIVE/INACTIVE status, plus the categories that have items. memory_id opens one memory's detail and marks it seen in the app, so only open it when asked. Memories can't be created here; the coach saves them from chats.
329
318
 
330
- #### `whoop_performance_assessment`
331
- Whoop's coaching evaluation for a period: total recoveries, required recoveries, expected next assessment.
319
+ | Input | Type | Notes |
320
+ |---|---|---|
321
+ | `category` | string | timeline = all, or a key from categories |
322
+ | `limit` | integer | |
323
+ | `memory_id` | string | |
332
324
 
333
- - **Input:** `{period?: "WEEK"|"MONTH"}` (default MONTH)
334
- - **Source:** `GET /coaching-service/v1/performance-assessment/{period}/data/{iso_timestamp}`
335
- - **Output:** `{period, is_assessment_needed, has_assessment, total_recoveries, required_recoveries, recoveries_before_recent_cutoff, expected_assessment_during, next_assessment_during}`
336
- - **Caveat:** The iOS app sends `YEAR` in some discovery captures, but the API rejects it with `400 "path param reportType must be one of [WEEK, MONTH]"` — so YEAR is documented in the spec but not implemented server-side. We removed it from the enum.
325
+ ### `whoop_memory_set` (changes data)
337
326
 
338
- ### Smart alarm (1 read + 1 write)
327
+ Change what WHOOP Coach remembers: activate or deactivate a memory (inactive ones stop shaping coaching), delete one permanently, or enable_memory / disable_memory for the whole account. With memory off nothing is stored, whatever the coach says. Previews unless confirm:true.
339
328
 
340
- #### `whoop_smart_alarm`
341
- Current Smart Alarm state: schedules array + preferences (lower/upper bounds, goal mode, enabled).
329
+ | Input | Type | Notes |
330
+ |---|---|---|
331
+ | `action` (required) | `activate`, `deactivate`, `delete`, `enable_memory`, `disable_memory` | |
332
+ | `memory_id` | string | From whoop_memory |
342
333
 
343
- - **Input:** `{}`
344
- - **Source (2 parallel):** `/smart-alarm-bff/v1/schedule/all`, `/smart-alarm-service/v1/smartalarm/preferences`
345
- - **Output:** `{enabled, preferences: {lower_time_bound, upper_time_bound, goal, weekly_plan_goal_minutes, last_triggered_at}, schedules: [{schedule_id, enabled, days_of_week, latest_wake_time, alarm_mode, sleep_goal, timezone_offset}]}`
346
- - **Quirk:** The `upper_time_bound` and `goal` are nested inside `alarm_bounds` on the preferences endpoint, NOT at top level. The MCP handles this.
334
+ Add `confirm: true` to make the change.
347
335
 
348
- #### `whoop_smart_alarm_set` ⚠️ WRITE
349
- Update one schedule, the global preferences, or the master enable/disable.
336
+ ## Body
350
337
 
351
- - **Input:** `{mode: "schedule"|"preferences"|"master_enable"|"master_disable", schedule_id?: string, schedule?: {...}, preferences?: {...}, confirm?: boolean}`
352
- - **Source (mode-dispatched):**
353
- - `schedule` → `PUT /smart-alarm-bff/v1/schedule/{schedule_id}`
354
- - `preferences` → `PUT /smart-alarm-service/v1/smartalarm/preferences`
355
- - `master_enable` → `PUT /smart-alarm-service/v1/alarm-schedule/enable`
356
- - `master_disable` → `PUT /smart-alarm-service/v1/alarm-schedule/disable`
357
- - **Output:** `{updated: true, mode}` (or preview)
358
- - **To change the wake time, use `mode=schedule`** (`schedule_id` + `latest_wake_time`) — that's the setting that actually controls when the alarm fires. `mode=preferences` sets the global goal + enable flags, but its `lower/upper_time_bound` are ignored by the server whenever an explicit schedule exists (the PUT returns 200 but the bounds don't change). Read `whoop_smart_alarm` first for the `schedule_id` + current values; schedule/preferences **replace**, they don't merge.
338
+ Weight and body composition, and cycle tracking.
359
339
 
360
- ### Social (2)
340
+ ### `whoop_weight`
361
341
 
362
- #### `whoop_leaderboard`
363
- Community leaderboard + your position. Auto-discovers your first community if `community_id` omitted.
342
+ Weight and body-composition readings, newest first, in kg (display_unit is the account's unit). The newest reading is the profile weight. Ids feed whoop_weight_log.
364
343
 
365
- - **Input:** `{community_id?: number, date?: string, window?: "day"|"week"|"month", metric?: "recovery"|"sleep"|"strain"}`
366
- - **Source (2-3 parallel):** memberships (if auto-discovery), board, your row
367
- - **Output:** `{community_id, community_name, window, metric, date_label, average, total_compliant, total_empty, records: [{rank, user_id, first_name, last_name, value, secondary_value}], your_position: {rank, value, in_window}}`
368
- - **Note:** 404 on your row is handled gracefully — `in_window: false` instead of throwing.
344
+ | Input | Type | Notes |
345
+ |---|---|---|
346
+ | `limit` | integer | |
347
+ | `cursor` | string | |
369
348
 
370
- #### `whoop_communities`
371
- The communities you're a member of (teams, friend groups), each with member count and — optionally — your rank in it. Complements `whoop_leaderboard`: use this to discover community IDs, then drill into one with `whoop_leaderboard`.
349
+ ### `whoop_weight_log` (changes data)
372
350
 
373
- - **Input:** `{team_type?: "ALL"|"COMMUNITY"|"TEAM"|"BUSINESS", metric?: "strain"|"sleep"|"recovery", period?: "day"|"week"|"month", include_rank?: boolean, limit?: number, offset?: number}` (defaults: `team_type=ALL`, `metric=strain`, `period=week`, `include_rank=true`, `limit=50`, `offset=0`)
374
- - **Source:** `GET /community-service/v1/communities/memberships` (the same endpoint `whoop_leaderboard` uses for auto-discovery)
375
- - **Output:** `{total_count, offset, team_type_filter, leaderboard_metric, period, communities: [{id, name, avatar_url, banner_url, about, private, member_count, owner_id, team_type, membership: {member_type, notification_setting, unread_count, online, joined_at, last_online}, rank: {rank, score, metric, period} | null}]}`
376
- - **Schema status:** permissive at the record level — the per-record field set hasn't been captured against a live account yet, so most fields are nullable. A `WhoopProjectionError` from this tool is the signal that Whoop's actual shape differs from the inferred one and the projection needs tightening.
351
+ Add, edit or delete a weight or body-composition reading. weight and lean_mass need unit. add ALWAYS creates a new reading, even on a day that has one; to replace, edit by reading_id (from whoop_weight). The latest reading becomes the profile weight, and deleting a reading never reverts it. No future times. Previews unless confirm:true.
377
352
 
378
- ### Settings (1 read + 3 write)
353
+ | Input | Type | Notes |
354
+ |---|---|---|
355
+ | `action` (required) | `add`, `edit`, `delete` | |
356
+ | `reading_id` | string | For edit and delete |
357
+ | `weight` | number | Required for add |
358
+ | `unit` | `kg`, `lb` | |
359
+ | `body_fat_pct` | number or null | Percent, e.g. 18.5; on edit null clears body composition |
360
+ | `lean_mass` | number | |
361
+ | `at` | string | Default now; edit keeps it |
379
362
 
380
- #### `whoop_hr_zones`
381
- Current HR zones + max HR + last updated.
363
+ Add `confirm: true` to make the change.
382
364
 
383
- - **Input:** `{}`
384
- - **Source (2 parallel):** `/hr-zones-service/v1/bff/zones`, `/hr-zones-service/v1/bff/settings`
385
- - **Output:** `{max_hr, is_custom, effective_timestamp, zones: [{id: "ZONE_1".."ZONE_5", min, max}]}`
365
+ ### `whoop_cycle`
386
366
 
387
- #### `whoop_hr_zones_set` ⚠️ WRITE
388
- Set max HR (auto-computes 5 zones) OR set custom 5-zone ranges.
367
+ Menstrual cycle / Hormonal Insights for a date (default today): cycle or period day, phase and next-period window. include adds calendar (the date's month), settings, cycles (past cycles), symptoms (patterns) and day_log (the date's flow, mucus and symptoms, with ids). available:false when Hormonal Insights isn't set up.
389
368
 
390
- - **Input:**
391
- - Max HR mode: `{mode: "max_hr", max_hr: number, confirm?}`
392
- - Custom mode: `{mode: "custom", zones: [{id, min, max}] (5 entries), confirm?}`
393
- - **Source:**
394
- - max_hr → `POST /hr-zones-service/v1/maxhr`
395
- - custom → `POST /hr-zones-service/v1/bff/custom`
396
- - **Output:** `{updated: true, mode}` (or preview)
369
+ | Input | Type | Notes |
370
+ |---|---|---|
371
+ | `date` | string | |
372
+ | `include` | list of `calendar`, `settings`, `cycles`, `symptoms`, `day_log` | |
397
373
 
398
- #### `whoop_profile_update` ⚠️ WRITE
399
- Update profile: name, email, birthday, gender, weight, height, country/state, city.
374
+ ### `whoop_cycle_log` (changes data)
400
375
 
401
- - **Input:** `{first_name?, last_name?, email?, birthday?, gender?: "MALE"|"FEMALE"|"NON_BINARY", physiological_baseline?: "MALE"|"FEMALE", weight_kg?, height_m?, city?, state?, country?, unit_system?: "imperial"|"metric", confirm?}`
402
- - **Source:** `PUT /profile-service/v1/profile`
403
- - **Output:** `{updated: true, fields_updated: string[]}` (or preview)
404
- - **Live-verified quirks:** Whoop's PUT is NOT a partial update — sending too few fields returns 422. Birthday accepts either `YYYY-MM-DD` or ISO datetime (the MCP auto-trims the time component). Gender enums must be UPPERCASE; `UNSPECIFIED`/`OTHER`/`PREFER_NOT_TO_SAY` are rejected (only `MALE`/`FEMALE`/`NON_BINARY` work). If `country=US`, the API requires `state` to be set too — otherwise 400 `"AdminDivision (state) must be set for US"`.
376
+ Log or undo (yes:false) a date's period (flow 0 light, 1 medium, 2 heavy) or ovulation, and/or its menstruation flow, cervical mucus and symptoms. Not period and ovulation on one date; no future dates. Any menstruation but none also logs a period day; to remove a period fully, also pass menstruation:null. A period on a fresh date creates a cycle that undo won't remove. Previews unless confirm:true.
405
377
 
406
- #### `whoop_hidden_metric` ⚠️ WRITE
407
- Show or hide BODY_COMP / HEALTHSPAN on your dashboard.
378
+ | Input | Type | Notes |
379
+ |---|---|---|
380
+ | `date` (required) | string | |
381
+ | `period` | object | |
382
+ | `ovulation` | object | |
383
+ | `menstruation` | `none`, `light_flow`, `medium_flow`, `heavy_flow`, `spotting` or null | null clears it |
384
+ | `cervical_mucus` | `vaginal-dryness`, `vaginal-discharge---egg-white`, `vaginal-discharge---sticky`, `vaginal-discharge---creamy`, `vaginal-discharge---watery`, `cervical_mucus_pink_brown_or_tan`, `vaginal-discharge---grey` or null | null clears it |
385
+ | `symptoms` | list of object | |
408
386
 
409
- - **Input:** `{metric: "BODY_COMP"|"HEALTHSPAN", action: "hide"|"show", confirm?}`
410
- - **Source:** `POST /users-service/v1/hidden-metrics/{metric}` (hide) OR `DELETE /users-service/v1/hidden-metrics/{metric}` (show)
411
- - **Output:** `{updated: true, metric, is_hidden}` (or preview)
387
+ Add `confirm: true` to make the change.
412
388
 
413
- ### Escape hatch (2)
389
+ ## Plans and alarms
414
390
 
415
- #### `whoop_raw`
416
- Call any Whoop endpoint directly. The escape hatch for endpoints not yet wrapped.
391
+ The weekly plan and Smart Alarm.
417
392
 
418
- - **Input:** `{path: string, method?: "GET"|"POST"|"PUT"|"DELETE", query?: Record, body?: unknown, confirm?: boolean}` (confirm required for mutating methods)
419
- - **Source:** Whatever path you pass
420
- - **Output:** `{path, method, status, response}` (or preview for mutations)
421
- - **Pairs with `whoop_endpoints`** — call that first to discover paths, then use `whoop_raw` to hit them.
393
+ ### `whoop_weekly_plan`
422
394
 
423
- #### `whoop_endpoints`
424
- Search the bundled catalog of 311 deduped endpoint paths.
395
+ The Weekly Plan for the Monday–Sunday week containing a date (default today): plan name, days left, % accomplished and each goal's target (steps/day or minutes/week), days met and running total.
425
396
 
426
- - **Input:** `{filter?: string, method?: "GET"|"POST"|"PUT"|"DELETE", limit?: number}`
427
- - **Source:** Bundled `src/data/endpoints.ts`
428
- - **Output:** `{total_in_catalog, matched, truncated, endpoints: string[]}` (lines like `GET 200 /home-service/v1/home`)
397
+ | Input | Type | Notes |
398
+ |---|---|---|
399
+ | `date` | string | |
429
400
 
401
+ ### `whoop_weekly_plan_set` (changes data)
402
+
403
+ Change Weekly Plan goals. set_goal adds or edits a goal (starting a Custom plan if there is none): STEPS target in steps/day, STRENGTH_TRAINING_TIME in minutes/week, within WHOOP's slider. remove_goal drops one, and removing the last ends the plan. end_plan removes every goal. Previews unless confirm:true.
404
+
405
+ | Input | Type | Notes |
406
+ |---|---|---|
407
+ | `action` (required) | `set_goal`, `remove_goal`, `end_plan` | |
408
+ | `type` | `STEPS`, `STRENGTH_TRAINING_TIME` | |
409
+ | `target` | integer | |
410
+
411
+ Add `confirm: true` to make the change.
412
+
413
+ ### `whoop_smart_alarm`
414
+
415
+ Smart Alarm: recurring schedules (id, days, mode, sleep goal, latest wake time, enabled), unscheduled days, the master switch and the next alarm WHOOP will set. Server state only: it doesn't prove the strap has synced.
416
+
417
+ No inputs.
418
+
419
+ ### `whoop_smart_alarm_set` (changes data)
420
+
421
+ Change Smart Alarm. create/edit a recurring schedule (edit merges; mode NO_ALARM is off); a day belongs to one schedule, so claiming it moves it off another. enable/disable flip the master switch; disable also turns the next alarm off. single_alarm sets only the next alarm and turns recurring schedules off. Changes reach the strap only after the WHOOP app syncs. Previews unless confirm:true.
422
+
423
+ | Input | Type | Notes |
424
+ |---|---|---|
425
+ | `action` (required) | `create`, `edit`, `delete`, `enable`, `disable`, `single_alarm` | |
426
+ | `schedule_id` | string | For edit and delete |
427
+ | `days` | list of `MON`, `TUE`, `WED`, `THU`, `FRI`, `SAT`, `SUN` | |
428
+ | `mode` | `EXACT_TIME`, `SLEEP_GOAL`, `IN_THE_GREEN`, `NO_ALARM` | |
429
+ | `sleep_goal` | `PEAK`, `PERFORM`, `GET_BY` | Only with mode SLEEP_GOAL |
430
+ | `wake_time` | string | Latest wake time, 24h, e.g. 06:45 |
431
+ | `enabled` | boolean | The schedule's own on/off flag |
432
+ | `goal` | `EXACT_TIME_PERFORM`, `EXACT_TIME_PEAK`, `EXACT_TIME_OPTIMIZE_SLEEP`, `IN_THE_GREEN`, `SLEEP_HEALTH_PEAK`, `SLEEP_HEALTH_PERFORM`, `SLEEP_HEALTH_GET_BY` | single_alarm only; default EXACT_TIME_PERFORM |
433
+
434
+ Add `confirm: true` to make the change.
435
+
436
+ ## Health features
437
+
438
+ WHOOP's paid health features. Healthspan is checked on a real account. Blood pressure, AFib history and Advanced Labs are experimental: built without an account that has them, so untested.
439
+
440
+ ### `whoop_health`
441
+
442
+ healthspan for a date: WHOOP Age, pace of aging, contributors. EXPERIMENTAL, untested (fields may be missing or misnamed): blood_pressure for a date; afib history (date: a day; cursor: next page); labs: biomarkers and tests (id: one of them).
443
+
444
+ | Input | Type | Notes |
445
+ |---|---|---|
446
+ | `feature` (required) | `healthspan`, `blood_pressure`, `afib`, `labs` | |
447
+ | `date` | string | |
448
+ | `id` | string | |
449
+ | `cursor` | string | |
450
+
451
+ ## Profile, settings and community
452
+
453
+ Your profile, heart-rate zones, app settings, milestones and teams.
454
+
455
+ ### `whoop_profile`
456
+
457
+ Your profile: name, email, birthday, gender, physiological baseline, height (m), weight (kg), unit system, location, max and resting HR, membership, hidden metrics and stealth mode. include adds hr_zones (bpm), entitlements (features that are off, and why), integrations and community privacy.
458
+
459
+ | Input | Type | Notes |
460
+ |---|---|---|
461
+ | `include` | list of `hr_zones`, `entitlements`, `integrations`, `privacy` | |
462
+
463
+ ### `whoop_profile_update` (changes data)
464
+
465
+ Change profile fields; pass only what changes and the rest is kept. Weight is kg or lb (24–272 kg), height m, cm or in (0.91–2.72 m). Changing birthday or country makes WHOOP end the session; totem refreshes the token on the next call. Email can't be changed here. Previews unless confirm:true.
466
+
467
+ | Input | Type | Notes |
468
+ |---|---|---|
469
+ | `first_name` | string | |
470
+ | `last_name` | string | |
471
+ | `birthday` | string | |
472
+ | `gender` | `MALE`, `FEMALE`, `NON_BINARY`, `PREFER_NOT` | |
473
+ | `physiological_baseline` | `MALE`, `FEMALE` | Sex used for physiology baselines |
474
+ | `weight` | number | |
475
+ | `weight_unit` | `kg`, `lb` | Default kg |
476
+ | `height` | number | |
477
+ | `height_unit` | `m`, `cm`, `in` | Default m |
478
+ | `city` | string | |
479
+ | `state` | string | Region code, e.g. CA; required for US |
480
+ | `country` | string | |
481
+ | `unit_system` | `metric`, `imperial` | Display units; also how WHOOP reads lift weights |
482
+
483
+ Add `confirm: true` to make the change.
484
+
485
+ ### `whoop_hr_zones_set` (changes data)
486
+
487
+ Set heart-rate zones. max_hr: set max_heart_rate (WHOOP recomputes its default zones; custom zones stay in force). custom: zones as 5 [min, max] bpm pairs Z1..Z5, contiguous (each min = previous max + 1), Z5 max at most your max HR. reset: back to WHOOP's defaults. Previews unless confirm:true.
488
+
489
+ | Input | Type | Notes |
490
+ |---|---|---|
491
+ | `action` (required) | `max_hr`, `custom`, `reset` | |
492
+ | `max_heart_rate` | integer | |
493
+ | `zones` | list of list of integer | |
494
+
495
+ Add `confirm: true` to make the change.
496
+
497
+ ### `whoop_preferences`
498
+
499
+ Account preferences: journal flags, notification namespaces (false = blocked), AI coach settings, the home dashboard (2 focus gauges, pinned metrics and the keys to choose from) and how many journal behaviours you track.
500
+
501
+ | Input | Type | Notes |
502
+ |---|---|---|
503
+ | `include` | list of `journal`, `notifications`, `ai`, `dashboard`, `tracked_behaviors` | Default all |
504
+
505
+ ### `whoop_preferences_set` (changes data)
506
+
507
+ Change one account setting, picked by setting: hidden_metric (metric, hidden), stealth (enabled), dashboard (gauges and/or pinned; an omitted one is kept), notification (namespace, enabled), journal_prefs (its three flags), tracked_behaviors (track, untrack; untracking only hides a behaviour, its answers stay), clock_format. Previews unless confirm:true.
508
+
509
+ | Input | Type | Notes |
510
+ |---|---|---|
511
+ | `setting` (required) | `hidden_metric`, `stealth`, `dashboard`, `notification`, `journal_prefs`, `tracked_behaviors`, `clock_format` | |
512
+ | `metric` | `BODY_COMP`, `HEALTHSPAN` | |
513
+ | `hidden` | boolean | |
514
+ | `enabled` | boolean | notification: false blocks the namespace |
515
+ | `namespace` | `StressSummary`, `GPS`, `ConversationalCheckIn`, `CheckIn` | |
516
+ | `gauges` | list of string | 2 metric keys; not RECOVERY or DAY_STRAIN |
517
+ | `pinned` | list of string | Metric keys in order; replaces the list |
518
+ | `journal_enabled` | boolean | |
519
+ | `journal_autopop_enabled` | boolean | |
520
+ | `ai_autopop_enabled` | boolean | |
521
+ | `track` | list of integer or string | Behaviour ids or names |
522
+ | `untrack` | list of integer or string | |
523
+ | `clock_format` | `TWELVE_HOUR_FORMAT`, `TWENTY_FOUR_HOUR_FORMAT` | |
524
+
525
+ Add `confirm: true` to make the change.
526
+
527
+ ### `whoop_milestones`
528
+
529
+ Milestone badges and the wear streak: totals, the data streak, top earned badges and the closest unearned ones. include badges lists every badge. milestone_type returns one badge's detail: count, progress to the next level and levels earned with dates.
530
+
531
+ | Input | Type | Notes |
532
+ |---|---|---|
533
+ | `milestone_type` | string | e.g. HIGH_STRAIN |
534
+ | `include` | list of `badges` | |
535
+
536
+ ### `whoop_community`
537
+
538
+ Community and friends. Returns OTHER PEOPLE'S names and scores, read live (never cached). Views: communities (your teams and rank), leaderboard (a community's ranking plus your row, for a day or a 7/30-day average), following (people you follow and their shared scores), snapshot (one person's daily scores), comments (on a snapshot). No social writes.
539
+
540
+ | Input | Type | Notes |
541
+ |---|---|---|
542
+ | `view` | `communities`, `leaderboard`, `following`, `snapshot`, `comments` | |
543
+ | `community_id` | integer | leaderboard; default your first |
544
+ | `metric` | `recovery`, `sleep`, `strain` | |
545
+ | `window` | `day`, `week`, `month` | |
546
+ | `date` | string | leaderboard: the window's last day |
547
+ | `limit` | integer | |
548
+ | `offset` | integer | |
549
+ | `user_id` | integer | snapshot: from view following; default you |
550
+ | `snapshot_id` | string | comments: from view snapshot |
551
+
552
+ ## Anything else
553
+
554
+ Any WHOOP endpoint, for what no tool covers yet.
555
+
556
+ ### `whoop_raw` (changes data)
557
+
558
+ Escape hatch: call any WHOOP endpoint when no tool fits (the whoop://catalog/endpoints resource lists verified paths). Writes need allow_write:true and confirm:true; some paths are refused outright (auth, account, purchases, consents, strap, telemetry). Social writes (follow, comment) are only available here.
559
+
560
+ | Input | Type | Notes |
561
+ |---|---|---|
562
+ | `path` (required) | string | e.g. /home-service/v1/home |
563
+ | `method` | `GET`, `POST`, `PUT`, `PATCH`, `DELETE` | |
564
+ | `query` | object | |
565
+ | `body` | any | |
566
+ | `allow_write` | boolean | |