create-module
Creates a new module in qTest Test Design to organize test cases under a project, optionally as a submodule under a parent module.
Instructions
Test Design — create a new module in qTest Test Design to organise test cases
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | ||
| name | Yes | Name of the new module | |
| parentId | No | Parent module ID; omit to create at root |
Implementation Reference
- The core handler function that executes the create-module logic. It constructs the API endpoint (with optional parentId for sub-module or root), sends a POST request via qtestFetch, and returns the created module as a QTestModule.
export async function createModule(args: CreateModuleArgs): Promise<QTestModule> { const { projectId, name, parentId } = args const endpoint = parentId !== undefined ? `/modules?parentId=${parentId}&parentType=module` : `/modules?parentType=root` const result = await qtestFetch(config, projectId, endpoint, 'POST', { name }) return result as QTestModule - TypeScript interface defining the input schema for createModule: projectId (string), name (string), and optional parentId (number).
export interface CreateModuleArgs { projectId: string name: string parentId?: number } - src/server.ts:61-75 (registration)Registration of the 'create-module' tool on the MCP server, including its description, Zod input schema, and the inline async handler that calls createModule.
server.registerTool( 'create-module', { description: 'Test Design — create a new module in qTest Test Design to organise test cases', inputSchema: { projectId: z.string(), name: z.string().describe('Name of the new module'), parentId: z.number().int().optional().describe('Parent module ID; omit to create at root'), }, }, async ({ projectId, name, parentId }) => { const result = await createModule({ projectId, name, parentId }) return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] } } )