Skip to main content
Glama

get-routine

Retrieve detailed information about a specific workout routine, including title, notes, folder, and exercise data with set configurations, using the routine ID.

Instructions

Get complete details of a specific routine by ID. Returns all routine information including title, notes, assigned folder, and detailed exercise data with set configurations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
routineIdYes

Implementation Reference

  • The core handler logic wrapped in withErrorHandling: fetches routine by ID from Hevy API client, checks for existence, formats with formatRoutine, and returns JSON response or empty if not found.
    withErrorHandling(async ({ routineId }) => {
    	if (!hevyClient) {
    		throw new Error(
    			"API client not initialized. Please provide HEVY_API_KEY.",
    		);
    	}
    	const data = await hevyClient.getRoutineById(String(routineId));
    	if (!data || !data.routine) {
    		return createEmptyResponse(`Routine with ID ${routineId} not found`);
    	}
    	const routine = formatRoutine(data.routine);
    	return createJsonResponse(routine);
    }, "get-routine"),
  • Input schema: requires a single parameter 'routineId' as a non-empty string.
    {
    	routineId: z.string().min(1),
    },
  • Registration of the 'get-routine' tool on the MCP server, including name, description, input schema, and handler function.
    server.tool(
    	"get-routine",
    	"Get a routine by its ID using the direct endpoint. Returns all details for the specified routine.",
    	{
    		routineId: z.string().min(1),
    	},
    	withErrorHandling(async ({ routineId }) => {
    		if (!hevyClient) {
    			throw new Error(
    				"API client not initialized. Please provide HEVY_API_KEY.",
    			);
    		}
    		const data = await hevyClient.getRoutineById(String(routineId));
    		if (!data || !data.routine) {
    			return createEmptyResponse(`Routine with ID ${routineId} not found`);
    		}
    		const routine = formatRoutine(data.routine);
    		return createJsonResponse(routine);
    	}, "get-routine"),
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the tool as a read operation ('Get') and details the return content, but lacks information on permissions, error handling, rate limits, or whether the data is cached. 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 two sentences that are front-loaded with the core purpose and efficiently detail the return values without unnecessary words. Every sentence adds value by specifying the action, parameter use, and output content, making it highly concise and well-structured.

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 (1 parameter, no nested objects) and lack of output schema, the description adequately covers the basic purpose and return data. However, it does not address behavioral aspects like error cases or performance, which are important for a tool with no annotations, leaving 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 schema has 0% description coverage, so the description must compensate. It adds meaning by explaining that 'routineId' is used to identify 'a specific routine', clarifying its purpose beyond the schema's minimal type constraints. However, it does not specify format or validation rules for the ID, leaving some ambiguity.

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 specific action ('Get complete details') and resource ('a specific routine by ID'), distinguishing it from siblings like 'get-routines' (which lists multiple routines) and 'get-routine-folders' (which focuses on folders rather than routine details). It explicitly mentions what information is returned, making the purpose unambiguous.

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 by specifying 'by ID', suggesting it should be used when you have a specific routine identifier. However, it does not explicitly state when to use this tool versus alternatives like 'get-routines' (for listing routines) or 'get-workout' (for workout details), nor does it provide exclusions or prerequisites for use.

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