Skip to main content
Glama

get_test_script

Retrieve Gherkin-format test scripts for specific test cases in Zephyr Scale Cloud to support test execution and management.

Instructions

Get the test script (Gherkin format) for a test case

Input Schema

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

Implementation Reference

  • Handler function that validates the testCaseKey input, fetches the test script using ZephyrClient, formats the response in MCP content format, and handles errors.
    async function getTestScript(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 script = await client.getTestScript(testCaseKey);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                testCaseKey,
                testScript: script,
                note: 'Test script is returned in Gherkin format (BDD style)'
              }, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: formatError(error, `fetching test script for ${args.testCaseKey}`)
            }
          ],
          isError: true
        };
      }
    }
  • Registration of the 'get_test_script' tool in the testScriptTools array, including name, description, inputSchema, and handler reference.
    {
      name: 'get_test_script',
      description: 'Get the test script (Gherkin format) for a test case',
      inputSchema: {
        type: 'object',
        properties: {
          testCaseKey: {
            type: 'string',
            description: 'Test case key (format: [A-Z]+-T[0-9]+)',
            pattern: config.testCaseKeyPattern.source
          }
        },
        required: ['testCaseKey']
      },
      handler: getTestScript
    },
  • Input schema for the 'get_test_script' tool defining the required testCaseKey parameter with pattern validation.
    inputSchema: {
      type: 'object',
      properties: {
        testCaseKey: {
          type: 'string',
          description: 'Test case key (format: [A-Z]+-T[0-9]+)',
          pattern: config.testCaseKeyPattern.source
        }
      },
      required: ['testCaseKey']
    },
  • Helper method in ZephyrClient class that makes the API request to retrieve the test script for a given test case key.
    async getTestScript(testCaseKey) {
      return this.request('GET', `/testcases/${testCaseKey}/testscript`);
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states it's a retrieval operation ('Get'), implying read-only behavior, but doesn't disclose any behavioral traits like authentication requirements, error conditions, rate limits, or what happens if the test case doesn't exist. For a tool with zero annotation coverage, this leaves significant gaps.

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 with zero waste. It's front-loaded with the core purpose and includes essential qualifiers (Gherkin format, test case) without unnecessary elaboration. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (single parameter, 100% schema coverage, no output schema), the description is adequate but incomplete. It specifies the resource and format but lacks behavioral context (e.g., error handling, return format details). For a read operation with no annotations, it should ideally mention what's returned or common usage scenarios.

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%, with the single parameter 'testCaseKey' fully documented in the schema (including format and pattern). The description doesn't add any parameter semantics beyond what's in the schema, so it meets the baseline of 3 where the schema does the heavy lifting.

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 verb ('Get') and resource ('test script') with specific format information ('Gherkin format') and target ('for a test case'). It distinguishes from siblings like 'get_test_case' or 'get_test_steps' by focusing on the script content rather than metadata or steps. However, it doesn't explicitly contrast with 'create_test_script' or 'create_bdd_test_script'.

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 provides no guidance on when to use this tool versus alternatives. With siblings like 'get_test_case', 'get_test_steps', and 'create_test_script', there's no indication of when this retrieval of Gherkin scripts is preferred over other read operations or when it might be inappropriate.

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