@uarlouski/testrail-mcp-server 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/testrail.js +20 -7
- package/dist/index.js +1 -1
- package/dist/tools/add_run.js +1 -1
- package/dist/tools/update_cases.js +1 -1
- package/dist/utils/sanitizer.js +1 -1
- package/package.json +1 -1
package/dist/client/testrail.js
CHANGED
|
@@ -172,13 +172,26 @@ export class TestRailClient {
|
|
|
172
172
|
headers,
|
|
173
173
|
body,
|
|
174
174
|
};
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
175
|
+
console.error(`[TestRailClient] Executing ${method} request to ${endpoint}`);
|
|
176
|
+
const startTime = Date.now();
|
|
177
|
+
try {
|
|
178
|
+
const response = await fetch(url, params);
|
|
179
|
+
const duration = Date.now() - startTime;
|
|
180
|
+
console.error(`[TestRailClient] Received ${response.status} ${response.statusText} from ${method} ${endpoint} in ${duration}ms`);
|
|
181
|
+
if (!response.ok) {
|
|
182
|
+
let errorMessage = `TestRail API Error: ${response.status} ${response.statusText}`;
|
|
183
|
+
const errorText = await response.text();
|
|
184
|
+
errorMessage += ` - ${errorText}`;
|
|
185
|
+
console.error(`[TestRailClient] Error Details: ${errorMessage}`);
|
|
186
|
+
throw new Error(errorMessage);
|
|
187
|
+
}
|
|
188
|
+
return await response.json();
|
|
189
|
+
}
|
|
190
|
+
catch (error) {
|
|
191
|
+
if (error instanceof Error && !error.message.startsWith('TestRail API Error')) {
|
|
192
|
+
console.error(`[TestRailClient] Request Failed: ${method} ${endpoint} - ${error.message}`);
|
|
193
|
+
}
|
|
194
|
+
throw error;
|
|
181
195
|
}
|
|
182
|
-
return await response.json();
|
|
183
196
|
}
|
|
184
197
|
}
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ if (!TESTRAIL_INSTANCE_URL || !TESTRAIL_USERNAME || !TESTRAIL_API_KEY) {
|
|
|
27
27
|
}
|
|
28
28
|
const server = new McpServer({
|
|
29
29
|
name: "TestRail MCP Server",
|
|
30
|
-
version: "1.
|
|
30
|
+
version: "1.5.0",
|
|
31
31
|
});
|
|
32
32
|
const client = new TestRailClient(TESTRAIL_INSTANCE_URL, TESTRAIL_USERNAME, TESTRAIL_API_KEY);
|
|
33
33
|
const tools = [
|
package/dist/tools/add_run.js
CHANGED
|
@@ -4,7 +4,7 @@ const parameters = {
|
|
|
4
4
|
project_id: z.number().describe("The ID of the project. Use get_projects to find available projects"),
|
|
5
5
|
name: z.string().optional().describe("The name of the test run"),
|
|
6
6
|
description: z.string().optional().describe("The description of the test run"),
|
|
7
|
-
case_ids: z.array(z.number()).describe("Array of case IDs to include in the run. After creating the run, use get_tests with the returned run_id to retrieve test IDs for result submission")
|
|
7
|
+
case_ids: z.array(z.number()).min(1).describe("Array of case IDs to include in the run. After creating the run, use get_tests with the returned run_id to retrieve test IDs for result submission")
|
|
8
8
|
};
|
|
9
9
|
export const addRunTool = {
|
|
10
10
|
name: "add_run",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
const parameters = {
|
|
3
|
-
case_ids: z.array(z.number()).describe("Array of case IDs to update (e.g. [123, 456, 789])"),
|
|
3
|
+
case_ids: z.array(z.number()).min(1).describe("Array of case IDs to update (e.g. [123, 456, 789])"),
|
|
4
4
|
fields: z.record(z.string(), z.any()).describe("Object containing fields to update for ALL specified cases. Use get_case_fields to see available fields. Example: {\"priority_id\": 2, \"type_id\": 1}"),
|
|
5
5
|
};
|
|
6
6
|
export const updateCasesTool = {
|
package/dist/utils/sanitizer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Recursively
|
|
2
|
+
* Recursively strips inline style attributes from HTML tags contained in string values
|
|
3
3
|
* in an object or array. Useful for cleaning up TestRail markdown content before sending
|
|
4
4
|
* to LLMs.
|
|
5
5
|
*/
|
package/package.json
CHANGED