Skip to main content
Glama

get_linked_test_cycles

List all test cycles linked to a test plan using its internal ID. Returns paginated results with cycle ID, key, status, and priority.

Instructions

List all test cycles currently linked to a test plan. Returns paginated list with id, key, status, priority per cycle. Use the plan's internal id (not key).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesTest plan ID
startAtNoPage offset (default 0)
maxResultsNoItems per page (max 100, default 50)
sortNoSort e.g. "id:asc" or "updated:desc"
fieldsNoComma-separated fields to return

Implementation Reference

  • The handler function that executes the 'get_linked_test_cycles' tool logic. It sends a POST request to /testplans/{id}/testcycles with pagination query params and an empty filter body.
      async ({ id, startAt, maxResults, sort, fields }) =>
        ok(
          await qtmFetch(`/testplans/${id}/testcycles${qs({ startAt, maxResults, sort, fields })}`, {
            method: "POST",
            body: JSON.stringify({ filter: {} }),
          })
        )
    );
  • Input schema for the tool: takes a test plan ID and pagination fields (startAt, maxResults, sort, fields).
    {
      id: ID.describe("Test plan ID"),
      ...Pagination,
    },
  • src/index.ts:587-601 (registration)
    Registration of the 'get_linked_test_cycles' tool via the 'tool()' wrapper which calls server.registerTool().
    tool(
      "get_linked_test_cycles",
      "List all test cycles currently linked to a test plan. Returns paginated list with id, key, status, priority per cycle. Use the plan's internal id (not key).",
      {
        id: ID.describe("Test plan ID"),
        ...Pagination,
      },
      async ({ id, startAt, maxResults, sort, fields }) =>
        ok(
          await qtmFetch(`/testplans/${id}/testcycles${qs({ startAt, maxResults, sort, fields })}`, {
            method: "POST",
            body: JSON.stringify({ filter: {} }),
          })
        )
    );
  • HTTP fetch helper used by the handler to make API calls to QMetry.
    async function qtmFetch(
      path: string,
      options: RequestInit = {},
      attempt = 1
    ): Promise<unknown> {
      const url = `${BASE_URL}${path}`;
      const headers: Record<string, string> = {
        apiKey: API_KEY ?? "",
        "Content-Type": "application/json",
        Accept: "application/json",
        ...(options.headers as Record<string, string> | undefined),
      };
    
      const response = await fetch(url, { ...options, headers });
    
      // Exponential back-off for rate limiting (max 3 attempts)
      if (response.status === 429 && attempt < 3) {
        const retryAfter = Number.parseInt(
          response.headers.get("Retry-After") ?? "1",
          10
        );
        const delay = Math.max(retryAfter * 1000, 1000) * attempt;
        await new Promise((r) => setTimeout(r, delay));
        return qtmFetch(path, options, attempt + 1);
      }
    
      const text = await response.text();
      let body: unknown;
      try {
        body = text ? JSON.parse(text) : null;
      } catch {
        body = text;
      }
    
      if (!response.ok) {
        throw new Error(
          `HTTP ${response.status} ${response.statusText}: ${JSON.stringify(body)}`
        );
      }
    
      return body;
    }
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the return fields and pagination behavior but does not mention side effects, authentication needs, or rate limits. For a read-only listing tool, the transparency is adequate but not exceptional.

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?

Two sentences, front-loaded with purpose and return fields. Every word earns its place. No redundancy or fluff.

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 the complexity (5 params, no output schema, no annotations), the description covers the main purpose, return fields, and key parameter guidance. It lacks details on sorting and filtering parameters, but for a listing tool, it is sufficiently complete.

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 descriptions for all parameters. The description adds value by clarifying the 'id' parameter ('internal id, not key') and noting pagination (startAt, maxResults). This guidance goes beyond the 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?

The description clearly states the action ('list all test cycles'), the resource ('linked to a test plan'), and the return fields. It distinguishes from siblings like 'get_test_cycle' (single) and 'search_test_cycles' (not necessarily linked) by specifying 'linked to a test plan'.

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 provides context for when to use this tool (when you need linked cycles) and gives a specific usage instruction ('Use the plan's internal id (not key)'). It does not explicitly state when not to use it or list alternative tools, but the purpose clarity implies the scope.

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/salehrifai42/qmetrymcp'

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