Skip to main content
Glama
willc121

Garmin Health MCP Server

by willc121

get_race_predictions

Predict race times for 5K, 10K, half marathon, and marathon distances using current fitness data from Garmin health metrics.

Instructions

Get predicted race times for 5K, 10K, half marathon, and marathon based on current fitness

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for get_race_predictions tool. Fetches the latest 5 race predictions from Supabase 'race_predictions' table, formats times with formatTime helper, returns latest predictions for common distances and a brief history.
    async function getRacePredictions() {
      const { data, error } = await supabase
        .from("race_predictions")
        .select("*")
        .order("calendar_date", { ascending: false })
        .limit(5);
    
      if (error) throw error;
    
      const latest = data?.[0];
      return {
        latest_date: latest?.calendar_date || null,
        predictions: {
          "5k": formatTime(latest?.race_time_5k),
          "10k": formatTime(latest?.race_time_10k),
          half_marathon: formatTime(latest?.race_time_half),
          marathon: formatTime(latest?.race_time_marathon),
        },
        history: data?.map((r) => ({
          date: r.calendar_date,
          "5k": formatTime(r.race_time_5k),
          "10k": formatTime(r.race_time_10k),
        })),
      };
    }
  • Schema definition for the get_race_predictions tool in the listTools response, including name, description, and empty input schema (no parameters required).
    {
      name: "get_race_predictions",
      description:
        "Get predicted race times for 5K, 10K, half marathon, and marathon based on current fitness",
      inputSchema: { type: "object", properties: {} },
    },
  • src/index.ts:417-419 (registration)
    Registration of the get_race_predictions tool in the CallToolRequestHandler switch statement, mapping the tool name to the handler function.
    case "get_race_predictions":
      result = await getRacePredictions();
      break;
  • Helper function used by getRacePredictions to format seconds into readable time strings (e.g., "1:23:45").
    function formatTime(seconds: number | null): string {
      if (!seconds) return "N/A";
      const hrs = Math.floor(seconds / 3600);
      const mins = Math.floor((seconds % 3600) / 60);
      const secs = Math.round(seconds % 60);
      if (hrs > 0) {
        return `${hrs}:${mins.toString().padStart(2, "0")}:${secs
          .toString()
          .padStart(2, "0")}`;
      }
      return `${mins}:${secs.toString().padStart(2, "0")}`;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'Get[s] predicted race times,' implying a read-only operation, but doesn't clarify if it requires specific permissions, how predictions are generated (e.g., algorithm details), latency, or error handling. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior and constraints.

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?

The description is a single, efficient sentence that front-loads the core action ('Get predicted race times') and includes essential details (distances and fitness basis) without waste. Every word contributes to understanding the tool's purpose, making it appropriately sized and well-structured for quick comprehension.

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 the tool's complexity (predictive analysis based on fitness) and lack of annotations and output schema, the description is minimally adequate. It covers the purpose and output types (race times for specific distances) but doesn't explain how predictions are derived, what data sources are used, or the format of results. For a predictive tool with no structured output, more detail would improve completeness, but it meets the baseline for a simple read operation.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameters need documentation. The description adds value by specifying the types of race distances predicted (5K, 10K, etc.) and the basis ('current fitness'), which provides context beyond the empty schema. This compensates adequately for the lack of parameters, earning a high score as it clarifies what the tool does without redundant parameter info.

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

Purpose4/5

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

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('predicted race times'), specifying the distances (5K, 10K, half marathon, marathon) and the basis ('based on current fitness'). It distinguishes from siblings like get_activities or get_health_summary by focusing on race predictions rather than raw data or summaries. However, it doesn't explicitly differentiate from all siblings (e.g., get_training_load might overlap in fitness assessment).

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing fitness data from other tools), exclusions, or comparisons to siblings like get_vo2max (which might relate to fitness metrics). Usage is implied by the phrase 'based on current fitness,' but this is vague and lacks explicit context for selection.

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

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