Skip to main content
Glama
st3v

Running Formulas MCP Server

by st3v

mcmillan_calculate_training_paces

Calculate personalized running training paces for endurance, stamina, speed, and sprint zones using McMillan methodology based on your race performance.

Instructions

Calculate training paces for all zones based on a race performance using McMillan methodology.

Args: distance: Race distance in meters time: Race time in seconds

Returns: Dictionary containing training paces organized by zones (endurance, stamina, speed, sprint)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
distanceYes
timeYes

Implementation Reference

  • The MCP tool handler function for 'mcmillan_calculate_training_paces', decorated with @mcp.tool. It validates inputs via type hints and docstring, calls the core training_paces helper, and handles exceptions.
    @mcp.tool def mcmillan_calculate_training_paces(distance: float, time: float) -> dict: """ Calculate training paces for all zones based on a race performance using McMillan methodology. Args: distance: Race distance in meters time: Race time in seconds Returns: Dictionary containing training paces organized by zones (endurance, stamina, speed, sprint) """ try: return training_paces(distance, time) except Exception as e: return {"error": str(e)}
  • Core helper function implementing the McMillan training paces calculation logic. Initializes structure, interpolates paces for various zones (endurance, stamina, speed, sprint), and formats outputs.
    def training_paces(distance_meters: float, time_seconds: float) -> dict: """ Calculate training paces based on a race performance using McMillan methodology. Args: distance_meters: Race distance in meters time_seconds: Race time in seconds Returns: dict: Dictionary containing training pace zones with official McMillan accuracy Raises: InvalidInputError: If distance or time is not positive or if inputs are unrealistic. """ _assert_inputs(distance_meters, time_seconds) # Initialize training pace structure training_paces = _initialize_training_pace_structure() # Get all training pace zone keys from the unified model system training_pace_zones = _get_all_training_pace_zones() # Process each zone type for zone_key in training_pace_zones: zone_group, zone_type, zone_distance = zone_key pace_result = _interpolate_training_pace(zone_key, distance_meters, time_seconds) if pace_result is None: continue fast_pace_seconds, slow_pace_seconds = pace_result # Process zone based on type if zone_group == 'endurance': _process_endurance_zone(training_paces, zone_type, fast_pace_seconds, slow_pace_seconds) elif zone_group == 'stamina': _process_stamina_zone(training_paces, zone_type, zone_distance, fast_pace_seconds, slow_pace_seconds) elif zone_group in ['speed', 'sprint']: _process_interval_zone(training_paces, zone_group, zone_type, zone_distance, fast_pace_seconds, slow_pace_seconds) return training_paces
  • The @mcp.tool decorator registers this function as the MCP tool 'mcmillan_calculate_training_paces'.
    @mcp.tool def mcmillan_calculate_training_paces(distance: float, time: float) -> dict: """ Calculate training paces for all zones based on a race performance using McMillan methodology. Args: distance: Race distance in meters time: Race time in seconds Returns: Dictionary containing training paces organized by zones (endurance, stamina, speed, sprint) """ try: return training_paces(distance, time) except Exception as e: return {"error": str(e)}

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/st3v/running-formulas-mcp'

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