Skip to main content
Glama

create_test_execution

Create a new test execution in Xray Cloud to run tests for a Jira project, including test cases and environments.

Instructions

Create a new test execution in Xray Cloud to run tests

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectKeyYesThe Jira project key (e.g., "PROJ")
summaryYesThe test execution summary/title
descriptionNoThe test execution description
testIssueIdsNoArray of test issue IDs to include in this execution (e.g., ["10001", "10002"])
testEnvironmentsNoArray of test environments (e.g., ["Chrome", "iOS"])

Implementation Reference

  • MCP server CallTool handler for 'create_test_execution': constructs TestExecution from params and calls XrayClient.createTestExecution
    case 'create_test_execution': {
      const testExecution: TestExecution = {
        projectKey: args.projectKey as string,
        summary: args.summary as string,
        description: args.description as string | undefined,
        testIssueIds: args.testIssueIds as string[] | undefined,
        testEnvironments: args.testEnvironments as string[] | undefined,
      };
    
      const result = await xrayClient.createTestExecution(testExecution);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Tool registration in tools list with input schema for parameter validation
    {
      name: 'create_test_execution',
      description: 'Create a new test execution in Xray Cloud to run tests',
      inputSchema: {
        type: 'object',
        properties: {
          projectKey: {
            type: 'string',
            description: 'The Jira project key (e.g., "PROJ")',
          },
          summary: {
            type: 'string',
            description: 'The test execution summary/title',
          },
          description: {
            type: 'string',
            description: 'The test execution description',
          },
          testIssueIds: {
            type: 'array',
            items: { type: 'string' },
            description: 'Array of test issue IDs to include in this execution (e.g., ["10001", "10002"])',
          },
          testEnvironments: {
            type: 'array',
            items: { type: 'string' },
            description: 'Array of test environments (e.g., ["Chrome", "iOS"])',
          },
        },
        required: ['projectKey', 'summary'],
      },
    },
  • Core XrayClient helper method implementing GraphQL mutation for creating test execution
    async createTestExecution(testExecution: TestExecution): Promise<TestExecutionResponse> {
      const mutation = `
        mutation CreateTestExecution($jira: JSON!, $testIssueIds: [String], $testEnvironments: [String]) {
          createTestExecution(jira: $jira, testIssueIds: $testIssueIds, testEnvironments: $testEnvironments) {
            testExecution {
              issueId
              jira(fields: ["key", "summary"])
              testRuns(limit: 100) {
                results {
                  id
                  status {
                    name
                    description
                  }
                  test {
                    issueId
                    jira(fields: ["key", "summary"])
                  }
                }
              }
            }
            warnings
          }
        }
      `;
    
      const jiraFields: any = {
        fields: {
          project: {
            key: testExecution.projectKey
          },
          summary: testExecution.summary,
          issuetype: {
            name: 'Test Execution'
          }
        }
      };
    
      if (testExecution.description) {
        jiraFields.fields.description = testExecution.description;
      }
    
      const variables: any = {
        jira: jiraFields
      };
    
      if (testExecution.testIssueIds && testExecution.testIssueIds.length > 0) {
        variables.testIssueIds = testExecution.testIssueIds;
      }
    
      if (testExecution.testEnvironments && testExecution.testEnvironments.length > 0) {
        variables.testEnvironments = testExecution.testEnvironments;
      }
    
      const result = await this.graphqlRequest<{ createTestExecution: any }>(mutation, variables);
    
      return {
        issueId: result.createTestExecution.testExecution.issueId,
        key: result.createTestExecution.testExecution.jira.key,
        testRuns: result.createTestExecution.testExecution.testRuns.results
      };
    }
  • TypeScript interface defining input structure for createTestExecution
      summary: string;
      projectKey: string;
      testIssueIds?: string[];
      testEnvironments?: string[];
      description?: string;
    }
  • TypeScript interface for the response from createTestExecution
    export interface TestExecutionResponse {
      issueId: string;
      key: string;
      testRuns?: TestRun[];
    }
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, the description doesn't disclose important behavioral traits like required permissions, whether this creates a draft or immediately executes tests, what happens to existing test executions, or any rate limits. It provides minimal context beyond the basic action.

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 gets straight to the point without any unnecessary words. It's front-loaded with the core purpose and efficiently communicates the essential action. Every word earns its place in this minimal description.

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 inadequate. It doesn't explain what happens after creation, what the tool returns, error conditions, or how this fits into the broader test execution workflow. Given the complexity of test execution systems and the lack of structured behavioral information, this description leaves significant gaps.

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%, so the schema already documents all 5 parameters thoroughly. The description doesn't add any meaningful parameter semantics beyond what's in the schema - it doesn't explain relationships between parameters, provide examples of valid combinations, or clarify edge cases. The baseline score of 3 reflects adequate but minimal value addition.

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 execution') and the resource ('in Xray Cloud to run tests'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from sibling tools like 'create_test_case', 'create_test_plan', or 'create_test_set' which also create different test artifacts in the same system.

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 about when to use this tool versus alternatives. It doesn't mention when you would create a test execution versus a test plan or test set, nor does it specify prerequisites or contextual constraints for using this tool effectively.

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