testmo_list_runs
Retrieve test runs for a project with optional filters by closed status, milestone, and pagination controls.
Instructions
List test runs in a project.
Args: project_id: The project ID. page: Page number (default: 1). per_page: Results per page (default: 100). Valid: 25, 50, 100. is_closed: Filter by closed status. milestone_id: Comma-separated milestone IDs to filter by. expands: Related entities to include.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| page | No | ||
| per_page | No | ||
| is_closed | No | ||
| milestone_id | No | ||
| expands | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- testmo/tools/runs.py:7-33 (handler)The tool handler for testmo_list_runs. Uses the @mcp.tool() decorator to register as an MCP tool. Accepts project_id, page, per_page, is_closed, milestone_id, and expands parameters, then calls the Testmo API GET /projects/{project_id}/runs endpoint.
@mcp.tool() async def testmo_list_runs( project_id: int, page: int = 1, per_page: int = 100, is_closed: bool | None = None, milestone_id: str | None = None, expands: list[str] | None = None, ) -> dict[str, Any]: """List test runs in a project. Args: project_id: The project ID. page: Page number (default: 1). per_page: Results per page (default: 100). Valid: 25, 50, 100. is_closed: Filter by closed status. milestone_id: Comma-separated milestone IDs to filter by. expands: Related entities to include. """ params: dict[str, Any] = {"page": page, "per_page": per_page} if is_closed is not None: params["is_closed"] = is_closed if milestone_id: params["milestone_id"] = milestone_id if expands: params["expands"] = ",".join(expands) return await _request("GET", f"/projects/{project_id}/runs", params=params) - testmo-mcp.py:15-15 (registration)Registration of the runs module (which includes testmo_list_runs) via import of testmo.tools.runs module in the main entry point.
import testmo.tools.runs # noqa: F401 - testmo/client.py:25-49 (helper)The _request helper function used by testmo_list_runs to make HTTP requests to the Testmo API.
async def _request( method: str, endpoint: str, data: dict[str, Any] | None = None, params: dict[str, Any] | None = None, ) -> dict[str, Any]: async with _get_client() as client: response = await client.request( method=method, url=endpoint, json=data, params=params, ) if response.status_code == 204: return {"success": True} if response.status_code >= 400: try: error_body = response.json() except Exception: error_body = response.text raise RuntimeError( f"Testmo API error {response.status_code}: " f"{json.dumps(error_body) if isinstance(error_body, dict) else error_body}" ) return response.json() - testmo/server.py:6-6 (helper)The FastMCP server instance (mcp) that provides the @mcp.tool() decorator used to register testmo_list_runs.
mcp = FastMCP("testmo-mcp")