Skip to main content
Glama

create-test-case

Define a new test case in a QA Studio project by specifying title, description, priority, type, automation status, and step instructions. Simplify test case creation using natural language.

Instructions

Create a new test case in a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesThe project ID
titleYesTitle of the test case
descriptionNoDetailed description of the test case
priorityNoPriority level
typeNoTest type
automationStatusNoAutomation status
stepsNoTest steps

Implementation Reference

  • src/index.ts:261-331 (registration)
    Registration of the 'create-test-case' tool via server.registerTool with name 'create-test-case'
    // Register tool: create-test-case
    server.registerTool(
      'create-test-case',
      {
        description: 'Create a new test case in a project',
        inputSchema: {
          projectId: z.string().describe('The project ID'),
          title: z.string().describe('Title of the test case'),
          description: z.string().optional().describe('Detailed description of the test case'),
          priority: z.enum(['CRITICAL', 'HIGH', 'MEDIUM', 'LOW']).optional().describe('Priority level'),
          type: z
            .enum([
              'FUNCTIONAL',
              'REGRESSION',
              'SMOKE',
              'INTEGRATION',
              'PERFORMANCE',
              'SECURITY',
              'UI',
              'API',
              'UNIT',
              'E2E'
            ])
            .optional()
            .describe('Test type'),
          automationStatus: z
            .enum(['AUTOMATED', 'NOT_AUTOMATED', 'CANDIDATE'])
            .optional()
            .describe('Automation status'),
          steps: z
            .array(
              z.object({
                order: z.number(),
                action: z.string(),
                expectedResult: z.string().optional()
              })
            )
            .optional()
            .describe('Test steps')
        }
      },
      async (args) => {
        try {
          const { projectId, ...testCaseData } = args;
    
          const data = await apiRequest(`/projects/${projectId}/test-cases`, {
            method: 'POST',
            body: JSON.stringify(testCaseData)
          });
    
          return {
            content: [
              {
                type: 'text' as const,
                text: `✅ Test case created successfully!\n\nID: ${data.id}\nTitle: ${data.title}\nPriority: ${data.priority}\nType: ${data.type}`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: 'text' as const,
                text: `Error: ${error instanceof Error ? error.message : String(error)}`
              }
            ],
            isError: true
          };
        }
      }
    );
  • Input schema definition using Zod: requires projectId (string), title (string), with optional description, priority (enum CRITICAL/HIGH/MEDIUM/LOW), type (enum of test types), automationStatus (enum), and steps (array of {order, action, expectedResult})
    {
      description: 'Create a new test case in a project',
      inputSchema: {
        projectId: z.string().describe('The project ID'),
        title: z.string().describe('Title of the test case'),
        description: z.string().optional().describe('Detailed description of the test case'),
        priority: z.enum(['CRITICAL', 'HIGH', 'MEDIUM', 'LOW']).optional().describe('Priority level'),
        type: z
          .enum([
            'FUNCTIONAL',
            'REGRESSION',
            'SMOKE',
            'INTEGRATION',
            'PERFORMANCE',
            'SECURITY',
            'UI',
            'API',
            'UNIT',
            'E2E'
          ])
          .optional()
          .describe('Test type'),
        automationStatus: z
          .enum(['AUTOMATED', 'NOT_AUTOMATED', 'CANDIDATE'])
          .optional()
          .describe('Automation status'),
        steps: z
          .array(
            z.object({
              order: z.number(),
              action: z.string(),
              expectedResult: z.string().optional()
            })
          )
          .optional()
          .describe('Test steps')
      }
  • Handler function that destructures projectId from args, sends POST to /projects/{projectId}/test-cases API with remaining test case data, and returns success/error response
      async (args) => {
        try {
          const { projectId, ...testCaseData } = args;
    
          const data = await apiRequest(`/projects/${projectId}/test-cases`, {
            method: 'POST',
            body: JSON.stringify(testCaseData)
          });
    
          return {
            content: [
              {
                type: 'text' as const,
                text: `✅ Test case created successfully!\n\nID: ${data.id}\nTitle: ${data.title}\nPriority: ${data.priority}\nType: ${data.type}`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: 'text' as const,
                text: `Error: ${error instanceof Error ? error.message : String(error)}`
              }
            ],
            isError: true
          };
        }
      }
    );
  • Helper function apiRequest that makes authenticated API calls using fetch with X-API-Key header and JSON parsing
    async function apiRequest(endpoint: string, options: RequestInit = {}): Promise<any> {
      const url = `${API_URL}${endpoint}`;
      const response = await fetch(url, {
        ...options,
        headers: {
          'Content-Type': 'application/json',
          'X-API-Key': API_KEY,
          ...options.headers
        }
      });
    
      if (!response.ok) {
        const error = await response.text();
        throw new Error(`API Error (${response.status}): ${error}`);
      }
    
      return response.json();
    }
Behavior2/5

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

No annotations provided, and the description fails to disclose behavioral traits such as idempotency, side effects, permission requirements, or error handling. A mutation tool needs more context.

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?

A single concise sentence with no unnecessary words or repetition. It efficiently conveys the core purpose.

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 7 parameters (including enums and nested arrays) and no output schema, the description does not explain return values, error conditions, or the meaning of the steps array. Incomplete for the complexity.

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 coverage is 100% with descriptions for all 7 parameters. The description adds no additional meaning beyond what the schema already provides, so baseline score applies.

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 action (Create), resource (test case), and context (in a project), which distinctly separates it from sibling tools like create-test-run.

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 on when to use this tool versus alternatives, no prerequisites mentioned (e.g., project must exist), and no explicit when-not or exclusion criteria.

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/QAStudio-Dev/mcp-server'

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