Skip to main content
Glama

get-exercise-template

Retrieve detailed information about a specific exercise template by ID, including title, type, muscle groups, and customization status, via the Hevy MCP server.

Instructions

Get complete details of a specific exercise template by ID. Returns all template information including title, type, primary muscle group, secondary muscle groups, and whether it's a custom exercise.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exerciseTemplateIdYes

Implementation Reference

  • Executes the tool logic: checks for hevyClient, fetches exercise template by ID, handles not found, formats with helper, returns JSON response.
    async ({ exerciseTemplateId }: { exerciseTemplateId: string }) => {
    	if (!hevyClient) {
    		throw new Error(
    			"API client not initialized. Please provide HEVY_API_KEY.",
    		);
    	}
    	const data = await hevyClient.getExerciseTemplate(exerciseTemplateId);
    
    	if (!data) {
    		return createEmptyResponse(
    			`Exercise template with ID ${exerciseTemplateId} not found`,
    		);
    	}
    
    	const template = formatExerciseTemplate(data);
    	return createJsonResponse(template);
    },
  • Zod schema for input parameters: exerciseTemplateId as non-empty string.
    {
    	exerciseTemplateId: z.string().min(1),
    },
  • Registers the 'get-exercise-template' MCP tool with server.tool, specifying name, description, input schema, and error-handled handler function.
    server.tool(
    	"get-exercise-template",
    	"Get complete details of a specific exercise template by its ID, including name, category, equipment, muscle groups, and notes.",
    	{
    		exerciseTemplateId: z.string().min(1),
    	},
    	withErrorHandling(
    		async ({ exerciseTemplateId }: { exerciseTemplateId: string }) => {
    			if (!hevyClient) {
    				throw new Error(
    					"API client not initialized. Please provide HEVY_API_KEY.",
    				);
    			}
    			const data = await hevyClient.getExerciseTemplate(exerciseTemplateId);
    
    			if (!data) {
    				return createEmptyResponse(
    					`Exercise template with ID ${exerciseTemplateId} not found`,
    				);
    			}
    
    			const template = formatExerciseTemplate(data);
    			return createJsonResponse(template);
    		},
    		"get-exercise-template",
    	),
    );
  • Formats raw ExerciseTemplate from API into simplified FormattedExerciseTemplate used in the tool response.
    export function formatExerciseTemplate(
    	template: ExerciseTemplate,
    ): FormattedExerciseTemplate {
    	return {
    		id: template.id,
    		title: template.title,
    		type: template.type,
    		primaryMuscleGroup: template.primary_muscle_group,
    		secondaryMuscleGroups: template.secondary_muscle_groups,
    		isCustom: template.is_custom,
    	};
    }
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 this is a read operation ('Get'), which implies it's non-destructive, but doesn't cover aspects like authentication needs, rate limits, error handling, or what happens if the ID is invalid. 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 appropriately sized and front-loaded. The first sentence clearly states the purpose, and the second sentence adds useful detail about the return values without redundancy. Every sentence earns its place, making it efficient and easy to parse.

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 minimally adequate. It covers the purpose and return information but lacks behavioral details and usage guidelines. For a simple read tool, this is acceptable but leaves room for improvement in completeness.

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 description adds meaningful context beyond the input schema. The schema only defines 'exerciseTemplateId' as a required string, with 0% description coverage. The description clarifies that this parameter is used to 'Get complete details of a specific exercise template by ID,' explaining its role in identifying the template. Since there's only one parameter, this is sufficient to compensate for the low schema coverage.

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 exercise template by ID.' It specifies the verb ('Get'), resource ('exercise template'), and scope ('by ID'), distinguishing it from the sibling 'get-exercise-templates' which likely lists multiple templates. However, it doesn't explicitly contrast with that sibling, so it's not a perfect 5.

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 (e.g., needing an existing template ID), exclusions, or comparisons to siblings like 'get-exercise-templates' for listing templates or 'get-workout' for workout details. Usage is implied by the purpose but not explicitly stated.

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