Skip to main content
Glama
TCSoftInc

TestCollab MCP Server

by TCSoftInc

list_suites

Retrieve and filter test suites as a hierarchical tree structure from TestCollab projects to organize and navigate testing resources.

Instructions

List all test suites in a TestCollab project as a hierarchical tree. Returns the complete suite tree with parent-child relationships.

Each suite node includes: id, title, parent_id, children (nested suites).

Optional filter:

  • title: Filter suites by title substring.

  • title_contains: Filter suites by title substring (applied at API level).

  • parent: Filter suites by parent suite ID.

  • description: Filter suites by description substring.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNoProject ID (optional if TC_DEFAULT_PROJECT is set)
titleNoFilter suites whose title contains this string
title_containsNoAlias of title (contains match)
parentNoFilter suites by parent suite ID
descriptionNoFilter suites whose description contains this string
description_containsNoAlias of description (contains match)

Implementation Reference

  • The handler function 'handleListSuites' executes the logic to list suites by calling the client API and building a hierarchical tree.
    export async function handleListSuites(args: {
      project_id?: number;
      title?: string;
      title_contains?: string;
      parent?: number;
      description?: string;
      description_contains?: string;
    }): Promise<{ content: Array<{ type: "text"; text: string }> }> {
      try {
        const projectId = resolveProjectId(args.project_id);
        if (!projectId) {
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify({
                  error: {
                    code: "MISSING_PROJECT_ID",
                    message:
                      "No project_id provided and no default project configured. Set TC_DEFAULT_PROJECT or pass project_id.",
                  },
                }),
              },
            ],
          };
        }
    
        const client = getApiClient();
        const title = args.title?.trim() || args.title_contains?.trim();
        const description =
          args.description?.trim() || args.description_contains?.trim();
        const filter: Record<string, number | string> = {};
        if (title) {
          filter.title = title;
        }
        if (description) {
          filter.description = description;
        }
        if (args.parent !== undefined) {
          filter.parent = args.parent;
        }
        const suitesList = await client.listSuites(
          projectId,
          Object.keys(filter).length
            ? {
                filter,
              }
            : undefined
        );
        const tree = buildSuiteTree(Array.isArray(suitesList) ? suitesList : []);
    
        // Count total suites
        const countSuites = (
          nodes: Array<{ children: unknown[] }>
        ): number => {
          let count = nodes.length;
          for (const node of nodes) {
            count += countSuites(
              node.children as Array<{ children: unknown[] }>
            );
          }
          return count;
        };
    
        const totalCount = countSuites(tree);
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                project_id: projectId,
                total_count: totalCount,
                suites: tree,
              }),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                error: {
                  code: "LIST_SUITES_FAILED",
                  message:
                    error instanceof Error ? error.message : "Unknown error",
                },
              }),
            },
          ],
        };
      }
    }
  • The Zod schema 'listSuitesSchema' defines the expected input arguments for the 'list_suites' tool.
    export const listSuitesSchema = z.object({
      project_id: z
        .number()
        .optional()
        .describe("Project ID (optional if TC_DEFAULT_PROJECT is set)"),
      title: z
        .string()
        .optional()
        .describe("Filter suites whose title contains this string"),
      title_contains: z
        .string()
        .optional()
        .describe("Alias of title (contains match)"),
      parent: z
        .number()
        .optional()
        .describe("Filter suites by parent suite ID"),
      description: z
        .string()
        .optional()
        .describe("Filter suites whose description contains this string"),
      description_contains: z
        .string()
        .optional()
        .describe("Alias of description (contains match)"),
    });
  • The 'listSuitesTool' constant defines the name and description of the 'list_suites' tool.
    export const listSuitesTool = {
      name: "list_suites",
      description: `List all test suites in a TestCollab project as a hierarchical tree.
    Returns the complete suite tree with parent-child relationships.
    
    Each suite node includes: id, title, parent_id, children (nested suites).
    
    Optional filter:
    - title: Filter suites by title substring.
    - title_contains: Filter suites by title substring (applied at API level).
    - parent: Filter suites by parent suite ID.
    - description: Filter suites by description substring.`,
    };
Behavior3/5

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

With no annotations provided, the description carries the full burden. It successfully discloses the hierarchical/tree structure and nested parent-child relationships, and documents the return payload structure (id, title, parent_id, children). However, it omits safety indicators (read-only status), rate limits, pagination behavior, or performance characteristics of the tree construction.

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 efficiently structured with clear front-loading: purpose statement, return format, node structure details, and optional filters. Every sentence earns its place without redundancy. The hierarchical formatting of filter options enhances scannability.

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 absence of an output schema, the description appropriately compensates by detailing the return value structure (suite node fields and nesting). With 100% schema parameter coverage and clear filter semantics documented, the description is functionally complete, though it could benefit from noting read-only safety or pagination constraints.

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%, establishing a baseline of 3. The description adds value by clarifying that 'title_contains' is applied at the API level (performance implication) and explicitly documenting the alias relationship between 'title'/'title_contains' and 'description'/'description_contains' parameters, which aids in filter selection.

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 opens with a specific verb ('List') + resource ('test suites') + context ('TestCollab project') + format ('hierarchical tree'), clearly distinguishing this from sibling 'get_suite' which retrieves a single suite. The scope is precisely defined as returning the 'complete suite tree'.

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?

While the description documents available filters (title, parent, description) which implies usage patterns, it lacks explicit guidance on when to use this versus 'get_suite' for single-suite retrieval or versus 'list_test_cases'. No 'when-not-to-use' or alternative recommendations are provided.

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/TCSoftInc/testcollab-mcp-server'

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