@thebriangao/totem 1.4.4

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 (405) hide show
  1. package/.dockerignore +23 -0
  2. package/.env.example +66 -0
  3. package/CHANGELOG.md +283 -0
  4. package/CONTRIBUTING.md +149 -0
  5. package/Dockerfile +53 -0
  6. package/LICENSE +37 -0
  7. package/README.md +587 -0
  8. package/SECURITY.md +79 -0
  9. package/TOOLS.md +429 -0
  10. package/WHOOP.md +2673 -0
  11. package/assets/banner.svg +38 -0
  12. package/dist/cli/index.js +589 -0
  13. package/dist/cli/index.js.map +1 -0
  14. package/dist/cli/setup.js +1127 -0
  15. package/dist/cli/setup.js.map +1 -0
  16. package/dist/cli/ui.js +512 -0
  17. package/dist/cli/ui.js.map +1 -0
  18. package/dist/cli/update.js +465 -0
  19. package/dist/cli/update.js.map +1 -0
  20. package/dist/data/behaviors.js +2777 -0
  21. package/dist/data/behaviors.js.map +1 -0
  22. package/dist/data/endpoints.js +320 -0
  23. package/dist/data/endpoints.js.map +1 -0
  24. package/dist/data/exercises.js +4863 -0
  25. package/dist/data/exercises.js.map +1 -0
  26. package/dist/data/sports.js +212 -0
  27. package/dist/data/sports.js.map +1 -0
  28. package/dist/lib/concurrency.js +27 -0
  29. package/dist/lib/concurrency.js.map +1 -0
  30. package/dist/lib/dates.js +29 -0
  31. package/dist/lib/dates.js.map +1 -0
  32. package/dist/lib/format.js +22 -0
  33. package/dist/lib/format.js.map +1 -0
  34. package/dist/lib/stats.js +32 -0
  35. package/dist/lib/stats.js.map +1 -0
  36. package/dist/lib/timezone.js +249 -0
  37. package/dist/lib/timezone.js.map +1 -0
  38. package/dist/lib/walk.js +396 -0
  39. package/dist/lib/walk.js.map +1 -0
  40. package/dist/projections/behavior_impact.js +96 -0
  41. package/dist/projections/behavior_impact.js.map +1 -0
  42. package/dist/projections/calendar.js +33 -0
  43. package/dist/projections/calendar.js.map +1 -0
  44. package/dist/projections/communities.js +105 -0
  45. package/dist/projections/communities.js.map +1 -0
  46. package/dist/projections/cycle.js +81 -0
  47. package/dist/projections/cycle.js.map +1 -0
  48. package/dist/projections/hr_zones.js +35 -0
  49. package/dist/projections/hr_zones.js.map +1 -0
  50. package/dist/projections/journal.js +56 -0
  51. package/dist/projections/journal.js.map +1 -0
  52. package/dist/projections/leaderboard.js +37 -0
  53. package/dist/projections/leaderboard.js.map +1 -0
  54. package/dist/projections/lift_exercise.js +22 -0
  55. package/dist/projections/lift_exercise.js.map +1 -0
  56. package/dist/projections/lift_history.js +133 -0
  57. package/dist/projections/lift_history.js.map +1 -0
  58. package/dist/projections/lift_library.js +71 -0
  59. package/dist/projections/lift_library.js.map +1 -0
  60. package/dist/projections/lift_progression.js +138 -0
  61. package/dist/projections/lift_progression.js.map +1 -0
  62. package/dist/projections/lift_prs.js +20 -0
  63. package/dist/projections/lift_prs.js.map +1 -0
  64. package/dist/projections/live_hr.js +19 -0
  65. package/dist/projections/live_hr.js.map +1 -0
  66. package/dist/projections/live_state.js +23 -0
  67. package/dist/projections/live_state.js.map +1 -0
  68. package/dist/projections/live_stress.js +11 -0
  69. package/dist/projections/live_stress.js.map +1 -0
  70. package/dist/projections/performance_assessment.js +15 -0
  71. package/dist/projections/performance_assessment.js.map +1 -0
  72. package/dist/projections/profile.js +59 -0
  73. package/dist/projections/profile.js.map +1 -0
  74. package/dist/projections/recovery.js +131 -0
  75. package/dist/projections/recovery.js.map +1 -0
  76. package/dist/projections/sleep.js +256 -0
  77. package/dist/projections/sleep.js.map +1 -0
  78. package/dist/projections/sleep_need.js +32 -0
  79. package/dist/projections/sleep_need.js.map +1 -0
  80. package/dist/projections/smart_alarm.js +45 -0
  81. package/dist/projections/smart_alarm.js.map +1 -0
  82. package/dist/projections/strain.js +128 -0
  83. package/dist/projections/strain.js.map +1 -0
  84. package/dist/projections/stress.js +86 -0
  85. package/dist/projections/stress.js.map +1 -0
  86. package/dist/projections/today.js +129 -0
  87. package/dist/projections/today.js.map +1 -0
  88. package/dist/projections/trend.js +149 -0
  89. package/dist/projections/trend.js.map +1 -0
  90. package/dist/projections/workout.js +161 -0
  91. package/dist/projections/workout.js.map +1 -0
  92. package/dist/projections/workouts.js +37 -0
  93. package/dist/projections/workouts.js.map +1 -0
  94. package/dist/schemas/calendar.js +12 -0
  95. package/dist/schemas/calendar.js.map +1 -0
  96. package/dist/schemas/coach.js +11 -0
  97. package/dist/schemas/coach.js.map +1 -0
  98. package/dist/schemas/communities.js +51 -0
  99. package/dist/schemas/communities.js.map +1 -0
  100. package/dist/schemas/compare.js +15 -0
  101. package/dist/schemas/compare.js.map +1 -0
  102. package/dist/schemas/escape.js +18 -0
  103. package/dist/schemas/escape.js.map +1 -0
  104. package/dist/schemas/journal.js +69 -0
  105. package/dist/schemas/journal.js.map +1 -0
  106. package/dist/schemas/leaderboard.js +25 -0
  107. package/dist/schemas/leaderboard.js.map +1 -0
  108. package/dist/schemas/live.js +26 -0
  109. package/dist/schemas/live.js.map +1 -0
  110. package/dist/schemas/performance.js +12 -0
  111. package/dist/schemas/performance.js.map +1 -0
  112. package/dist/schemas/primitives.js +29 -0
  113. package/dist/schemas/primitives.js.map +1 -0
  114. package/dist/schemas/profile.js +39 -0
  115. package/dist/schemas/profile.js.map +1 -0
  116. package/dist/schemas/recovery.js +27 -0
  117. package/dist/schemas/recovery.js.map +1 -0
  118. package/dist/schemas/settings.js +26 -0
  119. package/dist/schemas/settings.js.map +1 -0
  120. package/dist/schemas/sleep.js +38 -0
  121. package/dist/schemas/sleep.js.map +1 -0
  122. package/dist/schemas/sleep_need.js +15 -0
  123. package/dist/schemas/sleep_need.js.map +1 -0
  124. package/dist/schemas/smart_alarm.js +36 -0
  125. package/dist/schemas/smart_alarm.js.map +1 -0
  126. package/dist/schemas/strain.js +24 -0
  127. package/dist/schemas/strain.js.map +1 -0
  128. package/dist/schemas/strength.js +170 -0
  129. package/dist/schemas/strength.js.map +1 -0
  130. package/dist/schemas/stress.js +16 -0
  131. package/dist/schemas/stress.js.map +1 -0
  132. package/dist/schemas/today.js +38 -0
  133. package/dist/schemas/today.js.map +1 -0
  134. package/dist/schemas/trend.js +50 -0
  135. package/dist/schemas/trend.js.map +1 -0
  136. package/dist/schemas/womens_health.js +23 -0
  137. package/dist/schemas/womens_health.js.map +1 -0
  138. package/dist/schemas/workouts.js +50 -0
  139. package/dist/schemas/workouts.js.map +1 -0
  140. package/dist/scripts/cognito_bootstrap.js +278 -0
  141. package/dist/scripts/cognito_bootstrap.js.map +1 -0
  142. package/dist/server-http.js +221 -0
  143. package/dist/server-http.js.map +1 -0
  144. package/dist/server.js +74 -0
  145. package/dist/server.js.map +1 -0
  146. package/dist/tools/register.js +117 -0
  147. package/dist/tools/register.js.map +1 -0
  148. package/dist/tools/v2/activity_create.js +64 -0
  149. package/dist/tools/v2/activity_create.js.map +1 -0
  150. package/dist/tools/v2/activity_delete.js +26 -0
  151. package/dist/tools/v2/activity_delete.js.map +1 -0
  152. package/dist/tools/v2/behavior_impact.js +36 -0
  153. package/dist/tools/v2/behavior_impact.js.map +1 -0
  154. package/dist/tools/v2/calendar.js +28 -0
  155. package/dist/tools/v2/calendar.js.map +1 -0
  156. package/dist/tools/v2/coach_ask.js +117 -0
  157. package/dist/tools/v2/coach_ask.js.map +1 -0
  158. package/dist/tools/v2/communities.js +60 -0
  159. package/dist/tools/v2/communities.js.map +1 -0
  160. package/dist/tools/v2/compare.js +67 -0
  161. package/dist/tools/v2/compare.js.map +1 -0
  162. package/dist/tools/v2/cycle.js +23 -0
  163. package/dist/tools/v2/cycle.js.map +1 -0
  164. package/dist/tools/v2/cycle_log.js +43 -0
  165. package/dist/tools/v2/cycle_log.js.map +1 -0
  166. package/dist/tools/v2/day.js +32 -0
  167. package/dist/tools/v2/day.js.map +1 -0
  168. package/dist/tools/v2/endpoints.js +28 -0
  169. package/dist/tools/v2/endpoints.js.map +1 -0
  170. package/dist/tools/v2/hidden_metric.js +28 -0
  171. package/dist/tools/v2/hidden_metric.js.map +1 -0
  172. package/dist/tools/v2/hr_zones.js +24 -0
  173. package/dist/tools/v2/hr_zones.js.map +1 -0
  174. package/dist/tools/v2/hr_zones_set.js +51 -0
  175. package/dist/tools/v2/hr_zones_set.js.map +1 -0
  176. package/dist/tools/v2/journal.js +26 -0
  177. package/dist/tools/v2/journal.js.map +1 -0
  178. package/dist/tools/v2/journal_autopop.js +19 -0
  179. package/dist/tools/v2/journal_autopop.js.map +1 -0
  180. package/dist/tools/v2/journal_catalog.js +44 -0
  181. package/dist/tools/v2/journal_catalog.js.map +1 -0
  182. package/dist/tools/v2/journal_log.js +78 -0
  183. package/dist/tools/v2/journal_log.js.map +1 -0
  184. package/dist/tools/v2/leaderboard.js +79 -0
  185. package/dist/tools/v2/leaderboard.js.map +1 -0
  186. package/dist/tools/v2/lift_catalog.js +47 -0
  187. package/dist/tools/v2/lift_catalog.js.map +1 -0
  188. package/dist/tools/v2/lift_custom_exercise.js +108 -0
  189. package/dist/tools/v2/lift_custom_exercise.js.map +1 -0
  190. package/dist/tools/v2/lift_exercise.js +31 -0
  191. package/dist/tools/v2/lift_exercise.js.map +1 -0
  192. package/dist/tools/v2/lift_history.js +39 -0
  193. package/dist/tools/v2/lift_history.js.map +1 -0
  194. package/dist/tools/v2/lift_library.js +22 -0
  195. package/dist/tools/v2/lift_library.js.map +1 -0
  196. package/dist/tools/v2/lift_log.js +95 -0
  197. package/dist/tools/v2/lift_log.js.map +1 -0
  198. package/dist/tools/v2/lift_progression.js +30 -0
  199. package/dist/tools/v2/lift_progression.js.map +1 -0
  200. package/dist/tools/v2/lift_prs.js +21 -0
  201. package/dist/tools/v2/lift_prs.js.map +1 -0
  202. package/dist/tools/v2/lift_template_save.js +83 -0
  203. package/dist/tools/v2/lift_template_save.js.map +1 -0
  204. package/dist/tools/v2/live_hr.js +21 -0
  205. package/dist/tools/v2/live_hr.js.map +1 -0
  206. package/dist/tools/v2/live_state.js +21 -0
  207. package/dist/tools/v2/live_state.js.map +1 -0
  208. package/dist/tools/v2/live_stress.js +22 -0
  209. package/dist/tools/v2/live_stress.js.map +1 -0
  210. package/dist/tools/v2/performance_assessment.js +38 -0
  211. package/dist/tools/v2/performance_assessment.js.map +1 -0
  212. package/dist/tools/v2/profile.js +28 -0
  213. package/dist/tools/v2/profile.js.map +1 -0
  214. package/dist/tools/v2/profile_update.js +66 -0
  215. package/dist/tools/v2/profile_update.js.map +1 -0
  216. package/dist/tools/v2/raw.js +43 -0
  217. package/dist/tools/v2/raw.js.map +1 -0
  218. package/dist/tools/v2/recovery.js +31 -0
  219. package/dist/tools/v2/recovery.js.map +1 -0
  220. package/dist/tools/v2/sleep.js +23 -0
  221. package/dist/tools/v2/sleep.js.map +1 -0
  222. package/dist/tools/v2/sleep_need.js +21 -0
  223. package/dist/tools/v2/sleep_need.js.map +1 -0
  224. package/dist/tools/v2/smart_alarm.js +24 -0
  225. package/dist/tools/v2/smart_alarm.js.map +1 -0
  226. package/dist/tools/v2/smart_alarm_set.js +94 -0
  227. package/dist/tools/v2/smart_alarm_set.js.map +1 -0
  228. package/dist/tools/v2/sports_catalog.js +26 -0
  229. package/dist/tools/v2/sports_catalog.js.map +1 -0
  230. package/dist/tools/v2/strain.js +23 -0
  231. package/dist/tools/v2/strain.js.map +1 -0
  232. package/dist/tools/v2/stress.js +23 -0
  233. package/dist/tools/v2/stress.js.map +1 -0
  234. package/dist/tools/v2/symptom_log.js +72 -0
  235. package/dist/tools/v2/symptom_log.js.map +1 -0
  236. package/dist/tools/v2/today.js +30 -0
  237. package/dist/tools/v2/today.js.map +1 -0
  238. package/dist/tools/v2/trend.js +26 -0
  239. package/dist/tools/v2/trend.js.map +1 -0
  240. package/dist/tools/v2/workout.js +23 -0
  241. package/dist/tools/v2/workout.js.map +1 -0
  242. package/dist/tools/v2/workouts.js +32 -0
  243. package/dist/tools/v2/workouts.js.map +1 -0
  244. package/dist/whoop/build_lift_body.js +67 -0
  245. package/dist/whoop/build_lift_body.js.map +1 -0
  246. package/dist/whoop/client.js +84 -0
  247. package/dist/whoop/client.js.map +1 -0
  248. package/dist/whoop/cognito.js +110 -0
  249. package/dist/whoop/cognito.js.map +1 -0
  250. package/dist/whoop/constants.js +4 -0
  251. package/dist/whoop/constants.js.map +1 -0
  252. package/dist/whoop/device.js +103 -0
  253. package/dist/whoop/device.js.map +1 -0
  254. package/dist/whoop/errors.js +42 -0
  255. package/dist/whoop/errors.js.map +1 -0
  256. package/dist/whoop/init_timezone.js +62 -0
  257. package/dist/whoop/init_timezone.js.map +1 -0
  258. package/dist/whoop/installation.js +62 -0
  259. package/dist/whoop/installation.js.map +1 -0
  260. package/dist/whoop/json_out.js +9 -0
  261. package/dist/whoop/json_out.js.map +1 -0
  262. package/dist/whoop/oauth_provider.js +297 -0
  263. package/dist/whoop/oauth_provider.js.map +1 -0
  264. package/dist/whoop/session_state.js +34 -0
  265. package/dist/whoop/session_state.js.map +1 -0
  266. package/dist/whoop/token_manager.js +60 -0
  267. package/dist/whoop/token_manager.js.map +1 -0
  268. package/dist/whoop/token_store.js +47 -0
  269. package/dist/whoop/token_store.js.map +1 -0
  270. package/dist/whoop/types.js +82 -0
  271. package/dist/whoop/types.js.map +1 -0
  272. package/dist/whoop/write_safety.js +23 -0
  273. package/dist/whoop/write_safety.js.map +1 -0
  274. package/package.json +66 -0
  275. package/src/cli/index.ts +597 -0
  276. package/src/cli/setup.ts +1106 -0
  277. package/src/cli/ui.ts +505 -0
  278. package/src/cli/update.ts +442 -0
  279. package/src/data/behaviors.ts +2784 -0
  280. package/src/data/endpoints.ts +319 -0
  281. package/src/data/exercises.ts +4868 -0
  282. package/src/data/sports.ts +218 -0
  283. package/src/lib/concurrency.ts +28 -0
  284. package/src/lib/dates.ts +35 -0
  285. package/src/lib/format.ts +27 -0
  286. package/src/lib/stats.ts +35 -0
  287. package/src/lib/timezone.ts +269 -0
  288. package/src/lib/walk.ts +418 -0
  289. package/src/projections/behavior_impact.ts +98 -0
  290. package/src/projections/calendar.ts +46 -0
  291. package/src/projections/communities.ts +135 -0
  292. package/src/projections/cycle.ts +85 -0
  293. package/src/projections/hr_zones.ts +43 -0
  294. package/src/projections/journal.ts +55 -0
  295. package/src/projections/leaderboard.ts +49 -0
  296. package/src/projections/lift_exercise.ts +29 -0
  297. package/src/projections/lift_history.ts +140 -0
  298. package/src/projections/lift_library.ts +70 -0
  299. package/src/projections/lift_progression.ts +138 -0
  300. package/src/projections/lift_prs.ts +23 -0
  301. package/src/projections/live_hr.ts +21 -0
  302. package/src/projections/live_state.ts +28 -0
  303. package/src/projections/live_stress.ts +13 -0
  304. package/src/projections/performance_assessment.ts +19 -0
  305. package/src/projections/profile.ts +71 -0
  306. package/src/projections/recovery.ts +133 -0
  307. package/src/projections/sleep.ts +276 -0
  308. package/src/projections/sleep_need.ts +36 -0
  309. package/src/projections/smart_alarm.ts +70 -0
  310. package/src/projections/strain.ts +131 -0
  311. package/src/projections/stress.ts +95 -0
  312. package/src/projections/today.ts +166 -0
  313. package/src/projections/trend.ts +149 -0
  314. package/src/projections/workout.ts +168 -0
  315. package/src/projections/workouts.ts +36 -0
  316. package/src/schemas/calendar.ts +13 -0
  317. package/src/schemas/coach.ts +11 -0
  318. package/src/schemas/communities.ts +56 -0
  319. package/src/schemas/compare.ts +17 -0
  320. package/src/schemas/escape.ts +21 -0
  321. package/src/schemas/journal.ts +80 -0
  322. package/src/schemas/leaderboard.ts +26 -0
  323. package/src/schemas/live.ts +31 -0
  324. package/src/schemas/performance.ts +13 -0
  325. package/src/schemas/primitives.ts +35 -0
  326. package/src/schemas/profile.ts +40 -0
  327. package/src/schemas/recovery.ts +28 -0
  328. package/src/schemas/settings.ts +30 -0
  329. package/src/schemas/sleep.ts +40 -0
  330. package/src/schemas/sleep_need.ts +16 -0
  331. package/src/schemas/smart_alarm.ts +40 -0
  332. package/src/schemas/strain.ts +25 -0
  333. package/src/schemas/strength.ts +189 -0
  334. package/src/schemas/stress.ts +17 -0
  335. package/src/schemas/today.ts +39 -0
  336. package/src/schemas/trend.ts +53 -0
  337. package/src/schemas/womens_health.ts +26 -0
  338. package/src/schemas/workouts.ts +55 -0
  339. package/src/scripts/cognito_bootstrap.ts +249 -0
  340. package/src/server-http.ts +241 -0
  341. package/src/server.ts +85 -0
  342. package/src/tools/register.ts +120 -0
  343. package/src/tools/v2/activity_create.ts +74 -0
  344. package/src/tools/v2/activity_delete.ts +33 -0
  345. package/src/tools/v2/behavior_impact.ts +39 -0
  346. package/src/tools/v2/calendar.ts +33 -0
  347. package/src/tools/v2/coach_ask.ts +131 -0
  348. package/src/tools/v2/communities.ts +65 -0
  349. package/src/tools/v2/compare.ts +83 -0
  350. package/src/tools/v2/cycle.ts +28 -0
  351. package/src/tools/v2/cycle_log.ts +51 -0
  352. package/src/tools/v2/day.ts +37 -0
  353. package/src/tools/v2/endpoints.ts +32 -0
  354. package/src/tools/v2/hidden_metric.ts +33 -0
  355. package/src/tools/v2/hr_zones.ts +29 -0
  356. package/src/tools/v2/hr_zones_set.ts +57 -0
  357. package/src/tools/v2/journal.ts +31 -0
  358. package/src/tools/v2/journal_autopop.ts +26 -0
  359. package/src/tools/v2/journal_catalog.ts +48 -0
  360. package/src/tools/v2/journal_log.ts +84 -0
  361. package/src/tools/v2/leaderboard.ts +92 -0
  362. package/src/tools/v2/lift_catalog.ts +48 -0
  363. package/src/tools/v2/lift_custom_exercise.ts +117 -0
  364. package/src/tools/v2/lift_exercise.ts +35 -0
  365. package/src/tools/v2/lift_history.ts +52 -0
  366. package/src/tools/v2/lift_library.ts +28 -0
  367. package/src/tools/v2/lift_log.ts +102 -0
  368. package/src/tools/v2/lift_progression.ts +34 -0
  369. package/src/tools/v2/lift_prs.ts +26 -0
  370. package/src/tools/v2/lift_template_save.ts +89 -0
  371. package/src/tools/v2/live_hr.ts +26 -0
  372. package/src/tools/v2/live_state.ts +26 -0
  373. package/src/tools/v2/live_stress.ts +27 -0
  374. package/src/tools/v2/performance_assessment.ts +44 -0
  375. package/src/tools/v2/profile.ts +33 -0
  376. package/src/tools/v2/profile_update.ts +76 -0
  377. package/src/tools/v2/raw.ts +50 -0
  378. package/src/tools/v2/recovery.ts +36 -0
  379. package/src/tools/v2/sleep.ts +28 -0
  380. package/src/tools/v2/sleep_need.ts +26 -0
  381. package/src/tools/v2/smart_alarm.ts +29 -0
  382. package/src/tools/v2/smart_alarm_set.ts +103 -0
  383. package/src/tools/v2/sports_catalog.ts +32 -0
  384. package/src/tools/v2/strain.ts +28 -0
  385. package/src/tools/v2/stress.ts +28 -0
  386. package/src/tools/v2/symptom_log.ts +78 -0
  387. package/src/tools/v2/today.ts +35 -0
  388. package/src/tools/v2/trend.ts +31 -0
  389. package/src/tools/v2/workout.ts +28 -0
  390. package/src/tools/v2/workouts.ts +37 -0
  391. package/src/whoop/build_lift_body.ts +84 -0
  392. package/src/whoop/client.ts +118 -0
  393. package/src/whoop/cognito.ts +150 -0
  394. package/src/whoop/constants.ts +3 -0
  395. package/src/whoop/device.ts +106 -0
  396. package/src/whoop/errors.ts +41 -0
  397. package/src/whoop/init_timezone.ts +64 -0
  398. package/src/whoop/installation.ts +58 -0
  399. package/src/whoop/json_out.ts +9 -0
  400. package/src/whoop/oauth_provider.ts +377 -0
  401. package/src/whoop/session_state.ts +41 -0
  402. package/src/whoop/token_manager.ts +76 -0
  403. package/src/whoop/token_store.ts +45 -0
  404. package/src/whoop/types.ts +89 -0
  405. package/src/whoop/write_safety.ts +30 -0
package/SECURITY.md ADDED
@@ -0,0 +1,79 @@
1
+ # Security policy
2
+
3
+ ## What this MCP touches
4
+
5
+ This server holds AWS Cognito access + refresh tokens for your Whoop account and reads + writes your personal fitness data. Treat the host running it (and the file holding the tokens) with the same care you'd treat a logged-in Whoop session.
6
+
7
+ **In local stdio mode** (the default), the only attack surface is your own machine. Anyone with local file access to `.env` or to the running process has full access to your Whoop account.
8
+
9
+ **In HTTP mode** (`MCP_TRANSPORT=http`, since v1.1.0), there's an additional surface: the URL is public-by-default and protected only by a static bearer token in the `MCP_AUTH_TOKEN` env var. Anyone who learns that bearer token gets the same full account access as if they had your `.env`. See "Threat model — HTTP mode" below.
10
+
11
+ ## What it does NOT do
12
+
13
+ - No telemetry, no analytics, no remote logging
14
+ - No outbound network calls except `https://api.prod.whoop.com`
15
+ - No data persisted outside `.env` (stdio mode) or the configured `TokenStore` (HTTP mode) and the running process memory
16
+ - No file-system access outside the repo root
17
+ - No code-execution surface for the AI: tool inputs are validated by zod before any HTTP call
18
+ - No multi-tenancy: one deployment = one Whoop account, full stop
19
+
20
+ ## Reporting a vulnerability
21
+
22
+ Email **briangaoo2@gmail.com** with subject `[totem security]`. Please don't open a public GitHub issue for security reports.
23
+
24
+ For non-security bug reports, [open an issue](https://github.com/thebriangao/totem/issues).
25
+
26
+ ## What counts as security
27
+
28
+ - Credential leakage (`.env` being read by a path that shouldn't, tokens being logged, secrets accidentally committed)
29
+ - Privilege escalation (a tool writing to a different user's account, a write firing without `confirm: true`)
30
+ - Code injection via tool arguments (input not validated before being passed to `fetch` or `eval`)
31
+ - Sensitive data being exfiltrated to a third party (responses being sent anywhere besides the MCP client)
32
+ - Auth bypass (a tool succeeding without a valid Cognito token, OR — in HTTP mode — a request to `/mcp` succeeding without a valid bearer token, OR a timing attack against the bearer token compare)
33
+ - Logging that leaks the bearer token, refresh token, or any portion of `Authorization` headers
34
+
35
+ What's NOT a security report (open a normal issue):
36
+ - A projection returning incorrect data
37
+ - A tool returning empty output
38
+ - A Whoop API change breaking a projection
39
+ - A schema mismatch
40
+ - A 4xx or 5xx from Whoop
41
+
42
+ ## Threat model — stdio mode (default, local)
43
+
44
+ - **The MCP trusts the user's local environment.** If your machine is compromised, the tokens in `.env` are too.
45
+ - **The MCP trusts the AI client.** Claude (or whoever you wire in via MCP) can call any tool. The write-safety harness (`confirm: false` default) is a check against accidental mutations, not against a malicious AI. If you don't want a tool callable at all, comment out its registration in `src/tools/register.ts` and rebuild.
46
+ - **The MCP trusts Whoop's API.** A compromised Whoop backend could return arbitrary content and we'd happily pass it to the AI. zod validates shape, not provenance.
47
+
48
+ ## Threat model — HTTP mode (remote, since v1.1.0)
49
+
50
+ When you set `MCP_TRANSPORT=http` and deploy to a public URL, you add:
51
+
52
+ - **The bearer token (`MCP_AUTH_TOKEN`) is the only thing protecting your Whoop account.** Anyone with the URL + token gets full read+write. There is no second factor.
53
+ - **Token compromise is total.** The server can't distinguish a leaked-token request from a legitimate one. The leaked token grants full account access until you rotate it.
54
+ - **HTTPS is required in production.** Plain HTTP exposes the bearer token to anyone on the network path. Every recommended deploy host (Fly, Railway, Render, Cloudflare Tunnel) gives you HTTPS automatically. If you bring your own VPS, put it behind Caddy / Nginx with a TLS cert.
55
+ - **The static bearer token is compared with `crypto.timingSafeEqual`** (via a constant-time helper that length-checks first, so a wrong-length token returns 401 without exposing length via timing) to dodge timing-attack side channels. The `/mcp` auth gate is the MCP SDK's `requireBearerAuth`, which also accepts OAuth 2.1 access tokens (the same `MCP_AUTH_TOKEN` signs them — see "OAuth" below). A failed request returns 401 with a `WWW-Authenticate: Bearer` header pointing at the protected-resource metadata (`/.well-known/oauth-protected-resource/mcp`, per RFC 9728) so OAuth clients can discover the authorization server.
56
+ - **The MCP host can read your Whoop data.** Whoever operates the host you deploy to — Fly, Railway, your VPS provider, etc. — has root on the box. They can read the env vars (including `WHOOP_IOS_BEARER_TOKEN` + `WHOOP_COGNITO_REFRESH_TOKEN` + `MCP_AUTH_TOKEN`) and the running process memory. Don't deploy to a host you don't trust at the operator level.
57
+ - **Logs are minimal but non-zero.** The server logs request errors to stderr. We avoid logging `Authorization` headers, tool arguments, and response bodies. If you fork and add custom logging, scrub these.
58
+ - **Concurrent connections share state.** The catalog gate (`session_state.ts`) is process-global. Two clients connected to one deployment share the unlock state. Not a security issue (both are the same Whoop account) but worth noting if you fork it to support multiple users.
59
+
60
+ ### OAuth (claude.ai web + mobile connectors)
61
+
62
+ Setting `AUTH_PASSWORD` enables a full OAuth 2.1 + PKCE authorization server (the MCP SDK's `mcpAuthRouter` + a custom provider in `src/whoop/oauth_provider.ts`), required for adding the server as a custom connector on claude.ai web / Claude mobile (which have no bearer-token field).
63
+
64
+ - **A password gates the `/authorize` step.** Adding the connector serves a small password page; the user enters `AUTH_PASSWORD` once. A stranger who finds the URL can't connect without it. The password is checked with the same constant-time compare as the bearer token.
65
+ - **Stateless tokens.** Access + refresh tokens are HS256 JWTs signed with a key **derived from `MCP_AUTH_TOKEN`** (HMAC, since 1.2.3 — not the token itself, so the static bearer and the signing secret aren't the same string in two roles); registered clients (dynamic client registration) encode their redirect URIs into a signed `client_id`. Only the 60-second authorization codes live in memory. This survives Fly's auto-stop restarts without a database — but it also means **rotating `MCP_AUTH_TOKEN` invalidates every issued OAuth token** (clients must re-authorize) in addition to the static bearer.
66
+ - **Tokens are audience-bound** (RFC 8707, since 1.2.3). An access token carrying a `resource` claim is rejected unless it matches this server's `/mcp` URL, so a token minted for one deployment can't be replayed against another that happens to share the secret.
67
+ - **Leave `AUTH_PASSWORD` unset to disable the OAuth path entirely** — then only the static bearer is accepted, as in the bullets above.
68
+
69
+ ## Token hygiene
70
+
71
+ - **Cognito tokens (Whoop):** the 24h access token is in memory and (in stdio mode) `.env`. The ~30d refresh token is in `.env`. If you suspect either is compromised: revoke via `DELETE /v2/user/access` (the OAuth account-deletion endpoint), then re-bootstrap with a fresh password.
72
+ - **`MCP_AUTH_TOKEN` (HTTP mode only):** generate with `openssl rand -hex 32` for 256 bits of entropy. Set it as a secret on your deploy host, never check into source. If it leaks: generate a new one, update both server and client config, redeploy. The token has no automatic rotation — if you want one, set up a cron job that regenerates and redeploys.
73
+ - Don't commit any `.env`. The repo's `.gitignore` excludes `.env*` (every variant, including `.env.bak*` backups) — only `.env.example` is tracked.
74
+ - Don't paste tokens into chat windows or LLM prompts outside this MCP.
75
+ - Don't put the bearer token in the URL (e.g., `?token=…`). It would end up in proxy logs, browser history, and HTTP referer headers. Always send it via the `Authorization` header.
76
+
77
+ ## Disclosure timeline
78
+
79
+ I'll respond to security reports within 7 days. Critical issues will get a patch within 30 days. Coordinated disclosure preferred.
package/TOOLS.md ADDED
@@ -0,0 +1,429 @@
1
+ # The 48 tools
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).
4
+
5
+
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/`).
7
+
8
+ ### Snapshots & profile (4)
9
+
10
+ #### `whoop_today`
11
+ Composite snapshot of today: recovery score + state, sleep performance + stages, day strain so far, current activity state, workouts count.
12
+
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}}`
16
+
17
+ #### `whoop_day`
18
+ Same composite as `whoop_today` but for any past date. Drops the live state (not relevant for historical days).
19
+
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
23
+
24
+ #### `whoop_profile`
25
+ Identity + body measurements + privacy state.
26
+
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}}`
30
+
31
+ #### `whoop_calendar`
32
+ Per-day recovery / sleep / strain scores for a month.
33
+
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}]}`
37
+
38
+ ### Deep dives (3)
39
+
40
+ #### `whoop_recovery`
41
+ Recovery score + HRV (with baseline) + RHR (with baseline) + respiratory rate + SpO2 + skin temp + sleep performance.
42
+
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.
49
+
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.
52
+
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}`
56
+
57
+ Note: the underlying endpoint is 848 KB. The projection extracts ~500 chars.
58
+
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).
60
+
61
+ #### `whoop_strain`
62
+ Day strain + HR zone time buckets + steps + strength activity time + workouts count.
63
+
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
+
72
+ ### Trends (2)
73
+
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.
76
+
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
+
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
+
83
+ #### `whoop_compare`
84
+ Side-by-side comparison of two date windows across recovery / sleep performance / day strain / HRV / RHR.
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}]}`
89
+
90
+ ### Stress + sleep coach (2)
91
+
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`.)
94
+
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
+
99
+ #### `whoop_sleep_need`
100
+ Recommended bedtime + sleep need breakdown (baseline + debt + strain + nap credit) + smart-alarm eligibility.
101
+
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
+
106
+ ### Live (3)
107
+
108
+ #### `whoop_live_hr`
109
+ Current heart rate from the strap (if recording).
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.
115
+
116
+ #### `whoop_live_state`
117
+ What you're currently doing — workout, sleep, idle, recovery.
118
+
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}`
122
+
123
+ #### `whoop_live_stress`
124
+ Current stress level (cheaper than `whoop_stress` if you don't need the timeline).
125
+
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}`
129
+
130
+ ### Activities (2 read + 2 write + 1 catalog)
131
+
132
+ #### `whoop_workouts`
133
+ List of recent activities with sport, start, end, duration, strain, HR, calories.
134
+
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}>`
138
+
139
+ #### `whoop_workout`
140
+ Full detail of one activity: HR curve, HR zone durations, calories, distance. Strength workouts include MSK summary (volume + intensity).
141
+
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.
147
+
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).
150
+
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.
157
+
158
+ #### `whoop_activity_delete` ⚠️ WRITE (DESTRUCTIVE)
159
+ Delete a workout / activity. Cannot be undone — the activity is removed from Whoop's system.
160
+
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
+
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.
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}]}`
171
+
172
+ ### Strength reads (6)
173
+
174
+ #### `whoop_lift_prs`
175
+ All Strength Trainer personal records across every exercise, with medals.
176
+
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}>`
180
+
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.
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[]}`
188
+
189
+ #### `whoop_lift_progression` (gated by `whoop_lift_catalog`)
190
+ Volume trend for a single exercise across week / month / 6-month / year windows.
191
+
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)
196
+
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.
199
+
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 `[]`.
206
+
207
+ #### `whoop_lift_library`
208
+ Your saved templates. Returns the list or a single template detail.
209
+
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: [...]}`
214
+
215
+ #### `whoop_lift_catalog`
216
+ Local lookup over the bundled 372-exercise catalog. Zero network calls.
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}]}`
221
+
222
+ ### Strength writes (3)
223
+
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.
226
+
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.
231
+
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").
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.
239
+
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").
242
+
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.
248
+
249
+ ### Journal (3 read + 2 write)
250
+
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).
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}]}`
257
+
258
+ #### `whoop_journal_catalog`
259
+ Local lookup over the bundled 308-behavior catalog. Filter by category, magnitude type, or substring search.
260
+
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
265
+
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.)
268
+
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.
274
+
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.
277
+
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.
283
+
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.
286
+
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)
290
+
291
+ ### Women's health (1 read + 2 write)
292
+
293
+ #### `whoop_cycle`
294
+ Current menstrual cycle status — phase, cycle day, typical cycle length, and predicted next-period / ovulation dates.
295
+
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.
300
+
301
+ #### `whoop_cycle_log` ⚠️ WRITE
302
+ Log a period start or ovulation event for a date.
303
+
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)
308
+
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.
311
+
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.
319
+
320
+ ### Coach + performance (2)
321
+
322
+ #### `whoop_coach_ask` ⚠️ WRITE (creates artifact)
323
+ Ask Whoop Coach a question. Polls up to 30 seconds for the response.
324
+
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.
329
+
330
+ #### `whoop_performance_assessment`
331
+ Whoop's coaching evaluation for a period: total recoveries, required recoveries, expected next assessment.
332
+
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.
337
+
338
+ ### Smart alarm (1 read + 1 write)
339
+
340
+ #### `whoop_smart_alarm`
341
+ Current Smart Alarm state: schedules array + preferences (lower/upper bounds, goal mode, enabled).
342
+
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.
347
+
348
+ #### `whoop_smart_alarm_set` ⚠️ WRITE
349
+ Update one schedule, the global preferences, or the master enable/disable.
350
+
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.
359
+
360
+ ### Social (2)
361
+
362
+ #### `whoop_leaderboard`
363
+ Community leaderboard + your position. Auto-discovers your first community if `community_id` omitted.
364
+
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.
369
+
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`.
372
+
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.
377
+
378
+ ### Settings (1 read + 3 write)
379
+
380
+ #### `whoop_hr_zones`
381
+ Current HR zones + max HR + last updated.
382
+
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}]}`
386
+
387
+ #### `whoop_hr_zones_set` ⚠️ WRITE
388
+ Set max HR (auto-computes 5 zones) OR set custom 5-zone ranges.
389
+
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)
397
+
398
+ #### `whoop_profile_update` ⚠️ WRITE
399
+ Update profile: name, email, birthday, gender, weight, height, country/state, city.
400
+
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"`.
405
+
406
+ #### `whoop_hidden_metric` ⚠️ WRITE
407
+ Show or hide BODY_COMP / HEALTHSPAN on your dashboard.
408
+
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)
412
+
413
+ ### Escape hatch (2)
414
+
415
+ #### `whoop_raw`
416
+ Call any Whoop endpoint directly. The escape hatch for endpoints not yet wrapped.
417
+
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.
422
+
423
+ #### `whoop_endpoints`
424
+ Search the bundled catalog of 311 deduped endpoint paths.
425
+
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`)
429
+