Skip to main content
Glama

update_test_steps

Update existing test steps on a test case version. Provide step IDs and new step details, expected results, or test data. Returns the updated step objects.

Instructions

Update existing test steps on a test case version. Each step must include its step id (from create_test_steps or get_test_case response). Returns the updated step objects.

Input Schema

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

Implementation Reference

  • The async handler that performs PUT request to update test steps for a given test case version. Receives id, versionNo, and steps, then sends them to the API endpoint.
    async ({ id, versionNo, steps }) =>
      ok(
        await qtmFetch(`/testcases/${id}/versions/${versionNo}/teststeps`, {
          method: "PUT",
          body: JSON.stringify(steps),
        })
      )
  • Zod schema defining the input parameters for update_test_steps: id (union string|number), versionNo (integer), and steps (array of objects with id, stepDetails, expectedResult, testData).
    {
      id: ID.describe("Test case ID"),
      versionNo: z.number().int().describe("Test case version number"),
      steps: z
        .array(
          z.object({
            id: z.number().int().describe("Step ID to update"),
            stepDetails: z.string().optional(),
            expectedResult: z.string().optional(),
            testData: z.string().optional(),
          })
        )
        .describe("Steps to update"),
    },
  • src/index.ts:318-342 (registration)
    Registration of the 'update_test_steps' tool via the 'tool' wrapper which calls server.registerTool with the name, description, schema, and callback handler.
    tool(
      "update_test_steps",
      "Update existing test steps on a test case version. Each step must include its step id (from create_test_steps or get_test_case response). Returns the updated step objects.",
      {
        id: ID.describe("Test case ID"),
        versionNo: z.number().int().describe("Test case version number"),
        steps: z
          .array(
            z.object({
              id: z.number().int().describe("Step ID to update"),
              stepDetails: z.string().optional(),
              expectedResult: z.string().optional(),
              testData: z.string().optional(),
            })
          )
          .describe("Steps to update"),
      },
      async ({ id, versionNo, steps }) =>
        ok(
          await qtmFetch(`/testcases/${id}/versions/${versionNo}/teststeps`, {
            method: "PUT",
            body: JSON.stringify(steps),
          })
        )
    );
  • The 'ok' helper function wraps API response data into the MCP content structure expected by the tool callback.
    function ok(data: unknown) {
      return {
        content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
      };
    }
  • The 'qtmFetch' helper function used by the tool handler to make HTTP requests to the QMetry API.
    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;
    }
Behavior4/5

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

Given no annotations, the description discloses that this tool modifies existing steps and returns updated objects. It doesn't detail side effects or partial update behavior, but the core update nature is clear.

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?

Two sentences front-load purpose and a key prerequisite, with no wasted words.

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

Completeness4/5

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

The description covers purpose, prerequisites, and return value, but could be improved by explicitly mentioning that partial updates are allowed or that the test case version must exist.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds valuable context that step ids must come from prior API responses, which is not explicit 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?

The description clearly states the verb 'Update', the resource 'existing test steps on a test case version', and distinguishes from siblings like create_test_steps and update_test_step_execution.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides one key prerequisite (steps must include step id from create or get response) but does not guide when to use this tool versus alternatives like create_test_steps or update_test_step_execution.

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