get_training_plans
Retrieve all your training plans from Garmin Coach or custom plans to view and manage your workout schedules.
Instructions
Get all training plans from Garmin Coach or custom plans
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/training.tools.ts:11-16 (handler)The async handler function that executes the 'get_training_plans' tool. Calls client.getTrainingPlans() and returns the result as JSON text.
async () => { const data = await client.getTrainingPlans(); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, - src/client/garmin.client.ts:540-542 (handler)GarminClient.getTrainingPlans() method that makes the actual HTTP request to the TRAINING_PLANS_ENDPOINT.
async getTrainingPlans(): Promise<unknown> { return this.request(TRAINING_PLANS_ENDPOINT); } - src/tools/training.tools.ts:8-23 (schema)Tool registration with description (no inputSchema for this tool since it takes no parameters, but it references getTrainingPlanSchema.shape for sibling tools).
{ description: 'Get all training plans from Garmin Coach or custom plans', }, async () => { const data = await client.getTrainingPlans(); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); server.registerTool( 'get_training_plan_by_id', { description: 'Get a specific training plan by ID with full schedule and workout details', inputSchema: getTrainingPlanSchema.shape, - src/tools/training.tools.ts:6-17 (registration)Registration of 'get_training_plans' tool via server.registerTool within registerTrainingTools().
server.registerTool( 'get_training_plans', { description: 'Get all training plans from Garmin Coach or custom plans', }, async () => { const data = await client.getTrainingPlans(); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - src/index.ts:48-48 (registration)Call to registerTrainingTools(server, client) which registers all training tools including 'get_training_plans'.
registerTrainingTools(server, client); - The API endpoint constant TRAINING_PLANS_ENDPOINT = '/trainingplan-service/trainingplan' used by the client.
export const TRAINING_PLANS_ENDPOINT = '/trainingplan-service/trainingplan';