{
  "tool_id": "marathon_pace_elevation",
  "slug": "marathon-pace-elevation",
  "path": "/marathon-pace-elevation/",
  "mode": "engine_module",
  "usage": "Import https://aifithub.io/engines/marathon-pace-elevation.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/marathon-pace-elevation/.",
  "methodology": "https://aifithub.io/methodology/marathon-pace-elevation/",
  "sample_input": {
    "target_distance_km": 42.195,
    "target_time_minutes": 240,
    "total_elevation_gain_m": 200,
    "total_elevation_loss_m": 200
  },
  "input_schema": {
    "type": "object",
    "properties": {
      "target_distance_km": {
        "type": "number",
        "description": "Race distance in km (marathon 42.195).",
        "x-unit": "km",
        "minimum": 0.1,
        "maximum": 1000,
        "default": 42.195
      },
      "target_time_minutes": {
        "type": "number",
        "description": "Target finish time in minutes (3:30 = 210).",
        "x-unit": "min",
        "minimum": 0.1,
        "default": 240
      },
      "total_elevation_gain_m": {
        "type": "number",
        "description": "Total climb over the course, metres (not net).",
        "x-unit": "m",
        "minimum": 0,
        "default": 200
      },
      "total_elevation_loss_m": {
        "type": "number",
        "description": "Total descent over the course, metres.",
        "x-unit": "m",
        "minimum": 0,
        "default": 200
      }
    },
    "additionalProperties": false
  },
  "output_schema": {
    "type": "object",
    "properties": {
      "targetDistanceKm": {
        "type": "number"
      },
      "targetTimeMinutes": {
        "type": "number"
      },
      "averagePaceSecondsPerKm": {
        "type": "number",
        "description": "Average race pace, s/km."
      },
      "averagePaceLabel": {
        "type": "string",
        "description": "Average pace as m:ss per km."
      },
      "flatEquivalentPaceSecondsPerKm": {
        "type": "number",
        "description": "Flat-course pace for the same effort, s/km."
      },
      "flatEquivalentPaceLabel": {
        "type": "string",
        "description": "Same as m:ss per km."
      },
      "netElevationCorrectionSeconds": {
        "type": "number",
        "description": "Net elevation cost on finish time, s (negative on net-downhill courses)."
      },
      "segments": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "segmentKm": {
              "type": "number"
            },
            "paceSecondsPerKm": {
              "type": "number"
            },
            "paceLabel": {
              "type": "string"
            }
          }
        },
        "description": "Even-pace per-km splits { segmentKm, paceSecondsPerKm, paceLabel }."
      },
      "difficulty": {
        "type": "string",
        "description": "downhill_aided, flat, rolling, climbing or extreme (net climb per km)."
      }
    }
  },
  "summary": "Average race pace and the flat-equivalent pace for a target time and distance on a hilly course, using a rule-of-thumb elevation cost of 1.5 s per metre of total climb minus 0.75 s per metre of total descent; paces in seconds per km with m:ss labels."
}
