Skip to main content
Glama

search_test_cases

Search for test cases in Xray using JQL queries to find specific tests based on criteria like project, labels, or status.

Instructions

Search for test cases using JQL (Jira Query Language)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jqlYesJQL query to search test cases (e.g., "project = PROJ AND labels = automation")
maxResultsNoMaximum number of results to return

Implementation Reference

  • MCP tool handler that processes the 'search_test_cases' tool call, extracts JQL and maxResults arguments, invokes the Xray client method, and formats the result as MCP content.
    case 'search_test_cases': {
      const result = await xrayClient.searchTestCases(
        args.jql as string,
        args.maxResults as number | undefined
      );
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Input schema for the 'search_test_cases' tool defining the expected parameters: required 'jql' string and optional 'maxResults' number.
    inputSchema: {
      type: 'object',
      properties: {
        jql: {
          type: 'string',
          description: 'JQL query to search test cases (e.g., "project = PROJ AND labels = automation")',
        },
        maxResults: {
          type: 'number',
          description: 'Maximum number of results to return',
          default: 50,
        },
      },
      required: ['jql'],
    },
  • src/index.ts:125-143 (registration)
    Tool registration in the tools array returned by ListToolsRequestHandler, including name, description, and schema.
    {
      name: 'search_test_cases',
      description: 'Search for test cases using JQL (Jira Query Language)',
      inputSchema: {
        type: 'object',
        properties: {
          jql: {
            type: 'string',
            description: 'JQL query to search test cases (e.g., "project = PROJ AND labels = automation")',
          },
          maxResults: {
            type: 'number',
            description: 'Maximum number of results to return',
            default: 50,
          },
        },
        required: ['jql'],
      },
    },
  • Main helper function in XrayClient that executes GraphQL query to Xray Cloud API's getTests using the provided JQL and limit, returning search results.
    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;
    }
Behavior2/5

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

With no annotations, the description carries full burden but only states the action without behavioral details. It doesn't disclose whether this is read-only, potential rate limits, authentication needs, or what the return format looks like (e.g., pagination, error handling).

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 with zero waste. It's appropriately sized and front-loaded, clearly stating the tool's purpose without unnecessary elaboration.

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?

Given no annotations and no output schema, the description is incomplete for a search tool. It lacks details on behavioral traits, return values, or error handling, leaving significant gaps for an AI agent to understand how to use it effectively.

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 fully documents both parameters. The description adds no additional meaning beyond implying JQL usage, which is already covered in the schema's example. Baseline 3 is appropriate as the schema does the heavy lifting.

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 verb ('Search') and resource ('test cases') with the method ('using JQL'). It distinguishes from siblings like 'get_project_test_cases' by specifying search functionality, though it doesn't explicitly contrast with 'search_test_executions' or other search siblings.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_project_test_cases' or other search tools (e.g., 'search_test_executions'). The description implies usage for JQL-based searches but lacks explicit context or exclusions.

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