Skip to main content
Glama

add_tests_to_test_plan

Add multiple test cases to an existing test plan in Xray Cloud by specifying test plan and test issue IDs for test management automation.

Instructions

Add tests to an existing test plan

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
testPlanIssueIdYesThe test plan issue ID (not key)
testIssueIdsYesArray of test issue IDs to add

Implementation Reference

  • MCP tool handler implementation for 'add_tests_to_test_plan'. Extracts arguments from request, calls XrayClient.addTestsToTestPlan, and returns the JSON-stringified result as text content.
    case 'add_tests_to_test_plan': { const result = await xrayClient.addTestsToTestPlan( args.testPlanIssueId as string, args.testIssueIds as string[] ); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • Input schema defining parameters for the add_tests_to_test_plan tool: testPlanIssueId (string) and testIssueIds (array of strings).
    inputSchema: { type: 'object', properties: { testPlanIssueId: { type: 'string', description: 'The test plan issue ID (not key)', }, testIssueIds: { type: 'array', items: { type: 'string' }, description: 'Array of test issue IDs to add', }, }, required: ['testPlanIssueId', 'testIssueIds'], },
  • src/index.ts:347-365 (registration)
    Registration of the 'add_tests_to_test_plan' tool in the tools array, including name, description, and input schema. Used by the MCP server for tool listing.
    { name: 'add_tests_to_test_plan', description: 'Add tests to an existing test plan', inputSchema: { type: 'object', properties: { testPlanIssueId: { type: 'string', description: 'The test plan issue ID (not key)', }, testIssueIds: { type: 'array', items: { type: 'string' }, description: 'Array of test issue IDs to add', }, }, required: ['testPlanIssueId', 'testIssueIds'], }, },
  • Supporting method in XrayClient class that executes the GraphQL mutation to add tests to a test plan and returns the result.
    async addTestsToTestPlan(testPlanIssueId: string, testIssueIds: string[]): Promise<any> { const mutation = ` mutation AddTestsToTestPlan($issueId: String!, $testIssueIds: [String]!) { addTestsToTestPlan(issueId: $issueId, testIssueIds: $testIssueIds) { addedTests warning } } `; const variables = { issueId: testPlanIssueId, testIssueIds }; const result = await this.graphqlRequest<{ addTestsToTestPlan: any }>(mutation, variables); return result.addTestsToTestPlan; }

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/c4m3lblue-star/xray-mcp'

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