{
  "tool_id": "tdee_calculator",
  "slug": "tdee-calculator",
  "path": "/tdee-calculator/",
  "mode": "engine_module",
  "usage": "Import https://aifithub.io/engines/tdee-calculator.js as an ES module and call compute(input) with the fields in input_schema (every field is optional and falls back to its default). Input is validated: an unknown field, a wrong type, or a value outside enum/minimum/maximum throws an Error that names the field. The same calculator runs at https://aifithub.io/tdee-calculator/.",
  "methodology": "https://aifithub.io/methodology/tdee-calculator/",
  "sample_input": {
    "sex": "male",
    "age": 30,
    "weight_kg": 80,
    "height_cm": 180,
    "activity_level": "moderate",
    "body_fat_percent": 0,
    "training_days_per_week": 0
  },
  "input_schema": {
    "type": "object",
    "properties": {
      "sex": {
        "type": "string",
        "description": "Sex constant in the BMR equations.",
        "enum": [
          "male",
          "female"
        ],
        "default": "male"
      },
      "age": {
        "type": "number",
        "description": "Age in years; the equations were built on adults.",
        "x-unit": "years",
        "minimum": 1,
        "maximum": 120,
        "default": 30
      },
      "weight_kg": {
        "type": "number",
        "description": "Body weight in kilograms.",
        "x-unit": "kg",
        "minimum": 1,
        "maximum": 650,
        "default": 80
      },
      "height_cm": {
        "type": "number",
        "description": "Height in centimetres.",
        "x-unit": "cm",
        "minimum": 30,
        "maximum": 275,
        "default": 180
      },
      "activity_level": {
        "type": "string",
        "description": "Activity factor: sedentary 1.2, light 1.375, moderate 1.55, very 1.725, athlete 1.9.",
        "enum": [
          "sedentary",
          "light",
          "moderate",
          "very",
          "athlete"
        ],
        "default": "moderate"
      },
      "body_fat_percent": {
        "type": "number",
        "description": "Optional body fat in percent (20 = 20%); adds Katch-McArdle to the formula comparison. Omit or 0 if unknown.",
        "x-unit": "percent",
        "minimum": 0,
        "maximum": 69.9,
        "default": 0
      },
      "training_days_per_week": {
        "type": "number",
        "description": "Optional training days per week (whole number 1–7) to split the weekly total into training-day and rest-day calories. Omit or 0 for no split.",
        "x-unit": "days/week",
        "minimum": 0,
        "maximum": 7,
        "default": 0
      }
    },
    "additionalProperties": false
  },
  "output_schema": {
    "type": "object",
    "properties": {
      "bmr": {
        "type": "number",
        "description": "Basal metabolic rate, kcal/day (Mifflin-St Jeor)."
      },
      "tdee": {
        "type": "number",
        "description": "Maintenance calories, kcal/day (Mifflin-St Jeor BMR × activity factor)."
      },
      "activityFactor": {
        "type": "number",
        "description": "Activity multiplier used."
      },
      "tdeeRange": {
        "type": "object",
        "properties": {
          "min": {
            "type": "number"
          },
          "max": {
            "type": "number"
          }
        },
        "description": "{ min, max } TDEE across the formulas, kcal/day."
      },
      "formulas": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "bmr": {
              "type": "number"
            },
            "tdee": {
              "type": "number"
            }
          }
        },
        "description": "Array of { name, bmr, tdee } per formula (Mifflin-St Jeor, Harris-Benedict revised, WHO/FAO/UNU, Katch-McArdle when body fat is given)."
      },
      "goalCalories": {
        "type": "object",
        "properties": {
          "maintain": {
            "type": "number"
          },
          "cut": {
            "type": "number"
          },
          "leanGain": {
            "type": "number"
          }
        },
        "description": "{ maintain, cut (TDEE − 500), leanGain (TDEE + 300) }, kcal/day."
      },
      "weeklyBreakdown": {
        "description": "Training-day and rest-day calories with the same weekly total, or null."
      },
      "warnings": {
        "type": "array",
        "description": "Cautions (activity level vs training days, cut below 1,200/1,500 kcal, under 18)."
      }
    }
  },
  "summary": "Maintenance calories (TDEE): Mifflin-St Jeor BMR × activity factor, with the other BMR formulas for comparison, daily calories for maintain / cut (−500) / lean gain (+300), and an optional training-day vs rest-day split of the same weekly total."
}
