Skip to main content
Glama

testmo_find_folder_by_name

Find a folder in your Testmo project by its exact name, with optional parent folder scope.

Instructions

Find a folder by its name within a project.

Args: project_id: The project ID. name: Folder name to search for. parent_id: Parent folder ID to search within (omit for root level).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
nameYes
parent_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual implementation of the testmo_find_folder_by_name tool handler. It fetches all folders via the internal helper _get_all_folders, then searches by name (and optional parent_id), returning the matching folder dict or a not-found response.
    @mcp.tool()
    async def testmo_find_folder_by_name(
        project_id: int,
        name: str,
        parent_id: int | None = None,
    ) -> dict[str, Any]:
        """Find a folder by its name within a project.
    
        Args:
            project_id: The project ID.
            name: Folder name to search for.
            parent_id: Parent folder ID to search within (omit for root level).
        """
        all_folders = await _get_all_folders(project_id)
        for folder in all_folders:
            folder_parent = folder.get("parent_id") or 0
            search_parent = parent_id or 0
            if folder["name"] == name and folder_parent == search_parent:
                return folder
        return {"found": False, "message": f"Folder '{name}' not found"}
  • The `@mcp.tool()` decorator on line 138 registers `testmo_find_folder_by_name` as an MCP tool on the FastMCP instance imported from `..server`.
    import asyncio
  • The function signature defines the input schema: project_id (int), name (str), parent_id (int | None). The return type is dict[str, Any]. These are automatically interpreted by FastMCP as the tool's input/output schema.
    @mcp.tool()
    async def testmo_find_folder_by_name(
        project_id: int,
        name: str,
        parent_id: int | None = None,
    ) -> dict[str, Any]:
        """Find a folder by its name within a project.
    
        Args:
            project_id: The project ID.
            name: Folder name to search for.
            parent_id: Parent folder ID to search within (omit for root level).
        """
        all_folders = await _get_all_folders(project_id)
        for folder in all_folders:
            folder_parent = folder.get("parent_id") or 0
            search_parent = parent_id or 0
            if folder["name"] == name and folder_parent == search_parent:
                return folder
        return {"found": False, "message": f"Folder '{name}' not found"}
  • Internal helper _get_all_folders used by testmo_find_folder_by_name to fetch all folders from the Testmo API with auto-pagination.
    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
  • testmo-mcp.py:11-12 (registration)
    Top-level entry point imports testmo.tools.folders, which triggers the @mcp.tool() decorators and registers all folder tools (including testmo_find_folder_by_name) on the mcp instance.
    import testmo.tools.projects  # noqa: F401
    import testmo.tools.folders  # noqa: F401
Behavior4/5

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

With no annotations, the description carries full burden. It indicates a read-only search operation with no destructive hints, and explains the optional parent_id scope. However, it does not disclose what happens on no match or multiple matches, though that is minor.

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 extremely concise: one sentence for purpose followed by a clear args list. Every word serves a purpose, no unnecessary details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and an existing output schema, the description sufficiently covers the tool's purpose, parameters, and basic behavior. It is complete enough for a simple find operation, though it lacks mention of edge cases like multiple matches.

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?

Schema coverage is 0%, so the description must add meaning. It explains project_id as 'The project ID', name as 'Folder name to search for', and parent_id with usage guidance ('omit for root level'), adding significant value beyond the schema types and titles.

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 'Find' and the resource 'a folder by its name within a project', distinguishing it from sibling tools like testmo_get_folder (which retrieves by ID) and testmo_list_folders (which lists all folders).

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?

While the description implies usage when searching by name, it does not explicitly state when to use this tool versus alternatives like testmo_get_folder or testmo_get_folders_recursive, nor does it provide when-not-to-use or prerequisite 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/strelec00/testmo-mcp'

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