delete_activity
Permanently delete a Garmin activity by providing its activity ID. This action cannot be undone.
Instructions
Delete an activity permanently. This action cannot be undone
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| activityId | Yes | The Garmin activity ID to delete |
Implementation Reference
- src/tools/write.tools.ts:49-61 (handler)The tool handler for 'delete_activity' - registers the tool with the MCP server, extracts activityId from input, calls client.deleteActivity(), and returns the result.
server.registerTool( 'delete_activity', { description: 'Delete an activity permanently. This action cannot be undone', inputSchema: deleteActivitySchema.shape, }, async ({ activityId }) => { const data = await client.deleteActivity(activityId); return { content: [{ type: 'text' as const, text: JSON.stringify(data ?? 'Activity deleted', null, 2) }], }; }, ); - src/dtos/write.dto.ts:32-38 (schema)The input schema and type definition for delete_activity - validates that activityId is a positive number.
export type DeleteActivityDto = { activityId: number; }; export const deleteActivitySchema = z.object({ activityId: z.number().positive().describe('The Garmin activity ID to delete'), }); - src/client/garmin.client.ts:688-692 (helper)The underlying GarminClient method that sends an HTTP DELETE request to the activity endpoint with the given activityId.
async deleteActivity(activityId: number): Promise<unknown> { return this.request(`${ACTIVITY_ENDPOINT}/${activityId}`, { method: 'DELETE', }); } - src/tools/write.tools.ts:49-61 (registration)The registration of 'delete_activity' via server.registerTool, which is called from registerWriteTools().
server.registerTool( 'delete_activity', { description: 'Delete an activity permanently. This action cannot be undone', inputSchema: deleteActivitySchema.shape, }, async ({ activityId }) => { const data = await client.deleteActivity(activityId); return { content: [{ type: 'text' as const, text: JSON.stringify(data ?? 'Activity deleted', null, 2) }], }; }, );