get_test_case
Retrieve detailed information about a specific test case in Zephyr Scale Cloud for test management and execution tracking.
Instructions
Get detailed information about a specific test case
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| testCaseKey | Yes | Test case key to retrieve (format: [A-Z]+-T[0-9]+) |
Implementation Reference
- src/tools/test-case-tools.js:64-96 (handler)The main handler function for the 'get_test_case' MCP tool. It validates the testCaseKey input, calls the ZephyrClient to fetch the test case details, formats the response as JSON, and handles errors.async function getTestCase(args) { try { const { testCaseKey } = 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 testCase = await client.getTestCase(testCaseKey); return { content: [ { type: 'text', text: JSON.stringify(testCase, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: formatError(error, `fetching test case ${args.testCaseKey}`) } ], isError: true }; } }
- src/tools/test-case-tools.js:295-305 (schema)Input schema for the 'get_test_case' tool, specifying the required 'testCaseKey' parameter with type, description, and regex pattern validation.inputSchema: { type: 'object', properties: { testCaseKey: { type: 'string', description: 'Test case key to retrieve (format: [A-Z]+-T[0-9]+)', pattern: config.testCaseKeyPattern.source } }, required: ['testCaseKey'] },
- src/tools/test-case-tools.js:292-307 (registration)Registration of the 'get_test_case' tool in the testCaseTools array, including name, description, inputSchema, and handler reference. This array is imported and spread into the main MCP tools list.{ name: 'get_test_case', description: 'Get detailed information about a specific test case', inputSchema: { type: 'object', properties: { testCaseKey: { type: 'string', description: 'Test case key to retrieve (format: [A-Z]+-T[0-9]+)', pattern: config.testCaseKeyPattern.source } }, required: ['testCaseKey'] }, handler: getTestCase },
- src/zephyr-client.js:128-130 (helper)ZephyrClient helper method invoked by the tool handler to perform the actual API request for retrieving test case details.async getTestCase(testCaseKey) { return this.request('GET', `/testcases/${testCaseKey}`); }
- src/index.js:30-38 (registration)Global registration in the MCP server where testCaseTools (containing get_test_case) is spread into the allTools array used for tool lookup and execution.const allTools = [ ...projectTools, ...folderTools, ...testCaseTools, ...testStepsTools, ...testScriptTools, ...referenceDataTools ];