Skip to main content
Glama
willc121

Garmin Health MCP Server

by willc121

get_heart_rate_zones

Calculate personalized heart rate training zones using maximum heart rate and lactate threshold data to optimize workout intensity.

Instructions

Get personalized heart rate training zones based on max HR and lactate threshold

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the get_heart_rate_zones tool. It fetches the latest heart rate zones from the Supabase database and formats them into readable ranges.
    async function getHeartRateZones() { const { data, error } = await supabase.from("heart_rate_zones").select("*").limit(1); if (error) throw error; const zones = data?.[0]; if (!zones) return { error: "No heart rate zone data available" }; return { max_hr: zones.max_hr, lactate_threshold_hr: zones.lactate_threshold_hr, zones: { zone1_warmup: `${zones.zone1_floor}-${zones.zone2_floor - 1} bpm`, zone2_easy: `${zones.zone2_floor}-${zones.zone3_floor - 1} bpm`, zone3_aerobic: `${zones.zone3_floor}-${zones.zone4_floor - 1} bpm`, zone4_threshold: `${zones.zone4_floor}-${zones.zone5_floor - 1} bpm`, zone5_maximum: `${zones.zone5_floor}-${zones.max_hr} bpm`, }, }; }
  • Input schema and metadata for the get_heart_rate_zones tool as defined in the ListTools response.
    name: "get_heart_rate_zones", description: "Get personalized heart rate training zones based on max HR and lactate threshold", inputSchema: { type: "object", properties: {} }, },
  • src/index.ts:420-422 (registration)
    Registration and dispatching logic in the CallToolRequestSchema handler's switch statement.
    case "get_heart_rate_zones": result = await getHeartRateZones(); break;
  • Helper usage of getHeartRateZones within the getHealthSummary function to include HR zones data.
    const [vo2, activities, sleep, races, zones] = await Promise.all([ getVO2Max(), getActivities(), getSleep(), getRacePredictions(), getHeartRateZones(), ]);

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/willc121/garmin-mcp-server'

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