delete_workout
Remove a specific workout from your Garmin Connect account by providing its workout ID to manage your training plans.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workout_id | Yes |
Implementation Reference
- The delete_workout tool handler function. It takes a workout_id string parameter, formats the Garmin API endpoint, makes a DELETE request via _connectapi, and returns True on success or False on failure with appropriate logging.
@mcp.tool def delete_workout(workout_id: str) -> bool: endpoint = GET_WORKOUT_ENDPOINT.format(workout_id=workout_id) try: _connectapi(endpoint, method="DELETE") logger.info("Deleted workout %s", workout_id) return True except Exception as exc: logger.error("Failed deleting workout %s: %s", workout_id, exc) return False - src/garmin_workouts_mcp/server.py:111-111 (registration)The @mcp.tool decorator registers delete_workout as an MCP tool with the FastMCP server.
@mcp.tool - Helper function that ensures Garmin authentication and makes HTTP requests to Garmin's ConnectAPI. Used by delete_workout to perform the DELETE operation.
def _connectapi(endpoint: str, method: str = "GET", **kwargs) -> dict: _ensure_authenticated() return garth.connectapi(endpoint, method=method, **kwargs)