Skip to main content
Glama

log_body_metrics

Record body weight and skinfold measurements to track fitness progress. Input date, weight in kg, and skinfold data from sites like abdomen or chest.

Instructions

Log body weight and skinfold measurements.

Args: date: Date in YYYY-MM-DD format body_weight_kg: Body weight in kilograms (optional) skinfolds: Dictionary of skinfold measurements in mm (optional). Can be a single site like {"abdomen": 10} or multiple sites like {"chest": 12, "abdomen": 18, "thigh": 15}. Common sites: abdomen, chest, thigh, tricep, subscapular, suprailiac, midaxillary notes: Optional notes about the measurement

Example: Single belly skinfold: {"abdomen": 10} Multiple sites: {"chest": 12, "abdomen": 18, "thigh": 15}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes
body_weight_kgNo
skinfoldsNo
notesNo

Implementation Reference

  • The 'log_body_metrics' tool handler processes date, weight, skinfold measurements, and notes, saves them to the database, and returns the generated metrics ID.
    def log_body_metrics(
        date: str,
        body_weight_kg: Optional[float] = None,
        skinfolds: Optional[dict[str, float]] = None,
        notes: Optional[str] = None,
    ) -> dict[str, int]:
        """Log body weight and skinfold measurements.
        
        Args:
            date: Date in YYYY-MM-DD format
            body_weight_kg: Body weight in kilograms (optional)
            skinfolds: Dictionary of skinfold measurements in mm (optional).
                       Can be a single site like {"abdomen": 10} or multiple sites
                       like {"chest": 12, "abdomen": 18, "thigh": 15}.
                       Common sites: abdomen, chest, thigh, tricep, subscapular, 
                       suprailiac, midaxillary
            notes: Optional notes about the measurement
        
        Example:
            Single belly skinfold: {"abdomen": 10}
            Multiple sites: {"chest": 12, "abdomen": 18, "thigh": 15}
        """
        date = _ensure_date(date)
        conn = get_connection()
        cursor = conn.cursor()
    
        cursor.execute(
            "INSERT INTO body_metrics (date, body_weight_kg, notes) VALUES (?, ?, ?)",
            (date, body_weight_kg, notes),
        )
        metrics_id = cursor.lastrowid
    
        if skinfolds:
            for site, mm in skinfolds.items():
                cursor.execute(
                    "INSERT INTO skinfolds (body_metrics_id, site_name, mm) VALUES (?, ?, ?)",
                    (metrics_id, site, mm),
                )
    
        conn.commit()
        conn.close()
        return {"body_metrics_id": metrics_id}

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/JohnZolton/MCP-logger'

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