Skip to main content
Glama

append_test_steps

Add new test steps to existing test cases in Zephyr Scale Cloud for comprehensive test management.

Instructions

Append new test steps to a test case (max 100 steps per request)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
testCaseKeyYesTest case key to append steps to (format: [A-Z]+-T[0-9]+)
stepsYesArray of test steps to append (max 100 steps)

Implementation Reference

  • Main MCP tool handler: validates testCaseKey and steps array, formats steps into API payload, calls ZephyrClient.appendTestSteps, handles errors, returns MCP-formatted response.
    async function appendTestSteps(args) {
      try {
        const { testCaseKey, steps } = args;
    
        if (!testCaseKey) {
          throw new Error('testCaseKey is required');
        }
    
        if (!config.testCaseKeyPattern.test(testCaseKey)) {
          throw new Error('Invalid testCaseKey format. Must match pattern: [A-Z]+-T[0-9]+');
        }
    
        if (!steps || !Array.isArray(steps)) {
          throw new Error('steps must be provided as an array');
        }
    
        if (steps.length === 0) {
          throw new Error('At least one step must be provided');
        }
    
        if (steps.length > 100) {
          throw new Error('Maximum 100 steps can be added per request');
        }
    
        // Validate each step and format according to TestStepsInput schema
        const formattedSteps = steps.map((step, index) => {
          if (!step.description) {
            throw new Error(`Step ${index + 1} is missing required field: description`);
          }
    
          const formattedStep = {
            inline: {
              description: step.description
            }
          };
    
          // Optional fields
          if (step.expectedResult !== undefined) {
            formattedStep.inline.expectedResult = step.expectedResult;
          }
    
          if (step.data !== undefined) {
            formattedStep.inline.testData = step.data;
          }
    
          if (step.attachments !== undefined) {
            formattedStep.inline.attachments = step.attachments;
          }
    
          return formattedStep;
        });
    
        // Format according to TestStepsInput schema
        const payload = {
          mode: 'OVERWRITE',
          items: formattedSteps
        };
    
        const result = await client.appendTestSteps(testCaseKey, payload);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                message: `Successfully added ${steps.length} test steps to ${testCaseKey}`,
                testCaseKey,
                stepsAdded: steps.length,
                result,
                warning: 'If this test case had a test script, it has been implicitly removed'
              }, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: formatError(error, `appending test steps to ${args.testCaseKey}`)
            }
          ],
          isError: true
        };
      }
    }
  • Input schema for the append_test_steps tool, defining validation for testCaseKey (with pattern) and steps array (1-100 items, each with required description).
    inputSchema: {
      type: 'object',
      properties: {
        testCaseKey: {
          type: 'string',
          description: 'Test case key to append steps to (format: [A-Z]+-T[0-9]+)',
          pattern: config.testCaseKeyPattern.source
        },
        steps: {
          type: 'array',
          description: 'Array of test steps to append (max 100 steps)',
          items: {
            type: 'object',
            properties: {
              description: {
                type: 'string',
                description: 'Step description (required)',
                minLength: 1
              },
              expectedResult: {
                type: 'string',
                description: 'Expected result for this step'
              },
              data: {
                type: 'string',
                description: 'Test data for this step'
              },
              attachments: {
                type: 'array',
                description: 'Array of attachment objects',
                items: {
                  type: 'object'
                }
              }
            },
            required: ['description']
          },
          minItems: 1,
          maxItems: 100
        }
      },
      required: ['testCaseKey', 'steps']
    },
  • Tool registration object in testStepsTools array, including name, description, inputSchema, and handler reference.
    {
      name: 'append_test_steps',
      description: 'Append new test steps to a test case (max 100 steps per request)',
      inputSchema: {
        type: 'object',
        properties: {
          testCaseKey: {
            type: 'string',
            description: 'Test case key to append steps to (format: [A-Z]+-T[0-9]+)',
            pattern: config.testCaseKeyPattern.source
          },
          steps: {
            type: 'array',
            description: 'Array of test steps to append (max 100 steps)',
            items: {
              type: 'object',
              properties: {
                description: {
                  type: 'string',
                  description: 'Step description (required)',
                  minLength: 1
                },
                expectedResult: {
                  type: 'string',
                  description: 'Expected result for this step'
                },
                data: {
                  type: 'string',
                  description: 'Test data for this step'
                },
                attachments: {
                  type: 'array',
                  description: 'Array of attachment objects',
                  items: {
                    type: 'object'
                  }
                }
              },
              required: ['description']
            },
            minItems: 1,
            maxItems: 100
          }
        },
        required: ['testCaseKey', 'steps']
      },
      handler: appendTestSteps
    }
  • ZephyrClient helper method that performs the actual API POST request to append test steps.
    async appendTestSteps(testCaseKey, stepsData) {
      return this.request('POST', `/testcases/${testCaseKey}/teststeps`, stepsData);
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the 'max 100 steps per request' constraint, which is useful. However, it doesn't address critical behaviors: whether this is idempotent, what permissions are required, how it handles duplicate steps, error conditions (e.g., invalid testCaseKey), or what the response looks like (success/failure indicators). For a mutation tool with zero annotation coverage, this leaves significant gaps.

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 waste. It's front-loaded with the core purpose and includes a key constraint. Every word earns its place, making it easy for an agent to parse quickly.

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 this is a mutation tool with no annotations and no output schema, the description is incomplete. It lacks information on behavioral traits (e.g., idempotency, error handling), response format, and usage context relative to siblings. While concise, it doesn't provide enough context for reliable agent invocation in complex scenarios.

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 fully documents both parameters (testCaseKey format, steps structure with nested properties). The description adds minimal value beyond the schema—it reiterates the 'max 100 steps' limit already in the schema's maxItems, but doesn't provide additional context like example usage or edge cases. 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 ('Append new test steps') and resource ('to a test case'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'update_test_case' or 'create_test_case' that might also modify test cases, leaving some ambiguity about when this specific append operation is preferred.

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. It doesn't mention prerequisites (e.g., test case must exist), exclusions (e.g., cannot append to archived cases), or comparisons to sibling tools like 'update_test_case' or 'get_test_steps'. The agent must infer usage from the name alone.

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

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