testmo_get_folder
Retrieve details of a specific test folder by providing project and folder IDs.
Instructions
Get details of a specific folder.
Args: project_id: The project ID. folder_id: The folder ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| folder_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- testmo/tools/folders.py:52-64 (handler)The main handler for the testmo_get_folder tool. Decorated with @mcp.tool(), it fetches all folders for the project via _get_all_folders (which handles auto-pagination), then iterates to find the matching folder_id. Raises RuntimeError if not found.
@mcp.tool() async def testmo_get_folder(project_id: int, folder_id: int) -> dict[str, Any]: """Get details of a specific folder. Args: project_id: The project ID. folder_id: The folder ID. """ folders = await _get_all_folders(project_id) for folder in folders: if folder["id"] == folder_id: return folder raise RuntimeError(f"Folder {folder_id} not found in project {project_id}") - testmo/tools/folders.py:4-4 (registration)The @mcp.tool() decorator on line 52 registers testmo_get_folder with the FastMCP server instance via the 'mcp' object imported from ..server.
from ..server import mcp - testmo/server.py:6-6 (registration)The FastMCP server instance 'mcp' which provides the .tool() decorator used to register all tools including testmo_get_folder.
mcp = FastMCP("testmo-mcp") - testmo-mcp.py:12-12 (registration)The import of testmo.tools.folders module which triggers the @mcp.tool() decorators to register testmo_get_folder (and all folder tools) on the server.
import testmo.tools.folders # noqa: F401 - testmo/tools/folders.py:9-24 (helper)The _get_all_folders helper function used by testmo_get_folder. It auto-paginates through all folders in a project, making repeated API calls with RATE_LIMIT_DELAY between pages.
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