get_test_case
Retrieve detailed information about a specific test case from JIRA's Zephyr test management system using its ID or key.
Instructions
Get detailed information about a specific test case
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| testCaseId | Yes | Test case ID or key |
Implementation Reference
- src/tools/test-cases.ts:111-143 (handler)The primary handler function that executes the 'get_test_case' tool logic: fetches test case data from Zephyr client and returns formatted response with error handling.export const getTestCase = async (input: { testCaseId: string }) => { try { const testCase = await getZephyrClient().getTestCase(input.testCaseId); 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, status: testCase.status, folder: testCase.folder, labels: testCase.labels || [], component: testCase.component, owner: testCase.owner, createdOn: testCase.createdOn, customFields: testCase.customFields, links: testCase.links, testScript: testCase.testScript, }, }; } catch (error: any) { return { success: false, error: error.response?.data?.message || error.message, }; } };
- src/index.ts:240-250 (registration)Registers the 'get_test_case' tool in the MCP server's listTools response, defining its name, description, and input schema.{ name: 'get_test_case', description: 'Get detailed information about a specific test case', inputSchema: { type: 'object', properties: { testCaseId: { type: 'string', description: 'Test case ID or key' }, }, required: ['testCaseId'], }, },
- src/index.ts:461-471 (handler)Central dispatch handler in MCP server that validates input for 'get_test_case' and calls the specific getTestCase function.case 'get_test_case': { const validatedArgs = validateInput<GetTestCaseInput>(getTestCaseSchema, args, 'get_test_case'); return { content: [ { type: 'text', text: JSON.stringify(await getTestCase(validatedArgs), null, 2), }, ], }; }
- src/utils/validation.ts:89-91 (schema)Zod schema for validating input to the 'get_test_case' tool, requiring testCaseId.export const getTestCaseSchema = z.object({ testCaseId: z.string().min(1, 'Test case ID is required'), });
- src/utils/validation.ts:109-109 (schema)TypeScript type inferred from getTestCaseSchema for input validation.export type GetTestCaseInput = z.infer<typeof getTestCaseSchema>;