Skip to main content
Glama

create_test_steps

Add one or more test steps to a specific version of a test case. Each step requires step details, with optional expected result and test data. Returns created step IDs.

Instructions

Add one or more test steps to a specific version of a test case. Each step has stepDetails (required), expectedResult, and testData. Returns the created step objects with their IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesTest case ID
versionNoYesTest case version number
stepsYesSteps to create

Implementation Reference

  • src/index.ts:293-316 (registration)
    The tool 'create_test_steps' is registered using the local 'tool()' wrapper (lines 172-184) which calls server.registerTool. It is defined at lines 293-316 with name 'create_test_steps', description, input schema, and handler callback all inline.
    tool(
      "create_test_steps",
      "Add one or more test steps to a specific version of a test case. Each step has stepDetails (required), expectedResult, and testData. Returns the created step objects with their IDs.",
      {
        id: ID.describe("Test case ID"),
        versionNo: z.number().int().describe("Test case version number"),
        steps: z
          .array(
            z.object({
              stepDetails: z.string().describe("Step action/description"),
              expectedResult: z.string().optional(),
              testData: z.string().optional(),
            })
          )
          .describe("Steps to create"),
      },
      async ({ id, versionNo, steps }) =>
        ok(
          await qtmFetch(`/testcases/${id}/versions/${versionNo}/teststeps`, {
            method: "POST",
            body: JSON.stringify(steps),
          })
        )
    );
  • The handler function for 'create_test_steps'. It is an async callback that destructures { id, versionNo, steps } from the input, then makes a POST request to /testcases/{id}/versions/{versionNo}/teststeps with the steps array as the JSON body. The response is wrapped via the ok() helper to produce MCP content.
      async ({ id, versionNo, steps }) =>
        ok(
          await qtmFetch(`/testcases/${id}/versions/${versionNo}/teststeps`, {
            method: "POST",
            body: JSON.stringify(steps),
          })
        )
    );
  • The input schema for 'create_test_steps', defined as a Zod object. It requires: id (string|number union), versionNo (integer), and steps (array of objects each with required stepDetails string and optional expectedResult/testData strings).
    {
      id: ID.describe("Test case ID"),
      versionNo: z.number().int().describe("Test case version number"),
      steps: z
        .array(
          z.object({
            stepDetails: z.string().describe("Step action/description"),
            expectedResult: z.string().optional(),
            testData: z.string().optional(),
          })
        )
        .describe("Steps to create"),
    },
  • The ok() helper wraps an API response into the MCP content format (content array with a single text block containing JSON). It is used by the create_test_steps handler to format the response.
    function ok(data: unknown) {
      return {
        content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
      };
    }
  • The qtmFetch() helper is the HTTP fetch abstraction used by create_test_steps to make the API call. It handles authentication via apiKey header, JSON parsing, and retry with exponential backoff on 429 rate limiting.
    async function qtmFetch(
      path: string,
      options: RequestInit = {},
      attempt = 1
    ): Promise<unknown> {
      const url = `${BASE_URL}${path}`;
      const headers: Record<string, string> = {
        apiKey: API_KEY ?? "",
        "Content-Type": "application/json",
        Accept: "application/json",
        ...(options.headers as Record<string, string> | undefined),
      };
    
      const response = await fetch(url, { ...options, headers });
    
      // Exponential back-off for rate limiting (max 3 attempts)
      if (response.status === 429 && attempt < 3) {
        const retryAfter = Number.parseInt(
          response.headers.get("Retry-After") ?? "1",
          10
        );
        const delay = Math.max(retryAfter * 1000, 1000) * attempt;
        await new Promise((r) => setTimeout(r, delay));
        return qtmFetch(path, options, attempt + 1);
      }
    
      const text = await response.text();
      let body: unknown;
      try {
        body = text ? JSON.parse(text) : null;
      } catch {
        body = text;
      }
    
      if (!response.ok) {
        throw new Error(
          `HTTP ${response.status} ${response.statusText}: ${JSON.stringify(body)}`
        );
      }
    
      return body;
    }
Behavior3/5

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

With no annotations, the description carries full burden. It discloses that steps are created and returns objects with IDs, but lacks details on side effects, permissions, or behavior if the version does not exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the action and key details. No extraneous information, though it could be slightly more structured for readability.

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?

For a creation tool with no output schema, the description covers purpose and return value. Missing context on error cases, duplication, or whether steps are appended or replaced.

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 coverage is 100%, so the description adds minimal value beyond the schema. It reiterates that stepDetails is required and lists step fields, which are already in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool adds test steps to a specific version of a test case, using the verb 'add' and specifying the resource. It distinguishes from sibling tools like update_test_steps by focusing on creation.

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?

No guidance on when to use this tool versus alternatives such as update_test_steps for modifying steps. Users are left to infer usage from the purpose alone.

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/salehrifai42/qmetrymcp'

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