Skip to main content
Glama

list-athlete-routes

Retrieve your created Strava routes with pagination to manage and access your saved cycling or running paths.

Instructions

Lists the routes created by the authenticated athlete, with pagination.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination
perPageNoNumber of routes per page (max 50)

Implementation Reference

  • The execute function that fetches and formats the athlete routes.
    execute: async ({ page = 1, perPage = 20 }: ListAthleteRoutesInput) => {
        const token = process.env.STRAVA_ACCESS_TOKEN;
        
        if (!token) {
            console.error("Missing 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 routes (page ${page}, per_page: ${perPage})...`);
            
            const routes = await fetchAthleteRoutes(token, page, perPage);
            
            if (!routes || routes.length === 0) {
                console.error(`No routes found for athlete.`);
                return { content: [{ type: "text" as const, text: "No routes found for the athlete." }] };
            }
            
            console.error(`Successfully fetched ${routes.length} routes.`);
            const summaries = routes.map(route => formatRouteSummary(route));
            const responseText = `**Athlete Routes (Page ${page}):**\n\n${summaries.join("\n")}`;
            
            return { content: [{ type: "text" as const, text: responseText }] };
        } catch (error) {
            const errorMessage = error instanceof Error ? error.message : String(error);
            console.error(`Error listing athlete routes (page ${page}, perPage: ${perPage}): ${errorMessage}`);
            // Removed call to handleApiError and its retry logic
            // Note: 404 is less likely for a list endpoint like this
            const userFriendlyMessage = `An unexpected error occurred while listing athlete routes. Details: ${errorMessage}`;
            return {
                content: [{ type: "text" as const, text: `❌ ${userFriendlyMessage}` }],
                isError: true
            };
        }
    }
  • Input validation schema for the list-athlete-routes tool.
    const ListAthleteRoutesInputSchema = z.object({
        page: z.number().int().positive().optional().default(1).describe("Page number for pagination"),
        perPage: z.number().int().positive().min(1).max(50).optional().default(20).describe("Number of routes per page (max 50)"),
    });
  • Tool definition including name, description, schema, and execute handler.
    export const listAthleteRoutesTool = {
        name: "list-athlete-routes",
        description: "Lists the routes created by the authenticated athlete, with pagination.",
        inputSchema: ListAthleteRoutesInputSchema,

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.1

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the transparency burden. It discloses the read-only listing nature and pagination, but does not describe return format, ordering, or specific authentication needs beyond the phrase 'authenticated athlete'. This is acceptable for a low-risk list operation, but some behavioral details are missing.

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 one concise sentence, front-loaded with the core purpose and including the key pagination detail. No wasted words or redundancy.

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

Completeness4/5

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

For a simple list tool with two optional parameters and no output schema, the description provides sufficient context: it states what is listed, ownership, and pagination. It does not specify the response shape, but that is less critical for a standard list endpoint.

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%: both 'page' and 'perPage' have descriptions with defaults, ranges, and meanings. The tool description adds no additional parameter context beyond the schema, so the 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 clearly states the verb 'lists' and the resource 'routes', with scope 'created by the authenticated athlete'. This distinguishes it from siblings like 'get-route' (likely a single route) and 'list-athlete-clubs' (a different resource), making the purpose unmistakable.

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

Usage Guidelines4/5

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

The description implies usage for retrieving the authenticated athlete's routes, and the pagination mention indicates how to handle large result sets. It does not explicitly name alternatives or exclusion conditions, but the context is clear enough for a simple listing tool.

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