Skip to main content
Glama

heart_rate_zones

Calculate personalized heart rate training zones using the Karvonen method based on age, resting heart rate, and maximum heart rate.

Instructions

Calculate heart rate training zones using the Karvonen method

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ageYesYour age in years
resting_hrNoResting heart rate in bpm (default: 60)
max_hrNoKnown max heart rate in bpm (auto-calculated if omitted)

Implementation Reference

  • index.js:89-108 (handler)
    Helper function implementing the Karvonen formula for heart rate zones.
    function heartRateZones(age, restingHR, maxHR) {
      const mhr = maxHR || Math.round(207 - 0.7 * age);
      const hrr = mhr - restingHR;
      const zones = [
        { zone: 1, name: 'Recovery', low: 0.50, high: 0.60 },
        { zone: 2, name: 'Aerobic', low: 0.60, high: 0.70 },
        { zone: 3, name: 'Tempo', low: 0.70, high: 0.80 },
        { zone: 4, name: 'Threshold', low: 0.80, high: 0.90 },
        { zone: 5, name: 'VO2max', low: 0.90, high: 1.00 },
      ];
      return {
        maxHR: mhr,
        restingHR,
        zones: zones.map(z => ({
          ...z,
          bpmLow: Math.round(restingHR + hrr * z.low),
          bpmHigh: Math.round(restingHR + hrr * z.high),
        })),
      };
    }
  • index.js:292-310 (registration)
    MCP tool registration and handler wrapper for heart_rate_zones.
    // Tool: heart_rate_zones
    server.tool(
      'heart_rate_zones',
      'Calculate heart rate training zones using the Karvonen method',
      {
        age: z.number().min(10).max(99).describe('Your age in years'),
        resting_hr: z.number().min(30).max(120).optional().describe('Resting heart rate in bpm (default: 60)'),
        max_hr: z.number().min(100).max(220).optional().describe('Known max heart rate in bpm (auto-calculated if omitted)'),
      },
      async ({ age, resting_hr, max_hr }) => {
        const result = heartRateZones(age, resting_hr || 60, max_hr);
        let text = `Heart Rate Training Zones (Karvonen Method)\n\nAge: ${age} | Resting HR: ${result.restingHR} bpm | Max HR: ${result.maxHR} bpm\n\n`;
        result.zones.forEach(z => {
          text += `Zone ${z.zone} (${z.name}): ${z.bpmLow}-${z.bpmHigh} bpm\n`;
        });
        text += `\nFor more options: ${BASE_URL}/tools/heart-rate-zones/`;
        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