@@ -30,6 +30,38 @@ import { createInstrumentedStdioTransport } from "./utils/stdio-observability.js
3030const name = serviceName ;
3131const version = serviceVersion ;
3232
33+ const SERVER_INSTRUCTIONS = [
34+ [
35+ "Hevy MCP connects clients to the authenticated user's Hevy" ,
36+ "workout-tracking data, including workouts, routines, exercise templates," ,
37+ "routine folders, body measurements, and profile information." ,
38+ "HEVY_API_KEY must contain a valid Hevy API key." ,
39+ ] . join ( " " ) ,
40+ [
41+ "Safety: all get-* and search-* tools are read-only. create-* and" ,
42+ "update-* tools mutate Hevy data. Creates are additive and" ,
43+ "non-idempotent, so repeating one can create duplicates. Updates can" ,
44+ "overwrite existing data. Delete operations are not available." ,
45+ ] . join ( " " ) ,
46+ [
47+ "Workflow: search exercise templates first, then use the returned" ,
48+ "template IDs when creating workouts or routines. To create a completed" ,
49+ "workout from a routine, fetch the routine as a plan, then obtain the" ,
50+ "actual completed sets and end time from the user; never invent completion" ,
51+ "data. Use the built-in workflow prompts when they match the task." ,
52+ ] . join ( " " ) ,
53+ [
54+ "Pagination: start at page 1 and fetch only the pages needed. Most list" ,
55+ "tools allow pageSize up to 10; get-exercise-templates allows up to 100." ,
56+ ] . join ( " " ) ,
57+ [
58+ "Rate limits and retries: minimize repeated calls. If Hevy returns HTTP" ,
59+ "429, follow its retry guidance. Transient read requests retry" ,
60+ "automatically, but write requests do not; confirm uncertain write" ,
61+ "outcomes before trying again." ,
62+ ] . join ( " " ) ,
63+ ] . join ( "\n\n" ) ;
64+
3365const HELP_TEXT = [
3466 "Usage:" ,
3567 " hevy-mcp [options]" ,
@@ -144,7 +176,10 @@ function buildServer(apiKey: string) {
144176 name,
145177 version,
146178 } ,
147- { capabilities : { logging : { } } } ,
179+ {
180+ capabilities : { logging : { } } ,
181+ instructions : SERVER_INSTRUCTIONS ,
182+ } ,
148183 ) ;
149184 const server = Sentry . wrapMcpServerWithSentry ( baseServer ) ;
150185 const clientLogger = createMcpClientLogger ( server ) ;
0 commit comments