@smartbear/mcp 0.8.0 → 0.10.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/README.md +29 -4
- package/dist/api-hub/client/api.js +239 -10
- package/dist/api-hub/client/configuration.js +5 -0
- package/dist/api-hub/client/index.js +1 -0
- package/dist/api-hub/client/portal-types.js +126 -0
- package/dist/api-hub/client/registry-types.js +8 -0
- package/dist/api-hub/client/tools.js +78 -15
- package/dist/api-hub/client/user-management-types.js +24 -0
- package/dist/api-hub/client.js +34 -0
- package/dist/bugsnag/client/api/CurrentUser.js +12 -49
- package/dist/bugsnag/client/api/Error.js +29 -142
- package/dist/bugsnag/client/api/Project.js +52 -113
- package/dist/bugsnag/client/api/api.js +3743 -0
- package/dist/bugsnag/client/api/base.js +97 -34
- package/dist/bugsnag/client/api/configuration.js +26 -0
- package/dist/bugsnag/client/api/index.js +2 -0
- package/dist/bugsnag/client/filters.js +28 -0
- package/dist/bugsnag/client.js +104 -155
- package/dist/collaborator/client.js +364 -0
- package/dist/common/server.js +73 -23
- package/dist/common/types.js +6 -1
- package/dist/index.js +9 -1
- package/dist/pactflow/client/prompt-utils.js +2 -1
- package/dist/pactflow/client/tools.js +4 -4
- package/dist/pactflow/client/utils.js +5 -4
- package/dist/pactflow/client.js +10 -9
- package/dist/qmetry/client/api/client-api.js +21 -16
- package/dist/qmetry/client/api/error-handler.js +329 -0
- package/dist/qmetry/client/auto-resolve.js +96 -0
- package/dist/qmetry/client/handlers.js +33 -2
- package/dist/qmetry/client/issues.js +123 -0
- package/dist/qmetry/client/project.js +73 -0
- package/dist/qmetry/client/requirement.js +76 -0
- package/dist/qmetry/client/testcase.js +122 -6
- package/dist/qmetry/client/testsuite.js +272 -0
- package/dist/qmetry/client/tools/index.js +17 -0
- package/dist/qmetry/client/tools/issue-tools.js +545 -0
- package/dist/qmetry/client/tools/project-tools.js +348 -0
- package/dist/qmetry/client/tools/requirement-tools.js +530 -0
- package/dist/qmetry/client/tools/testcase-tools.js +526 -0
- package/dist/qmetry/client/tools/testsuite-tools.js +772 -0
- package/dist/qmetry/client/tools/types.js +1 -0
- package/dist/qmetry/client/utils.js +16 -0
- package/dist/qmetry/client.js +27 -17
- package/dist/qmetry/config/constants.js +28 -0
- package/dist/qmetry/config/rest-endpoints.js +30 -0
- package/dist/qmetry/types/common.js +599 -9
- package/dist/qmetry/types/issues.js +16 -0
- package/dist/qmetry/types/project.js +17 -0
- package/dist/qmetry/types/requirements.js +19 -0
- package/dist/qmetry/types/testcase.js +20 -0
- package/dist/qmetry/types/testsuite.js +44 -0
- package/dist/reflect/client.js +7 -6
- package/dist/zephyr/client.js +7 -1
- package/dist/zephyr/common/api-client.js +8 -0
- package/dist/zephyr/common/auth-service.js +1 -0
- package/dist/zephyr/common/rest-api-schemas.js +5173 -0
- package/dist/zephyr/tool/project/get-project.js +39 -0
- package/dist/zephyr/tool/project/get-projects.js +7 -13
- package/dist/zephyr/tool/test-cycle/get-test-cycles.js +72 -0
- package/package.json +1 -1
- package/dist/bugsnag/client/api/filters.js +0 -167
- package/dist/bugsnag/client/configuration.js +0 -10
- package/dist/bugsnag/client/index.js +0 -2
- package/dist/qmetry/client/tools.js +0 -222
- package/dist/zephyr/common/types.js +0 -35
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { getProjectParams, getProjectResponse, } from "../../common/rest-api-schemas.js";
|
|
2
|
+
export class GetProject {
|
|
3
|
+
apiClient;
|
|
4
|
+
constructor(apiClient) {
|
|
5
|
+
this.apiClient = apiClient;
|
|
6
|
+
}
|
|
7
|
+
specification = {
|
|
8
|
+
title: "Get Project",
|
|
9
|
+
summary: "Get details of project specified by id or key in Zephyr",
|
|
10
|
+
readOnly: true,
|
|
11
|
+
idempotent: true,
|
|
12
|
+
inputSchema: getProjectParams,
|
|
13
|
+
outputSchema: getProjectResponse,
|
|
14
|
+
examples: [
|
|
15
|
+
{
|
|
16
|
+
description: "Get the project with id 1",
|
|
17
|
+
parameters: {
|
|
18
|
+
projectIdOrKey: "1",
|
|
19
|
+
},
|
|
20
|
+
expectedOutput: "The project with its details",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
description: "Get the project with key 'PROJ'",
|
|
24
|
+
parameters: {
|
|
25
|
+
projectIdOrKey: "PROJ",
|
|
26
|
+
},
|
|
27
|
+
expectedOutput: "The project with its details",
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
handle = async (args) => {
|
|
32
|
+
const { projectIdOrKey } = getProjectParams.parse(args);
|
|
33
|
+
const response = await this.apiClient.get(`/projects/${projectIdOrKey}`);
|
|
34
|
+
return {
|
|
35
|
+
structuredContent: response,
|
|
36
|
+
content: [],
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { MaxResultsSchema, StartAtSchema } from "../../common/types.js";
|
|
3
|
-
export const GetProjectsInputSchema = z.object({
|
|
4
|
-
startAt: StartAtSchema.optional(),
|
|
5
|
-
maxResults: MaxResultsSchema.optional(),
|
|
6
|
-
});
|
|
1
|
+
import { listProjectsQueryParams, listProjectsResponse, } from "../../common/rest-api-schemas.js";
|
|
7
2
|
export class GetProjects {
|
|
8
3
|
apiClient;
|
|
9
4
|
constructor(apiClient) {
|
|
@@ -14,7 +9,8 @@ export class GetProjects {
|
|
|
14
9
|
summary: "Get details of projects in Zephyr",
|
|
15
10
|
readOnly: true,
|
|
16
11
|
idempotent: true,
|
|
17
|
-
|
|
12
|
+
inputSchema: listProjectsQueryParams,
|
|
13
|
+
outputSchema: listProjectsResponse,
|
|
18
14
|
examples: [
|
|
19
15
|
{
|
|
20
16
|
description: "Get the first 10 projects",
|
|
@@ -42,13 +38,11 @@ export class GetProjects {
|
|
|
42
38
|
],
|
|
43
39
|
};
|
|
44
40
|
handle = async (args) => {
|
|
45
|
-
const
|
|
46
|
-
const response = await this.apiClient.get("/projects",
|
|
47
|
-
maxResults,
|
|
48
|
-
startAt,
|
|
49
|
-
});
|
|
41
|
+
const parsedArgs = listProjectsQueryParams.parse(args);
|
|
42
|
+
const response = await this.apiClient.get("/projects", parsedArgs);
|
|
50
43
|
return {
|
|
51
|
-
|
|
44
|
+
structuredContent: response,
|
|
45
|
+
content: [],
|
|
52
46
|
};
|
|
53
47
|
};
|
|
54
48
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { listTestCyclesQueryParams, listTestCyclesResponse, } from "../../common/rest-api-schemas.js";
|
|
2
|
+
export class GetTestCycles {
|
|
3
|
+
apiClient;
|
|
4
|
+
constructor(apiClient) {
|
|
5
|
+
this.apiClient = apiClient;
|
|
6
|
+
}
|
|
7
|
+
specification = {
|
|
8
|
+
title: "Get Test Cycles",
|
|
9
|
+
summary: "Get details of Test Cycles in Zephyr",
|
|
10
|
+
readOnly: true,
|
|
11
|
+
idempotent: true,
|
|
12
|
+
inputSchema: listTestCyclesQueryParams,
|
|
13
|
+
outputSchema: listTestCyclesResponse,
|
|
14
|
+
examples: [
|
|
15
|
+
{
|
|
16
|
+
description: "Get the first 10 Test Cycles",
|
|
17
|
+
parameters: {
|
|
18
|
+
maxResults: 10,
|
|
19
|
+
startAt: 0,
|
|
20
|
+
},
|
|
21
|
+
expectedOutput: "The first 10 Test Cycles with their details",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
description: "Get any Test Cycle",
|
|
25
|
+
parameters: {
|
|
26
|
+
maxResults: 1,
|
|
27
|
+
},
|
|
28
|
+
expectedOutput: "One Test Cycle with its details",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
description: "Get five Test Cycles starting from the 7th Test Cycles of the list",
|
|
32
|
+
parameters: {
|
|
33
|
+
maxResults: 5,
|
|
34
|
+
startAt: 6,
|
|
35
|
+
},
|
|
36
|
+
expectedOutput: "The 7th to the 11th Test Cycles with their details",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
description: "Get one Test Cycle from the project PROJ",
|
|
40
|
+
parameters: {
|
|
41
|
+
projectKey: "PROJ",
|
|
42
|
+
maxResults: 1,
|
|
43
|
+
},
|
|
44
|
+
expectedOutput: "One Test Cycle from project PROJ with its details",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
description: "Get one Test Cycle from the folder 123",
|
|
48
|
+
parameters: {
|
|
49
|
+
folderId: 123,
|
|
50
|
+
maxResults: 1,
|
|
51
|
+
},
|
|
52
|
+
expectedOutput: "One Test Cycle from folder 123 with its details",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
description: "Get one Test Cycle from the version 456",
|
|
56
|
+
parameters: {
|
|
57
|
+
jiraProjectVersionId: 456,
|
|
58
|
+
maxResults: 1,
|
|
59
|
+
},
|
|
60
|
+
expectedOutput: "One Test Cycle from version 456 with its details",
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
};
|
|
64
|
+
handle = async (args) => {
|
|
65
|
+
const parsedArgs = listTestCyclesQueryParams.parse(args);
|
|
66
|
+
const response = await this.apiClient.get("/testcycles", parsedArgs);
|
|
67
|
+
return {
|
|
68
|
+
structuredContent: response,
|
|
69
|
+
content: [],
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
}
|
package/package.json
CHANGED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Filters utility for BugSnag API
|
|
3
|
-
*
|
|
4
|
-
* This file provides utility functions for creating filter URL parameters
|
|
5
|
-
* based on the BugSnag filtering specification described in the Filtering.md document.
|
|
6
|
-
*/
|
|
7
|
-
import { z } from "zod";
|
|
8
|
-
export const FilterValueSchema = z.object({
|
|
9
|
-
type: z.enum(["eq", "ne", "empty"]),
|
|
10
|
-
value: z.union([z.string(), z.boolean(), z.number()]),
|
|
11
|
-
});
|
|
12
|
-
export const FilterObjectSchema = z.record(z.array(FilterValueSchema));
|
|
13
|
-
/**
|
|
14
|
-
* Creates a filter value object for equality comparison
|
|
15
|
-
*
|
|
16
|
-
* @param value The value to compare against
|
|
17
|
-
* @returns FilterValue with type 'eq'
|
|
18
|
-
*/
|
|
19
|
-
export function equals(value) {
|
|
20
|
-
return {
|
|
21
|
-
type: "eq",
|
|
22
|
-
value,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Creates a filter value object for inequality comparison
|
|
27
|
-
*
|
|
28
|
-
* @param value The value to compare against
|
|
29
|
-
* @returns FilterValue with type 'ne'
|
|
30
|
-
*/
|
|
31
|
-
export function notEquals(value) {
|
|
32
|
-
return {
|
|
33
|
-
type: "ne",
|
|
34
|
-
value,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Creates a filter value object for checking if a field is empty or not
|
|
39
|
-
*
|
|
40
|
-
* @param isEmpty Whether the field should be empty (true) or not (false)
|
|
41
|
-
* @returns FilterValue with type 'empty'
|
|
42
|
-
*/
|
|
43
|
-
export function empty(isEmpty) {
|
|
44
|
-
return {
|
|
45
|
-
type: "empty",
|
|
46
|
-
value: isEmpty.toString(),
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Creates a relative time filter for event.since or event.before
|
|
51
|
-
*
|
|
52
|
-
* @param value The amount of time
|
|
53
|
-
* @param unit The time unit ('h' for hours, 'd' for days)
|
|
54
|
-
* @returns FilterValue for the relative time
|
|
55
|
-
*/
|
|
56
|
-
export function relativeTime(value, unit) {
|
|
57
|
-
return {
|
|
58
|
-
type: "eq",
|
|
59
|
-
value: `${value}${unit}`,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Creates an ISO 8601 time filter (must be in UTC format like 2018-05-20T00:00:00Z)
|
|
64
|
-
*
|
|
65
|
-
* @param date The date object to convert to ISO string
|
|
66
|
-
* @returns FilterValue for the ISO time
|
|
67
|
-
*/
|
|
68
|
-
export function isoTime(date) {
|
|
69
|
-
return {
|
|
70
|
-
type: "eq",
|
|
71
|
-
value: date.toISOString(),
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Converts a FilterObject to URL search parameters
|
|
76
|
-
*
|
|
77
|
-
* @param filters The filter object to convert
|
|
78
|
-
* @returns URLSearchParams object with the encoded filters
|
|
79
|
-
*/
|
|
80
|
-
export function toUrlSearchParams(filters) {
|
|
81
|
-
const params = new URLSearchParams();
|
|
82
|
-
Object.entries(filters).forEach(([field, filterValues]) => {
|
|
83
|
-
filterValues.forEach((filterValue) => {
|
|
84
|
-
params.append(`filters[${field}][][type]`, filterValue.type);
|
|
85
|
-
params.append(`filters[${field}][][value]`, filterValue.value.toString());
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
return params;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Converts a FilterObject to a query string
|
|
92
|
-
*
|
|
93
|
-
* @param filters The filter object to convert
|
|
94
|
-
* @returns Query string representation of the filters
|
|
95
|
-
*/
|
|
96
|
-
export function toQueryString(filters) {
|
|
97
|
-
return toUrlSearchParams(filters).toString();
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Helper to build a FilterObject with type safety
|
|
101
|
-
*
|
|
102
|
-
* @returns An empty FilterObject that can be built upon
|
|
103
|
-
*/
|
|
104
|
-
export function createFilter() {
|
|
105
|
-
return {};
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Adds a field filter to an existing FilterObject
|
|
109
|
-
*
|
|
110
|
-
* @param filters The FilterObject to add to
|
|
111
|
-
* @param field The field name (e.g., 'error.status', 'event.since')
|
|
112
|
-
* @param filterValue The FilterValue to add
|
|
113
|
-
* @returns The updated FilterObject for chaining
|
|
114
|
-
*/
|
|
115
|
-
export function addFilter(filters, field, filterValue) {
|
|
116
|
-
if (!filters[field]) {
|
|
117
|
-
filters[field] = [];
|
|
118
|
-
}
|
|
119
|
-
filters[field].push(filterValue);
|
|
120
|
-
return filters;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Utility to create a time range filter between two dates
|
|
124
|
-
*
|
|
125
|
-
* @param filters The FilterObject to add to
|
|
126
|
-
* @param since Start date
|
|
127
|
-
* @param before End date
|
|
128
|
-
* @returns The updated FilterObject for chaining
|
|
129
|
-
*/
|
|
130
|
-
export function addTimeRange(filters, since, before) {
|
|
131
|
-
addFilter(filters, "event.since", isoTime(since));
|
|
132
|
-
addFilter(filters, "event.before", isoTime(before));
|
|
133
|
-
return filters;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Utility to create a relative time range filter
|
|
137
|
-
*
|
|
138
|
-
* @param filters The FilterObject to add to
|
|
139
|
-
* @param amount The amount of time (e.g., 7 for 7 days)
|
|
140
|
-
* @param unit The time unit ('h' for hours, 'd' for days)
|
|
141
|
-
* @returns The updated FilterObject for chaining
|
|
142
|
-
*/
|
|
143
|
-
export function addRelativeTimeRange(filters, amount, unit) {
|
|
144
|
-
addFilter(filters, "event.since", relativeTime(amount, unit));
|
|
145
|
-
return filters;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Usage examples:
|
|
149
|
-
*
|
|
150
|
-
* // Example 1: Open errors with events in the last day
|
|
151
|
-
* const filters = createFilter();
|
|
152
|
-
* addRelativeTimeRange(filters, 1, 'd');
|
|
153
|
-
* addFilter(filters, 'error.status', equals('open'));
|
|
154
|
-
* const queryString = toQueryString(filters);
|
|
155
|
-
*
|
|
156
|
-
* // Example 2: Events affecting specific users on a specific day
|
|
157
|
-
* const filters = createFilter();
|
|
158
|
-
* addTimeRange(filters, new Date('2017-01-01'), new Date('2017-01-02'));
|
|
159
|
-
* addFilter(filters, 'user.email', equals('user1@example.com'));
|
|
160
|
-
* addFilter(filters, 'user.email', equals('user2@example.com'));
|
|
161
|
-
* const queryString = toQueryString(filters);
|
|
162
|
-
*
|
|
163
|
-
* // Example 3: Events that have user data
|
|
164
|
-
* const filters = createFilter();
|
|
165
|
-
* addFilter(filters, 'user.id', empty(false));
|
|
166
|
-
* const queryString = toQueryString(filters);
|
|
167
|
-
*/
|
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import { QMetryToolsHandlers } from "../config/constants.js";
|
|
2
|
-
import { ProjectArgsSchema, TestCaseDetailsArgsSchema, TestCaseListArgsSchema, TestCaseStepsArgsSchema, TestCaseVersionDetailsArgsSchema, } from "../types/common.js";
|
|
3
|
-
export const TOOLS = [
|
|
4
|
-
{
|
|
5
|
-
title: "Set QMetry Project Info",
|
|
6
|
-
summary: "Set current QMetry project for your account",
|
|
7
|
-
handler: QMetryToolsHandlers.SET_PROJECT_INFO,
|
|
8
|
-
zodSchema: ProjectArgsSchema,
|
|
9
|
-
purpose: "Switch the active QMetry project context for the current session. " +
|
|
10
|
-
"This tool sets the default project that will be used for all subsequent QMetry operations. " +
|
|
11
|
-
"Essential for multi-project QMetry instances where you need to work with specific projects.",
|
|
12
|
-
useCases: [
|
|
13
|
-
"Switch to a specific project before performing test case operations",
|
|
14
|
-
"Set project context for batch operations on test cases",
|
|
15
|
-
"Configure the default project for the current session",
|
|
16
|
-
"Validate access to a specific project before proceeding with operations",
|
|
17
|
-
],
|
|
18
|
-
examples: [
|
|
19
|
-
{
|
|
20
|
-
description: "Set default project as active",
|
|
21
|
-
parameters: { projectKey: "default" },
|
|
22
|
-
expectedOutput: "Project context set to 'default' with confirmation of project details",
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
description: "Switch to UT project",
|
|
26
|
-
parameters: { projectKey: "UT" },
|
|
27
|
-
expectedOutput: "Project context switched to 'UT' project with available configurations",
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
description: "Set MAC project as active for test case operations",
|
|
31
|
-
parameters: { projectKey: "MAC" },
|
|
32
|
-
expectedOutput: "Project context set to 'MAC' with viewIds and folder structure",
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
hints: [
|
|
36
|
-
"Always set the project context before performing test case operations in multi-project environments",
|
|
37
|
-
"Use the same project key that you'll use in subsequent test case operations",
|
|
38
|
-
"Common project keys include 'default', 'UT', 'MAC', 'VT' - check with your QMetry admin for available projects",
|
|
39
|
-
"This operation must be performed before fetching test cases if working with non-default projects",
|
|
40
|
-
"The project context persists for the current session until changed again",
|
|
41
|
-
],
|
|
42
|
-
outputFormat: "JSON object containing project configuration details, confirmation of project switch, and available project metadata",
|
|
43
|
-
readOnly: false,
|
|
44
|
-
idempotent: true,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
title: "Fetch QMetry Project Info",
|
|
48
|
-
summary: "Fetch QMetry project information including viewId and folderPath needed for other operations",
|
|
49
|
-
handler: QMetryToolsHandlers.FETCH_PROJECT_INFO,
|
|
50
|
-
zodSchema: ProjectArgsSchema,
|
|
51
|
-
purpose: "Prerequisite tool that provides project configuration data required by other QMetry operations. " +
|
|
52
|
-
"The project key to fetch info for. Use 'default' if not specified. " +
|
|
53
|
-
"Common project keys include 'UT', 'VT', 'MAC', etc. " +
|
|
54
|
-
"If user doesn't specify a project key, this tool will use 'default' automatically.",
|
|
55
|
-
useCases: [
|
|
56
|
-
"Get project configuration before fetching test cases",
|
|
57
|
-
"Retrieve available viewIds for test case listing",
|
|
58
|
-
"Get folderPath information for project navigation",
|
|
59
|
-
"Validate project access and permissions",
|
|
60
|
-
],
|
|
61
|
-
examples: [
|
|
62
|
-
{
|
|
63
|
-
description: "Get default project info",
|
|
64
|
-
parameters: {},
|
|
65
|
-
expectedOutput: "Project configuration with viewIds, folderPaths, and project details",
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
description: "Get specific project info",
|
|
69
|
-
parameters: { projectKey: "MAC" },
|
|
70
|
-
expectedOutput: "MAC project configuration with available views and folders",
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
hints: [
|
|
74
|
-
"Always call this first when user doesn't provide viewId or folderPath",
|
|
75
|
-
"Use 'default' project key when user doesn't specify one",
|
|
76
|
-
"Extract viewId from latestViews.TC.viewId for test case operations",
|
|
77
|
-
"Use empty string '' as folderPath for root directory",
|
|
78
|
-
],
|
|
79
|
-
outputFormat: "JSON object containing project details, viewIds, folderPaths, and project configuration",
|
|
80
|
-
readOnly: true,
|
|
81
|
-
idempotent: true,
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
title: "Fetch Test Cases",
|
|
85
|
-
summary: "Fetch QMetry test cases - automatically handles viewId resolution based on project",
|
|
86
|
-
handler: QMetryToolsHandlers.FETCH_TEST_CASES,
|
|
87
|
-
zodSchema: TestCaseListArgsSchema,
|
|
88
|
-
purpose: "Get test cases from QMetry. System automatically gets correct viewId from project info if not provided.",
|
|
89
|
-
useCases: [
|
|
90
|
-
"List all test cases in a project",
|
|
91
|
-
"Search for specific test cases using filters",
|
|
92
|
-
"Browse test cases in specific folders",
|
|
93
|
-
"Get paginated test case results",
|
|
94
|
-
],
|
|
95
|
-
examples: [
|
|
96
|
-
{
|
|
97
|
-
description: "Get all test cases from default project - system will auto-fetch viewId",
|
|
98
|
-
parameters: {},
|
|
99
|
-
expectedOutput: "List of test cases from default project with auto-resolved viewId",
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
description: "Get all test cases from UT project - system will auto-fetch UT project's viewId",
|
|
103
|
-
parameters: { projectKey: "UT" },
|
|
104
|
-
expectedOutput: "List of test cases from UT project using UT's specific TC viewId",
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
description: "Get test cases with manual viewId (skip auto-resolution)",
|
|
108
|
-
parameters: { projectKey: "MAC", viewId: 167136, folderPath: "" },
|
|
109
|
-
expectedOutput: "Test cases using manually specified viewId 167136",
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
description: "List test cases from specific project (ex: project key can be anything (VT, UT, PROJ1, TEST9)",
|
|
113
|
-
parameters: {
|
|
114
|
-
projectKey: "use specific given project key",
|
|
115
|
-
viewId: "fetch specific project given projectKey Test Case ViewId",
|
|
116
|
-
folderPath: "",
|
|
117
|
-
},
|
|
118
|
-
expectedOutput: "Test cases using manually specified viewId 167136 or projectKey",
|
|
119
|
-
},
|
|
120
|
-
],
|
|
121
|
-
hints: [
|
|
122
|
-
"CRITICAL WORKFLOW: Always use the SAME projectKey for both project info and test case fetching",
|
|
123
|
-
"Step 1: If user specifies projectKey (like 'UT', 'MAC'), use that EXACT projectKey for project info",
|
|
124
|
-
"Step 2: Get project info using that projectKey, extract latestViews.TC.viewId",
|
|
125
|
-
"Step 3: Use the SAME projectKey and the extracted TC viewId for fetching test cases",
|
|
126
|
-
"Step 4: If user doesn't specify projectKey, use 'default' for both project info and test case fetching",
|
|
127
|
-
"NEVER mix project keys - if user says 'MAC project', use projectKey='MAC' for everything",
|
|
128
|
-
'For search by test case key (like MAC-TC-1684), use filter: \'[{"type":"string","value":"MAC-TC-1684","field":"entityKeyId"}]\'',
|
|
129
|
-
],
|
|
130
|
-
outputFormat: "JSON object with 'data' array containing test cases and pagination info",
|
|
131
|
-
readOnly: true,
|
|
132
|
-
idempotent: true,
|
|
133
|
-
openWorld: false,
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
title: "Fetch Test Case Details",
|
|
137
|
-
summary: "Get detailed information for a specific QMetry test case by numeric ID",
|
|
138
|
-
handler: QMetryToolsHandlers.FETCH_TEST_CASE_DETAILS,
|
|
139
|
-
zodSchema: TestCaseDetailsArgsSchema,
|
|
140
|
-
purpose: "Retrieve comprehensive test case information including metadata, status, and basic properties",
|
|
141
|
-
useCases: [
|
|
142
|
-
"Get test case details by numeric ID",
|
|
143
|
-
"Retrieve test case metadata for reporting",
|
|
144
|
-
"Get test case summary and properties",
|
|
145
|
-
"Fetch test case details before accessing steps or version details",
|
|
146
|
-
],
|
|
147
|
-
examples: [
|
|
148
|
-
{
|
|
149
|
-
description: "Get test case details by numeric ID",
|
|
150
|
-
parameters: { tcID: 4468020 },
|
|
151
|
-
expectedOutput: "Detailed test case information including summary, description, status",
|
|
152
|
-
},
|
|
153
|
-
],
|
|
154
|
-
hints: [
|
|
155
|
-
"⚠️ This API requires a numeric tcID parameter",
|
|
156
|
-
"If user provides entityKey (e.g., MAC-TC-1684), first call FETCH_TEST_CASES with a filter on entityKeyId to resolve the tcID",
|
|
157
|
-
"After resolving entityKey → tcID, call this tool with the resolved numeric tcID",
|
|
158
|
-
"This tool provides metadata and properties; use FETCH_TEST_CASE_STEPS for step-level details",
|
|
159
|
-
],
|
|
160
|
-
outputFormat: "JSON object with test case details including ID, key, summary, description, and metadata",
|
|
161
|
-
readOnly: true,
|
|
162
|
-
idempotent: true,
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
title: "Fetch Test Case Version Details",
|
|
166
|
-
summary: "Get QMetry test case details for a specific version by numeric ID",
|
|
167
|
-
handler: QMetryToolsHandlers.FETCH_TEST_CASE_VERSION_DETAILS,
|
|
168
|
-
zodSchema: TestCaseVersionDetailsArgsSchema,
|
|
169
|
-
purpose: "Retrieve version-specific information for a test case including history and changes",
|
|
170
|
-
useCases: [
|
|
171
|
-
"Get specific version details of a test case",
|
|
172
|
-
"Compare different versions of a test case",
|
|
173
|
-
"Retrieve version history information",
|
|
174
|
-
"Audit changes made across test case versions",
|
|
175
|
-
],
|
|
176
|
-
examples: [
|
|
177
|
-
{
|
|
178
|
-
description: "Get version 2 details for test case ID 123",
|
|
179
|
-
parameters: { id: 123, version: 2 },
|
|
180
|
-
expectedOutput: "Version 2 details for test case 123",
|
|
181
|
-
},
|
|
182
|
-
],
|
|
183
|
-
hints: [
|
|
184
|
-
"⚠️ Requires numeric ID, not entityKey",
|
|
185
|
-
"If user provides entityKey (e.g., MAC-TC-1684), first resolve it to numeric ID using FETCH_TEST_CASES",
|
|
186
|
-
"Version defaults to 1 if not specified",
|
|
187
|
-
"Provides version-specific metadata and history",
|
|
188
|
-
],
|
|
189
|
-
outputFormat: "JSON object with version-specific test case details",
|
|
190
|
-
readOnly: true,
|
|
191
|
-
idempotent: true,
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
title: "Fetch Test Case Steps",
|
|
195
|
-
summary: "Get detailed test case steps for a specific test case by numeric ID",
|
|
196
|
-
handler: QMetryToolsHandlers.FETCH_TEST_CASE_STEPS,
|
|
197
|
-
zodSchema: TestCaseStepsArgsSchema,
|
|
198
|
-
purpose: "Retrieve step-by-step instructions and expected results for manual execution of a test case",
|
|
199
|
-
useCases: [
|
|
200
|
-
"Get step-by-step instructions with expected results",
|
|
201
|
-
"Retrieve test case execution procedure for manual runs",
|
|
202
|
-
"Export or display detailed test steps for documentation",
|
|
203
|
-
"Fetch steps before automation mapping",
|
|
204
|
-
],
|
|
205
|
-
examples: [
|
|
206
|
-
{
|
|
207
|
-
description: "Get steps for test case ID 123",
|
|
208
|
-
parameters: { id: 123 },
|
|
209
|
-
expectedOutput: "Detailed steps with actions and expected results for test case 123",
|
|
210
|
-
},
|
|
211
|
-
],
|
|
212
|
-
hints: [
|
|
213
|
-
"⚠️ Requires numeric ID, not entityKey",
|
|
214
|
-
"If user provides entityKey (e.g., MAC-TC-1684), resolve it first via FETCH_TEST_CASES to get the numeric ID",
|
|
215
|
-
"Version defaults to 1 if not specified",
|
|
216
|
-
"Use pagination for test cases with many steps",
|
|
217
|
-
],
|
|
218
|
-
outputFormat: "JSON object with array of test steps including step description, expected result, and order",
|
|
219
|
-
readOnly: true,
|
|
220
|
-
idempotent: true,
|
|
221
|
-
},
|
|
222
|
-
];
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export const MaxResultsSchema = z
|
|
3
|
-
.number()
|
|
4
|
-
.min(1)
|
|
5
|
-
.max(1000)
|
|
6
|
-
.describe(`
|
|
7
|
-
Specifies the maximum number of results to return in a single call. The default value is 10, and the maximum value that can be requested is 1000.
|
|
8
|
-
|
|
9
|
-
Note that the server may enforce a lower limit than requested, depending on resource availability or other internal constraints.
|
|
10
|
-
If this happens, the result set may be truncated. Always check the maxResults value in the response to confirm how many results were actually returned.
|
|
11
|
-
`);
|
|
12
|
-
export const StartAtSchema = z
|
|
13
|
-
.number()
|
|
14
|
-
.min(0)
|
|
15
|
-
.max(1000000)
|
|
16
|
-
.describe(`
|
|
17
|
-
Zero-indexed starting position used to paginate through results. Defaults to 0.
|
|
18
|
-
`);
|
|
19
|
-
export const ZephyrProjectSchema = z.object({
|
|
20
|
-
id: z.number(),
|
|
21
|
-
jiraProjectId: z.number(),
|
|
22
|
-
key: z.string(),
|
|
23
|
-
enabled: z.boolean(),
|
|
24
|
-
});
|
|
25
|
-
export function createListSchema(itemSchema) {
|
|
26
|
-
return z.object({
|
|
27
|
-
next: z.string().nullable(),
|
|
28
|
-
startAt: StartAtSchema,
|
|
29
|
-
maxResults: MaxResultsSchema,
|
|
30
|
-
total: z.number(),
|
|
31
|
-
isLast: z.boolean(),
|
|
32
|
-
values: z.array(itemSchema),
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
export const ZephyrProjectListSchema = createListSchema(ZephyrProjectSchema);
|