Skip to main content
Glama

get-athlete-shoes

Retrieve your Strava running shoes data including usage distance and primary shoe status to track gear wear and optimize training equipment.

Instructions

Fetches the authenticated athlete's shoes from Strava, including usage distance and primary flag.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Implementation of the get-athlete-shoes tool handler.
    export const getAthleteShoesTool = {
        name: "get-athlete-shoes",
        description: "Fetches the authenticated athlete's shoes from Strava, including usage distance and primary flag.",
        inputSchema: undefined,
        execute: async () => {
            const token = process.env.STRAVA_ACCESS_TOKEN;
    
            if (!token || token === 'YOUR_STRAVA_ACCESS_TOKEN_HERE') {
                console.error("Missing or placeholder STRAVA_ACCESS_TOKEN in .env");
                return {
                    content: [{ type: "text" as const, text: "โŒ Configuration Error: STRAVA_ACCESS_TOKEN is missing or not set in the .env file." }],
                    isError: true,
                };
            }
    
            try {
                console.error("Fetching athlete shoes...");
                const athlete = await getAuthenticatedAthlete(token);
                const shoes = athlete.shoes ?? [];
    
                if (shoes.length === 0) {
                    return {
                        content: [{ type: "text" as const, text: "No shoes found in your Strava profile." }],
                    };
                }
    
                const lines = shoes.map((shoe, index) => {
                    const distanceKm = typeof shoe.distance === "number" ? (shoe.distance / 1000).toFixed(2) : "N/A";
                    return `${index + 1}. ${shoe.name} (ID: ${shoe.id})\n   - Distance: ${distanceKm} km\n   - Primary: ${shoe.primary ? "Yes" : "No"}`;
                });
    
                return {
                    content: [{
                        type: "text" as const,
                        text: `๐Ÿ‘Ÿ **Your Strava Shoes** (Total: ${shoes.length})\n\n${lines.join("\n\n")}`,
                    }],
                };
            } catch (error) {
                const errorMessage = error instanceof Error ? error.message : "An unknown error occurred";
                console.error("Error in get-athlete-shoes tool:", errorMessage);
                return {
                    content: [{ type: "text" as const, text: `โŒ API Error: ${errorMessage}` }],
                    isError: true,
                };
            }
        }
    };
  • src/server.ts:173-179 (registration)
    Registration of the get-athlete-shoes tool in the main MCP server file.
    // --- Register get-athlete-shoes tool ---
    server.tool(
        getAthleteShoesTool.name,
        getAthleteShoesTool.description,
        {},
        getAthleteShoesTool.execute
    );

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