hevy-mcp 1.15.0 → 1.17.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.
- package/README.md +2 -1
- package/dist/cli.js +267 -103
- package/dist/cli.js.map +1 -1
- package/dist/index.js +267 -103
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -130,7 +130,8 @@ pnpm start -- --hevy-api-key=your_hevy_api_key_here
|
|
|
130
130
|
`hevy-mcp` ships with Sentry monitoring baked into the built MCP server so
|
|
131
131
|
that usage and errors from published builds can be observed.
|
|
132
132
|
|
|
133
|
-
The server initializes `@sentry/node` with a fixed DSN
|
|
133
|
+
The server initializes `@sentry/node` with a fixed DSN, release name derived
|
|
134
|
+
from the package version, and tracing settings
|
|
134
135
|
directly in the code (see `src/index.ts`), and wraps the underlying
|
|
135
136
|
`McpServer` with `Sentry.wrapMcpServerWithSentry` so requests and tool calls
|
|
136
137
|
are captured by Sentry automatically. The configuration uses
|
package/dist/cli.js
CHANGED
|
@@ -9,10 +9,6 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
9
9
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
10
10
|
import { z as z6 } from "zod";
|
|
11
11
|
|
|
12
|
-
// package.json
|
|
13
|
-
var name = "hevy-mcp";
|
|
14
|
-
var version = "1.14.4";
|
|
15
|
-
|
|
16
12
|
// src/tools/folders.ts
|
|
17
13
|
import { z } from "zod";
|
|
18
14
|
|
|
@@ -165,6 +161,22 @@ function formatExerciseTemplate(template) {
|
|
|
165
161
|
isCustom: template.is_custom
|
|
166
162
|
};
|
|
167
163
|
}
|
|
164
|
+
function formatExerciseHistoryEntry(entry) {
|
|
165
|
+
return {
|
|
166
|
+
workoutId: entry.workout_id,
|
|
167
|
+
workoutTitle: entry.workout_title,
|
|
168
|
+
workoutStartTime: entry.workout_start_time,
|
|
169
|
+
workoutEndTime: entry.workout_end_time,
|
|
170
|
+
exerciseTemplateId: entry.exercise_template_id,
|
|
171
|
+
weight: entry.weight_kg,
|
|
172
|
+
reps: entry.reps,
|
|
173
|
+
distance: entry.distance_meters,
|
|
174
|
+
duration: entry.duration_seconds,
|
|
175
|
+
rpe: entry.rpe,
|
|
176
|
+
customMetric: entry.custom_metric,
|
|
177
|
+
setType: entry.set_type
|
|
178
|
+
};
|
|
179
|
+
}
|
|
168
180
|
|
|
169
181
|
// src/utils/response-formatter.ts
|
|
170
182
|
function createJsonResponse(data, options = { pretty: true, indent: 2 }) {
|
|
@@ -553,6 +565,139 @@ function registerTemplateTools(server, hevyClient) {
|
|
|
553
565
|
return createJsonResponse(template);
|
|
554
566
|
}, "get-exercise-template")
|
|
555
567
|
);
|
|
568
|
+
const getExerciseHistorySchema = {
|
|
569
|
+
exerciseTemplateId: z3.string().min(1),
|
|
570
|
+
startDate: z3.string().datetime({ offset: true }).describe("ISO 8601 start date for filtering history").optional(),
|
|
571
|
+
endDate: z3.string().datetime({ offset: true }).describe("ISO 8601 end date for filtering history").optional()
|
|
572
|
+
};
|
|
573
|
+
server.tool(
|
|
574
|
+
"get-exercise-history",
|
|
575
|
+
"Get past sets for a specific exercise template, optionally filtered by start and end dates.",
|
|
576
|
+
getExerciseHistorySchema,
|
|
577
|
+
withErrorHandling(async (args) => {
|
|
578
|
+
if (!hevyClient) {
|
|
579
|
+
throw new Error(
|
|
580
|
+
"API client not initialized. Please provide HEVY_API_KEY."
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
const { exerciseTemplateId, startDate, endDate } = args;
|
|
584
|
+
const data = await hevyClient.getExerciseHistory(exerciseTemplateId, {
|
|
585
|
+
...startDate ? { start_date: startDate } : {},
|
|
586
|
+
...endDate ? { end_date: endDate } : {}
|
|
587
|
+
});
|
|
588
|
+
const history = data?.exercise_history?.map(
|
|
589
|
+
(entry) => formatExerciseHistoryEntry(entry)
|
|
590
|
+
) || [];
|
|
591
|
+
if (history.length === 0) {
|
|
592
|
+
return createEmptyResponse(
|
|
593
|
+
`No exercise history found for template ${exerciseTemplateId}`
|
|
594
|
+
);
|
|
595
|
+
}
|
|
596
|
+
return createJsonResponse(history);
|
|
597
|
+
}, "get-exercise-history")
|
|
598
|
+
);
|
|
599
|
+
const createExerciseTemplateSchema = {
|
|
600
|
+
title: z3.string().min(1),
|
|
601
|
+
exerciseType: z3.enum([
|
|
602
|
+
"weight_reps",
|
|
603
|
+
"reps_only",
|
|
604
|
+
"bodyweight_reps",
|
|
605
|
+
"bodyweight_assisted_reps",
|
|
606
|
+
"duration",
|
|
607
|
+
"weight_duration",
|
|
608
|
+
"distance_duration",
|
|
609
|
+
"short_distance_weight"
|
|
610
|
+
]),
|
|
611
|
+
equipmentCategory: z3.enum([
|
|
612
|
+
"none",
|
|
613
|
+
"barbell",
|
|
614
|
+
"dumbbell",
|
|
615
|
+
"kettlebell",
|
|
616
|
+
"machine",
|
|
617
|
+
"plate",
|
|
618
|
+
"resistance_band",
|
|
619
|
+
"suspension",
|
|
620
|
+
"other"
|
|
621
|
+
]),
|
|
622
|
+
muscleGroup: z3.enum([
|
|
623
|
+
"abdominals",
|
|
624
|
+
"shoulders",
|
|
625
|
+
"biceps",
|
|
626
|
+
"triceps",
|
|
627
|
+
"forearms",
|
|
628
|
+
"quadriceps",
|
|
629
|
+
"hamstrings",
|
|
630
|
+
"calves",
|
|
631
|
+
"glutes",
|
|
632
|
+
"abductors",
|
|
633
|
+
"adductors",
|
|
634
|
+
"lats",
|
|
635
|
+
"upper_back",
|
|
636
|
+
"traps",
|
|
637
|
+
"lower_back",
|
|
638
|
+
"chest",
|
|
639
|
+
"cardio",
|
|
640
|
+
"neck",
|
|
641
|
+
"full_body",
|
|
642
|
+
"other"
|
|
643
|
+
]),
|
|
644
|
+
otherMuscles: z3.array(
|
|
645
|
+
z3.enum([
|
|
646
|
+
"abdominals",
|
|
647
|
+
"shoulders",
|
|
648
|
+
"biceps",
|
|
649
|
+
"triceps",
|
|
650
|
+
"forearms",
|
|
651
|
+
"quadriceps",
|
|
652
|
+
"hamstrings",
|
|
653
|
+
"calves",
|
|
654
|
+
"glutes",
|
|
655
|
+
"abductors",
|
|
656
|
+
"adductors",
|
|
657
|
+
"lats",
|
|
658
|
+
"upper_back",
|
|
659
|
+
"traps",
|
|
660
|
+
"lower_back",
|
|
661
|
+
"chest",
|
|
662
|
+
"cardio",
|
|
663
|
+
"neck",
|
|
664
|
+
"full_body",
|
|
665
|
+
"other"
|
|
666
|
+
])
|
|
667
|
+
).default([])
|
|
668
|
+
};
|
|
669
|
+
server.tool(
|
|
670
|
+
"create-exercise-template",
|
|
671
|
+
"Create a custom exercise template with title, type, equipment, and muscle groups.",
|
|
672
|
+
createExerciseTemplateSchema,
|
|
673
|
+
withErrorHandling(async (args) => {
|
|
674
|
+
if (!hevyClient) {
|
|
675
|
+
throw new Error(
|
|
676
|
+
"API client not initialized. Please provide HEVY_API_KEY."
|
|
677
|
+
);
|
|
678
|
+
}
|
|
679
|
+
const {
|
|
680
|
+
title,
|
|
681
|
+
exerciseType,
|
|
682
|
+
equipmentCategory,
|
|
683
|
+
muscleGroup,
|
|
684
|
+
otherMuscles
|
|
685
|
+
} = args;
|
|
686
|
+
const response = await hevyClient.createExerciseTemplate({
|
|
687
|
+
exercise: {
|
|
688
|
+
title,
|
|
689
|
+
exercise_type: exerciseType,
|
|
690
|
+
equipment_category: equipmentCategory,
|
|
691
|
+
muscle_group: muscleGroup,
|
|
692
|
+
other_muscles: otherMuscles
|
|
693
|
+
}
|
|
694
|
+
});
|
|
695
|
+
return createJsonResponse({
|
|
696
|
+
id: response?.id,
|
|
697
|
+
message: "Exercise template created successfully"
|
|
698
|
+
});
|
|
699
|
+
}, "create-exercise-template")
|
|
700
|
+
);
|
|
556
701
|
}
|
|
557
702
|
|
|
558
703
|
// src/tools/webhooks.ts
|
|
@@ -594,7 +739,7 @@ function registerWebhookTools(server, hevyClient) {
|
|
|
594
739
|
"API client not initialized. Please provide HEVY_API_KEY."
|
|
595
740
|
);
|
|
596
741
|
}
|
|
597
|
-
if (!
|
|
742
|
+
if (!hevyClient.getWebhookSubscription) {
|
|
598
743
|
throw new Error(
|
|
599
744
|
"Webhook subscription API not available. Please regenerate the client from the updated OpenAPI spec."
|
|
600
745
|
);
|
|
@@ -627,7 +772,7 @@ function registerWebhookTools(server, hevyClient) {
|
|
|
627
772
|
);
|
|
628
773
|
}
|
|
629
774
|
const { url, authToken } = args;
|
|
630
|
-
if (!
|
|
775
|
+
if (!hevyClient.createWebhookSubscription) {
|
|
631
776
|
throw new Error(
|
|
632
777
|
"Webhook subscription API not available. Please regenerate the client from the updated OpenAPI spec."
|
|
633
778
|
);
|
|
@@ -657,7 +802,7 @@ function registerWebhookTools(server, hevyClient) {
|
|
|
657
802
|
"API client not initialized. Please provide HEVY_API_KEY."
|
|
658
803
|
);
|
|
659
804
|
}
|
|
660
|
-
if (!
|
|
805
|
+
if (!hevyClient.deleteWebhookSubscription) {
|
|
661
806
|
throw new Error(
|
|
662
807
|
"Webhook subscription API not available. Please regenerate the client from the updated OpenAPI spec."
|
|
663
808
|
);
|
|
@@ -776,6 +921,7 @@ function registerWorkoutTools(server, hevyClient) {
|
|
|
776
921
|
description: z5.string().optional().nullable(),
|
|
777
922
|
startTime: z5.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/),
|
|
778
923
|
endTime: z5.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/),
|
|
924
|
+
routineId: z5.string().optional().nullable(),
|
|
779
925
|
isPrivate: z5.boolean().default(false),
|
|
780
926
|
exercises: z5.array(
|
|
781
927
|
z5.object({
|
|
@@ -810,31 +956,31 @@ function registerWorkoutTools(server, hevyClient) {
|
|
|
810
956
|
);
|
|
811
957
|
}
|
|
812
958
|
const { title, description, startTime, endTime, isPrivate, exercises } = args;
|
|
813
|
-
const
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
}
|
|
959
|
+
const workoutPayload = {
|
|
960
|
+
title,
|
|
961
|
+
description: description || null,
|
|
962
|
+
start_time: startTime,
|
|
963
|
+
end_time: endTime,
|
|
964
|
+
routine_id: args.routineId ?? null,
|
|
965
|
+
is_private: isPrivate,
|
|
966
|
+
exercises: exercises.map(
|
|
967
|
+
(exercise) => ({
|
|
968
|
+
exercise_template_id: exercise.exerciseTemplateId,
|
|
969
|
+
superset_id: exercise.supersetId ?? null,
|
|
970
|
+
notes: exercise.notes ?? null,
|
|
971
|
+
sets: exercise.sets.map((set) => ({
|
|
972
|
+
type: set.type,
|
|
973
|
+
weight_kg: set.weight ?? set.weightKg ?? null,
|
|
974
|
+
reps: set.reps ?? null,
|
|
975
|
+
distance_meters: set.distance ?? set.distanceMeters ?? null,
|
|
976
|
+
duration_seconds: set.duration ?? set.durationSeconds ?? null,
|
|
977
|
+
rpe: set.rpe ?? null,
|
|
978
|
+
custom_metric: set.customMetric ?? null
|
|
979
|
+
}))
|
|
980
|
+
})
|
|
981
|
+
)
|
|
837
982
|
};
|
|
983
|
+
const requestBody = { workout: workoutPayload };
|
|
838
984
|
const data = await hevyClient.createWorkout(requestBody);
|
|
839
985
|
if (!data) {
|
|
840
986
|
return createEmptyResponse(
|
|
@@ -854,6 +1000,7 @@ function registerWorkoutTools(server, hevyClient) {
|
|
|
854
1000
|
description: z5.string().optional().nullable(),
|
|
855
1001
|
startTime: z5.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/),
|
|
856
1002
|
endTime: z5.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/),
|
|
1003
|
+
routineId: z5.string().optional().nullable(),
|
|
857
1004
|
isPrivate: z5.boolean().default(false),
|
|
858
1005
|
exercises: z5.array(
|
|
859
1006
|
z5.object({
|
|
@@ -893,34 +1040,35 @@ function registerWorkoutTools(server, hevyClient) {
|
|
|
893
1040
|
description,
|
|
894
1041
|
startTime,
|
|
895
1042
|
endTime,
|
|
1043
|
+
routineId,
|
|
896
1044
|
isPrivate,
|
|
897
1045
|
exercises
|
|
898
1046
|
} = args;
|
|
899
|
-
const
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
}
|
|
1047
|
+
const workoutPayload = {
|
|
1048
|
+
title,
|
|
1049
|
+
description: description || null,
|
|
1050
|
+
start_time: startTime,
|
|
1051
|
+
end_time: endTime,
|
|
1052
|
+
routine_id: routineId ?? null,
|
|
1053
|
+
is_private: isPrivate,
|
|
1054
|
+
exercises: exercises.map(
|
|
1055
|
+
(exercise) => ({
|
|
1056
|
+
exercise_template_id: exercise.exerciseTemplateId,
|
|
1057
|
+
superset_id: exercise.supersetId ?? null,
|
|
1058
|
+
notes: exercise.notes ?? null,
|
|
1059
|
+
sets: exercise.sets.map((set) => ({
|
|
1060
|
+
type: set.type,
|
|
1061
|
+
weight_kg: set.weight ?? set.weightKg ?? null,
|
|
1062
|
+
reps: set.reps ?? null,
|
|
1063
|
+
distance_meters: set.distance ?? set.distanceMeters ?? null,
|
|
1064
|
+
duration_seconds: set.duration ?? set.durationSeconds ?? null,
|
|
1065
|
+
rpe: set.rpe ?? null,
|
|
1066
|
+
custom_metric: set.customMetric ?? null
|
|
1067
|
+
}))
|
|
1068
|
+
})
|
|
1069
|
+
)
|
|
923
1070
|
};
|
|
1071
|
+
const requestBody = { workout: workoutPayload };
|
|
924
1072
|
const data = await hevyClient.updateWorkout(workoutId, requestBody);
|
|
925
1073
|
if (!data) {
|
|
926
1074
|
return createEmptyResponse(
|
|
@@ -973,15 +1121,15 @@ function assertApiKey(apiKey) {
|
|
|
973
1121
|
// src/utils/hevyClientKubb.ts
|
|
974
1122
|
import axios from "axios";
|
|
975
1123
|
|
|
976
|
-
// src/generated/client/api/
|
|
1124
|
+
// src/generated/client/api/getV1ExerciseHistoryExercisetemplateid.ts
|
|
977
1125
|
import fetch from "@kubb/plugin-client/clients/axios";
|
|
978
|
-
function
|
|
979
|
-
const res = { method: "
|
|
1126
|
+
function getGetV1ExerciseHistoryExercisetemplateidUrl(exerciseTemplateId) {
|
|
1127
|
+
const res = { method: "GET", url: `/v1/exercise_history/${exerciseTemplateId}` };
|
|
980
1128
|
return res;
|
|
981
1129
|
}
|
|
982
|
-
async function
|
|
1130
|
+
async function getV1ExerciseHistoryExercisetemplateid(exerciseTemplateId, headers, params, config = {}) {
|
|
983
1131
|
const { client: request = fetch, ...requestConfig } = config;
|
|
984
|
-
const res = await request({ method: "
|
|
1132
|
+
const res = await request({ method: "GET", url: getGetV1ExerciseHistoryExercisetemplateidUrl(exerciseTemplateId).url.toString(), params, ...requestConfig, headers: { ...headers, ...requestConfig.headers } });
|
|
985
1133
|
return res.data;
|
|
986
1134
|
}
|
|
987
1135
|
|
|
@@ -1057,66 +1205,67 @@ async function getV1RoutinesRoutineid(routineId, headers, config = {}) {
|
|
|
1057
1205
|
return res.data;
|
|
1058
1206
|
}
|
|
1059
1207
|
|
|
1060
|
-
// src/generated/client/api/getV1WebhookSubscription.ts
|
|
1061
|
-
import fetch8 from "@kubb/plugin-client/clients/axios";
|
|
1062
|
-
function getGetV1WebhookSubscriptionUrl() {
|
|
1063
|
-
const res = { method: "GET", url: `/v1/webhook-subscription` };
|
|
1064
|
-
return res;
|
|
1065
|
-
}
|
|
1066
|
-
async function getV1WebhookSubscription(headers, config = {}) {
|
|
1067
|
-
const { client: request = fetch8, ...requestConfig } = config;
|
|
1068
|
-
const res = await request({ method: "GET", url: getGetV1WebhookSubscriptionUrl().url.toString(), ...requestConfig, headers: { ...headers, ...requestConfig.headers } });
|
|
1069
|
-
return res.data;
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
1208
|
// src/generated/client/api/getV1Workouts.ts
|
|
1073
|
-
import
|
|
1209
|
+
import fetch8 from "@kubb/plugin-client/clients/axios";
|
|
1074
1210
|
function getGetV1WorkoutsUrl() {
|
|
1075
1211
|
const res = { method: "GET", url: `/v1/workouts` };
|
|
1076
1212
|
return res;
|
|
1077
1213
|
}
|
|
1078
1214
|
async function getV1Workouts(headers, params, config = {}) {
|
|
1079
|
-
const { client: request =
|
|
1215
|
+
const { client: request = fetch8, ...requestConfig } = config;
|
|
1080
1216
|
const res = await request({ method: "GET", url: getGetV1WorkoutsUrl().url.toString(), params, ...requestConfig, headers: { ...headers, ...requestConfig.headers } });
|
|
1081
1217
|
return res.data;
|
|
1082
1218
|
}
|
|
1083
1219
|
|
|
1084
1220
|
// src/generated/client/api/getV1WorkoutsCount.ts
|
|
1085
|
-
import
|
|
1221
|
+
import fetch9 from "@kubb/plugin-client/clients/axios";
|
|
1086
1222
|
function getGetV1WorkoutsCountUrl() {
|
|
1087
1223
|
const res = { method: "GET", url: `/v1/workouts/count` };
|
|
1088
1224
|
return res;
|
|
1089
1225
|
}
|
|
1090
1226
|
async function getV1WorkoutsCount(headers, config = {}) {
|
|
1091
|
-
const { client: request =
|
|
1227
|
+
const { client: request = fetch9, ...requestConfig } = config;
|
|
1092
1228
|
const res = await request({ method: "GET", url: getGetV1WorkoutsCountUrl().url.toString(), ...requestConfig, headers: { ...headers, ...requestConfig.headers } });
|
|
1093
1229
|
return res.data;
|
|
1094
1230
|
}
|
|
1095
1231
|
|
|
1096
1232
|
// src/generated/client/api/getV1WorkoutsEvents.ts
|
|
1097
|
-
import
|
|
1233
|
+
import fetch10 from "@kubb/plugin-client/clients/axios";
|
|
1098
1234
|
function getGetV1WorkoutsEventsUrl() {
|
|
1099
1235
|
const res = { method: "GET", url: `/v1/workouts/events` };
|
|
1100
1236
|
return res;
|
|
1101
1237
|
}
|
|
1102
1238
|
async function getV1WorkoutsEvents(headers, params, config = {}) {
|
|
1103
|
-
const { client: request =
|
|
1239
|
+
const { client: request = fetch10, ...requestConfig } = config;
|
|
1104
1240
|
const res = await request({ method: "GET", url: getGetV1WorkoutsEventsUrl().url.toString(), params, ...requestConfig, headers: { ...headers, ...requestConfig.headers } });
|
|
1105
1241
|
return res.data;
|
|
1106
1242
|
}
|
|
1107
1243
|
|
|
1108
1244
|
// src/generated/client/api/getV1WorkoutsWorkoutid.ts
|
|
1109
|
-
import
|
|
1245
|
+
import fetch11 from "@kubb/plugin-client/clients/axios";
|
|
1110
1246
|
function getGetV1WorkoutsWorkoutidUrl(workoutId) {
|
|
1111
1247
|
const res = { method: "GET", url: `/v1/workouts/${workoutId}` };
|
|
1112
1248
|
return res;
|
|
1113
1249
|
}
|
|
1114
1250
|
async function getV1WorkoutsWorkoutid(workoutId, headers, config = {}) {
|
|
1115
|
-
const { client: request =
|
|
1251
|
+
const { client: request = fetch11, ...requestConfig } = config;
|
|
1116
1252
|
const res = await request({ method: "GET", url: getGetV1WorkoutsWorkoutidUrl(workoutId).url.toString(), ...requestConfig, headers: { ...headers, ...requestConfig.headers } });
|
|
1117
1253
|
return res.data;
|
|
1118
1254
|
}
|
|
1119
1255
|
|
|
1256
|
+
// src/generated/client/api/postV1ExerciseTemplates.ts
|
|
1257
|
+
import fetch12 from "@kubb/plugin-client/clients/axios";
|
|
1258
|
+
function getPostV1ExerciseTemplatesUrl() {
|
|
1259
|
+
const res = { method: "POST", url: `/v1/exercise_templates` };
|
|
1260
|
+
return res;
|
|
1261
|
+
}
|
|
1262
|
+
async function postV1ExerciseTemplates(headers, data, config = {}) {
|
|
1263
|
+
const { client: request = fetch12, ...requestConfig } = config;
|
|
1264
|
+
const requestData = data;
|
|
1265
|
+
const res = await request({ method: "POST", url: getPostV1ExerciseTemplatesUrl().url.toString(), data: requestData, ...requestConfig, headers: { ...headers, ...requestConfig.headers } });
|
|
1266
|
+
return res.data;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1120
1269
|
// src/generated/client/api/postV1RoutineFolders.ts
|
|
1121
1270
|
import fetch13 from "@kubb/plugin-client/clients/axios";
|
|
1122
1271
|
function getPostV1RoutineFoldersUrl() {
|
|
@@ -1143,53 +1292,40 @@ async function postV1Routines(headers, data, config = {}) {
|
|
|
1143
1292
|
return res.data;
|
|
1144
1293
|
}
|
|
1145
1294
|
|
|
1146
|
-
// src/generated/client/api/postV1WebhookSubscription.ts
|
|
1147
|
-
import fetch15 from "@kubb/plugin-client/clients/axios";
|
|
1148
|
-
function getPostV1WebhookSubscriptionUrl() {
|
|
1149
|
-
const res = { method: "POST", url: `/v1/webhook-subscription` };
|
|
1150
|
-
return res;
|
|
1151
|
-
}
|
|
1152
|
-
async function postV1WebhookSubscription(headers, data, config = {}) {
|
|
1153
|
-
const { client: request = fetch15, ...requestConfig } = config;
|
|
1154
|
-
const requestData = data;
|
|
1155
|
-
const res = await request({ method: "POST", url: getPostV1WebhookSubscriptionUrl().url.toString(), data: requestData, ...requestConfig, headers: { ...headers, ...requestConfig.headers } });
|
|
1156
|
-
return res.data;
|
|
1157
|
-
}
|
|
1158
|
-
|
|
1159
1295
|
// src/generated/client/api/postV1Workouts.ts
|
|
1160
|
-
import
|
|
1296
|
+
import fetch15 from "@kubb/plugin-client/clients/axios";
|
|
1161
1297
|
function getPostV1WorkoutsUrl() {
|
|
1162
1298
|
const res = { method: "POST", url: `/v1/workouts` };
|
|
1163
1299
|
return res;
|
|
1164
1300
|
}
|
|
1165
1301
|
async function postV1Workouts(headers, data, config = {}) {
|
|
1166
|
-
const { client: request =
|
|
1302
|
+
const { client: request = fetch15, ...requestConfig } = config;
|
|
1167
1303
|
const requestData = data;
|
|
1168
1304
|
const res = await request({ method: "POST", url: getPostV1WorkoutsUrl().url.toString(), data: requestData, ...requestConfig, headers: { ...headers, ...requestConfig.headers } });
|
|
1169
1305
|
return res.data;
|
|
1170
1306
|
}
|
|
1171
1307
|
|
|
1172
1308
|
// src/generated/client/api/putV1RoutinesRoutineid.ts
|
|
1173
|
-
import
|
|
1309
|
+
import fetch16 from "@kubb/plugin-client/clients/axios";
|
|
1174
1310
|
function getPutV1RoutinesRoutineidUrl(routineId) {
|
|
1175
1311
|
const res = { method: "PUT", url: `/v1/routines/${routineId}` };
|
|
1176
1312
|
return res;
|
|
1177
1313
|
}
|
|
1178
1314
|
async function putV1RoutinesRoutineid(routineId, headers, data, config = {}) {
|
|
1179
|
-
const { client: request =
|
|
1315
|
+
const { client: request = fetch16, ...requestConfig } = config;
|
|
1180
1316
|
const requestData = data;
|
|
1181
1317
|
const res = await request({ method: "PUT", url: getPutV1RoutinesRoutineidUrl(routineId).url.toString(), data: requestData, ...requestConfig, headers: { ...headers, ...requestConfig.headers } });
|
|
1182
1318
|
return res.data;
|
|
1183
1319
|
}
|
|
1184
1320
|
|
|
1185
1321
|
// src/generated/client/api/putV1WorkoutsWorkoutid.ts
|
|
1186
|
-
import
|
|
1322
|
+
import fetch17 from "@kubb/plugin-client/clients/axios";
|
|
1187
1323
|
function getPutV1WorkoutsWorkoutidUrl(workoutId) {
|
|
1188
1324
|
const res = { method: "PUT", url: `/v1/workouts/${workoutId}` };
|
|
1189
1325
|
return res;
|
|
1190
1326
|
}
|
|
1191
1327
|
async function putV1WorkoutsWorkoutid(workoutId, headers, data, config = {}) {
|
|
1192
|
-
const { client: request =
|
|
1328
|
+
const { client: request = fetch17, ...requestConfig } = config;
|
|
1193
1329
|
const requestData = data;
|
|
1194
1330
|
const res = await request({ method: "PUT", url: getPutV1WorkoutsWorkoutidUrl(workoutId).url.toString(), data: requestData, ...requestConfig, headers: { ...headers, ...requestConfig.headers } });
|
|
1195
1331
|
return res.data;
|
|
@@ -1229,16 +1365,34 @@ function createClient(apiKey, baseUrl = "https://api.hevyapp.com") {
|
|
|
1229
1365
|
getExerciseTemplate: (templateId) => getV1ExerciseTemplatesExercisetemplateid(templateId, headers, {
|
|
1230
1366
|
client
|
|
1231
1367
|
}),
|
|
1368
|
+
getExerciseHistory: (exerciseTemplateId, params) => getV1ExerciseHistoryExercisetemplateid(
|
|
1369
|
+
exerciseTemplateId,
|
|
1370
|
+
headers,
|
|
1371
|
+
params,
|
|
1372
|
+
{ client }
|
|
1373
|
+
),
|
|
1374
|
+
createExerciseTemplate: (data) => postV1ExerciseTemplates(headers, data, { client }),
|
|
1232
1375
|
// Routine Folders
|
|
1233
1376
|
getRoutineFolders: (params) => getV1RoutineFolders(headers, params, { client }),
|
|
1234
1377
|
createRoutineFolder: (data) => postV1RoutineFolders(headers, data, { client }),
|
|
1235
1378
|
getRoutineFolder: (folderId) => getV1RoutineFoldersFolderid(folderId, headers, {
|
|
1236
1379
|
client
|
|
1237
1380
|
}),
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1381
|
+
getWebhookSubscription: async () => {
|
|
1382
|
+
throw new Error(
|
|
1383
|
+
"Webhook subscription API not available. Please regenerate the client from the updated OpenAPI spec."
|
|
1384
|
+
);
|
|
1385
|
+
},
|
|
1386
|
+
createWebhookSubscription: async (_data) => {
|
|
1387
|
+
throw new Error(
|
|
1388
|
+
"Webhook subscription API not available. Please regenerate the client from the updated OpenAPI spec."
|
|
1389
|
+
);
|
|
1390
|
+
},
|
|
1391
|
+
deleteWebhookSubscription: async () => {
|
|
1392
|
+
throw new Error(
|
|
1393
|
+
"Webhook subscription API not available. Please regenerate the client from the updated OpenAPI spec."
|
|
1394
|
+
);
|
|
1395
|
+
}
|
|
1242
1396
|
};
|
|
1243
1397
|
}
|
|
1244
1398
|
|
|
@@ -1248,9 +1402,19 @@ function createClient2(apiKey, baseUrl) {
|
|
|
1248
1402
|
}
|
|
1249
1403
|
|
|
1250
1404
|
// src/index.ts
|
|
1405
|
+
var isBuiltArtifact = true ? true : false;
|
|
1406
|
+
if (isBuiltArtifact && false) {
|
|
1407
|
+
throw new Error(
|
|
1408
|
+
"Build-time variables __HEVY_MCP_NAME__ and __HEVY_MCP_VERSION__ must be defined."
|
|
1409
|
+
);
|
|
1410
|
+
}
|
|
1411
|
+
var name = true ? "hevy-mcp" : "hevy-mcp";
|
|
1412
|
+
var version = true ? "1.16.0" : "dev";
|
|
1251
1413
|
dotenvx.config({ quiet: true });
|
|
1414
|
+
var sentryRelease = process.env.SENTRY_RELEASE ?? `${name}@${version}`;
|
|
1252
1415
|
var sentryConfig = {
|
|
1253
1416
|
dsn: "https://ce696d8333b507acbf5203eb877bce0f@o4508975499575296.ingest.de.sentry.io/4509049671647312",
|
|
1417
|
+
release: sentryRelease,
|
|
1254
1418
|
// Tracing must be enabled for MCP monitoring to work
|
|
1255
1419
|
tracesSampleRate: 1,
|
|
1256
1420
|
sendDefaultPii: false
|