Skip to main content
Glama

get-workout

Retrieve detailed workout information by ID, including title, description, start/end times, and exercise data, using the Hevy MCP server.

Instructions

Get complete details of a specific workout by ID. Returns all workout information including title, description, start/end times, and detailed exercise data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workoutIdYes

Implementation Reference

  • Handler for the 'get-workout' tool: validates input, checks hevyClient availability, fetches workout by ID, formats it, and returns JSON or empty response if not found.
    server.tool(
    	"get-workout",
    	"Get complete details of a specific workout by ID. Returns all workout information including title, description, start/end times, and detailed exercise data.",
    	{
    		workoutId: z.string().min(1),
    	},
    	withErrorHandling(async ({ workoutId }) => {
    		if (!hevyClient) {
    			throw new Error(
    				"API client not initialized. Please provide HEVY_API_KEY.",
    			);
    		}
    		const data = await hevyClient.getWorkout(workoutId);
    
    		if (!data) {
    			return createEmptyResponse(`Workout with ID ${workoutId} not found`);
    		}
    
    		const workout = formatWorkout(data);
    		return createJsonResponse(workout);
    	}, "get-workout"),
    );
  • Input schema for 'get-workout' tool: requires 'workoutId' as non-empty string.
    {
    	workoutId: z.string().min(1),
    },
  • src/index.ts:40-40 (registration)
    Top-level call to register all workout tools, including 'get-workout'.
    registerWorkoutTools(server, hevyClient);
  • Supporting helper function formatWorkout used in the handler to standardize workout data structure, including computed duration and flattened exercise/set details.
    export function formatWorkout(workout: Workout): FormattedWorkout {
    	return {
    		id: workout.id,
    		title: workout.title,
    		description: workout.description,
    		startTime: workout.start_time,
    		endTime: workout.end_time,
    		createdAt: workout.created_at,
    		updatedAt: workout.updated_at,
    		duration: calculateDuration(workout.start_time, workout.end_time),
    		exercises: workout.exercises?.map((exercise) => {
    			return {
    				index: exercise.index,
    				name: exercise.title,
    				exerciseTemplateId: exercise.exercise_template_id,
    				notes: exercise.notes,
    				supersetsId: exercise.supersets_id,
    				sets: exercise.sets?.map((set) => ({
    					index: set.index,
    					type: set.type,
    					weight: set.weight_kg,
    					reps: set.reps,
    					distance: set.distance_meters,
    					duration: set.duration_seconds,
    					rpe: set.rpe,
    					customMetric: set.custom_metric,
    				})),
    			};
    		}),
    	};
    }
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 of behavioral disclosure. It states the tool returns 'complete details' including specific fields like title and exercise data, which adds some context about output behavior. However, it doesn't disclose critical traits such as whether this is a read-only operation, error handling for invalid IDs, authentication requirements, or rate limits. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 highly concise and well-structured in two sentences. The first sentence states the purpose and parameter use, and the second sentence details the return information. Every sentence adds value without redundancy, making it front-loaded and efficient for quick understanding.

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 low complexity (one parameter, no nested objects) and lack of annotations or output schema, the description is moderately complete. It covers the purpose and return data, but it doesn't address behavioral aspects like error cases or permissions. For a simple read operation, this is adequate but has clear gaps that could hinder effective use by an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has one parameter ('workoutId') with 0% schema description coverage, meaning the schema provides no semantic details. The description compensates by explaining that the parameter is used to 'Get complete details of a specific workout by ID,' clarifying that 'workoutId' identifies the workout to retrieve. This adds meaningful semantics beyond the bare schema, though it doesn't specify format constraints (e.g., UUID) or examples.

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 tool's purpose: 'Get complete details of a specific workout by ID.' It specifies the verb ('Get'), resource ('workout'), and scope ('by ID'), which is specific and actionable. However, it doesn't explicitly distinguish this tool from sibling tools like 'get-workouts' (which likely lists multiple workouts) or 'get-workout-events' (which might focus on events rather than full details), so it misses full sibling differentiation.

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 sibling tools like 'get-workouts' for listing workouts or 'get-workout-events' for event-specific data, nor does it specify prerequisites or exclusions. Usage is implied only by the purpose statement, with no explicit context for selection.

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

Related 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/chrisdoc/hevy-mcp'

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