Skip to main content
Glama
leorosignoli

JIRA Zephyr MCP Server

by leorosignoli

create_multiple_test_cases

Create multiple test cases in Zephyr simultaneously to streamline test management and reduce manual entry time.

Instructions

Create multiple test cases in Zephyr at once

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
testCasesYesArray of test cases to create
continueOnErrorNoContinue creating remaining test cases if one fails (default: true)

Implementation Reference

  • The primary handler function for the 'create_multiple_test_cases' tool. It validates the input using the schema, calls the ZephyrClient to perform the creation, and formats the response.
    export const createMultipleTestCases = async (input: CreateMultipleTestCasesInput) => {
      const validatedInput = createMultipleTestCasesSchema.parse(input);
      
      try {
        const result = await getZephyrClient().createMultipleTestCases(
          validatedInput.testCases,
          validatedInput.continueOnError
        );
        
        return {
          success: true,
          data: {
            results: result.results.map(r => ({
              index: r.index,
              success: r.success,
              testCase: r.success ? {
                id: r.data?.id,
                key: r.data?.key,
                name: r.data?.name,
                projectKey: r.data?.project?.id,
                objective: r.data?.objective,
                precondition: r.data?.precondition,
                estimatedTime: r.data?.estimatedTime,
                priority: r.data?.priority?.id,
                status: r.data?.status?.id,
                folder: r.data?.folder?.id,
                labels: r.data?.labels || [],
                component: r.data?.component?.id,
                owner: r.data?.owner?.accountId,
                createdOn: r.data?.createdOn,
                links: {
                  self: r.data ? `https://api.zephyrscale.smartbear.com/v2/testcases/${r.data.key}` : undefined,
                },
              } : undefined,
              error: r.error,
            })),
            summary: result.summary,
          },
        };
      } catch (error: any) {
        return {
          success: false,
          error: error.response?.data?.message || error.message,
        };
      }
    };
  • Zod schema for validating the input to the create_multiple_test_cases tool, along with the inferred TypeScript type.
    export const createMultipleTestCasesSchema = z.object({
      testCases: z.array(createTestCaseSchema).min(1, 'At least one test case is required'),
      continueOnError: z.boolean().default(true),
    });
    
    export type CreateTestPlanInput = z.infer<typeof createTestPlanSchema>;
    export type CreateTestCycleInput = z.infer<typeof createTestCycleSchema>;
    export type ReadJiraIssueInput = z.infer<typeof readJiraIssueSchema>;
    export type ListTestPlansInput = z.infer<typeof listTestPlansSchema>;
    export type ListTestCyclesInput = z.infer<typeof listTestCyclesSchema>;
    export type ExecuteTestInput = z.infer<typeof executeTestSchema>;
    export type GetTestExecutionStatusInput = z.infer<typeof getTestExecutionStatusSchema>;
    export type LinkTestsToIssuesInput = z.infer<typeof linkTestsToIssuesSchema>;
    export type GenerateTestReportInput = z.infer<typeof generateTestReportSchema>;
    export type CreateTestCaseInput = z.infer<typeof createTestCaseSchema>;
    export type SearchTestCasesInput = z.infer<typeof searchTestCasesSchema>;
    export type GetTestCaseInput = z.infer<typeof getTestCaseSchema>;
    export type CreateMultipleTestCasesInput = z.infer<typeof createMultipleTestCasesSchema>;
  • src/index.ts:473-483 (registration)
    Registration and dispatch logic in the main server handler switch statement. Validates arguments again and calls the tool handler.
    case 'create_multiple_test_cases': {
      const validatedArgs = validateInput<CreateMultipleTestCasesInput>(createMultipleTestCasesSchema, args, 'create_multiple_test_cases');
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(await createMultipleTestCases(validatedArgs), null, 2),
          },
        ],
      };
    }
  • src/index.ts:252-305 (registration)
    Tool registration in the TOOLS array, defining name, description, and input schema for the MCP server.
      name: 'create_multiple_test_cases',
      description: 'Create multiple test cases in Zephyr at once',
      inputSchema: {
        type: 'object',
        properties: {
          testCases: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                projectKey: { type: 'string', description: 'JIRA project key' },
                name: { type: 'string', description: 'Test case name' },
                objective: { type: 'string', description: 'Test case objective/description (optional)' },
                precondition: { type: 'string', description: 'Test preconditions (optional)' },
                estimatedTime: { type: 'number', description: 'Estimated execution time in minutes (optional)' },
                priority: { type: 'string', description: 'Test case priority (optional)' },
                status: { type: 'string', description: 'Test case status (optional)' },
                folderId: { type: 'string', description: 'Folder ID to organize test case (optional)' },
                labels: { type: 'array', items: { type: 'string' }, description: 'Test case labels (optional)' },
                componentId: { type: 'string', description: 'Component ID (optional)' },
                customFields: { type: 'object', description: 'Custom fields as key-value pairs (optional)' },
                testScript: {
                  type: 'object',
                  description: 'Test script with steps (optional)',
                  properties: {
                    type: { type: 'string', enum: ['STEP_BY_STEP', 'PLAIN_TEXT'], description: 'Script type' },
                    steps: {
                      type: 'array',
                      items: {
                        type: 'object',
                        properties: {
                          index: { type: 'number', description: 'Step number' },
                          description: { type: 'string', description: 'Step description' },
                          testData: { type: 'string', description: 'Test data (optional)' },
                          expectedResult: { type: 'string', description: 'Expected result' },
                        },
                        required: ['index', 'description', 'expectedResult'],
                      },
                      description: 'Test steps (for STEP_BY_STEP type)',
                    },
                    text: { type: 'string', description: 'Plain text script (for PLAIN_TEXT type)' },
                  },
                  required: ['type'],
                },
              },
              required: ['projectKey', 'name'],
            },
            description: 'Array of test cases to create',
          },
          continueOnError: { type: 'boolean', description: 'Continue creating remaining test cases if one fails (default: true)', default: true },
        },
        required: ['testCases'],
      },
    },
  • Supporting method in ZephyrClient that implements the batch creation logic by looping over test cases, calling createTestCase for each, and handling individual errors.
    async createMultipleTestCases(testCases: Array<{
      projectKey: string;
      name: string;
      objective?: string;
      precondition?: string;
      estimatedTime?: number;
      priority?: string;
      status?: string;
      folderId?: string;
      labels?: string[];
      componentId?: string;
      customFields?: Record<string, any>;
      testScript?: {
        type: 'STEP_BY_STEP' | 'PLAIN_TEXT';
        steps?: Array<{
          index: number;
          description: string;
          testData?: string;
          expectedResult: string;
        }>;
        text?: string;
      };
    }>, continueOnError = true): Promise<{
      results: Array<{
        index: number;
        success: boolean;
        data?: ZephyrTestCase;
        error?: string;
      }>;
      summary: {
        total: number;
        successful: number;
        failed: number;
      };
    }> {
      const results = [];
      let successful = 0;
      let failed = 0;
    
      for (let i = 0; i < testCases.length; i++) {
        try {
          const testCase = await this.createTestCase(testCases[i]);
          results.push({
            index: i,
            success: true,
            data: testCase,
          });
          successful++;
        } catch (error: any) {
          const errorMessage = error.response?.data?.message || error.message;
          results.push({
            index: i,
            success: false,
            error: errorMessage,
          });
          failed++;
    
          if (!continueOnError) {
            break;
          }
        }
      }
    
      return {
        results,
        summary: {
          total: testCases.length,
          successful,
          failed,
        },
      };
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It doesn't disclose whether this is a write operation (implied but not stated), what permissions are required, how errors are handled, rate limits, or what the response format looks like. 'Create multiple... at once' suggests batch processing but lacks operational details.

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 with zero wasted words. It's appropriately sized for a tool with comprehensive schema documentation and gets straight to the point without unnecessary elaboration.

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?

For a batch creation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens on partial success (though the 'continueOnError' parameter hints at this), what the return value contains, error conditions, or system limitations. The schema does heavy lifting, but the description should provide more operational context.

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?

With 100% schema description coverage, the baseline is 3. The description adds no parameter-specific information beyond what's already documented in the comprehensive schema, which details all fields, requirements, and optional parameters including the complex testScript object structure.

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 ('create multiple test cases') and target system ('in Zephyr'), with the 'at once' phrase distinguishing it from the sibling 'create_test_case' tool. However, it doesn't explicitly mention the batch nature or contrast with the single-case sibling.

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 about when to use this tool versus the 'create_test_case' sibling, nor any prerequisites, error handling considerations, or system constraints. The description merely restates the tool's name without contextual usage information.

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/leorosignoli/jira-zephyr-mcp'

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