Skip to main content
Glama

update_test_case

Modify existing test cases in Zephyr Scale Cloud by updating details like name, description, objectives, and labels to maintain accurate test documentation.

Instructions

Update an existing test case

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
testCaseKeyYesTest case key to update (format: [A-Z]+-T[0-9]+)
nameNoUpdated name of the test case
descriptionNoUpdated description of the test case
folderIdNoUpdated folder ID
componentNoUpdated component ID
labelsNoUpdated labels (single string or array of strings)
objectiveNoUpdated test objective
preconditionNoUpdated test precondition
estimatedTimeNoUpdated estimated time in minutes (will be converted to milliseconds)

Implementation Reference

  • The core handler function that executes the 'update_test_case' tool. It destructures args, validates testCaseKey, fetches the current test case to preserve unchanged fields, builds the update payload, calls the ZephyrClient.updateTestCase method, and formats the success or error response in MCP format.
    async function updateTestCase(args) {
      try {
        const {
          testCaseKey,
          name,
          description,
          folderId,
          component,
          labels,
          objective,
          precondition,
          estimatedTime
        } = 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]+');
        }
    
        const currentTestCase = await client.getTestCase(testCaseKey);
        const testCaseData = {
          id: currentTestCase.id,
          key: testCaseKey,
          name: name !== undefined ? name : currentTestCase.name,
          project: {
            id: currentTestCase.project.id
          },
          status: {
            id: currentTestCase.status.id
          },
          priority: {
            id: currentTestCase.priority.id
          },
          folder: {
            id: folderId !== undefined ? folderId : currentTestCase.folder.id
          },
          objective: objective !== undefined ? objective : currentTestCase.objective,
          precondition: precondition !== undefined ? precondition : currentTestCase.precondition,
          estimatedTime: estimatedTime !== undefined
            ? estimatedTime * 60000 // Convert minutes to milliseconds
            : currentTestCase.estimatedTime,
          labels: labels !== undefined
            ? (Array.isArray(labels) ? labels : [labels])
            : currentTestCase.labels || [],
          description: description !== undefined ? description : currentTestCase.description,
          component: component !== undefined ? component : currentTestCase.component,
          owner: currentTestCase.owner,
          customFields: currentTestCase.customFields || {}
        };
        
        const result = await client.updateTestCase(testCaseKey, testCaseData);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                message: 'Test case updated successfully',
                testCase: result
              }, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: formatError(error, `updating test case ${args.testCaseKey}`)
            }
          ],
          isError: true
        };
      }
    }
  • The input schema defining the parameters for the 'update_test_case' tool. testCaseKey is required with pattern validation; other fields like name, description, etc., are optional with type constraints.
    inputSchema: {
      type: 'object',
      properties: {
        testCaseKey: {
          type: 'string',
          description: 'Test case key to update (format: [A-Z]+-T[0-9]+)',
          pattern: config.testCaseKeyPattern.source
        },
        name: {
          type: 'string',
          description: 'Updated name of the test case',
          minLength: 1,
          maxLength: 255
        },
        description: {
          type: 'string',
          description: 'Updated description of the test case'
        },
        folderId: {
          type: 'integer',
          description: 'Updated folder ID',
          minimum: 1
        },
        component: {
          type: 'integer',
          description: 'Updated component ID',
          minimum: 1
        },
        labels: {
          oneOf: [
            { type: 'string' },
            { type: 'array', items: { type: 'string' } }
          ],
          description: 'Updated labels (single string or array of strings)'
        },
        objective: {
          type: 'string',
          description: 'Updated test objective'
        },
        precondition: {
          type: 'string',
          description: 'Updated test precondition'
        },
        estimatedTime: {
          type: 'integer',
          description: 'Updated estimated time in minutes (will be converted to milliseconds)',
          minimum: 0
        }
      },
      required: ['testCaseKey']
    },
  • The tool registration object within the testCaseTools export array. Specifies the name 'update_test_case', description, inputSchema, and references the handler function.
    {
      name: 'update_test_case',
      description: 'Update an existing test case',
      inputSchema: {
        type: 'object',
        properties: {
          testCaseKey: {
            type: 'string',
            description: 'Test case key to update (format: [A-Z]+-T[0-9]+)',
            pattern: config.testCaseKeyPattern.source
          },
          name: {
            type: 'string',
            description: 'Updated name of the test case',
            minLength: 1,
            maxLength: 255
          },
          description: {
            type: 'string',
            description: 'Updated description of the test case'
          },
          folderId: {
            type: 'integer',
            description: 'Updated folder ID',
            minimum: 1
          },
          component: {
            type: 'integer',
            description: 'Updated component ID',
            minimum: 1
          },
          labels: {
            oneOf: [
              { type: 'string' },
              { type: 'array', items: { type: 'string' } }
            ],
            description: 'Updated labels (single string or array of strings)'
          },
          objective: {
            type: 'string',
            description: 'Updated test objective'
          },
          precondition: {
            type: 'string',
            description: 'Updated test precondition'
          },
          estimatedTime: {
            type: 'integer',
            description: 'Updated estimated time in minutes (will be converted to milliseconds)',
            minimum: 0
          }
        },
        required: ['testCaseKey']
      },
      handler: updateTestCase
    }
  • src/index.js:30-37 (registration)
    Top-level registration in the MCP server index.js where testCaseTools (including update_test_case) is spread into the allTools array used for dynamic tool lookup and execution.
    const allTools = [
      ...projectTools,
      ...folderTools,
      ...testCaseTools,
      ...testStepsTools,
      ...testScriptTools,
      ...referenceDataTools
    ];
  • The ZephyrClient helper method called by the tool handler. Performs the actual API PUT request to update the test case via the Zephyr Scale Cloud API.
    async updateTestCase(testCaseKey, testCaseData) {
      return this.request('PUT', `/testcases/${testCaseKey}`, testCaseData);
    }
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. It states 'update' which implies mutation, but doesn't disclose permission requirements, whether changes are reversible, error handling, or what happens to unspecified fields. For a mutation tool with zero annotation coverage, this leaves significant behavioral 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 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 mutation tool with 9 parameters and no annotations or output schema, the description is inadequate. It doesn't explain what 'update' entails operationally, what permissions are needed, how partial updates work, or what the response contains. The agent would need to guess about important behavioral aspects.

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%, with all 9 parameters well-documented in the schema itself. The description adds no additional parameter information beyond what's already in the schema, so it meets the baseline score of 3 where 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 ('update') and resource ('existing test case'), making the purpose unambiguous. However, it doesn't differentiate this tool from sibling tools like 'create_test_case' or explain what distinguishes updating from creating.

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_test_case' or 'get_test_case'. It doesn't mention prerequisites (e.g., needing an existing test case key) or contextual constraints, leaving the agent to infer usage from the tool 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