Skip to main content
Glama

list-test-cycle

List qTest test cycles by project ID. Filter by name, parent cycle, or single cycle ID for targeted results.

Instructions

Test Execution — list qTest test cycles. Omit all optional args for root-level listing, provide id for a single cycle, or provide name to filter by name (case-insensitive exact match)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesNumeric project ID as string
idNoTest cycle ID; returns a single cycle
nameNoFilter cycles by name (case-insensitive exact match)
parentIdNoList child cycles of this parent test cycle ID

Implementation Reference

  • Main handler function that lists test cycles. Accepts projectId (required), id, name, and parentId (optional). If id is provided, fetches a single cycle and its children tree. Otherwise, fetches all cycles (optionally filtered by parentId) and optionally filters by name (case-insensitive).
    export async function listTestCycles(
      args: ListTestCyclesArgs
    ): Promise<QTestTestCycle | QTestTestCycle[]> {
      const { projectId, id, name, parentId } = args
    
      if (id !== undefined) {
        const raw = await qtestFetch(config, projectId, `/test-cycles/${id}`, 'GET')
        return fetchCycleTree(projectId, raw as QTestTestCycle)
      }
    
      const endpoint = parentId !== undefined
        ? `/test-cycles?parentId=${parentId}&parentType=test-cycle`
        : '/test-cycles'
    
      const raw = await qtestFetch(config, projectId, endpoint, 'GET')
      const all = extractArray<QTestTestCycle>(raw)
    
      if (name !== undefined) {
        const lower = name.toLowerCase()
        return all.filter((c) => c.name.toLowerCase() === lower)
      }
    
      return all
    }
  • Recursive helper function that fetches and attaches child cycles to a given test cycle, building a full hierarchy tree.
    async function fetchCycleTree(projectId: string, cycle: QTestTestCycle): Promise<QTestTestCycle> {
      const childrenRaw = await qtestFetch(
        config, projectId,
        `/test-cycles?parentId=${cycle.id}&parentType=test-cycle`,
        'GET'
      )
      const children = extractArray<QTestTestCycle>(childrenRaw)
      if (children.length > 0) {
        const childTrees: QTestTestCycle[] = []
        for (const child of children) {
          childTrees.push(await fetchCycleTree(projectId, child))
        }
        cycle.children = childTrees
      }
      return cycle
    }
  • TypeScript interface defining the input arguments for listTestCycles: projectId (string), id (optional number), name (optional string), parentId (optional number).
    export interface ListTestCyclesArgs {
      projectId: string
      id?: number
      name?: string
      parentId?: number
    }
  • src/server.ts:135-150 (registration)
    Registration of the 'list-test-cycle' tool on the MCP server with input schema (projectId, id, name, parentId) and handler that delegates to listTestCycles().
    server.registerTool(
      'list-test-cycle',
      {
        description:
          'Test Execution — list qTest test cycles. Omit all optional args for root-level listing, provide id for a single cycle, or provide name to filter by name (case-insensitive exact match)',
        inputSchema: {
          projectId: z.string().describe('Numeric project ID as string'),
          id: z.number().int().optional().describe('Test cycle ID; returns a single cycle'),
          name: z.string().optional().describe('Filter cycles by name (case-insensitive exact match)'),
          parentId: z.number().int().optional().describe('List child cycles of this parent test cycle ID'),
        },
      },
      async ({ projectId, id, name, parentId }) => {
        const result = await listTestCycles({ projectId, id, name, parentId })
        return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] }
      }
  • TypeScript type definition for QTestTestCycle, the return type shape: id, name, pid, parentId, description, and optional children array for hierarchical cycles.
    export interface QTestTestCycle {
      id: number
      name: string
      pid?: string
      parentId?: number
      description?: string
      children?: QTestTestCycle[]
    }
Behavior3/5

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

No annotations are provided, so the description carries full burden. It describes the behavior for different parameter combinations but does not mention whether the operation is read-only, any authentication needs, or return format. For a list tool, the behavioral disclosure is adequate but could be richer.

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?

The description is two sentences with no wasted words. The first sentence identifies the tool concisely, and the second covers all usage scenarios. Every sentence is essential.

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 no output schema and no annotations, the description explains all parameter usage comprehensively. It covers the main scenarios but could mention the read-only nature or output format. Still, it is complete enough for an agent to use correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with basic descriptions. The description adds value by grouping parameters into use-case patterns (root-level, single, filter), which is more helpful than just listing parameter names. This goes beyond the schema's descriptions.

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 'list qTest test cycles' with a prefix 'Test Execution', providing a specific verb and resource. It distinguishes from sibling tools like create-test-cycle or delete-test-cycle by explicitly naming the action and resource.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit guidance on when to use each argument: omit all optional args for root-level listing, use id for a single cycle, or name for case-insensitive filter. It does not explicitly mention when not to use the tool or alternative siblings, but the context is clear enough.

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