Skip to main content
Glama
Atakan-Emre

QA-MCP: Test Standardization & Orchestration Server

by Atakan-Emre

testcase.normalize

Converts test cases from various formats (markdown, gherkin, json, plain text) into standardized QA-MCP format for consistent testing workflows.

Instructions

Farklı formatlardaki test case'leri QA-MCP standardına çevirir

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
input_dataYesNormalize edilecek test case (markdown, gherkin, json veya plain text)
source_formatNoKaynak format (default: auto)

Implementation Reference

  • Core handler function implementing the testcase.normalize tool logic. Detects input format automatically if needed, parses the input_data accordingly (gherkin, markdown, json, plain), fills missing fields, normalizes values, and returns the standardized test case with metadata.
    def normalize_testcase(
        input_data: str | dict,
        source_format: str = "auto",
    ) -> dict:
        """
        Normalize a test case from various formats to QA-MCP standard.
    
        Args:
            input_data: Test case in string (markdown/gherkin) or dict format
            source_format: Source format - 'auto', 'markdown', 'gherkin', 'json', 'plain'
    
        Returns:
            Dictionary containing:
            - testcase: Normalized test case in standard format
            - source_format_detected: Detected source format
            - transformations: List of transformations applied
            - warnings: Any warnings during normalization
        """
        transformations = []
        warnings = []
    
        # Detect format if auto
        if source_format == "auto":
            source_format = _detect_format(input_data)
            transformations.append(f"Format otomatik tespit edildi: {source_format}")
    
        # Parse based on format
        try:
            if source_format == "gherkin":
                testcase, parse_warnings = _parse_gherkin(input_data)
            elif source_format == "markdown":
                testcase, parse_warnings = _parse_markdown(input_data)
            elif source_format == "json" or isinstance(input_data, dict):
                testcase, parse_warnings = _parse_json(input_data)
            else:  # plain text
                testcase, parse_warnings = _parse_plain_text(input_data)
    
            warnings.extend(parse_warnings)
    
        except Exception as e:
            return {
                "testcase": None,
                "source_format_detected": source_format,
                "transformations": transformations,
                "warnings": [f"Parse hatası: {str(e)}"],
                "error": str(e),
            }
    
        # Validate and fill missing fields
        testcase, fill_warnings = _fill_missing_fields(testcase)
        warnings.extend(fill_warnings)
        transformations.append("Eksik alanlar varsayılan değerlerle dolduruldu")
    
        # Normalize values
        testcase = _normalize_values(testcase)
        transformations.append("Değerler standartlaştırıldı")
    
        return {
            "testcase": testcase.model_dump(),
            "source_format_detected": source_format,
            "transformations": transformations,
            "warnings": warnings,
        }
  • Registration of the 'testcase.normalize' tool in the MCP server, including name, description, and input schema.
    Tool(
        name="testcase.normalize",
        description="Farklı formatlardaki test case'leri QA-MCP standardına çevirir",
        inputSchema={
            "type": "object",
            "properties": {
                "input_data": {
                    "type": ["string", "object"],
                    "description": "Normalize edilecek test case (markdown, gherkin, json veya plain text)",
                },
                "source_format": {
                    "type": "string",
                    "enum": ["auto", "markdown", "gherkin", "json", "plain"],
                    "description": "Kaynak format (default: auto)",
                },
            },
            "required": ["input_data"],
        },
  • Input schema defining parameters for testcase.normalize: input_data (string or object, required) and optional source_format.
    inputSchema={
        "type": "object",
        "properties": {
            "input_data": {
                "type": ["string", "object"],
                "description": "Normalize edilecek test case (markdown, gherkin, json veya plain text)",
            },
            "source_format": {
                "type": "string",
                "enum": ["auto", "markdown", "gherkin", "json", "plain"],
                "description": "Kaynak format (default: auto)",
            },
        },
        "required": ["input_data"],
  • Dispatch handler in server.call_tool that invokes the normalize_testcase function with parsed arguments and logs audit.
    elif name == "testcase.normalize":
        result = normalize_testcase(
            input_data=arguments["input_data"],
            source_format=arguments.get("source_format", "auto"),
        )
        audit_log(
            name,
            arguments,
            f"Normalized from {result.get('source_format_detected', 'unknown')}",
        )
Behavior2/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 states the tool converts test cases to a standard format, implying a transformation process, but lacks details on behavioral traits such as error handling, performance considerations, or what the output looks like. This is a significant gap for a tool with no annotation coverage.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to understand quickly. Every part of the sentence contributes to clarifying the tool's function.

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?

Given the tool has no annotations and no output schema, the description is incomplete. It doesn't explain what the normalized output entails, potential side effects, or usage context. For a transformation tool with 2 parameters, more details on behavior and output are needed to be fully helpful to an AI agent.

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?

Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description adds minimal value by implying the tool handles multiple input formats, but it doesn't provide additional context beyond what's in the schema, such as examples or format-specific nuances. Baseline 3 is appropriate when the schema does the heavy lifting.

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 the action ('normalize') and target resource ('test cases'), specifying conversion to a specific standard ('QA-MCP standard'). However, it doesn't explicitly differentiate from sibling tools like 'testcase.lint' or 'testcase.generate', which might also process test cases. The purpose is clear but lacks sibling distinction.

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 mentions converting from different formats, but it doesn't specify scenarios, prerequisites, or exclusions. For example, it doesn't clarify if this should be used for validation, standardization, or as a preprocessing step compared to other test case tools.

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/Atakan-Emre/McpTestGenerator'

If you have feedback or need assistance with the MCP directory API, please join our Discord server