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;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'add' implies a mutation operation, it doesn't disclose important behavioral traits like whether this requires specific permissions, if it's idempotent, what happens when adding duplicate tests, or what the expected response format is. The description is minimal and lacks necessary context for a mutation tool.

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 extremely concise - a single sentence that directly states the tool's purpose with zero wasted words. It's appropriately sized for a simple tool and front-loaded with the essential information.

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 mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after adding tests, whether there are success/failure conditions, what permissions are required, or how it interacts with the broader test management system. Given the complexity implied by the sibling tools, more context is needed.

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%, with both parameters clearly documented in the schema. The description doesn't add any meaningful parameter semantics beyond what's already in the schema. It doesn't explain what constitutes valid test plan or test issue IDs, format requirements, or constraints on the array size.

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 ('add tests') and target resource ('to an existing test plan'), providing a specific verb+resource combination. However, it doesn't differentiate from the sibling tool 'add_tests_to_test_set' which has a similar purpose but targets a different resource type.

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. It doesn't mention prerequisites (like needing an existing test plan), when not to use it, or how it differs from similar sibling tools like 'add_tests_to_test_set' or 'create_test_plan'.

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