Skip to main content
Glama

get_project_test_cases

Retrieve all test cases for a Jira project to manage testing workflows and track test coverage in Xray Cloud.

Instructions

Get all test cases for a specific project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectKeyYesThe Jira project key (e.g., "PROJ")
maxResultsNoMaximum number of results to return

Implementation Reference

  • src/index.ts:144-162 (registration)
    Registration of the 'get_project_test_cases' tool including its name, description, and input schema definition.
    {
      name: 'get_project_test_cases',
      description: 'Get all test cases for a specific project',
      inputSchema: {
        type: 'object',
        properties: {
          projectKey: {
            type: 'string',
            description: 'The Jira project key (e.g., "PROJ")',
          },
          maxResults: {
            type: 'number',
            description: 'Maximum number of results to return',
            default: 50,
          },
        },
        required: ['projectKey'],
      },
    },
  • The handler logic for executing the 'get_project_test_cases' tool, which extracts arguments and calls the XrayClient.getTestCasesByProject method, returning the JSON-formatted result.
    case 'get_project_test_cases': {
      const result = await xrayClient.getTestCasesByProject(
        args.projectKey as string,
        args.maxResults as number | undefined
      );
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Helper method in XrayClient that constructs JQL for project test cases and delegates to searchTestCases.
    async getTestCasesByProject(projectKey: string, maxResults: number = 50): Promise<any> {
      const jql = `project = '${projectKey}'`;
      return this.searchTestCases(jql, maxResults);
    }
  • Core helper method that executes GraphQL query to search and retrieve test cases using JQL, providing detailed test case information.
    async searchTestCases(jql: string, maxResults: number = 50): Promise<any> {
      const query = `
        query SearchTests($jql: String!, $limit: Int!) {
          getTests(jql: $jql, limit: $limit) {
            total
            start
            limit
            results {
              issueId
              projectId
              jira(fields: ["key", "summary", "description", "priority", "status", "labels"])
              testType {
                name
                kind
              }
            }
          }
        }
      `;
    
      const variables = {
        jql,
        limit: maxResults
      };
    
      const result = await this.graphqlRequest<{ getTests: any }>(query, variables);
      return result.getTests;
    }

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