Skip to main content
Glama

delete_test_case

Permanently delete a specific version of a test case. If it is the only version, the test case is removed entirely. Returns success when complete.

Instructions

Permanently delete a specific version of a test case. If it is the only version, the test case is removed entirely. Returns 204 on success.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesTest case ID
versionNoYesVersion number to delete

Implementation Reference

  • The 'delete_test_case' tool handler: calls qtmFetch with DELETE method on /testcases/{id}/versions/{versionNo} to permanently delete a specific test case version. If it is the only version, the test case is removed entirely. Returns 204 on success.
    tool(
      "delete_test_case",
      "Permanently delete a specific version of a test case. If it is the only version, the test case is removed entirely. Returns 204 on success.",
      {
        id: ID.describe("Test case ID"),
        versionNo: z.number().int().describe("Version number to delete"),
      },
      async ({ id, versionNo }) => {
        await qtmFetch(`/testcases/${id}/versions/${versionNo}`, { method: "DELETE" });
        return ok({ message: `Test case ${id} version ${versionNo} deleted` });
      }
    );
  • Input schema for delete_test_case: accepts id (string or number via ID union type) and versionNo (integer).
    {
      id: ID.describe("Test case ID"),
      versionNo: z.number().int().describe("Version number to delete"),
    },
  • src/index.ts:172-184 (registration)
    The 'tool' helper function wraps server.registerTool to register each tool with name, description, schema, and callback. 'delete_test_case' is registered via this wrapper at lines 268-279.
    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 'ok' helper function wraps successful API responses into MCP tool content format, used by the delete_test_case handler.
    /** Wrap a successful API response as MCP tool content. */
    function ok(data: unknown) {
      return {
        content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
      };
    }
  • The 'qtmFetch' HTTP helper used by delete_test_case to make the DELETE request 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?

The description discloses key behavioral traits: 'permanently delete' indicates destructive action, clarifies version-specific behavior, and mentions the return code 204. With no annotations provided, it carries the full burden and does so adequately, though it could add more details like authorization requirements.

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 concise sentences with no unnecessary words. Critical information is front-loaded: the action, the target, the conditional behavior, and the return value. Every sentence earns its place.

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 the tool's simplicity (no output schema, two parameters), the description covers the return value (204) and the effect on test case versions. It is sufficiently complete for its complexity, though it could benefit from mentioning that the id can be either a string or number (but schema already covers that).

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% and the description does not add extra meaning beyond the schema's property descriptions. For a simple two-parameter tool, this meets the baseline but does not elevate it.

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 'Permanently delete a specific version of a test case' with the specific verb 'delete' and resource 'test case version'. It also explains the behavior when it's the only version, distinguishing it from sibling tools like delete_test_cycle or delete_test_plan.

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 explicit guidance on when to use this tool versus alternatives. Does not mention prerequisites, such as how to obtain the version number, or indicate that deletion is irreversible and should be used with caution.

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