testmo_list_run_results
List test results for a test run with optional filters for status, assignee, creator, and creation date.
Instructions
List test results for a run with optional filters.
Args: run_id: The test run ID. status_id: Comma-separated status IDs (1=Untested, 2=Passed, 3=Failed, 4=Retest, 5=Blocked, 6=Skipped). assignee_id: Comma-separated assignee IDs. created_by: Comma-separated user IDs who created results. created_after: Filter results created after (ISO8601 format). created_before: Filter results created before (ISO8601 format). get_latest_result: If true, return only the latest result per test. page: Page number (default: 1). per_page: Results per page (default: 100). Valid: 25, 50, 100. expands: Related entities to include.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| run_id | Yes | ||
| status_id | No | ||
| assignee_id | No | ||
| created_by | No | ||
| created_after | No | ||
| created_before | No | ||
| get_latest_result | No | ||
| page | No | ||
| per_page | No | ||
| expands | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- testmo/tools/runs.py:54-96 (handler)The handler function testmo_list_run_results that lists test results for a run with optional filters (status_id, assignee_id, created_by, created_after, created_before, get_latest_result, pagination, expands). Makes a GET request to /runs/{run_id}/results.
@mcp.tool() async def testmo_list_run_results( run_id: int, status_id: str | None = None, assignee_id: str | None = None, created_by: str | None = None, created_after: str | None = None, created_before: str | None = None, get_latest_result: bool | None = None, page: int = 1, per_page: int = 100, expands: list[str] | None = None, ) -> dict[str, Any]: """List test results for a run with optional filters. Args: run_id: The test run ID. status_id: Comma-separated status IDs (1=Untested, 2=Passed, 3=Failed, 4=Retest, 5=Blocked, 6=Skipped). assignee_id: Comma-separated assignee IDs. created_by: Comma-separated user IDs who created results. created_after: Filter results created after (ISO8601 format). created_before: Filter results created before (ISO8601 format). get_latest_result: If true, return only the latest result per test. page: Page number (default: 1). per_page: Results per page (default: 100). Valid: 25, 50, 100. expands: Related entities to include. """ params: dict[str, Any] = {"page": page, "per_page": per_page} if status_id: params["status_id"] = status_id if assignee_id: params["assignee_id"] = assignee_id if created_by: params["created_by"] = created_by if created_after: params["created_after"] = created_after if created_before: params["created_before"] = created_before if get_latest_result is not None: params["get_latest_result"] = get_latest_result if expands: params["expands"] = ",".join(expands) return await _request("GET", f"/runs/{run_id}/results", params=params) - testmo/tools/runs.py:54-96 (schema)The input schema is defined via the function signature parameters (run_id, status_id, assignee_id, created_by, created_after, created_before, get_latest_result, page, per_page, expands) with type hints and docstring documenting the valid values.
@mcp.tool() async def testmo_list_run_results( run_id: int, status_id: str | None = None, assignee_id: str | None = None, created_by: str | None = None, created_after: str | None = None, created_before: str | None = None, get_latest_result: bool | None = None, page: int = 1, per_page: int = 100, expands: list[str] | None = None, ) -> dict[str, Any]: """List test results for a run with optional filters. Args: run_id: The test run ID. status_id: Comma-separated status IDs (1=Untested, 2=Passed, 3=Failed, 4=Retest, 5=Blocked, 6=Skipped). assignee_id: Comma-separated assignee IDs. created_by: Comma-separated user IDs who created results. created_after: Filter results created after (ISO8601 format). created_before: Filter results created before (ISO8601 format). get_latest_result: If true, return only the latest result per test. page: Page number (default: 1). per_page: Results per page (default: 100). Valid: 25, 50, 100. expands: Related entities to include. """ params: dict[str, Any] = {"page": page, "per_page": per_page} if status_id: params["status_id"] = status_id if assignee_id: params["assignee_id"] = assignee_id if created_by: params["created_by"] = created_by if created_after: params["created_after"] = created_after if created_before: params["created_before"] = created_before if get_latest_result is not None: params["get_latest_result"] = get_latest_result if expands: params["expands"] = ",".join(expands) return await _request("GET", f"/runs/{run_id}/results", params=params) - testmo-mcp.py:15-15 (registration)Tool registration is triggered by importing testmo.tools.runs, which causes the @mcp.tool() decorator on testmo_list_run_results to execute.
import testmo.tools.runs # noqa: F401 - testmo/server.py:6-6 (registration)The mcp FastMCP instance (used via @mcp.tool() decorator) is created here.
mcp = FastMCP("testmo-mcp") - testmo/client.py:25-49 (helper)The _request helper function used by testmo_list_run_results to make the HTTP GET request 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()