Skip to main content
Glama

get_all_test_steps

Retrieve all test steps for a specific test case in Zephyr Scale Cloud, automatically handling pagination to ensure complete data collection.

Instructions

Get all test steps for a test case (handles pagination automatically)

Input Schema

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

Implementation Reference

  • The handler function that implements the get_all_test_steps tool logic. It fetches all test steps for a given test case by automatically paginating through the API responses using the ZephyrClient.
    async function getAllTestSteps(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 allSteps = []; let startAt = 0; const maxResults = 100; // Use maximum for efficiency while (true) { const response = await client.getTestSteps(testCaseKey, { maxResults, startAt }); if (response.values) { allSteps.push(...response.values); } else if (Array.isArray(response)) { allSteps.push(...response); } // Check if we have all results const total = response.total || response.size || 0; if (allSteps.length >= total || response.values?.length < maxResults) { break; } startAt += maxResults; } return { content: [ { type: 'text', text: JSON.stringify({ testCaseKey, testSteps: allSteps, totalSteps: allSteps.length, note: 'All test steps retrieved (pagination handled automatically)' }, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: formatError(error, `fetching all test steps for ${args.testCaseKey}`) } ], isError: true }; } }
  • The tool registration object defining the name, description, input schema, and handler reference for 'get_all_test_steps'. This array is imported and spread into the main tools list in src/index.js.
    { name: 'get_all_test_steps', description: 'Get all test steps for a test case (handles pagination automatically)', inputSchema: { type: 'object', properties: { testCaseKey: { type: 'string', description: 'Test case key (format: [A-Z]+-T[0-9]+)', pattern: config.testCaseKeyPattern.source } }, required: ['testCaseKey'] }, handler: getAllTestSteps },
  • The input schema for the get_all_test_steps tool, specifying the required testCaseKey parameter with validation pattern.
    inputSchema: { type: 'object', properties: { testCaseKey: { type: 'string', description: 'Test case key (format: [A-Z]+-T[0-9]+)', pattern: config.testCaseKeyPattern.source } }, required: ['testCaseKey'] },
  • src/index.js:30-36 (registration)
    Top-level aggregation of all tools including testStepsTools (which contains get_all_test_steps) into the allTools array used by the MCP server for handling tool calls.
    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