testmo_get_automation_run
Retrieve details of an automation run by its ID, with options to include related entities.
Instructions
Get details of a specific automation run.
Args: automation_run_id: The automation run ID. expands: Related entities to include.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| automation_run_id | Yes | ||
| expands | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- testmo/tools/automation.py:103-122 (handler)The handler function for testmo_get_automation_run tool. It calls the Testmo API GET /automation/runs/{automation_run_id} with optional expands parameter and returns the result.
@mcp.tool() async def testmo_get_automation_run( automation_run_id: int, expands: list[str] | None = None, ) -> dict[str, Any]: """Get details of a specific automation run. Args: automation_run_id: The automation run ID. expands: Related entities to include. """ params: dict[str, Any] = {} if expands: params["expands"] = ",".join(expands) result = await _request( "GET", f"/automation/runs/{automation_run_id}", params=params if params else None, ) return result.get("result", result) - testmo/tools/automation.py:104-107 (schema)The function signature defines the input schema: automation_run_id (int, required) and expands (optional list of strings).
async def testmo_get_automation_run( automation_run_id: int, expands: list[str] | None = None, ) -> dict[str, Any]: - testmo/tools/automation.py:103-103 (registration)The @mcp.tool() decorator registers this function as an MCP tool named testmo_get_automation_run.
@mcp.tool() - testmo-mcp.py:17-17 (registration)The import of testmo.tools.automation in the entry point registers all tools from automation.py, including testmo_get_automation_run.
import testmo.tools.automation # noqa: F401 - testmo/client.py:25-49 (helper)The _request helper used by testmo_get_automation_run 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()