Skip to main content
Glama

testmo_create_case

Create a test case in Testmo with required fields (name, folder, priority, type, creator) and optional configs like template, state, tags, issues, and configurations.

Instructions

Create a single test case in Testmo.

Required fields in case_data:

  • 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 fields:

  • template_id: 4=BDD/Gherkin (default), 1=Steps Table

  • state_id: 1=Draft, 2=Review, 3=Approved, 4=Active, 5=Deprecated

  • tags: Array of strings

  • issues: Array of issue objects for linking

  • configurations: Platform IDs array (4=Admin Portal, 5=iOS & Android, 10=Insti Web)

  • custom_milestone_id, custom_references, custom_feature, etc.

Args: project_id: The project ID. case_data: Test case data object with required fields.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
case_dataYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `testmo_create_case` async function decorated with @mcp.tool(). Creates a single test case by sending a POST request to /projects/{project_id}/cases with the case_data wrapped in a 'cases' array. Returns the first created case from the result.
    @mcp.tool()
    async def testmo_create_case(project_id: int, case_data: dict[str, Any]) -> dict[str, Any]:
        """Create a single test case in Testmo.
    
        Required fields in case_data:
        - 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 fields:
        - template_id: 4=BDD/Gherkin (default), 1=Steps Table
        - state_id: 1=Draft, 2=Review, 3=Approved, 4=Active, 5=Deprecated
        - tags: Array of strings
        - issues: Array of issue objects for linking
        - configurations: Platform IDs array (4=Admin Portal, 5=iOS & Android, 10=Insti Web)
        - custom_milestone_id, custom_references, custom_feature, etc.
    
        Args:
            project_id: The project ID.
            case_data: Test case data object with required fields.
        """
        result = await _request(
            "POST", f"/projects/{project_id}/cases", data={"cases": [case_data]}
        )
        cases = result.get("result", [])
        return cases[0] if cases else result
  • Imports the `mcp` FastMCP server instance from `..server` and the `_request` client helper. All tools in this module are registered via `@mcp.tool()` decorator.
    import asyncio
    from typing import Any
    
    from ..server import mcp
    from ..client import _request
    from ..config import RATE_LIMIT_DELAY, MAX_CASES_PER_REQUEST
  • testmo/server.py:6-6 (registration)
    The FastMCP instance `mcp` is created here as `FastMCP('testmo-mcp')`. Used by all tool modules to register tools via the @mcp.tool() decorator.
    mcp = FastMCP("testmo-mcp")
  • The `_request` async helper function used by testmo_create_case to make HTTP requests to the Testmo API. Handles authentication, error handling, and response parsing.
    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()
  • FIELD_MAPPINGS dictionary containing the numeric IDs for custom fields (priority, type, creator, configurations, template_id, state_id, etc.) referenced in the testmo_create_case docstring for constructing case_data.
    FIELD_MAPPINGS: dict[str, Any] = {
        "custom_priority": {
            "Critical": 52,
            "High": 1,
            "Medium": 2,
            "Low": 3,
        },
        "custom_type": {
            "Performance": 57,
            "Functional": 59,
            "Usability": 53,
            "Acceptance": 64,
            "Compatibility": 61,
            "Security": 55,
            "Other": 58,
        },
        "custom_creator": {
            "AI Generated": 51,
        },
        "configurations": {
            "Admin Portal": 4,
            "IOS & Android": 5,
            "Insti Web": 10,
        },
        "template_id": {
            "BDD/Gherkin": 4,
            "Steps Table": 1,
        },
        "state_id": {
            "Draft": 1,
            "Review": 2,
            "Approved": 3,
            "Active": 4,
            "Deprecated": 5,
        },
        "status_id": {
            "Incomplete": 1,
            "Complete": 2,
        },
        "result_status_id": {
            "Untested": 1,
            "Passed": 2,
            "Failed": 3,
            "Retest": 4,
            "Blocked": 5,
            "Skipped": 6,
        },
        "automation_run_status": {
            "Success": 2,
            "Failure": 3,
            "Running": 4,
        },
        "custom_issues_tags_and_configurations_added": {
            "Yes": 66,
            "No": 67,
        },
        "tags": {
            "domain": [
                "assets-crypto",
                "assets-noncrypto",
                "services-usergrowth",
                "services-platform",
                "wealth-hnwi",
            ],
            "tier-type": ["ui-verification", "e2e", "negative"],
            "scope": ["regression", "smoke", "sanity"],
            "risk": ["risk-financial", "risk-security", "risk-compliance"],
        },
        "defaults": {
            "template_id": 4,
            "state_id": 1,
            "status_id": 2,
            "custom_priority": 2,
            "custom_type": 59,
            "custom_creator": 51,
            "custom_issues_tags_and_configurations_added": 66,
        },
    }
Behavior2/5

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

No annotations provided, so description must disclose behavioral traits. It only states 'Create' without detailing side effects, permissions, rate limits, or error handling. Minimal behavioral disclosure.

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?

Well-structured with front-loaded purpose and organized sections. Slightly verbose but each sentence adds value.

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?

Covers input fields thoroughly with example values. Output schema exists so return values not needed. Missing error handling context, but adequate for 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?

Schema coverage is 0%, but description compensates with extensive field details: required fields with example IDs, optional fields, and types. Adds significant meaning beyond the object schema.

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?

Description clearly states 'Create a single test case in Testmo', specifying verb, resource, and scope. It effectively distinguishes from siblings like testmo_batch_create_cases and testmo_update_case.

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

Usage Guidelines4/5

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

The description implies use for single case creation, contrasting with batch alternatives. However, it lacks explicit guidance on when not to use or prerequisites.

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