Skip to main content
Glama
leorosignoli

JIRA Zephyr MCP Server

by leorosignoli

create_test_case

Create new test cases in JIRA Zephyr by specifying project, name, objectives, steps, and metadata for organized testing.

Instructions

Create a new test case in Zephyr

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectKeyYesJIRA project key
nameYesTest case name
objectiveNoTest case objective/description (optional)
preconditionNoTest preconditions (optional)
estimatedTimeNoEstimated execution time in minutes (optional)
priorityNoTest case priority (optional)
statusNoTest case status (optional)
folderIdNoFolder ID to organize test case (optional)
labelsNoTest case labels (optional)
componentIdNoComponent ID (optional)
customFieldsNoCustom fields as key-value pairs (optional)
testScriptNoTest script with steps (optional)

Implementation Reference

  • Main handler function that validates the input schema, calls the Zephyr client to create the test case, formats the response, and handles errors.
    export const createTestCase = async (input: CreateTestCaseInput) => {
      const validatedInput = createTestCaseSchema.parse(input);
      
      try {
        const testCase = await getZephyrClient().createTestCase({
          projectKey: validatedInput.projectKey,
          name: validatedInput.name,
          objective: validatedInput.objective,
          precondition: validatedInput.precondition,
          estimatedTime: validatedInput.estimatedTime,
          priority: validatedInput.priority,
          status: validatedInput.status,
          folderId: validatedInput.folderId,
          labels: validatedInput.labels,
          componentId: validatedInput.componentId,
          customFields: validatedInput.customFields,
          testScript: validatedInput.testScript,
        });
        
        return {
          success: true,
          data: {
            id: testCase.id,
            key: testCase.key,
            name: testCase.name,
            projectKey: testCase.project?.id,
            objective: testCase.objective,
            precondition: testCase.precondition,
            estimatedTime: testCase.estimatedTime,
            priority: testCase.priority?.id,
            status: testCase.status?.id,
            folder: testCase.folder?.id,
            labels: testCase.labels || [],
            component: testCase.component?.id,
            owner: testCase.owner?.accountId,
            createdOn: testCase.createdOn,
            links: {
              self: `https://api.zephyrscale.smartbear.com/v2/testcases/${testCase.key}`,
              issues: testCase.links?.issues?.length || 0,
            },
          },
        };
      } catch (error: any) {
        return {
          success: false,
          error: error.response?.data?.message || error.message,
        };
      }
    };
  • Zod schema defining the input structure and validation rules for create_test_case tool, used for parsing and type inference.
    export const createTestCaseSchema = z.object({
      projectKey: z.string().min(1, 'Project key is required'),
      name: z.string().min(1, 'Name is required'),
      objective: z.string().optional(),
      precondition: z.string().optional(),
      estimatedTime: z.number().min(0).optional(),
      priority: z.string().optional(),
      status: z.string().optional(),
      folderId: z.string().optional(),
      labels: z.array(z.string()).optional(),
      componentId: z.string().optional(),
      customFields: z.record(z.any()).optional(),
      testScript: z.object({
        type: z.enum(['STEP_BY_STEP', 'PLAIN_TEXT']),
        steps: z.array(z.object({
          index: z.number().min(1),
          description: z.string().min(1),
          testData: z.string().optional(),
          expectedResult: z.string().min(1),
        })).optional(),
        text: z.string().optional(),
      }).optional(),
    });
  • src/index.ts:184-226 (registration)
    Tool registration in the TOOLS array, defining name, description, and input schema for listTools endpoint.
      name: 'create_test_case',
      description: 'Create a new test case in Zephyr',
      inputSchema: {
        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'],
      },
    },
  • src/index.ts:437-447 (registration)
    Dispatch handler in the CallToolRequest switch statement that validates arguments and invokes the createTestCase handler.
    case 'create_test_case': {
      const validatedArgs = validateInput<CreateTestCaseInput>(createTestCaseSchema, args, 'create_test_case');
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(await createTestCase(validatedArgs), null, 2),
          },
        ],
      };
    }
  • ZephyrClient method that performs the actual API call to create the test case via POST /testcases.
    async createTestCase(data: {
      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;
      };
    }): Promise<ZephyrTestCase> {
      const payload: any = {
        projectKey: data.projectKey,
        name: data.name,
        objective: data.objective,
        precondition: data.precondition,
        estimatedTime: data.estimatedTime,
      };
    
      if (data.priority) {
        payload.priority = data.priority;
      }
    
      if (data.status) {
        payload.status = data.status;
      }
    
      if (data.folderId) {
        payload.folderId = data.folderId;
      }
    
      if (data.labels && data.labels.length > 0) {
        payload.labels = data.labels;
      }
    
      if (data.componentId) {
        payload.componentId = data.componentId;
      }
    
      if (data.customFields) {
        payload.customFields = data.customFields;
      }
    
      if (data.testScript) {
        payload.testScript = data.testScript;
      }
    
      const response = await this.client.post('/testcases', payload);
      return response.data;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It states this is a creation operation but doesn't mention required permissions, whether the operation is idempotent, what happens on failure, rate limits, or what the response looks like (especially important since there's no output schema). For a mutation tool with 12 parameters, this is a significant transparency gap.

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 extremely concise - a single sentence with no wasted words. It's front-loaded with the core purpose. However, for a tool with 12 parameters and complex nested objects, this brevity comes at the cost of completeness, preventing a perfect score.

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's complexity (12 parameters with nested objects), absence of annotations, and lack of output schema, the description is insufficiently complete. It doesn't explain the relationship between this tool and sibling tools, doesn't provide behavioral context for a mutation operation, and offers no guidance on error handling or response format. The description fails to compensate for the missing structured information.

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?

The schema description coverage is 100%, meaning all parameters are documented in the schema itself. The description adds no additional parameter information beyond what's already in the schema descriptions. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description, which applies here.

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 a new test case') and the target system ('in Zephyr'), providing a specific verb+resource combination. However, it doesn't differentiate this tool from its sibling 'create_multiple_test_cases' or explain when to use one versus the other, which prevents a perfect score.

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 guidance on when to use this tool versus alternatives like 'create_multiple_test_cases' for batch operations or 'create_test_cycle'/'create_test_plan' for related test management functions. There's no mention of prerequisites, dependencies, or typical use cases, leaving the agent with insufficient context for appropriate tool selection.

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