Skip to main content
Glama

get_project_test_plans

Retrieve all test plans for a specific Jira project to manage testing workflows and track test coverage.

Instructions

Get all test plans for a specific project

Input Schema

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

Implementation Reference

  • MCP server tool handler for 'get_project_test_plans'. Extracts projectKey and optional maxResults from arguments, calls xrayClient.getTestPlansByProject, and returns JSON stringified result.
    case 'get_project_test_plans': {
      const result = await xrayClient.getTestPlansByProject(
        args.projectKey as string,
        args.maxResults as number | undefined
      );
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Input schema definition for the 'get_project_test_plans' tool, specifying required projectKey and optional maxResults.
    {
      name: 'get_project_test_plans',
      description: 'Get all test plans 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'],
      },
    },
  • src/index.ts:328-346 (registration)
    Registration of the 'get_project_test_plans' tool in the tools array used by ListToolsRequestHandler.
    {
      name: 'get_project_test_plans',
      description: 'Get all test plans 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'],
      },
    },
  • XrayClient helper method that builds JQL query for test plans in a project and delegates to searchTestPlans.
    async getTestPlansByProject(projectKey: string, maxResults: number = 50): Promise<any> {
      const jql = `project = '${projectKey}'`;
      return this.searchTestPlans(jql, maxResults);
    }
  • Core helper method that executes GraphQL query to search test plans by JQL, fetching details including contained tests.
    async searchTestPlans(jql: string, maxResults: number = 50): Promise<any> {
      const query = `
        query SearchTestPlans($jql: String!, $limit: Int!) {
          getTestPlans(jql: $jql, limit: $limit) {
            total
            start
            limit
            results {
              issueId
              projectId
              jira(fields: ["key", "summary", "description", "status", "created", "updated"])
              tests(limit: 10) {
                total
                results {
                  issueId
                  jira(fields: ["key", "summary"])
                }
              }
            }
          }
        }
      `;
    
      const variables = {
        jql,
        limit: maxResults
      };
    
      const result = await this.graphqlRequest<{ getTestPlans: any }>(query, variables);
      return result.getTestPlans;
    }

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