Skip to main content
Glama
ennuiii

Azure DevOps MCP Server with PAT Authentication

by ennuiii

testplan_add_test_cases_to_suite

Adds existing test cases to a specified test suite in an Azure DevOps project by providing project ID, test plan ID, suite ID, and test case IDs.

Instructions

Adds existing test cases to a test suite.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
planIdYesThe ID of the test plan.
projectYesThe unique identifier (ID or name) of the Azure DevOps project.
suiteIdYesThe ID of the test suite.
testCaseIdsYesThe ID(s) of the test case(s) to add.

Implementation Reference

  • The handler function that executes the tool logic: connects to Azure DevOps, converts testCaseIds to string if array, calls testApi.addTestCasesToSuite, and returns JSON stringified result.
    async ({ project, planId, suiteId, testCaseIds }) => { const connection = await connectionProvider(); const testApi = await connection.getTestApi(); // If testCaseIds is an array, convert it to comma-separated string const testCaseIdsString = Array.isArray(testCaseIds) ? testCaseIds.join(",") : testCaseIds; const addedTestCases = await testApi.addTestCasesToSuite(project, planId, suiteId, testCaseIdsString); return { content: [{ type: "text", text: JSON.stringify(addedTestCases, null, 2) }], }; }
  • Zod schema defining input parameters for the tool.
    { 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."), testCaseIds: z.string().or(z.array(z.string())).describe("The ID(s) of the test case(s) to add. "), },
  • Registers the 'testplan_add_test_cases_to_suite' tool on the MCP server with description, input schema, and handler function.
    server.tool( Test_Plan_Tools.add_test_cases_to_suite, "Adds existing test cases to a test suite.", { 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."), testCaseIds: z.string().or(z.array(z.string())).describe("The ID(s) of the test case(s) to add. "), }, async ({ project, planId, suiteId, testCaseIds }) => { const connection = await connectionProvider(); const testApi = await connection.getTestApi(); // If testCaseIds is an array, convert it to comma-separated string const testCaseIdsString = Array.isArray(testCaseIds) ? testCaseIds.join(",") : testCaseIds; const addedTestCases = await testApi.addTestCasesToSuite(project, planId, suiteId, testCaseIdsString); return { content: [{ type: "text", text: JSON.stringify(addedTestCases, null, 2) }], }; } );
  • Defines constant object with tool names, including 'testplan_add_test_cases_to_suite' used in registration.
    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", };

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ennuiii/DevOpsMcpPAT'

If you have feedback or need assistance with the MCP directory API, please join our Discord server