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,
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It usefully mentions pagination behavior, which isn't obvious from the schema alone. However, it doesn't describe other important traits like rate limits, authentication requirements beyond 'authenticated athlete', error conditions, or what the return format looks like (e.g., array of route objects).

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 purpose ('Lists the routes') and includes essential behavioral context ('with pagination'). There's no wasted verbiage or redundant information.

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?

For a read-only list tool with full schema coverage but no output schema, the description is minimally adequate. It covers the basic purpose and pagination, but lacks details on authentication requirements, rate limits, return format, or error handling that would help an agent use it correctly in complex scenarios.

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?

The schema description coverage is 100%, with both parameters well-documented in the schema. The description adds no additional parameter semantics beyond mentioning pagination generally, which is already covered by the schema's parameter descriptions. This meets the baseline expectation when schema coverage is complete.

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 action ('Lists') and resource ('routes created by the authenticated athlete'), making the purpose immediately understandable. It distinguishes from siblings like 'get-route' (single route) and 'explore-segments' (public segments), though it doesn't explicitly name these alternatives.

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

Usage Guidelines3/5

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

The description implies usage context by specifying 'authenticated athlete' routes, suggesting it's for personal route retrieval rather than public exploration. However, it doesn't provide explicit guidance on when to use this versus alternatives like 'get-all-activities' or 'list-starred-segments', nor does it mention prerequisites like authentication.

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