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); }

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