Skip to main content
Glama

get-route

Retrieve detailed information about a specific Strava route using its unique ID to access route data for planning and analysis.

Instructions

Fetches detailed information about a specific route using its ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
routeIdYesThe unique identifier of the route to fetch.

Implementation Reference

  • The execution handler for the get-route tool, which calls the Strava client and formats the response.
    execute: async (input: GetRouteInput) => {
        const { routeId } = input;
        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 route details for ID: ${routeId}...`);
            const route = await getRouteById(token, routeId);
            const summary = formatRouteSummary(route); // Call shared formatter without units
    
            console.error(`Successfully fetched route ${routeId}.`);
            return { content: [{ type: "text" as const, text: summary }] };
        } catch (error) {
            const errorMessage = error instanceof Error ? error.message : String(error);
            console.error(`Error fetching route ${routeId}: ${errorMessage}`);
            const userFriendlyMessage = errorMessage.includes("Record Not Found") || errorMessage.includes("404")
                ? `Route with ID ${routeId} not found.`
                : `An unexpected error occurred while fetching route ${routeId}. Details: ${errorMessage}`;
            return {
                content: [{ type: "text" as const, text: `❌ ${userFriendlyMessage}` }],
                isError: true
            };
        }
    }
  • Input validation schema for the get-route tool.
    const GetRouteInputSchema = z.object({
        routeId: z.string()
            .regex(/^\d+$/, "Route ID must contain only digits")
            .refine(val => val.length > 0, "Route ID cannot be empty")
            .describe("The unique identifier of the route to fetch.")});
  • src/server.ts:132-137 (registration)
    Registration of the get-route tool with the MCP server instance.
    server.tool(
        getRouteTool.name,
        getRouteTool.description,
        getRouteTool.inputSchema?.shape ?? {},
        getRouteTool.execute
    );
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a fetch operation (implying read-only), but doesn't mention authentication requirements, rate limits, error conditions, or what 'detailed information' includes. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 gets straight to the point with zero wasted words. It's appropriately sized for a simple fetch operation and front-loads the essential 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 single-parameter fetch tool with no output schema, the description is minimally adequate but could be more complete. It doesn't explain what 'detailed information' includes or provide context about the response format. Given the lack of annotations and output schema, more behavioral and response context would be helpful.

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 has 100% description coverage, with the single parameter 'routeId' well-documented in the schema itself. The description adds no additional parameter semantics beyond what's already in the structured schema, so the baseline score of 3 is appropriate.

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 ('fetches detailed information') and resource ('a specific route using its ID'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from similar siblings like 'get-segment' or 'get-activity-details' beyond mentioning 'route' specifically.

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 (like needing a route ID from 'list-athlete-routes'), nor does it clarify when this tool is appropriate compared to other get-* tools for different resource types.

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