testplan_list_test_plans
Retrieve a paginated list of test plans from an Azure DevOps project. Filter for active plans and toggle detailed information to streamline test management.
Instructions
Retrieve a paginated list of test plans from an Azure DevOps project. Allows filtering for active plans and toggling detailed information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| continuationToken | No | Token to continue fetching test plans from a previous request. | |
| filterActivePlans | No | Filter to include only active test plans. Defaults to true. | |
| includePlanDetails | No | Include detailed information about each test plan. | |
| project | Yes | The unique identifier (ID or name) of the Azure DevOps project. |
Implementation Reference
- src/tools/testplans.ts:33-43 (handler)The handler function that executes the tool: fetches test plans from Azure DevOps TestPlanApi using provided parameters.async ({ project, filterActivePlans, includePlanDetails, continuationToken }) => { const owner = ""; //making owner an empty string untill we can figure out how to get owner id const connection = await connectionProvider(); const testPlanApi = await connection.getTestPlanApi(); const testPlans = await testPlanApi.getTestPlans(project, owner, continuationToken, includePlanDetails, filterActivePlans); return { content: [{ type: "text", text: JSON.stringify(testPlans, null, 2) }], }; }
- src/tools/testplans.ts:27-32 (schema)Zod schema defining input parameters for the tool.{ project: z.string().describe("The unique identifier (ID or name) of the Azure DevOps project."), filterActivePlans: z.boolean().default(true).describe("Filter to include only active test plans. Defaults to true."), includePlanDetails: z.boolean().default(false).describe("Include detailed information about each test plan."), continuationToken: z.string().optional().describe("Token to continue fetching test plans from a previous request."), },
- src/tools/testplans.ts:24-44 (registration)The server.tool registration call that defines the tool name, description, input schema, and handler function.server.tool( Test_Plan_Tools.list_test_plans, "Retrieve a paginated list of test plans from an Azure DevOps project. Allows filtering for active plans and toggling detailed information.", { project: z.string().describe("The unique identifier (ID or name) of the Azure DevOps project."), filterActivePlans: z.boolean().default(true).describe("Filter to include only active test plans. Defaults to true."), includePlanDetails: z.boolean().default(false).describe("Include detailed information about each test plan."), continuationToken: z.string().optional().describe("Token to continue fetching test plans from a previous request."), }, async ({ project, filterActivePlans, includePlanDetails, continuationToken }) => { const owner = ""; //making owner an empty string untill we can figure out how to get owner id const connection = await connectionProvider(); const testPlanApi = await connection.getTestPlanApi(); const testPlans = await testPlanApi.getTestPlans(project, owner, continuationToken, includePlanDetails, filterActivePlans); return { content: [{ type: "text", text: JSON.stringify(testPlans, null, 2) }], }; } );
- src/tools/testplans.ts:10-17 (helper)Constant object defining string names for test plan related tools, including 'testplan_list_test_plans'.const Test_Plan_Tools = { create_test_plan: "testplan_create_test_plan", create_test_case: "testplan_create_test_case", add_test_cases_to_suite: "testplan_add_test_cases_to_suite", test_results_from_build_id: "testplan_show_test_results_from_build_id", list_test_cases: "testplan_list_test_cases", list_test_plans: "testplan_list_test_plans", };
- src/tools.ts:27-27 (registration)Invocation of configureTestPlanTools within the main tools configuration, which registers the testplan_list_test_plans tool among others.configureTestPlanTools(server, tokenProvider, connectionProvider);