Skip to main content
Glama

list_routine_folders

Retrieve your Hevy routine folders to organize and view workout categories such as Push/Pull/Legs or Hypertrophy Block.

Instructions

List the user's routine folders (e.g. 'Push/Pull/Legs', 'Hypertrophy Block').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNo
page_sizeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async handler function that executes the list_routine_folders tool logic. It calls client.get('/routine_folders') with pagination params.
    async def list_routine_folders(page: int = 1, page_size: int = 10) -> dict[str, Any]:
        """List the user's routine folders (e.g. 'Push/Pull/Legs', 'Hypertrophy Block')."""
        return {"data": await client.get("/routine_folders",
                                          params={"page": page, "pageSize": page_size})}
  • The register_all function calls folders.register(mcp, ctx), which registers list_routine_folders as an MCP tool.
    def register_all(mcp, ctx) -> None:
        workouts.register(mcp, ctx)
        routines.register(mcp, ctx)
        folders.register(mcp, ctx)
        templates.register(mcp, ctx)
        webhooks.register(mcp, ctx)
        analytics.register(mcp, ctx)
  • The register() function that decorates list_routine_folders with @mcp.tool() to register it as an MCP tool.
    def register(mcp, ctx) -> None:
        client = ctx.client
    
        @mcp.tool()
        @tool_guard
        async def list_routine_folders(page: int = 1, page_size: int = 10) -> dict[str, Any]:
            """List the user's routine folders (e.g. 'Push/Pull/Legs', 'Hypertrophy Block')."""
            return {"data": await client.get("/routine_folders",
                                              params={"page": page, "pageSize": page_size})}
  • The @tool_guard decorator used on the handler to catch errors and return structured {error, hint} responses.
    def tool_guard(func: Callable[..., Awaitable[Any]]) -> Callable[..., Awaitable[Any]]:
        """Decorator: convert exceptions into `{error, hint}` and emit structured logs."""
    
        @functools.wraps(func)
        async def wrapper(*args: Any, **kwargs: Any) -> Any:
            start = time.monotonic()
            name = func.__name__
            try:
                result = await func(*args, **kwargs)
                log.info("tool=%s status=ok duration_ms=%.1f", name, (time.monotonic() - start) * 1000)
                return result
            except HevyApiError as e:
                log.warning(
                    "tool=%s status=hevy_error http=%d duration_ms=%.1f msg=%s",
                    name, e.status, (time.monotonic() - start) * 1000, e.message,
                )
                return {"error": e.message, "hint": e.hint, "http_status": e.status}
            except httpx.TimeoutException:
                log.warning("tool=%s status=timeout duration_ms=%.1f", name, (time.monotonic() - start) * 1000)
                return {
                    "error": "Hevy API request timed out.",
                    "hint": "Retry the call. If it keeps timing out, reduce page_size or scope.",
                }
            except ValueError as e:
                log.warning("tool=%s status=bad_input duration_ms=%.1f msg=%s", name, (time.monotonic() - start) * 1000, e)
                return {"error": str(e), "hint": "Re-read the tool's input schema and adjust the arguments."}
            except Exception as e:  # noqa: BLE001 — last-resort guard so Claude never sees a stack trace
                log.exception("tool=%s status=internal_error duration_ms=%.1f", name, (time.monotonic() - start) * 1000)
                return {
                    "error": f"Unexpected internal error: {type(e).__name__}: {e}",
                    "hint": "This is a bug in hevy-mcp. Retry once; if it persists, file an issue with the tool name and inputs.",
                }
    
        return wrapper
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. It does not disclose that this is a read-only operation, whether pagination is handled, or any authentication or rate-limit concerns. The brevity leaves important behavioral traits unmentioned.

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?

A single, well-front-loaded sentence that directly states the tool's purpose. No extraneous words; every word contributes.

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?

The tool is simple with two optional parameters and an output schema, but the description lacks details about pagination behavior, default ordering, or what information the folders contain. It is minimally adequate.

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

Parameters1/5

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

Schema description coverage is 0% and the description does not mention the 'page' or 'page_size' parameters. Since coverage is low, the description must compensate but fails to add any semantic meaning to the input 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 lists the user's routine folders and gives concrete examples ('Push/Pull/Legs', 'Hypertrophy Block'). The verb 'List' and resource 'routine folders' are specific and distinguish it from sibling tools like 'list_routines'.

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?

No guidance on when to use this tool versus alternatives such as 'get_routine_folder' or 'list_routines'. The description implies usage for listing folders but does not provide exclusions or conditions.

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

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