Skip to main content
Glama

get_test_steps

Retrieve test steps for a specific test case with paginated results, supporting up to 100 items per page.

Instructions

Get test steps for a test case (paged response, 100 items per page)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
testCaseKeyYesTest case key (format: [A-Z]+-T[0-9]+)
maxResultsNoMaximum number of steps to return (default: 50, max: 100)
startAtNoStarting position for pagination (default: 0)

Implementation Reference

  • Main handler function executing the get_test_steps tool: validates testCaseKey, prepares params, calls ZephyrClient.getTestSteps, formats JSON response or error.
    async function getTestSteps(args) {
      try {
        const { testCaseKey, maxResults, startAt } = 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 params = {
          maxResults: maxResults || config.defaultMaxResults,
          startAt: startAt || 0
        };
    
        const response = await client.getTestSteps(testCaseKey, params);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                testCaseKey,
                testSteps: response.values || response,
                total: response.total || response.length,
                startAt: response.startAt || 0,
                maxResults: response.maxResults || params.maxResults,
                note: 'Test steps are returned in paged format (100 items per page max)'
              }, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: formatError(error, `fetching test steps for ${args.testCaseKey}`)
            }
          ],
          isError: true
        };
      }
    }
  • Input schema for get_test_steps tool defining parameters (testCaseKey required, maxResults, startAt optional) with types, descriptions, patterns, and constraints.
    inputSchema: {
      type: 'object',
      properties: {
        testCaseKey: {
          type: 'string',
          description: 'Test case key (format: [A-Z]+-T[0-9]+)',
          pattern: config.testCaseKeyPattern.source
        },
        maxResults: {
          type: 'number',
          description: 'Maximum number of steps to return (default: 50, max: 100)',
          minimum: 1,
          maximum: 100,
          default: 50
        },
        startAt: {
          type: 'number',
          description: 'Starting position for pagination (default: 0)',
          minimum: 0,
          default: 0
        }
      },
      required: ['testCaseKey']
    },
  • Local registration of get_test_steps tool object within testStepsTools export array, linking name, description, schema, and handler.
    {
      name: 'get_test_steps',
      description: 'Get test steps for a test case (paged response, 100 items per page)',
      inputSchema: {
        type: 'object',
        properties: {
          testCaseKey: {
            type: 'string',
            description: 'Test case key (format: [A-Z]+-T[0-9]+)',
            pattern: config.testCaseKeyPattern.source
          },
          maxResults: {
            type: 'number',
            description: 'Maximum number of steps to return (default: 50, max: 100)',
            minimum: 1,
            maximum: 100,
            default: 50
          },
          startAt: {
            type: 'number',
            description: 'Starting position for pagination (default: 0)',
            minimum: 0,
            default: 0
          }
        },
        required: ['testCaseKey']
      },
      handler: getTestSteps
    },
  • src/index.js:25-37 (registration)
    Main MCP server registration: imports testStepsTools (containing get_test_steps) and spreads into allTools array used for tool lookup and execution in MCP handlers.
    import testStepsTools from './tools/test-steps-tools.js';
    import testScriptTools from './tools/test-script-tools.js';
    import referenceDataTools from './tools/reference-data-tools.js';
    
    // Combine all tools
    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