Skip to main content
Glama

create_test_plan

Create a new test plan in Xray Cloud to organize and group test cases for structured testing workflows and project management.

Instructions

Create a new test plan in Xray Cloud to organize tests

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoThe test plan description
projectKeyYesThe Jira project key (e.g., "PROJ")
summaryYesThe test plan summary/title
testIssueIdsNoArray of test issue IDs to include in this plan

Implementation Reference

  • MCP server handler for the 'create_test_plan' tool. Parses input arguments, constructs a TestPlan object, calls xrayClient.createTestPlan(), and returns the JSON-formatted result.
    case 'create_test_plan': { const testPlan: TestPlan = { projectKey: args.projectKey as string, summary: args.summary as string, description: args.description as string | undefined, testIssueIds: args.testIssueIds as string[] | undefined, }; const result = await xrayClient.createTestPlan(testPlan); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • src/index.ts:268-293 (registration)
    Registration of the 'create_test_plan' tool in the tools list, including name, description, and input schema. Returned by ListToolsRequestHandler.
    { name: 'create_test_plan', description: 'Create a new test plan in Xray Cloud to organize tests', inputSchema: { type: 'object', properties: { projectKey: { type: 'string', description: 'The Jira project key (e.g., "PROJ")', }, summary: { type: 'string', description: 'The test plan summary/title', }, description: { type: 'string', description: 'The test plan description', }, testIssueIds: { type: 'array', items: { type: 'string' }, description: 'Array of test issue IDs to include in this plan', }, }, required: ['projectKey', 'summary'], },
  • TypeScript interface definition for TestPlan input used by the createTestPlan method.
    export interface TestPlan { summary: string; projectKey: string; testIssueIds?: string[]; description?: string; }
  • Core implementation of createTestPlan in XrayClient class. Constructs GraphQL mutation to create test plan in Xray Cloud, handles Jira fields and testIssueIds, executes via graphqlRequest, and returns formatted response.
    async createTestPlan(testPlan: TestPlan): Promise<TestPlanResponse> { const mutation = ` mutation CreateTestPlan($jira: JSON!, $testIssueIds: [String]) { createTestPlan(jira: $jira, testIssueIds: $testIssueIds) { testPlan { issueId jira(fields: ["key", "summary"]) tests(limit: 100) { results { issueId jira(fields: ["key", "summary"]) } } } warnings } } `; const jiraFields: any = { fields: { project: { key: testPlan.projectKey }, summary: testPlan.summary, issuetype: { name: 'Test Plan' } } }; if (testPlan.description) { jiraFields.fields.description = testPlan.description; } const variables: any = { jira: jiraFields }; if (testPlan.testIssueIds && testPlan.testIssueIds.length > 0) { variables.testIssueIds = testPlan.testIssueIds; } const result = await this.graphqlRequest<{ createTestPlan: any }>(mutation, variables); return { issueId: result.createTestPlan.testPlan.issueId, key: result.createTestPlan.testPlan.jira.key, tests: result.createTestPlan.testPlan.tests?.results || [] }; }

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