Skip to main content
Glama

get_workout

Retrieve a specific workout definition using its unique ID. Access detailed workout data from Garmin Connect for analysis or integration.

Instructions

Get a specific workout definition by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workoutIdYesThe workout ID

Implementation Reference

  • Registration of the 'get_workout' tool with the MCP server. Links the tool name to its schema and handler.
    server.registerTool(
      'get_workout',
      {
        description: 'Get a specific workout definition by ID',
        inputSchema: getWorkoutSchema.shape,
      },
      async ({ workoutId }) => {
        const data = await client.getWorkout(workoutId);
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
        };
      },
    );
  • Handler function for 'get_workout'. Receives workoutId, calls client.getWorkout(workoutId), and returns the result as JSON text.
    async ({ workoutId }) => {
      const data = await client.getWorkout(workoutId);
      return {
        content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
      };
    },
  • Input schema (Zod) and TypeScript type for the 'get_workout' tool. Defines 'workoutId' as a required string.
    export type GetWorkoutDto = {
      workoutId: string;
    };
    
    export const getWorkoutSchema = z.object({
      workoutId: z.string().describe('The workout ID'),
    });
  • Client-side helper method that executes the actual HTTP request to the Garmin API for a specific workout.
    async getWorkout(workoutId: string): Promise<unknown> {
      return this.request(`${WORKOUT_ENDPOINT}/${workoutId}`);
    }
  • API endpoint constant for the workout endpoint used by the getWorkout client method.
    export const WORKOUT_ENDPOINT = '/workout-service/workout';
Behavior3/5

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

No annotations are provided, so the description must fully convey behavioral traits. It states it retrieves a 'workout definition', hinting at a read-only operation, but does not specify side effects, permissions, or return format.

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, clear sentence with no redundant words, efficiently conveying the tool's purpose.

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 multiple sibling tools and the lack of an output schema, the description is adequate but does not explain what a 'workout definition' includes or how the response is structured.

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?

With 100% schema coverage and the schema already describing 'workoutId' as 'The workout ID', the description adds no additional meaning beyond the schema.

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 tool retrieves a specific workout by ID, distinguishing it from sibling tools like get_workouts (list) and get_scheduled_workout_by_id (scheduled vs definition).

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 use when a specific workout ID is known, but provides no guidance on when not to use it or mention alternatives such as get_workouts for listing or get_scheduled_workout_by_id for scheduled workouts.

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/Nicolasvegam/garmin-connect-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server