riegel_predict_race_time
Calculate predicted race times using Riegel's formula based on your current running performance. Input your known distance and time to estimate completion times for different race distances.
Instructions
Predict race time for a target distance based on a current race performance. Uses Riegel's formula.
Args: current_distance: Distance of known performance in meters. current_time: Time of known performance in seconds. target_distance: Distance for race time prediction in meters.
Returns: dict: Riegel's formula prediction with value, format, and time_seconds.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| current_distance | Yes | ||
| current_time | Yes | ||
| target_distance | Yes |
Implementation Reference
- The MCP tool handler for 'riegel_predict_race_time', decorated with @mcp.tool for registration. Performs input validation and calls the core Riegel prediction function, formatting the output.@mcp.tool def riegel_predict_race_time(current_distance: float, current_time: float, target_distance: float) -> dict: """ Predict race time for a target distance based on a current race performance. Uses Riegel's formula. Args: current_distance: Distance of known performance in meters. current_time: Time of known performance in seconds. target_distance: Distance for race time prediction in meters. Returns: dict: Riegel's formula prediction with value, format, and time_seconds. """ if current_distance <= 0: raise ValueError("Current distance must be positive") if current_time <= 0: raise ValueError("Current time must be positive") if target_distance <= 0: raise ValueError("Target distance must be positive") time = predict_time_riegel(current_distance, current_time, target_distance) return { "value": time_in_hhmmss(time), "format": "HH:MM:SS", "time_seconds": round(time, 1) }
- Core implementation of Riegel's race time prediction formula: T2 = T1 × (D2/D1)^1.06. Called by the tool handler.def predict_time_riegel(current_distance: float, current_time: float, target_distance: float) -> float: """ Predict race time using Riegel's formula. Riegel's formula: T2 = T1 * (D2/D1)^1.06 Args: current_distance: Distance of known performance in meters. current_time: Time of known performance in seconds. target_distance: Distance for race time prediction in meters. Returns: float: Predicted time in seconds. """ riegel_exponent = 1.06 return current_time * ((target_distance / current_distance) ** riegel_exponent)
- src/running_formulas_mcp/server.py:147-147 (registration)The @mcp.tool decorator registers the riegel_predict_race_time function as an MCP tool.@mcp.tool