Skip to main content
Glama

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
NameRequiredDescriptionDefault
workout_idYes

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
  • 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)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pranciskus/garmin-workouts-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server