get_test_plan
Retrieve detailed information about a specific test plan including all associated tests using the test plan key identifier.
Instructions
Get details of a specific test plan by key, including all tests
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| testPlanKey | Yes | The test plan key (e.g., "PROJ-789") |
Implementation Reference
- src/index.ts:723-733 (handler)MCP server tool handler for 'get_test_plan': extracts testPlanKey from args, calls xrayClient.getTestPlan(), serializes result to JSON text content.case 'get_test_plan': { const result = await xrayClient.getTestPlan(args.testPlanKey as string); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:295-308 (schema)Tool definition with input schema: requires 'testPlanKey' string for fetching specific test plan.{ name: 'get_test_plan', description: 'Get details of a specific test plan by key, including all tests', inputSchema: { type: 'object', properties: { testPlanKey: { type: 'string', description: 'The test plan key (e.g., "PROJ-789")', }, }, required: ['testPlanKey'], }, },
- src/index.ts:519-521 (registration)Registration of tool list handler that returns the tools array containing 'get_test_plan'.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
- src/xray-client.ts:642-679 (helper)XrayClient helper method implementing the core logic: GraphQL query to fetch test plan by key using getTestPlans, returns detailed plan with tests if found.async getTestPlan(testPlanKey: string): Promise<any> { const query = ` query GetTestPlan($jql: String!, $limit: Int!) { getTestPlans(jql: $jql, limit: $limit) { total results { issueId projectId jira(fields: ["key", "summary", "description", "status"]) tests(limit: 100) { total results { issueId jira(fields: ["key", "summary", "status"]) testType { name kind } } } } } } `; const variables = { jql: `key = '${testPlanKey}'`, limit: 1 }; const result = await this.graphqlRequest<{ getTestPlans: any }>(query, variables); if (result.getTestPlans.total === 0) { throw new Error(`Test plan ${testPlanKey} not found`); } return result.getTestPlans.results[0]; }