Skip to main content
Glama

testmo_batch_delete_cases

Delete up to 100 test cases in a project by providing the project ID and an array of case IDs. Removes multiple cases in a single API call.

Instructions

Delete multiple test cases (max 100 per call).

Args: project_id: The project ID. case_ids: Array of test case IDs to delete (max 100).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
case_idsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `testmo_batch_delete_cases` tool handler function, decorated with @mcp.tool(). It deletes multiple test cases (max 100 per call), auto-batching larger requests with rate limiting and error collection.
    @mcp.tool()
    async def testmo_batch_delete_cases(
        project_id: int,
        case_ids: list[int],
    ) -> dict[str, Any]:
        """Delete multiple test cases (max 100 per call).
    
        Args:
            project_id: The project ID.
            case_ids: Array of test case IDs to delete (max 100).
        """
        if len(case_ids) > MAX_CASES_PER_REQUEST:
            all_errors: list[str] = []
            total_deleted = 0
            for i in range(0, len(case_ids), MAX_CASES_PER_REQUEST):
                batch = case_ids[i : i + MAX_CASES_PER_REQUEST]
                batch_num = (i // MAX_CASES_PER_REQUEST) + 1
                try:
                    await _request(
                        "DELETE", f"/projects/{project_id}/cases", data={"ids": batch}
                    )
                    total_deleted += len(batch)
                except RuntimeError as e:
                    all_errors.append(f"Batch {batch_num}: {e}")
                if i + MAX_CASES_PER_REQUEST < len(case_ids):
                    await asyncio.sleep(RATE_LIMIT_DELAY)
            return {
                "total_requested": len(case_ids),
                "total_deleted": total_deleted,
                "errors": all_errors if all_errors else None,
            }
        return await _request(
            "DELETE", f"/projects/{project_id}/cases", data={"ids": case_ids}
        )
  • The `@mcp.tool()` decorator registers the function as a tool on the FastMCP instance.
    @mcp.tool()
  • testmo-mcp.py:13-20 (registration)
    The import `import testmo.tools.cases` triggers the `@mcp.tool()` decorators in cases.py, registering all case tools (including batch_delete) on the server.
    import testmo.tools.milestones  # noqa: F401
    import testmo.tools.cases  # noqa: F401
    import testmo.tools.runs  # noqa: F401
    import testmo.tools.attachments  # noqa: F401
    import testmo.tools.automation  # noqa: F401
    import testmo.tools.issues  # noqa: F401
    import testmo.tools.composite  # noqa: F401
    import testmo.tools.utility  # noqa: F401
  • The `_request` helper function used by the handler to make HTTP DELETE 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()
  • Configuration constants `MAX_CASES_PER_REQUEST` (100) and `RATE_LIMIT_DELAY` (0.5) used by the handler for batching logic.
    RATE_LIMIT_DELAY = 0.5
    MAX_CASES_PER_REQUEST = 100
Behavior2/5

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

No annotations provided, so the description must fully disclose behavior. It states 'Delete' and a batch limit, but does not mention irreversibility, partial success handling, or cascading effects.

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

Conciseness5/5

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

The description is extremely concise: two lines front-loaded with the verb and resource. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having an output schema, the description lacks completeness for a destructive batch operation. It does not mention expected results, error behavior, or side effects like irreversibility.

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

Parameters4/5

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

The description adds the constraint 'max 100' for case_ids, which is not in the schema (no maxItems). This provides critical additional semantics beyond parameter names.

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

Purpose5/5

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

The description clearly states 'Delete multiple test cases' with a batch limit of 100, and differentiates from the sibling 'testmo_delete_case' which deletes a single case.

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

Usage Guidelines3/5

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

The description mentions the batch size limit (max 100) but lacks guidance on when to use versus alternatives like batch update, or when not to use (e.g., irreversible action).

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