Skip to main content
Glama

predict_race

Predict race finish times using the Riegel formula based on your known race results to plan training and set realistic goals.

Instructions

Predict race finish times using the Riegel formula based on a known race result

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
known_distanceYesKnown race distance: "5k", "10k", "half", "marathon", or km value
known_timeYesKnown race time in H:MM:SS or MM:SS format
target_distanceNoTarget distance to predict (defaults to showing all standard distances)

Implementation Reference

  • The `predict_race` tool is defined here using `server.tool`. It takes `known_distance`, `known_time`, and an optional `target_distance` as input parameters. The handler calculates race predictions using the Riegel formula and estimates VO2max.
    // Tool: predict_race
    server.tool(
      'predict_race',
      'Predict race finish times using the Riegel formula based on a known race result',
      {
        known_distance: z.string().describe('Known race distance: "5k", "10k", "half", "marathon", or km value'),
        known_time: z.string().describe('Known race time in H:MM:SS or MM:SS format'),
        target_distance: z.string().optional().describe('Target distance to predict (defaults to showing all standard distances)'),
      },
      async ({ known_distance, known_time, target_distance }) => {
        const distKm = resolveDistance(known_distance);
        const timeSecs = timeToSeconds(known_time);
        const vo2max = estimateVO2max(distKm, timeSecs);
    
        const targets = target_distance
          ? [{ name: target_distance, km: resolveDistance(target_distance) }]
          : [
              { name: '5K', km: 5 },
              { name: '10K', km: 10 },
              { name: 'Half Marathon', km: 21.0975 },
              { name: 'Marathon', km: 42.195 },
            ];
    
        let text = `Based on ${known_distance} in ${known_time}:\n\nEstimated VO2max: ${vo2max.toFixed(1)} ml/kg/min\n\nPredictions:\n`;
        targets.forEach(t => {
          const predicted = predictTime(distKm, timeSecs, t.km);
          const pace = predicted / t.km;
          text += `- ${t.name}: ${secondsToTime(predicted)} (pace: ${secondsToPace(pace)}/km)\n`;
        });
    
        text += `\nNote: Predictions assume equivalent training for the target distance. Use RunDida's Race Time Predictor for more details: ${BASE_URL}/tools/race-time-predictor/`;
        return { content: [{ type: 'text', text }] };
      }
    );

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/XWeaponX7/rundida-mcp'

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