Skip to main content
Glama

get_test_case

Retrieve detailed information about a specific test case in Zephyr Scale Cloud for test management and execution tracking.

Instructions

Get detailed information about a specific test case

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
testCaseKeyYesTest case key to retrieve (format: [A-Z]+-T[0-9]+)

Implementation Reference

  • The main handler function for the 'get_test_case' MCP tool. It validates the testCaseKey input, calls the ZephyrClient to fetch the test case details, formats the response as JSON, and handles errors.
    async function getTestCase(args) {
      try {
        const { testCaseKey } = args;
        if (!testCaseKey) {
          throw new Error('testCaseKey is required');
        }
    
        if (!config.testCaseKeyPattern.test(testCaseKey)) {
          throw new Error('Invalid testCaseKey format. Must match pattern: [A-Z]+-T[0-9]+');
        }
    
        const testCase = await client.getTestCase(testCaseKey);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(testCase, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: formatError(error, `fetching test case ${args.testCaseKey}`)
            }
          ],
          isError: true
        };
      }
    }
  • Input schema for the 'get_test_case' tool, specifying the required 'testCaseKey' parameter with type, description, and regex pattern validation.
    inputSchema: {
      type: 'object',
      properties: {
        testCaseKey: {
          type: 'string',
          description: 'Test case key to retrieve (format: [A-Z]+-T[0-9]+)',
          pattern: config.testCaseKeyPattern.source
        }
      },
      required: ['testCaseKey']
    },
  • Registration of the 'get_test_case' tool in the testCaseTools array, including name, description, inputSchema, and handler reference. This array is imported and spread into the main MCP tools list.
    {
      name: 'get_test_case',
      description: 'Get detailed information about a specific test case',
      inputSchema: {
        type: 'object',
        properties: {
          testCaseKey: {
            type: 'string',
            description: 'Test case key to retrieve (format: [A-Z]+-T[0-9]+)',
            pattern: config.testCaseKeyPattern.source
          }
        },
        required: ['testCaseKey']
      },
      handler: getTestCase
    },
  • ZephyrClient helper method invoked by the tool handler to perform the actual API request for retrieving test case details.
    async getTestCase(testCaseKey) {
      return this.request('GET', `/testcases/${testCaseKey}`);
    }
  • src/index.js:30-38 (registration)
    Global registration in the MCP server where testCaseTools (containing get_test_case) is spread into the allTools array used for tool lookup and execution.
    const allTools = [
      ...projectTools,
      ...folderTools,
      ...testCaseTools,
      ...testStepsTools,
      ...testScriptTools,
      ...referenceDataTools
    ];

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/donyfs/mcp-zephyr'

If you have feedback or need assistance with the MCP directory API, please join our Discord server