Skip to main content
Glama

list-modules

List qTest Test Design modules. Use query to search by name, parentId to see children, or omit both for root-level modules.

Instructions

Test Design — list qTest Test Design modules. Pass query to search by name, parentId to list children, or neither for root-level listing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYes
parentIdNoList children of this module ID
queryNoSearch modules by name

Implementation Reference

  • src/server.ts:44-59 (registration)
    Registration of the 'list-modules' tool on the MCP server, defining its input schema (projectId, parentId, query) and wire-up to the listModules handler.
    server.registerTool(
      'list-modules',
      {
        description:
          'Test Design — list qTest Test Design modules. Pass query to search by name, parentId to list children, or neither for root-level listing',
        inputSchema: {
          projectId: z.string(),
          parentId: z.number().int().optional().describe('List children of this module ID'),
          query: z.string().optional().describe('Search modules by name'),
        },
      },
      async ({ projectId, parentId, query }) => {
        const result = await listModules({ projectId, parentId, query })
        return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] }
      }
    )
  • Handler function 'listModules' that constructs the qTest API endpoint based on optional parentId/query parameters and fetches module data.
    export async function listModules(args: ListModulesArgs): Promise<QTestFolder[]> {
      const { projectId, parentId, query } = args
      let endpoint: string
    
      if (query !== undefined) {
        endpoint = `/modules?search=${encodeURIComponent(query)}&size=50`
      } else if (parentId !== undefined) {
        endpoint = `/modules?parentId=${parentId}&size=100`
      } else {
        endpoint = `/modules?size=100`
      }
    
      const raw = await qtestFetch(config, projectId, endpoint, 'GET')
      return extractArray<QTestFolder>(raw)
    }
  • TypeScript interface 'ListModulesArgs' defining the input shape for the list-modules handler.
    export interface ListModulesArgs {
      projectId: string
      parentId?: number
      query?: string
    }
  • Type definitions: QTestModule (with id, name, pid, parentId) and alias type QTestFolder used as the return type for listModules.
    export interface QTestModule {
      id: number
      name: string
      pid?: string
      parentId?: number
    }
    
    export type QTestFolder = QTestModule
  • Utility function 'extractArray' used to normalize the API response into an array (handles items/data/object wrapping).
    export function extractArray<T>(raw: unknown): T[] {
      if (Array.isArray(raw)) return raw as T[]
      if (raw && typeof raw === 'object') {
        for (const key of ['items', 'data', 'object'] as const) {
          const val = (raw as Record<string, unknown>)[key]
          if (Array.isArray(val)) return val as T[]
        }
      }
      return []
    }
Behavior3/5

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

With no annotations, the description carries full burden. It implies a read-only operation but does not disclose permissions, rate limits, or output format. 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?

Single sentence, no wasted words. Front-loaded with 'Test Design — list qTest Test Design modules' for immediate clarity.

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?

No output schema exists, but description covers main use cases. Missing details on pagination or return format, but sufficient for a straightforward list tool.

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 67%; description adds context for query and parentId (e.g., 'search by name') but projectId remains undescribed in both. Adds some value beyond schema but not all.

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 the tool lists qTest Test Design modules, with specific options for searching by name, listing children, or root-level. This distinguishes it from siblings like create-module or list-test-cases.

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?

The description provides three distinct usage scenarios (query, parentId, neither) but does not explicitly state when not to use this tool or compare it to siblings. While helpful, it lacks exclusion guidance.

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