Skip to main content
Glama

create_test_plan

Create a new test plan in Xray Cloud to organize tests by project, summary, description, and test issue IDs for structured test management.

Instructions

Create a new test plan in Xray Cloud to organize tests

Input Schema

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

Implementation Reference

  • Core handler function that executes the GraphQL mutation to create a test plan in Xray Cloud.
    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 || []
      };
    }
  • MCP server handler case that constructs TestPlan from tool arguments and delegates to xrayClient.createTestPlan.
    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),
          },
        ],
      };
    }
  • Input schema definition for the create_test_plan tool, defining parameters like projectKey, summary, etc.
      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'],
      },
    },
  • src/index.ts:519-521 (registration)
    Registration of the tools list for ListToolsRequest, which includes the create_test_plan tool schema.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Create' implies a write/mutation operation, it doesn't specify permission requirements, whether the creation is idempotent, what happens with duplicate names, or what the response contains. For a creation tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded with the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a creation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what a successful creation returns, error conditions, or how the created test plan integrates with the broader Xray ecosystem. The description should provide more context about the operation's outcome and implications.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, providing complete documentation of all 4 parameters. The description doesn't add any parameter-specific information beyond what's already in the schema, so it meets the baseline expectation but doesn't enhance understanding of parameter usage or relationships.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create a new test plan') and resource ('in Xray Cloud to organize tests'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from its sibling 'create_test_set' which also creates organizational structures for tests, missing explicit differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'create_test_set' or 'create_test_execution', nor does it mention prerequisites or context for creating test plans. It simply states what the tool does without usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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