delete-workout
Remove a specified workout from Garmin Connect by providing its unique workout ID.
Instructions
Delete a workout from Garmin Connect
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workoutId | Yes | The workout ID to delete |
Implementation Reference
- src/tools.ts:900-911 (registration)Registration of the delete-workout tool with its schema (workoutId) and handler logic.
server.tool( "delete-workout", "Delete a workout from Garmin Connect", { workoutId: z.string().describe("The workout ID to delete"), }, async ({ workoutId }) => { const client = getClient(); await client.delete(`workout-service/workout/${workoutId}`); return textResult(`Workout ${workoutId} deleted`); } ); - src/tools.ts:906-910 (handler)Handler function that deletes a workout by ID via Garmin Connect API.
async ({ workoutId }) => { const client = getClient(); await client.delete(`workout-service/workout/${workoutId}`); return textResult(`Workout ${workoutId} deleted`); } - src/tools.ts:903-905 (schema)Input schema for delete-workout: requires a workoutId string.
{ workoutId: z.string().describe("The workout ID to delete"), }, - src/tools.ts:20-22 (helper)Helper function that formats a plain text result response.
function textResult(text: string) { return { content: [{ type: "text" as const, text }] }; } - src/tools.ts:32-39 (helper)Helper function that returns the authenticated Garmin client, checking session exists first.
function getClient() { if (!sessionExists()) { throw new Error( "No Garmin session found. The user needs to run: npx garmin-connect-mcp login" ); } return getSharedClient(); }