Skip to main content
Glama

testmo_list_folders

List all folders in a Testmo project with their full paths by providing the project ID.

Instructions

List all folders in a Testmo project with full paths.

Args: project_id: The project ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler for the testmo_list_folders tool. Uses @mcp.tool() decorator to register as a FastMCP tool. Fetches all folders via _get_all_folders helper, then annotates them with full paths via _build_folder_paths.
    @mcp.tool()
    async def testmo_list_folders(project_id: int) -> list[dict[str, Any]]:
        """List all folders in a Testmo project with full paths.
    
        Args:
            project_id: The project ID.
        """
        folders = await _get_all_folders(project_id)
        return _build_folder_paths(folders)
  • Internal helper that fetches all folders with auto-pagination, calling the Testmo API at GET /projects/{project_id}/folders with page/per_page params.
    async def _get_all_folders(project_id: int) -> list[dict[str, Any]]:
        """Fetch all folders with auto-pagination (internal helper)."""
        all_folders: list[dict[str, Any]] = []
        page = 1
        while True:
            result = await _request(
                "GET",
                f"/projects/{project_id}/folders",
                params={"page": page, "per_page": 100},
            )
            all_folders.extend(result.get("result", []))
            if result.get("next_page") is None:
                break
            page += 1
            await asyncio.sleep(RATE_LIMIT_DELAY)
        return all_folders
  • Internal helper that builds full hierarchical paths for each folder by walking up the parent chain, adding a 'full_path' key to each folder dict.
    def _build_folder_paths(folders: list[dict[str, Any]]) -> list[dict[str, Any]]:
        """Annotate folders with full_path."""
        folder_map = {f["id"]: f for f in folders}
        for folder in folders:
            path_parts = [folder["name"]]
            parent_id = folder.get("parent_id")
            while parent_id and parent_id in folder_map:
                parent = folder_map[parent_id]
                path_parts.insert(0, parent["name"])
                parent_id = parent.get("parent_id")
            folder["full_path"] = " / ".join(path_parts)
        return folders
  • testmo-mcp.py:12-22 (registration)
    The tool module is imported in the main entry point (testmo-mcp.py), which triggers the @mcp.tool() decorator registration.
    import testmo.tools.folders  # noqa: F401
    import testmo.tools.milestones  # noqa: F401
    import testmo.tools.cases  # noqa: F401
    import testmo.tools.runs  # noqa: F401
    import testmo.tools.attachments  # noqa: F401
    import testmo.tools.automation  # noqa: F401
    import testmo.tools.issues  # noqa: F401
    import testmo.tools.composite  # noqa: F401
    import testmo.tools.utility  # noqa: F401
    
    if __name__ == "__main__":
  • testmo/server.py:6-6 (registration)
    The FastMCP instance ('mcp') is created here, and its .tool() decorator is used in folders.py to register testmo_list_folders.
    mcp = FastMCP("testmo-mcp")
Behavior3/5

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

The description mentions it lists all folders with full paths, implying a read operation. However, it lacks details on pagination, sorting, number of results, or any side effects. With no annotations, the description carries the burden but is only moderately transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise with one sentence and a parameter list. It is front-loaded with the main purpose. However, it could include brief information about return values without becoming verbose.

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 existence of an output schema, the description does not need to detail return values, but it is still incomplete regarding the format of folder paths, whether the list is flat or hierarchical, and any ordering. Adequate but with gaps.

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

Parameters3/5

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

The input schema has one parameter (project_id) with no description beyond its title. The overall description includes a line 'project_id: The project ID.' which adds minimal semantic value. Schema coverage is 0%, but the description partially compensates.

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 verb 'list', the resource 'folders in a Testmo project', and specifies 'with full paths', which distinguishes it from sibling tools like testmo_get_folder or testmo_find_folder_by_name.

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 does not provide any guidance on when to use this tool versus alternatives such as testmo_get_folders_recursive or testmo_find_folder_by_name. No when-not-to-use or prerequisites are mentioned.

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/strelec00/testmo-mcp'

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