Skip to main content
Glama

star-segment

Mark or unmark a Strava segment as a favorite to track it for future activities and personal goals.

Instructions

Stars or unstars a specific segment for the authenticated athlete.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
segmentIdYesThe unique identifier of the segment to star or unstar.
starredYesSet to true to star the segment, false to unstar it.

Implementation Reference

  • The tool definition and execution logic for 'star-segment'.
    export const starSegment = {
        name: "star-segment",
        description: "Stars or unstars a specific segment for the authenticated athlete.",
        inputSchema: StarSegmentInputSchema,
        execute: async ({ segmentId, starred }: StarSegmentInput) => {
            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 {
                const action = starred ? 'starring' : 'unstarring';
                console.error(`Attempting to ${action} segment ID: ${segmentId}...`);
    
                const updatedSegment = await updateStarStatus(token, segmentId, starred);
    
                const successMessage = `Successfully ${action} segment: "${updatedSegment.name}" (ID: ${updatedSegment.id}). Its starred status is now: ${updatedSegment.starred}.`;
                console.error(successMessage);
    
                return { content: [{ type: "text" as const, text: successMessage }] };
    
            } catch (error) {
                const errorMessage = error instanceof Error ? error.message : "An unknown error occurred";
                const action = starred ? 'star' : 'unstar';
                console.error(`Error attempting to ${action} segment ID ${segmentId}:`, errorMessage);
                return {
                    content: [{ type: "text" as const, text: `❌ API Error: Failed to ${action} segment ${segmentId}. ${errorMessage}` }],
                    isError: true,
                };
            }
        }
    };
  • Input validation schema for 'star-segment'.
    const StarSegmentInputSchema = z.object({
        segmentId: z.number().int().positive().describe("The unique identifier of the segment to star or unstar."),
        starred: z.boolean().describe("Set to true to star the segment, false to unstar it."),
    });
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. It mentions 'authenticated athlete' (implying authentication needs) and the star/unstar action (a mutation), but doesn't disclose other behavioral traits like rate limits, error conditions, or what happens if the segment doesn't exist. For a mutation tool with zero annotation coverage, this leaves significant 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 with zero waste. It front-loads the core action and resource, making it easy to parse. Every word earns its place without redundancy.

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's complexity (a mutation with authentication), lack of annotations, and no output schema, the description is minimally adequate. It covers the basic purpose and authentication context but misses details like return values, error handling, or side effects, which are important for a mutation tool.

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%, so the schema fully documents both parameters. The description doesn't add meaning beyond what the schema provides (e.g., no extra context about segmentId format or starred implications). Baseline 3 is appropriate when the schema does the heavy lifting.

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 action ('Stars or unstars'), specifies the resource ('a specific segment'), and identifies the subject ('for the authenticated athlete'). It uses specific verbs and distinguishes this tool from siblings like 'list-starred-segments' or 'get-segment' by focusing on modification rather than retrieval.

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 when an athlete wants to star or unstar a segment, but it doesn't explicitly state when to use this tool versus alternatives (e.g., no comparison to sibling tools). It mentions 'authenticated athlete' as a prerequisite, providing some context, but lacks guidance on exclusions or specific scenarios.

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