Skip to main content
Glama

get-routine-folders

Retrieve a paginated list of routine folders to organize workout routines by categories. Returns folder details including ID, title, order position, and timestamps for better management.

Instructions

Get a paginated list of routine folders available on the account. Returns folder details including ID, title, index (order position), and creation/update timestamps. Useful for organizing routines into categories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNo
pageSizeNo

Implementation Reference

  • Handler function that fetches a paginated list of routine folders from the Hevy API client, formats each folder using formatRoutineFolder, handles empty results, and returns a JSON response or empty response.
    async ({ page, pageSize }: { page: number; pageSize: number }) => {
    	if (!hevyClient) {
    		throw new Error(
    			"API client not initialized. Please provide HEVY_API_KEY.",
    		);
    	}
    	const data = await hevyClient.getRoutineFolders({
    		page,
    		pageSize,
    	});
    
    	// Process routine folders to extract relevant information
    	const folders =
    		data?.routine_folders?.map((folder: RoutineFolder) =>
    			formatRoutineFolder(folder),
    		) || [];
    
    	if (folders.length === 0) {
    		return createEmptyResponse(
    			"No routine folders found for the specified parameters",
    		);
    	}
    
    	return createJsonResponse(folders);
    },
  • Input schema using Zod: page (coerced integer >=1, default 1), pageSize (coerced integer 1-10, default 5).
    {
    	page: z.coerce.number().int().gte(1).default(1),
    	pageSize: z.coerce.number().int().gte(1).lte(10).default(5),
    },
  • Registers the 'get-routine-folders' tool with the MCP server, providing tool name, description, input schema, and error-handling wrapped handler function.
    	"get-routine-folders",
    	"Get a paginated list of your routine folders, including both default and custom folders. Useful for organizing and browsing your workout routines.",
    	{
    		page: z.coerce.number().int().gte(1).default(1),
    		pageSize: z.coerce.number().int().gte(1).lte(10).default(5),
    	},
    	withErrorHandling(
    		async ({ page, pageSize }: { page: number; pageSize: number }) => {
    			if (!hevyClient) {
    				throw new Error(
    					"API client not initialized. Please provide HEVY_API_KEY.",
    				);
    			}
    			const data = await hevyClient.getRoutineFolders({
    				page,
    				pageSize,
    			});
    
    			// Process routine folders to extract relevant information
    			const folders =
    				data?.routine_folders?.map((folder: RoutineFolder) =>
    					formatRoutineFolder(folder),
    				) || [];
    
    			if (folders.length === 0) {
    				return createEmptyResponse(
    					"No routine folders found for the specified parameters",
    				);
    			}
    
    			return createJsonResponse(folders);
    		},
    		"get-routine-folders",
    	),
    );
Behavior3/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 discloses key behavioral traits: pagination (list is paginated), return format (folder details including specific fields), and purpose (organizing routines). However, it lacks details on permissions, rate limits, error handling, or whether it's read-only (implied by 'Get' but not explicit).

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 front-loaded with the core purpose, followed by return details and a usage note. Both sentences earn their place by providing essential information without redundancy, making it efficient 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 no annotations, no output schema, and 2 parameters with low schema coverage, the description is moderately complete. It covers purpose, return data, and pagination, but lacks details on authentication, error cases, or full parameter semantics, which could be important for a tool with pagination and no structured output.

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 2 parameters with 0% description coverage, so the description must compensate. It mentions 'paginated list', which hints at 'page' and 'pageSize' parameters, adding meaning beyond the schema. However, it doesn't explain parameter defaults or constraints (e.g., pageSize maximum of 10), leaving some gaps.

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 verb ('Get') and resource ('paginated list of routine folders'), specifying what data is returned (ID, title, index, timestamps). It distinguishes from siblings like 'get-routine-folder' (singular) by indicating it lists multiple folders, though it doesn't explicitly contrast with other folder-related tools.

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 for organizing routines into categories, suggesting it's for browsing folders. However, it doesn't explicitly state when to use this tool versus alternatives like 'get-routine-folder' (singular) or 'get-routines', nor does it provide exclusions or prerequisites.

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