Skip to main content
Glama

delete-test-cycle

Delete a test cycle by numeric ID. Automatically removes all child test cycles, test suites, and test runs.

Instructions

Test Execution — delete a qTest test cycle by numeric id. Cascades to all child test cycles, test suites, and test runs automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesNumeric project ID as string
idYesTest cycle numeric ID to delete

Implementation Reference

  • The main handler function `deleteTestCycle` that fetches the cycle info, calls `deleteRecursive` to recursively delete child suites/runs/cycles, then deletes the cycle itself.
    export async function deleteTestCycle(
      args: DeleteTestCycleArgs
    ): Promise<DeleteTestCycleResult> {
      const { projectId, id } = args
    
      const raw = await qtestFetch(config, projectId, `/test-cycles/${id}`, 'GET')
      const cycleInfo = raw as QTestTestCycle
    
      await deleteRecursive(projectId, id)
    
      return { deleted: true, cycle: cycleInfo }
  • Recursive helper that deletes test suites (and their test runs), then child cycles, then the cycle itself.
    async function deleteRecursive(projectId: string, id: number): Promise<void> {
      const suitesRaw = await qtestFetch(
        config, projectId,
        `/test-suites?parentId=${id}&parentType=test-cycle`,
        'GET'
      )
      const suites = extractArray<QTestTestSuite>(suitesRaw)
      for (const suite of suites) {
        const runsRaw = await qtestFetch(
          config, projectId,
          `/test-runs?parentId=${suite.id}&parentType=test-suite`,
          'GET'
        )
        const runs = extractArray<QTestTestRun>(runsRaw)
        for (const run of runs) {
          await qtestFetch(config, projectId, `/test-runs/${run.id}`, 'DELETE')
        }
        await qtestFetch(config, projectId, `/test-suites/${suite.id}`, 'DELETE')
      }
    
      const childrenRaw = await qtestFetch(
        config, projectId,
        `/test-cycles?parentId=${id}&parentType=test-cycle`,
        'GET'
      )
      const children = extractArray<QTestTestCycle>(childrenRaw)
      for (const child of children) {
        await deleteRecursive(projectId, child.id)
      }
    
      await qtestFetch(config, projectId, `/test-cycles/${id}`, 'DELETE')
    }
  • Input type definition for the delete operation (projectId and id).
    export interface DeleteTestCycleArgs {
      projectId: string
      id: number
    }
  • Return type definition for the delete operation.
    export interface DeleteTestCycleResult {
      deleted: true
      cycle: QTestTestCycle
    }
  • src/server.ts:153-167 (registration)
    Registration of the 'delete-test-cycle' tool on the MCP server, with Zod input schema and handler that calls deleteTestCycle.
    server.registerTool(
      'delete-test-cycle',
      {
        description:
          'Test Execution — delete a qTest test cycle by numeric id. Cascades to all child test cycles, test suites, and test runs automatically.',
        inputSchema: {
          projectId: z.string().describe('Numeric project ID as string'),
          id: z.number().int().describe('Test cycle numeric ID to delete'),
        },
      },
      async ({ projectId, id }) => {
        const result = await deleteTestCycle({ projectId, id })
        return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] }
      }
    )
Behavior3/5

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

Discloses cascading deletion (child cycles, suites, runs), which is a critical behavioral trait not in the schema. However, lacks details on irreversibility, permission requirements, or performance implications. With no annotations, additional context is needed.

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?

Single, well-structured sentence that front-loads the primary action and resource, then adds cascading detail. No redundant or filler 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?

Adequately covers the tool's functionality for two simple parameters and no output schema. Cascading behavior is mentioned, but slight gaps in behavioral transparency and usage guidelines reduce completeness slightly.

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 parameter descriptions. No additional constraints or formatting details are provided.

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?

Clearly states the verb 'delete' and the resource 'qTest test cycle by numeric id'. Distinguishes from siblings by highlighting cascading deletion behavior.

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 when/when-not or alternative tools. Does not provide prerequisites or scenarios where this tool is preferred over others like list-test-cycle or create-test-cycle.

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/Usman-Ghani123/qtest-mcp-server'

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