Skip to main content
Glama

update_test_execution

Update a test case execution result in a QTM4J test cycle by specifying the cycle ID, execution ID, and result status (Pass, Fail, Blocked, etc.). Optionally add a comment, actual time, environment, or build ID. Returns HTTP 204 on success.

Instructions

Update a single test case execution result inside a test cycle. Use testCaseExecutionId from get_test_cycle_executions. executionResultId: 239443=Not Executed, 239444=Pass, 239441=Fail, 239442=Work In Progress, 239440=Blocked. Returns 204 on success.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cycleIdYesTest cycle ID
testCaseExecutionIdYesTest case execution ID
executionResultIdNoExecution result/status ID
environmentIdNoEnvironment ID
buildIdNoBuild ID
commentNoExecution comment
actualTimeNoActual time spent in milliseconds

Implementation Reference

  • Handler function that sends a PUT request to update a test case execution, returning a success message.
    async ({ cycleId, testCaseExecutionId, ...rest }) => {
      await qtmFetch(
        `/testcycles/${cycleId}/testcase-executions/${testCaseExecutionId}`,
        { method: "PUT", body: JSON.stringify(rest) }
      );
      return ok({ message: `Execution ${testCaseExecutionId} updated` });
    }
  • Input schema for update_test_execution: cycleId, testCaseExecutionId, and optional fields for result, environment, build, comment, and actual time.
    {
      cycleId: ID.describe("Test cycle ID"),
      testCaseExecutionId: ID.describe("Test case execution ID"),
      executionResultId: z.number().int().optional().describe("Execution result/status ID"),
      environmentId: z.number().int().optional().describe("Environment ID"),
      buildId: z.number().int().optional().describe("Build ID"),
      comment: z.string().optional().describe("Execution comment"),
      actualTime: z.number().int().optional().describe("Actual time spent in milliseconds"),
    },
  • src/index.ts:441-460 (registration)
    Registration of the 'update_test_execution' tool via the 'tool' wrapper which calls server.registerTool.
    tool(
      "update_test_execution",
      "Update a single test case execution result inside a test cycle. Use testCaseExecutionId from get_test_cycle_executions. executionResultId: 239443=Not Executed, 239444=Pass, 239441=Fail, 239442=Work In Progress, 239440=Blocked. Returns 204 on success.",
      {
        cycleId: ID.describe("Test cycle ID"),
        testCaseExecutionId: ID.describe("Test case execution ID"),
        executionResultId: z.number().int().optional().describe("Execution result/status ID"),
        environmentId: z.number().int().optional().describe("Environment ID"),
        buildId: z.number().int().optional().describe("Build ID"),
        comment: z.string().optional().describe("Execution comment"),
        actualTime: z.number().int().optional().describe("Actual time spent in milliseconds"),
      },
      async ({ cycleId, testCaseExecutionId, ...rest }) => {
        await qtmFetch(
          `/testcycles/${cycleId}/testcase-executions/${testCaseExecutionId}`,
          { method: "PUT", body: JSON.stringify(rest) }
        );
        return ok({ message: `Execution ${testCaseExecutionId} updated` });
      }
    );
  • Helper wrapper around server.registerTool used to register all tools concisely.
    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
      );
Behavior3/5

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

No annotations are provided, so the description shoulders the burden. It states the return code (204) and implies mutation, but does not disclose permissions, destructive potential, or behavior for omitted fields. Adequate but not thorough.

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 are tight, front-loaded with the main action, and every sentence adds essential information. No redundant or vague phrases.

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?

Covers key aspects: ID source, status mapping, return code. No output schema but return is stated. Could mention error handling or partial update behavior, but for a straightforward update tool, it is sufficiently complete.

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 100% of parameters with descriptions. The description adds value by mapping executionResultId to status names and specifying the source for testCaseExecutionId. Enhances understanding beyond 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 specifies the action 'update' and the resource 'single test case execution result inside a test cycle'. It distinguishes from sibling 'bulk_update_test_executions' by emphasizing 'single'. The purpose is evident and unambiguous.

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

Usage Guidelines4/5

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

Provides guidance on sourcing testCaseExecutionId from get_test_cycle_executions and gives explicit mapping for executionResultId values. Lacks explicit when-not-to-use but implicitly contrasts with bulk update. Clear context for using the tool.

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