testplan_list_test_cases
Retrieve a list of test cases from a specific test plan and suite in Azure DevOps. Input project ID, plan ID, and suite ID to access relevant test cases for streamlined test management.
Instructions
Gets a list of test cases in the test plan.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| planid | Yes | The ID of the test plan. | |
| project | Yes | The unique identifier (ID or name) of the Azure DevOps project. | |
| suiteid | Yes | The ID of the test suite. |
Implementation Reference
- src/tools/testplans.ts:190-207 (registration)Registers the 'testplan_list_test_cases' tool with MCP server, including schema and inline handler.server.tool( Test_Plan_Tools.list_test_cases, "Gets a list of test cases in the test plan.", { project: z.string().describe("The unique identifier (ID or name) of the Azure DevOps project."), planid: z.number().describe("The ID of the test plan."), suiteid: z.number().describe("The ID of the test suite."), }, async ({ project, planid, suiteid }) => { const connection = await connectionProvider(); const coreApi = await connection.getTestPlanApi(); const testcases = await coreApi.getTestCaseList(project, planid, suiteid); return { content: [{ type: "text", text: JSON.stringify(testcases, null, 2) }], }; } );
- src/tools/testplans.ts:198-206 (handler)The handler function fetches test cases for a given project, test plan ID, and suite ID using Azure DevOps TestPlanApi.getTestCaseList and returns JSON.async ({ project, planid, suiteid }) => { const connection = await connectionProvider(); const coreApi = await connection.getTestPlanApi(); const testcases = await coreApi.getTestCaseList(project, planid, suiteid); return { content: [{ type: "text", text: JSON.stringify(testcases, null, 2) }], }; }
- src/tools/testplans.ts:193-197 (schema)Input schema defined with Zod: project (string), planid (number), suiteid (number).{ project: z.string().describe("The unique identifier (ID or name) of the Azure DevOps project."), planid: z.number().describe("The ID of the test plan."), suiteid: z.number().describe("The ID of the test suite."), },