get_test_case
Retrieve detailed information about a specific test case using its unique key, such as PROJ-123, to support test management and automation workflows.
Instructions
Get details of a specific test case by key
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| testKey | Yes | The test case key (e.g., "PROJ-123") |
Implementation Reference
- src/xray-client.ts:278-316 (handler)Core handler function that executes the GraphQL query to retrieve detailed test case information from Xray Cloud by test key.async getTestCase(testKey: string): Promise<any> { const query = ` query GetTest($jql: String!, $limit: Int!) { getTests(jql: $jql, limit: $limit) { total results { issueId projectId jira(fields: ["key", "summary", "description", "priority", "status", "labels"]) testType { name kind } steps { id action data result } gherkin unstructured } } } `; const variables = { jql: `key = '${testKey}'`, limit: 1 }; const result = await this.graphqlRequest<{ getTests: any }>(query, variables); if (result.getTests.total === 0) { throw new Error(`Test case ${testKey} not found`); } return result.getTests.results[0]; }
- src/index.ts:554-564 (handler)MCP server tool call handler that invokes the XrayClient.getTestCase method and formats the response.case 'get_test_case': { const result = await xrayClient.getTestCase(args.testKey as string); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:66-79 (schema)Tool schema definition including input validation for testKey parameter.{ name: 'get_test_case', description: 'Get details of a specific test case by key', inputSchema: { type: 'object', properties: { testKey: { type: 'string', description: 'The test case key (e.g., "PROJ-123")', }, }, required: ['testKey'], }, },
- src/index.ts:519-521 (registration)Registration of the tools list handler that exposes all tools including get_test_case to MCP clients.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });