get_training_load
Retrieve training load data with acute/chronic workload ratio to evaluate overtraining risk and optimize workout intensity.
Instructions
Get training load data including acute/chronic workload ratio to assess overtraining risk
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Number of days (default: 30) |
Implementation Reference
- src/index.ts:254-278 (handler)The handler function for the 'get_training_load' tool. Fetches the most recent training load data from the Supabase 'training_load' table, computes latest values and provides a history list.async function getTrainingLoad(days: number = 30) { const { data, error } = await supabase .from("training_load") .select("*") .order("calendar_date", { ascending: false }) .limit(days); if (error) throw error; const latest = data?.[0]; return { latest: { date: latest?.calendar_date, acute_load: latest?.acute_load, chronic_load: latest?.chronic_load, status: latest?.acwr_status, }, history: data?.map((t) => ({ date: t.calendar_date, acute: t.acute_load, chronic: t.chronic_load, status: t.acwr_status, })), }; }
- src/index.ts:380-390 (registration)Tool registration in the ListTools handler, including name, description, and input schema definition.{ name: "get_training_load", description: "Get training load data including acute/chronic workload ratio to assess overtraining risk", inputSchema: { type: "object", properties: { days: { type: "number", description: "Number of days (default: 30)" }, }, }, },
- src/index.ts:423-425 (registration)Dispatch case in the CallToolRequestSchema handler that invokes the getTrainingLoad function.case "get_training_load": result = await getTrainingLoad(a.days || 30); break;