Skip to main content
Glama

testmo_search_cases

Search for test cases in a project using filters like query, folder, tags, and state to locate specific cases.

Instructions

Search for test cases with filters (query, folder, tags, state).

Args: project_id: The project ID. query: Search query (searches name and description). folder_id: Filter by folder ID. tags: Filter by tags. state_id: Filter by state (1=Draft, 2=Review, 3=Approved, 4=Active, 5=Deprecated). page: Page number (default: 1). per_page: Results per page (default: 100). Valid: 25, 50, 100.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
queryNo
folder_idNo
tagsNo
state_idNo
pageNo
per_pageNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler for the testmo_search_cases tool. It accepts optional filters (query, folder_id, tags, state_id) and pagination params, builds a query param dict, and delegates to the shared _request helper to call the Testmo API GET /projects/{id}/cases.
    @mcp.tool()
    async def testmo_search_cases(
        project_id: int,
        query: str | None = None,
        folder_id: int | None = None,
        tags: list[str] | None = None,
        state_id: int | None = None,
        page: int = 1,
        per_page: int = 100,
    ) -> dict[str, Any]:
        """Search for test cases with filters (query, folder, tags, state).
    
        Args:
            project_id: The project ID.
            query: Search query (searches name and description).
            folder_id: Filter by folder ID.
            tags: Filter by tags.
            state_id: Filter by state (1=Draft, 2=Review, 3=Approved, 4=Active, 5=Deprecated).
            page: Page number (default: 1).
            per_page: Results per page (default: 100). Valid: 25, 50, 100.
        """
        params: dict[str, Any] = {"page": page, "per_page": per_page}
        if query:
            params["query"] = query
        if folder_id is not None:
            params["folder_id"] = folder_id
        if tags:
            params["tags"] = ",".join(tags)
        if state_id is not None:
            params["state_id"] = state_id
        return await _request("GET", f"/projects/{project_id}/cases", params=params)
  • Reusable HTTP request helper used by testmo_search_cases to make the actual API call to Testmo, handling auth, errors, 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()
  • The @mcp.tool() decorator registers testmo_search_cases as an MCP tool on the FastMCP server instance.
    @mcp.tool()
Behavior3/5

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

No annotations are provided, so the description bears full responsibility. It discloses valid values for per_page (25, 50, 100) and state_id mapping (Draft=1, etc.), which aids correct invocation. However, it does not mention behavioral traits like pagination behavior beyond defaults, idempotency, rate limits, or authentication requirements. The read-only nature is implicit but not stated.

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 relatively concise with a single sentence purpose and a clear parameter list. It is front-loaded with the purpose. Minor redundancy: the 'Args:' section repeats parameter names that are already present in the input schema, but this aids readability. Could be slightly tighter by removing 'Args:' if schema is self-documenting.

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 tool's complexity (7 parameters, output schema exists), the description covers parameter explanations well. However, it lacks contextual completeness in differentiating from sibling tools (e.g., testmo_search_cases_recursive) and does not mention pagination behavior or result ordering. The presence of output schema mitigates the need to describe return values, but usage context remains incomplete.

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?

Input schema has 0% parameter descriptions, making the description essential. It adds meaning for each parameter: query 'searches name and description', folder_id filters by folder, tags as array, state_id with explicit mapping, and per_page valid values. This compensates for the schema's lack of descriptions, though formatting could be improved (e.g., inline with 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?

The description clearly states the tool's purpose: 'Search for test cases with filters.' It specifies the key filter parameters (query, folder, tags, state), distinguishing it from sibling tools like testmo_get_all_cases (unfiltered) and testmo_list_cases (basic listing). The verb 'search' correctly indicates filtering behavior.

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?

The description provides no explicit guidance on when to use this tool versus alternatives (e.g., testmo_search_cases_recursive for hierarchical search, testmo_get_all_cases for all cases without filters). Usage context is only implied through parameter list; no when-not or conditional usage advice is given.

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