Skip to main content
Glama

get-athlete-zones

Retrieve your configured heart rate and power zones from Strava to analyze workout intensity and track fitness progress.

Instructions

Retrieves the authenticated athlete's configured heart rate and power zones.

Output includes both a formatted summary and the raw JSON data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 'execute' function implementation for the 'get-athlete-zones' tool. It fetches athlete zones from Strava using the provided token, formats the result, and returns it.
        execute: async (_input: GetAthleteZonesInput) => {
            const token = process.env.STRAVA_ACCESS_TOKEN;
    
            if (!token) {
                console.error("Missing STRAVA_ACCESS_TOKEN environment variable.");
                return {
                    content: [{ type: "text" as const, text: "Configuration error: Missing Strava access token." }],
                    isError: true
                };
            }
    
            try {
                console.error("Fetching athlete zones...");
                const zonesData = await fetchAthleteZones(token);
                
                // Format the summary
                const formattedText = formatAthleteZones(zonesData);
                
                // Prepare the raw data
                const rawDataText = `\n\nRaw Athlete Zone Data:\n${JSON.stringify(zonesData, null, 2)}`;
                
                console.error("Successfully fetched athlete zones.");
                // Return both summary and raw data
                return { 
                    content: [
                        { type: "text" as const, text: formattedText },
                        { type: "text" as const, text: rawDataText }
                    ]
                };
    
            } catch (error) {
                const errorMessage = error instanceof Error ? error.message : String(error);
                console.error(`Error fetching athlete zones: ${errorMessage}`);
                
                let userFriendlyMessage;
                // Check for common errors like missing scope (403 Forbidden)
                if (errorMessage.includes("403")) {
                     userFriendlyMessage = "🔒 Access denied. This tool requires 'profile:read_all' permission. Please re-authorize with the correct scope.";
                } else if (errorMessage.startsWith("SUBSCRIPTION_REQUIRED:")) { // In case Strava changes this later
                    userFriendlyMessage = `🔒 Accessing zones might require a Strava subscription. Details: ${errorMessage}`;
                } else {
                    userFriendlyMessage = `An unexpected error occurred while fetching athlete zones. Details: ${errorMessage}`;
                }
    
                return {
                    content: [{ type: "text" as const, text: `❌ ${userFriendlyMessage}` }],
                    isError: true
                };
            }
        }
    }; 
  • Input schema definition for the 'get-athlete-zones' tool. It currently requires no input parameters.
    const inputSchema = z.object({}); 
    
    type GetAthleteZonesInput = z.infer<typeof inputSchema>;
  • src/server.ts:166-170 (registration)
    Registration of the 'get-athlete-zones' tool with the MCP server.
    server.tool(
        getAthleteZonesTool.name, 
        getAthleteZonesTool.description,
        getAthleteZonesTool.inputSchema?.shape ?? {},
        getAthleteZonesTool.execute
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 mentions the output includes a formatted summary and raw JSON, which adds some value, but fails to cover critical aspects like authentication requirements (implied by 'authenticated athlete' but not explicit), rate limits, error handling, or whether it's a read-only operation. For a tool with zero annotation coverage, this is a significant gap.

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 two sentences with zero waste: the first states the purpose clearly, and the second adds crucial output details. It's front-loaded with the core function and efficiently conveys necessary information without fluff or repetition.

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 has no parameters, no annotations, and no output schema, the description provides basic purpose and output format, which is adequate for a simple retrieval tool. However, it lacks details on authentication, error cases, or behavioral traits that would make it more complete. It meets the minimum viable threshold but has clear gaps in context.

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, meaning no parameters are documented in the schema. The description doesn't need to compensate for missing param info, as there are none to explain. It appropriately focuses on output details instead. A baseline of 4 is given since it adds context about output without redundant parameter explanations.

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 verb ('Retrieves') and resource ('authenticated athlete's configured heart rate and power zones'), making the purpose specific and understandable. It distinguishes itself from siblings like get-athlete-profile or get-athlete-stats by focusing on zones data. However, it doesn't explicitly contrast with all potential siblings, keeping it from a perfect 5.

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 authentication via connect-strava), exclusions, or comparisons to other tools like get-athlete-stats that might overlap. This leaves the agent with minimal context for decision-making.

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/LimeON-source/Strava-MCP'

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