Skip to main content
Glama

heart_rate_zones

Calculate heart rate training zones using the Karvonen method. Input age, resting heart rate, and optionally max heart rate to get personalized zones for guided workouts.

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)
    Core handler function `heartRateZones` that calculates heart rate training zones using the Karvonen method. Computes max heart rate (207 - 0.7*age if not provided), heart rate reserve (HRR), and five zones (Recovery, Aerobic, Tempo, Threshold, VO2max) with BPM ranges.
    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:303-321 (registration)
    Tool registration of 'heart_rate_zones' using server.tool(). Defines schema (age required, resting_hr and max_hr optional) and async handler that calls heartRateZones() and formats output text.
    // 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 }] };
      }
    );
  • Input schema for the heart_rate_zones tool: age (z.number, 10-99, required), resting_hr (z.number, 30-120, optional, default 60), max_hr (z.number, 100-220, optional, auto-calculated).
    {
      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)'),
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must bear full weight. It only states 'calculate' with no mention of side effects, authorization needs, or output format, leaving assumptions about behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, front-loaded with key information, no unnecessary words. Very concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 3 parameters, no output schema, and no annotations, the description is adequate for a simple calculation tool but lacks detail on output format and usage constraints.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with each parameter having a clear description. The tool description adds no extra semantics beyond 'Karvonen method', so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the verb 'calculate', the resource 'heart rate training zones', and the method 'Karvonen method', which clearly distinguishes it from sibling tools like calculate_pace.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool vs alternatives. The context of siblings provides implicit differentiation, but the description lacks direct usage instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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