Skip to main content
Glama

testmo_get_run

Retrieve details of a specific test run by ID, optionally including related entities.

Instructions

Get details of a specific test run.

Args: run_id: The test run ID. expands: Related entities to include.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
run_idYes
expandsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the testmo_get_run MCP tool. Calls the Testmo API GET /runs/{run_id} to fetch a specific test run's details. Uses the mcp.tool() decorator for registration.
    @mcp.tool()
    async def testmo_get_run(
        run_id: int,
        expands: list[str] | None = None,
    ) -> dict[str, Any]:
        """Get details of a specific test run.
    
        Args:
            run_id: The test run ID.
            expands: Related entities to include.
        """
        params: dict[str, Any] = {}
        if expands:
            params["expands"] = ",".join(expands)
        result = await _request("GET", f"/runs/{run_id}", params=params if params else None)
        return result.get("result", result)
  • Registration via @mcp.tool() decorator on the FastMCP instance defined in testmo/server.py.
    @mcp.tool()
  • Input schema/type annotations: run_id (int, required), expands (list[str] optional), returns dict[str, Any].
    async def testmo_get_run(
        run_id: int,
        expands: list[str] | None = None,
    ) -> dict[str, Any]:
        """Get details of a specific test run.
    
        Args:
            run_id: The test run ID.
            expands: Related entities to include.
        """
        params: dict[str, Any] = {}
        if expands:
            params["expands"] = ",".join(expands)
        result = await _request("GET", f"/runs/{run_id}", params=params if params else None)
        return result.get("result", result)
  • Helper function _get_client() creates the HTTP client used by _request() to call the Testmo API. Configuration comes from testmo/config.py.
    def _get_client() -> httpx.AsyncClient:
        if not TESTMO_URL:
            raise ValueError("TESTMO_URL environment variable not set")
        if not TESTMO_API_KEY:
            raise ValueError("TESTMO_API_KEY environment variable not set")
        return httpx.AsyncClient(
            base_url=f"{TESTMO_URL}/api/v1/",
            headers={
                "Authorization": f"Bearer {TESTMO_API_KEY}",
                "Content-Type": "application/json",
                "Accept": "application/json",
            },
            timeout=httpx.Timeout(REQUEST_TIMEOUT),
        )
    
    
    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()
Behavior2/5

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

No annotations are present, so the description carries full burden. It only states 'Get details' without revealing safety, auth requirements, or side effects. The tool is likely read-only, but this is not disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short and to the point, with a single-line pitch and an Args section. It is efficient, though the Args block could be integrated more naturally.

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 the simplicity of the tool (fetching a single run by ID) and the presence of an output schema, the description covers the essential purpose. It lacks edge case or error info, but is adequate for straightforward retrieval.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds minimal meaning beyond the schema: 'run_id' is just rephrased from the schema title, 'expands' receives a brief explanation ('Related entities to include'). With 0% schema coverage, the description partially compensates but remains thin.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Get details of a specific test run' with a specific verb and resource. It is distinct from sibling tools like testmo_list_runs (list) and testmo_get_automation_run (different resource), but does not explicitly differentiate itself.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description lacks context about its role in the workflow (e.g., retrieving a single run vs. listing multiple runs).

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