Skip to main content
Glama

update_test_step_execution

Update a single test step execution result within a test case execution by specifying the test cycle ID and step execution ID to modify execution result, actual result, or comment.

Instructions

Update a single step-level execution result within a test case execution. testStepExecutionId comes from get_test_cycle_executions step data. Returns 200 with updated step data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cycleIdYesTest cycle ID
testStepExecutionIdYesTest step execution ID
executionResultIdNoExecution result ID
actualResultNoActual result text
commentNo

Implementation Reference

  • The handler function that executes the 'update_test_step_execution' tool logic. It calls qtmFetch with PUT to /testcycles/{cycleId}/teststep-executions/{testStepExecutionId} and returns the updated step data.
    tool(
      "update_test_step_execution",
      "Update a single step-level execution result within a test case execution. testStepExecutionId comes from get_test_cycle_executions step data. Returns 200 with updated step data.",
      {
        cycleId: ID.describe("Test cycle ID"),
        testStepExecutionId: ID.describe("Test step execution ID"),
        executionResultId: z.number().int().optional().describe("Execution result ID"),
        actualResult: z.string().optional().describe("Actual result text"),
        comment: z.string().optional(),
      },
      async ({ cycleId, testStepExecutionId, ...rest }) => {
        const data = await qtmFetch(
          `/testcycles/${cycleId}/teststep-executions/${testStepExecutionId}`,
          { method: "PUT", body: JSON.stringify(rest) }
        );
        return ok(data ?? { message: `Step execution ${testStepExecutionId} updated` });
      }
    );
  • Input schema for the tool, defining parameters: cycleId (ID), testStepExecutionId (ID), executionResultId (optional int), actualResult (optional string), and comment (optional string).
    {
      cycleId: ID.describe("Test cycle ID"),
      testStepExecutionId: ID.describe("Test step execution ID"),
      executionResultId: z.number().int().optional().describe("Execution result ID"),
      actualResult: z.string().optional().describe("Actual result text"),
      comment: z.string().optional(),
    },
  • src/index.ts:171-184 (registration)
    The 'tool' wrapper function that registers tools via server.registerTool. The 'update_test_step_execution' tool is registered through this helper at line 462-479.
    /** Thin wrapper around registerTool for concise, non-deprecated tool registration. */
    const tool = <Shape extends z.ZodRawShape>(
      name: string,
      description: string,
      inputSchema: Shape,
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      callback: (args: z.infer<z.ZodObject<Shape>>) => Promise<any>
    ) =>
      server.registerTool(
        name,
        { description, inputSchema },
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        callback as any
      );
  • The qtmFetch helper function used by the handler to make HTTP requests to the QMetry API with retry logic for rate limiting (429).
    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;
    }
  • The 'ok' helper function that wraps API responses into MCP tool content format used by the handler to return results.
    function ok(data: unknown) {
      return {
        content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
      };
    }
Behavior3/5

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

No annotations provided, so description must cover behavior. It mentions the return status 200 with updated data, but does not disclose error conditions, prerequisites (e.g., existence of cycleId/testStepExecutionId), or mutation consequences.

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?

Three sentences, front-loaded with the action, clear and efficient. No unnecessary 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?

Given no output schema and omitted details like error handling, the description is fairly complete with the return status and parameter source. However, cycleId is required but its context is not explained.

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 covers 80% of parameters with descriptions. The description adds value by specifying the source of testStepExecutionId (from get_test_cycle_executions), which aids correct usage. Other parameters lack additional context.

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 it updates a single step-level execution result within a test case execution, and specifies the source of testStepExecutionId from get_test_cycle_executions, distinguishing it from sibling update_test_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 implies usage for updating step-level results but does not explicitly exclude or compare with alternatives like update_test_execution. No when-to-use or when-not-to-use guidance.

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