Skip to main content
Glama

list_test_cases

Retrieve test cases from Zephyr Scale Cloud with filtering options for projects, folders, and pagination to manage testing workflows.

Instructions

List test cases with optional filtering by project and folder

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectKeyNoJira project key to filter test cases
folderIdNoFolder ID to filter test cases
maxResultsNoMaximum number of results to return (default: 50, max: 1000)
startAtNoStarting position for pagination (default: 0)

Implementation Reference

  • The handler function that executes the list_test_cases tool. It validates input parameters, fetches test cases from ZephyrClient, formats the JSON response, and handles errors appropriately.
    async function listTestCases(args) {
      try {
        const params = {
          projectKey: args.projectKey,
          folderId: args.folderId,
          maxResults: args.maxResults || config.defaultMaxResults,
          startAt: args.startAt || 0
        };
    
        // Validate projectKey if provided
        if (params.projectKey && !config.projectKeyPattern.test(params.projectKey)) {
          throw new Error('Invalid projectKey format. Must match pattern: [A-Z][A-Z_0-9]+');
        }
    
        // Validate folderId if provided
        if (params.folderId && (!Number.isInteger(params.folderId) || params.folderId < 1)) {
          throw new Error('Invalid folderId format. Must be a positive integer.');
        }
    
        const response = await client.getTestCases(params);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                testCases: response.values || response,
                total: response.total || response.length,
                startAt: response.startAt || 0,
                maxResults: response.maxResults || params.maxResults
              }, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: formatError(error, 'fetching test cases')
            }
          ],
          isError: true
        };
      }
    }
  • The inputSchema defining the expected parameters for the list_test_cases tool, including types, descriptions, patterns, defaults, and constraints.
    inputSchema: {
      type: 'object',
      properties: {
        projectKey: {
          type: 'string',
          description: 'Jira project key to filter test cases',
          pattern: config.projectKeyPattern.source
        },
        folderId: {
          type: 'integer',
          description: 'Folder ID to filter test cases',
          minimum: 1
        },
        maxResults: {
          type: 'number',
          description: 'Maximum number of results to return (default: 50, max: 1000)',
          minimum: 1,
          maximum: config.maxMaxResults,
          default: config.defaultMaxResults
        },
        startAt: {
          type: 'number',
          description: 'Starting position for pagination (default: 0)',
          minimum: 0,
          default: 0
        }
      }
    },
  • Local registration of the tool within the testCaseTools array exported from this module.
    {
      name: 'list_test_cases',
      description: 'List test cases with optional filtering by project and folder',
      inputSchema: {
        type: 'object',
        properties: {
          projectKey: {
            type: 'string',
            description: 'Jira project key to filter test cases',
            pattern: config.projectKeyPattern.source
          },
          folderId: {
            type: 'integer',
            description: 'Folder ID to filter test cases',
            minimum: 1
          },
          maxResults: {
            type: 'number',
            description: 'Maximum number of results to return (default: 50, max: 1000)',
            minimum: 1,
            maximum: config.maxMaxResults,
            default: config.defaultMaxResults
          },
          startAt: {
            type: 'number',
            description: 'Starting position for pagination (default: 0)',
            minimum: 0,
            default: 0
          }
        }
      },
      handler: listTestCases
    },
  • src/index.js:30-37 (registration)
    Global registration by including testCaseTools in the allTools array, which is used for MCP tool listing and dynamic dispatch.
    const allTools = [
      ...projectTools,
      ...folderTools,
      ...testCaseTools,
      ...testStepsTools,
      ...testScriptTools,
      ...referenceDataTools
    ];
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions optional filtering but doesn't describe return format, pagination behavior, error conditions, authentication requirements, or rate limits. For a list operation with 4 parameters, this leaves significant gaps in understanding how the tool behaves.

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 that communicates the core functionality without unnecessary words. It's appropriately sized and front-loaded with the main purpose.

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?

For a list operation with 4 parameters and no output schema, the description is insufficient. It doesn't explain what format the results come in, whether there's pagination (implied by parameters but not stated), or how to interpret the output. With no annotations and missing output schema, more completeness is needed.

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 input schema already documents all parameters thoroughly. The description adds minimal value by mentioning project and folder filtering but doesn't provide additional context beyond what's in the schema. This meets the baseline for high schema coverage.

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 action ('List test cases') and mentions optional filtering by project and folder, which provides specific verb+resource information. However, it doesn't explicitly distinguish this tool from similar siblings like 'get_test_case' or 'list_folders', which would require more differentiation for a score of 5.

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?

The description mentions optional filtering parameters but provides no guidance on when to use this tool versus alternatives like 'get_test_case' for single cases or 'list_projects' for project listing. There's no context about prerequisites, typical use cases, 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/donyfs/mcp-zephyr'

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