Skip to main content
Glama

testmo_create_cases

Create up to 100 test cases in a batch by specifying required fields like name, folder, priority, type, and creator. Streamline test case generation for your Testmo projects.

Instructions

Create multiple test cases in a batch (max 100 per call).

Each case object MUST include these fields or the API will silently reject it:

  • name: Test case title

  • folder_id: Target folder ID (0 for root)

  • custom_priority: Priority ID (52=Critical, 1=High, 2=Medium, 3=Low)

  • custom_type: Type ID (59=Functional, 64=Acceptance, 55=Security)

  • custom_creator: Creator ID (51=AI Generated)

Optional: template_id, state_id, tags, issues, configurations, custom_feature, etc.

Args: project_id: The project ID. cases: Array of test case objects (max 100).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
casesYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the testmo_create_cases tool. Creates multiple test cases in a batch (max 100 per call) via POST to /projects/{project_id}/cases. Validates that the number of cases does not exceed MAX_CASES_PER_REQUEST (100).
    @mcp.tool()
    async def testmo_create_cases(
        project_id: int,
        cases: list[dict[str, Any]],
    ) -> dict[str, Any]:
        """Create multiple test cases in a batch (max 100 per call).
    
        Each case object MUST include these fields or the API will silently reject it:
        - name: Test case title
        - folder_id: Target folder ID (0 for root)
        - custom_priority: Priority ID (52=Critical, 1=High, 2=Medium, 3=Low)
        - custom_type: Type ID (59=Functional, 64=Acceptance, 55=Security)
        - custom_creator: Creator ID (51=AI Generated)
    
        Optional: template_id, state_id, tags, issues, configurations, custom_feature, etc.
    
        Args:
            project_id: The project ID.
            cases: Array of test case objects (max 100).
        """
        if len(cases) > MAX_CASES_PER_REQUEST:
            raise ValueError(
                f"Too many cases: {len(cases)}. Max is {MAX_CASES_PER_REQUEST}. "
                "Use testmo_batch_create_cases for larger batches."
            )
        return await _request(
            "POST", f"/projects/{project_id}/cases", data={"cases": cases}
        )
  • Registration of testmo_create_cases as an MCP tool via the @mcp.tool() decorator. The 'mcp' instance is a FastMCP server defined in testmo/server.py.
    @mcp.tool()
  • Input schema: accepts project_id (int) and cases (list of dicts, max 100). Output is a dict[str, Any].
    async def testmo_create_cases(
        project_id: int,
        cases: list[dict[str, Any]],
    ) -> dict[str, Any]:
  • The _request helper function used by testmo_create_cases to make the actual HTTP POST 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()
  • Configuration constant MAX_CASES_PER_REQUEST = 100, used by testmo_create_cases to validate the maximum batch size.
    MAX_CASES_PER_REQUEST = 100
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It warns about silent rejection if required fields are missing and lists required fields and example values. However, it does not disclose what happens on success, error handling, or other behavioral traits beyond the input constraints.

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 concise with a brief opening line, a bullet list of required fields, and an Args section. It front-loads the core purpose and constraints. Minor structure improvements could be made (e.g., grouping), but it is efficient with no wasted words.

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 an output schema exists (so description need not cover return values), the description covers the essential aspects: purpose, batch limit, required fields with examples, and optional fields. It misses some details like the role of project_id but that is straightforward. Overall, it is sufficiently complete for a batch creation tool.

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

Parameters5/5

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

The input schema has 0% description coverage and minimal structure (cases as array of objects with additionalProperties true). The description adds critical semantics: it lists required fields (name, folder_id, custom_priority, custom_type, custom_creator) with example enums (e.g., priority IDs, type IDs), and notes optional fields. This fully compensates for the sparse schema.

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?

Clearly states 'Create multiple test cases in a batch (max 100 per call),' which is a specific verb+resource+constraint. However, there is a sibling tool 'testmo_batch_create_cases' with a similar name, and the description does not differentiate from it, so it loses a point for distinguishing clarity.

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 provides constraints like max 100 and required fields, implying usage for batch creation. But it does not explicitly state when to use this tool versus alternatives (e.g., testmo_create_case for single cases, or testmo_batch_create_cases). No guidance on when not to use.

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