Skip to main content
Glama
uarlouski

TestRail MCP Server

get_priorities

Retrieve all available test case priorities, including their IDs and names, for use when creating or updating test cases.

Instructions

Get all available test case priorities (e.g. Critical, High, Medium, Low). Returns priority IDs and names that can be used when creating or updating test cases.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the get_priorities tool. Calls client.getPriorities() and maps results through PrioritySchema for validation.
    export const getPrioritiesTool: ToolDefinition<typeof parameters, TestRailClient> = {
        name: "get_priorities",
        description: "Get all available test case priorities (e.g. Critical, High, Medium, Low). Returns priority IDs and names that can be used when creating or updating test cases.",
        parameters,
        handler: async (_args: any, client: TestRailClient) => {
            const priorities = await client.getPriorities();
            return {
                priorities: priorities.map(p => PrioritySchema.parse(p)),
            };
        },
    };
  • Zod schema defining the Priority type with id (number), is_default (boolean), and name (string).
    export const PrioritySchema = z.object({
        id: z.number(),
        is_default: z.boolean(),
        name: z.string(),
    });
  • src/index.ts:87-115 (registration)
    Registration loop in index.ts where getPrioritiesTool (in the tools array at line 70) is registered with the MCP server via server.registerTool.
    for (const tool of tools) {
        server.registerTool(
            tool.name,
            {
                description: tool.description,
                inputSchema: tool.parameters,
            },
            async (args: any) => {
                try {
                    const output: Record<string, any> = await tool.handler(args, client);
                    const sanitized = removeNullish(output);
    
                    return {
                        content: [
                            {
                                type: "text" as const,
                                text: JSON.stringify(sanitized),
                            },
                        ],
                    } as any;
                } catch (error: any) {
                    return {
                        content: [{ type: "text", text: `Error: ${error.message}` }],
                        isError: true,
                    };
                }
            }
        );
    }
  • Client method that fetches priorities from TestRail API via GET /api/v2/get_priorities, with caching via prioritiesPromise.
    async getPriorities(): Promise<Priority[]> {
        if (!this.prioritiesPromise) {
            this.prioritiesPromise = this.get<Priority[]>(`${API_BASE_V2}/get_priorities`);
        }
        return this.prioritiesPromise;
    }
Behavior4/5

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

No annotations exist, so the description must convey behavior. It states the tool returns priority IDs and names, which is sufficient for a read-only list. It does not disclose potential nuances like caching or permissions, but the simplicity of the tool mitigates this gap.

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, clear sentence that immediately conveys purpose and output. It is front-loaded with the action and resource, earning its place without any wasted words.

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?

Although there is no output schema, the description specifies the return values (IDs and names) and their usage context. For a simple list tool with no parameters, this is nearly complete. It does not mention ordering or pagination, but that is a minor omission.

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 zero parameters, and the schema coverage is 100%. According to guidelines, 0 parameters yields a baseline score of 4. The description adds no additional parameter information, which is acceptable.

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 it retrieves all priorities, provides examples (Critical, High, Medium, Low), and explains how the output is used (for creating/updating test cases). This distinguishes it from sibling tools like get_cases or get_statuses.

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 explains when to use this tool (when creating or updating test cases) but does not explicitly mention when not to use it or list alternatives. However, the context is clear enough for a straightforward lookup.

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