Skip to main content
Glama

search_test_cases

Find test cases in Xray using JQL queries to filter by project, labels, or other criteria for test management and automation workflows.

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

  • Core implementation of searchTestCases: executes GraphQL query to fetch test cases matching the JQL query.
    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; }
  • Tool schema definition including name, description, and input schema for validation.
    { 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'], }, },
  • MCP server tool execution handler: dispatches to xrayClient and returns JSON response.
    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), }, ], }; }
  • src/index.ts:519-521 (registration)
    Registration of tool list handler that exposes the tools array including search_test_cases.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { 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