Skip to main content
Glama

delete-module

Delete a qTest test module by its numeric ID. Automatically removes all child modules and test cases.

Instructions

Test Design — delete a qTest test module by numeric id. Cascades to all child modules and test cases automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesNumeric project ID as string
idYesNumeric module ID to delete

Implementation Reference

  • Main handler function that deletes a module by ID. Fetches module info first, then recursively deletes all children and test cases, then deletes the module itself.
    export async function deleteModule(
      args: DeleteModuleArgs
    ): Promise<DeleteModuleResult> {
      const { projectId, id } = args
    
      const raw = await qtestFetch(config, projectId, `/modules/${id}`, 'GET')
      const moduleInfo = raw as QTestModule
    
      await deleteModuleRecursive(projectId, id)
    
      return { deleted: true, module: moduleInfo }
    }
  • Recursive helper that deletes child modules and their test cases before deleting the module.
    async function deleteModuleRecursive(projectId: string, id: number): Promise<void> {
      const childrenRaw = await qtestFetch(config, projectId, `/modules?parentId=${id}&size=100`, 'GET')
      const children = extractArray<QTestModule>(childrenRaw)
      for (const child of children) {
        await deleteModuleRecursive(projectId, child.id)
      }
    
      let page = 1
      while (true) {
        const casesRaw = await qtestFetch(
          config, projectId,
          `/test-cases?parentId=${id}&parentType=module&page=${page}&size=100`,
          'GET'
        )
        const cases = extractArray<QTestTestCase>(casesRaw)
        for (const tc of cases) {
          await qtestFetch(config, projectId, `/test-cases/${tc.id}`, 'DELETE')
        }
        if (cases.length < 100) break
        page++
      }
    
      await qtestFetch(config, projectId, `/modules/${id}`, 'DELETE')
    }
  • Input type definition for deleteModule: projectId (string) and id (number).
    export interface DeleteModuleArgs {
      projectId: string
      id: number
    }
  • Output type definition for deleteModule: deleted flag and module info.
    export interface DeleteModuleResult {
      deleted: true
      module: QTestModule
    }
  • src/server.ts:169-183 (registration)
    Registration of the 'delete-module' tool on the MCP server with input schema (projectId: string, id: number) and handler calling deleteModule.
    server.registerTool(
      'delete-module',
      {
        description:
          'Test Design — delete a qTest test module by numeric id. Cascades to all child modules and test cases automatically.',
        inputSchema: {
          projectId: z.string().describe('Numeric project ID as string'),
          id: z.number().int().describe('Numeric module ID to delete'),
        },
      },
      async ({ projectId, id }) => {
        const result = await deleteModule({ projectId, id })
        return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] }
      }
    )
Behavior4/5

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

Discloses cascading behavior to child modules and test cases, a critical side effect. With no annotations, this is valuable. However, does not mention irreversibility or permission 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?

Single sentence, no wasted words. Action and key behavior are front-loaded.

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?

Adequate for a simple delete operation with clear cascading behavior. Could mention error cases or permanence for full completeness, but not essential.

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 descriptions cover both parameters fully. Description adds no extra meaning beyond what is already in the input 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?

Description clearly states action ('delete'), resource ('qTest test module'), and input ('numeric id'). Distinguishes from sibling delete-test-cycle by specifying module type.

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?

Implies usage for deleting test modules but does not explicitly state when to use or not use this tool, nor provides comparison to sibling delete-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