Skip to main content
Glama
uarlouski

TestRail MCP Server

get_projects

Retrieve all projects in TestRail with their IDs and names for use with sections, templates, cases, and runs.

Instructions

Get all available projects in TestRail. Returns project IDs and names that can be used with get_sections, get_templates, get_cases, and add_run

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler for the 'get_projects' tool. Calls client.getProjects(), filters out completed projects, and parses each through ProjectSchema.
    export const getProjectsTool: ToolDefinition<typeof parameters, TestRailClient> = {
        name: "get_projects",
        description: "Get all available projects in TestRail. Returns project IDs and names that can be used with get_sections, get_templates, get_cases, and add_run",
        parameters,
        handler: async (_args, client) => {
            const projects = await client.getProjects();
    
            return {
                projects: projects
                    .filter(p => !p.is_completed)
                    .map(p => ProjectSchema.parse(p)),
            };
        }
    };
  • Zod schema for Project: defines shape with id (number), name (string), is_completed (boolean), suite_mode (number).
    export const ProjectSchema = z.object({
        id: z.number(),
        name: z.string(),
        is_completed: z.boolean(),
        suite_mode: z.number(),
    });
    
    export type Project = z.infer<typeof ProjectSchema>;
  • src/index.ts:15-15 (registration)
    Import of getProjectsTool into the main server entry point.
    import { getProjectsTool } from "./tools/get_projects.js";
  • src/index.ts:59-59 (registration)
    getProjectsTool included in the tools array used for registration with the MCP server.
    getProjectsTool,
  • Client-side helper method: fetches projects from TestRail API via GET /api/v2/get_projects, caches the result in projectsPromise.
    async getProjects(): Promise<Project[]> {
        if (!this.projectsPromise) {
            this.projectsPromise = this.get<{ projects: Project[] }>(`${API_BASE_V2}/get_projects`)
                .then(response => response.projects);
        }
        return this.projectsPromise;
    }
Behavior3/5

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

With no annotations provided, the description must convey behavioral traits. It correctly implies a read-only operation ('Get') and mentions the return type (IDs and names). However, it does not disclose potential limitations (e.g., pagination, number of projects) or authentication requirements, leaving some ambiguity.

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 a single, well-structured sentence that immediately conveys the tool's purpose and relevance to other tools. Every word adds value, with no redundancy.

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 tool has no parameters and no output schema, the description is largely complete. It explains the output and how it connects to other tools. However, it could be slightly more explicit about the data format (e.g., array of objects) or any implicit requirements (e.g., network access), but this is not critical.

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?

The input schema has no parameters and 100% schema coverage. There is nothing to add beyond what the schema already provides. The description appropriately does not attempt to explain non-existent parameters.

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 'Get', the resource 'all available projects', and specifies the output (project IDs and names). It distinguishes from sibling tools like get_sections or get_cases by indicating that the results can be used with those tools, establishing a clear purpose.

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 the tool: it should be used to retrieve project IDs that serve as input for other tools. However, it does not explicitly state when not to use it or mention any alternatives for listing projects, which is minor given the tool's simplicity.

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/uarlouski/testrail-mcp-server'

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