@smartbear/mcp 0.9.0 → 0.11.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 +38 -11
- package/dist/bugsnag/client/api/index.js +2 -0
- package/dist/bugsnag/client/filters.js +0 -6
- package/dist/bugsnag/client.js +238 -380
- package/dist/bugsnag/input-schemas.js +51 -0
- package/dist/collaborator/client.js +377 -0
- package/dist/common/cache.js +63 -0
- package/dist/common/client-registry.js +128 -0
- package/dist/common/register-clients.js +31 -0
- package/dist/common/server.js +77 -28
- package/dist/common/transport-http.js +377 -0
- package/dist/common/transport-stdio.js +43 -0
- package/dist/index.js +18 -60
- package/dist/pactflow/client/tools.js +4 -4
- package/dist/pactflow/client.js +39 -19
- package/dist/qmetry/client/auto-resolve.js +22 -0
- package/dist/qmetry/client/handlers.js +18 -4
- package/dist/qmetry/client/issues.js +98 -1
- package/dist/qmetry/client/project.js +18 -1
- package/dist/qmetry/client/testcase.js +79 -1
- package/dist/qmetry/client/testsuite.js +156 -1
- 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.js +33 -11
- package/dist/qmetry/config/constants.js +14 -0
- package/dist/qmetry/config/rest-endpoints.js +10 -0
- package/dist/qmetry/types/common.js +287 -2
- package/dist/qmetry/types/issues.js +11 -1
- package/dist/qmetry/types/project.js +7 -0
- package/dist/qmetry/types/testcase.js +6 -0
- package/dist/qmetry/types/testsuite.js +19 -1
- package/dist/reflect/client.js +10 -4
- package/dist/{api-hub → swagger}/client/api.js +190 -2
- package/dist/{api-hub → swagger}/client/configuration.js +6 -1
- package/dist/swagger/client/index.js +6 -0
- package/dist/{api-hub → swagger}/client/portal-types.js +126 -0
- package/dist/swagger/client/tools.js +161 -0
- package/dist/swagger/client/user-management-types.js +24 -0
- package/dist/swagger/client.js +141 -0
- package/dist/swagger/config-utils.js +18 -0
- package/dist/zephyr/client.js +44 -6
- package/dist/zephyr/common/api-client.js +8 -0
- package/dist/zephyr/common/rest-api-schemas.js +5174 -0
- package/dist/zephyr/tool/priority/get-priorities.js +43 -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/status/get-statuses.js +49 -0
- package/dist/zephyr/tool/test-case/get-test-case.js +39 -0
- package/dist/zephyr/tool/test-case/get-test-cases.js +64 -0
- package/dist/zephyr/tool/test-cycle/get-test-cycle.js +39 -0
- package/dist/zephyr/tool/test-cycle/get-test-cycles.js +72 -0
- package/dist/zephyr/tool/test-execution/get-test-execution.js +39 -0
- package/package.json +2 -2
- package/dist/api-hub/client/index.js +0 -5
- package/dist/api-hub/client/tools.js +0 -104
- package/dist/api-hub/client.js +0 -98
- package/dist/qmetry/client/tools.js +0 -1673
- package/dist/zephyr/common/types.js +0 -35
- /package/dist/{api-hub → swagger}/client/registry-types.js +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { listPrioritiesQueryParams, listPrioritiesResponse, } from "../../common/rest-api-schemas.js";
|
|
2
|
+
export class GetPriorities {
|
|
3
|
+
apiClient;
|
|
4
|
+
constructor(apiClient) {
|
|
5
|
+
this.apiClient = apiClient;
|
|
6
|
+
}
|
|
7
|
+
specification = {
|
|
8
|
+
title: "Get priorities",
|
|
9
|
+
summary: "Get Zephyr Test Case priorities with optional filters",
|
|
10
|
+
readOnly: true,
|
|
11
|
+
idempotent: true,
|
|
12
|
+
inputSchema: listPrioritiesQueryParams,
|
|
13
|
+
outputSchema: listPrioritiesResponse,
|
|
14
|
+
examples: [
|
|
15
|
+
{
|
|
16
|
+
description: "Get the first 10 priorities",
|
|
17
|
+
parameters: {
|
|
18
|
+
maxResults: 10,
|
|
19
|
+
startAt: 0,
|
|
20
|
+
},
|
|
21
|
+
expectedOutput: "The first 10 priorities with their details",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
description: "Get priorities for a specific project",
|
|
25
|
+
parameters: { projectKey: "PROJ" },
|
|
26
|
+
expectedOutput: "The priorities for project PROJ",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
description: "Get all priorities",
|
|
30
|
+
parameters: {},
|
|
31
|
+
expectedOutput: "All priorities",
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
handle = async (args) => {
|
|
36
|
+
const getPrioritiesInput = listPrioritiesQueryParams.parse(args);
|
|
37
|
+
const response = await this.apiClient.get("/priorities", getPrioritiesInput);
|
|
38
|
+
return {
|
|
39
|
+
structuredContent: response,
|
|
40
|
+
content: [],
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -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,49 @@
|
|
|
1
|
+
import { listStatusesQueryParams, listStatusesResponse, } from "../../common/rest-api-schemas.js";
|
|
2
|
+
export class GetStatuses {
|
|
3
|
+
apiClient;
|
|
4
|
+
constructor(apiClient) {
|
|
5
|
+
this.apiClient = apiClient;
|
|
6
|
+
}
|
|
7
|
+
specification = {
|
|
8
|
+
title: "Get Statuses",
|
|
9
|
+
summary: "Get statuses of different types of test artifacts in Zephyr",
|
|
10
|
+
readOnly: true,
|
|
11
|
+
idempotent: true,
|
|
12
|
+
inputSchema: listStatusesQueryParams,
|
|
13
|
+
outputSchema: listStatusesResponse,
|
|
14
|
+
examples: [
|
|
15
|
+
{
|
|
16
|
+
description: "Get the first 10 statuses",
|
|
17
|
+
parameters: {
|
|
18
|
+
maxResults: 10,
|
|
19
|
+
startAt: 0,
|
|
20
|
+
},
|
|
21
|
+
expectedOutput: "The first 10 statuses with their details from different projects and test artifact types",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
description: "Get 10 test case statuses",
|
|
25
|
+
parameters: {
|
|
26
|
+
maxResults: 10,
|
|
27
|
+
statusType: "TEST_CASE",
|
|
28
|
+
},
|
|
29
|
+
expectedOutput: "A list of statuses related to test cases with their details",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
description: "Get five statuses from the project PROJ",
|
|
33
|
+
parameters: {
|
|
34
|
+
maxResults: 5,
|
|
35
|
+
projectKey: "PROJ",
|
|
36
|
+
},
|
|
37
|
+
expectedOutput: "The first five statuses from the project PROJ with their details",
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
handle = async (args) => {
|
|
42
|
+
const getStatusesInput = listStatusesQueryParams.parse(args);
|
|
43
|
+
const response = await this.apiClient.get("/statuses", getStatusesInput);
|
|
44
|
+
return {
|
|
45
|
+
structuredContent: response,
|
|
46
|
+
content: [],
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { getTestCaseParams, getTestCaseResponse, } from "../../common/rest-api-schemas.js";
|
|
2
|
+
export class GetTestCase {
|
|
3
|
+
apiClient;
|
|
4
|
+
constructor(apiClient) {
|
|
5
|
+
this.apiClient = apiClient;
|
|
6
|
+
}
|
|
7
|
+
specification = {
|
|
8
|
+
title: "Get Test Case",
|
|
9
|
+
summary: "Get details of test case specified by key in Zephyr",
|
|
10
|
+
readOnly: true,
|
|
11
|
+
idempotent: true,
|
|
12
|
+
inputSchema: getTestCaseParams,
|
|
13
|
+
outputSchema: getTestCaseResponse,
|
|
14
|
+
examples: [
|
|
15
|
+
{
|
|
16
|
+
description: "Get the test case with key 'SA-T10'",
|
|
17
|
+
parameters: {
|
|
18
|
+
testCaseKey: "SA-T10",
|
|
19
|
+
},
|
|
20
|
+
expectedOutput: "The test case with its details",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
description: "Get the test case with key 'MM2-T1'",
|
|
24
|
+
parameters: {
|
|
25
|
+
testCaseKey: "MM2-T1",
|
|
26
|
+
},
|
|
27
|
+
expectedOutput: "The test case with its details",
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
handle = async (args) => {
|
|
32
|
+
const { testCaseKey } = getTestCaseParams.parse(args);
|
|
33
|
+
const response = await this.apiClient.get(`/testcases/${testCaseKey}`);
|
|
34
|
+
return {
|
|
35
|
+
structuredContent: response,
|
|
36
|
+
content: [],
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { listTestCasesCursorPaginatedQueryParams, listTestCasesCursorPaginatedResponse, } from "../../common/rest-api-schemas.js";
|
|
2
|
+
export class GetTestCases {
|
|
3
|
+
apiClient;
|
|
4
|
+
constructor(apiClient) {
|
|
5
|
+
this.apiClient = apiClient;
|
|
6
|
+
}
|
|
7
|
+
specification = {
|
|
8
|
+
title: "Get Test Cases",
|
|
9
|
+
summary: "Get details of test cases in Zephyr",
|
|
10
|
+
readOnly: true,
|
|
11
|
+
idempotent: true,
|
|
12
|
+
inputSchema: listTestCasesCursorPaginatedQueryParams,
|
|
13
|
+
outputSchema: listTestCasesCursorPaginatedResponse,
|
|
14
|
+
examples: [
|
|
15
|
+
{
|
|
16
|
+
description: "Get the first 10 Test Cases",
|
|
17
|
+
parameters: {
|
|
18
|
+
limit: 10,
|
|
19
|
+
startAtId: 1,
|
|
20
|
+
},
|
|
21
|
+
expectedOutput: "The first 10 Test Cases with their details",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
description: "Get any Test Case",
|
|
25
|
+
parameters: {
|
|
26
|
+
limit: 1,
|
|
27
|
+
},
|
|
28
|
+
expectedOutput: "One Test Case with its details",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
description: "Get five Test Cases starting from the ID 123",
|
|
32
|
+
parameters: {
|
|
33
|
+
limit: 5,
|
|
34
|
+
startAtId: 123,
|
|
35
|
+
},
|
|
36
|
+
expectedOutput: "Five Test Cases starting from the ID 123 with their details",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
description: "Get one Test Case from the project PROJ",
|
|
40
|
+
parameters: {
|
|
41
|
+
projectKey: "PROJ",
|
|
42
|
+
limit: 1,
|
|
43
|
+
},
|
|
44
|
+
expectedOutput: "One Test Case from project PROJ with its details",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
description: "Get one Test Case from the folder with ID 123",
|
|
48
|
+
parameters: {
|
|
49
|
+
folderId: 123,
|
|
50
|
+
limit: 1,
|
|
51
|
+
},
|
|
52
|
+
expectedOutput: "One Test Case from folder with ID 123 with its details",
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
};
|
|
56
|
+
handle = async (args) => {
|
|
57
|
+
const parsedArgs = listTestCasesCursorPaginatedQueryParams.parse(args);
|
|
58
|
+
const response = await this.apiClient.get("/testcases/nextgen", parsedArgs);
|
|
59
|
+
return {
|
|
60
|
+
structuredContent: response,
|
|
61
|
+
content: [],
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { getTestCycleParams, getTestCycleResponse, } from "../../common/rest-api-schemas.js";
|
|
2
|
+
export class GetTestCycle {
|
|
3
|
+
apiClient;
|
|
4
|
+
constructor(apiClient) {
|
|
5
|
+
this.apiClient = apiClient;
|
|
6
|
+
}
|
|
7
|
+
specification = {
|
|
8
|
+
title: "Get Test Cycle",
|
|
9
|
+
summary: "Get details of test cycle specified by id or key in Zephyr",
|
|
10
|
+
readOnly: true,
|
|
11
|
+
idempotent: true,
|
|
12
|
+
inputSchema: getTestCycleParams,
|
|
13
|
+
outputSchema: getTestCycleResponse,
|
|
14
|
+
examples: [
|
|
15
|
+
{
|
|
16
|
+
description: "Get the test cycle with id 1",
|
|
17
|
+
parameters: {
|
|
18
|
+
testCycleIdOrKey: "1",
|
|
19
|
+
},
|
|
20
|
+
expectedOutput: "The test cycle with its details",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
description: "Get the test cycle with key 'SA-R40'",
|
|
24
|
+
parameters: {
|
|
25
|
+
testCycleIdOrKey: "SA-R40",
|
|
26
|
+
},
|
|
27
|
+
expectedOutput: "The test cycle with its details",
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
handle = async (args) => {
|
|
32
|
+
const { testCycleIdOrKey } = getTestCycleParams.parse(args);
|
|
33
|
+
const response = await this.apiClient.get(`/testcycles/${testCycleIdOrKey}`);
|
|
34
|
+
return {
|
|
35
|
+
structuredContent: response,
|
|
36
|
+
content: [],
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -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 with ID 123",
|
|
48
|
+
parameters: {
|
|
49
|
+
folderId: 123,
|
|
50
|
+
maxResults: 1,
|
|
51
|
+
},
|
|
52
|
+
expectedOutput: "One Test Cycle from folder with ID 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
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { getTestExecutionParams, getTestExecutionResponse, } from "../../common/rest-api-schemas.js";
|
|
2
|
+
export class GetTestExecution {
|
|
3
|
+
apiClient;
|
|
4
|
+
constructor(apiClient) {
|
|
5
|
+
this.apiClient = apiClient;
|
|
6
|
+
}
|
|
7
|
+
specification = {
|
|
8
|
+
title: "Get Test Execution",
|
|
9
|
+
summary: "Get details of test execution specified by id or key in Zephyr",
|
|
10
|
+
readOnly: true,
|
|
11
|
+
idempotent: true,
|
|
12
|
+
inputSchema: getTestExecutionParams,
|
|
13
|
+
outputSchema: getTestExecutionResponse,
|
|
14
|
+
examples: [
|
|
15
|
+
{
|
|
16
|
+
description: "Get the test execution with id 1",
|
|
17
|
+
parameters: {
|
|
18
|
+
testExecutionIdOrKey: "1",
|
|
19
|
+
},
|
|
20
|
+
expectedOutput: "The test execution with its details",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
description: "Get the test execution with key 'PROJ-E123'",
|
|
24
|
+
parameters: {
|
|
25
|
+
testExecutionIdOrKey: "PROJ-E123",
|
|
26
|
+
},
|
|
27
|
+
expectedOutput: "The test execution with its details",
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
handle = async (args) => {
|
|
32
|
+
const { testExecutionIdOrKey } = getTestExecutionParams.parse(args);
|
|
33
|
+
const response = await this.apiClient.get(`/testexecutions/${testExecutionIdOrKey}`);
|
|
34
|
+
return {
|
|
35
|
+
structuredContent: response,
|
|
36
|
+
content: [],
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smartbear/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "MCP server for interacting SmartBear Products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"smartbear",
|
|
7
7
|
"mcp",
|
|
8
8
|
"bugsnag",
|
|
9
9
|
"reflect",
|
|
10
|
-
"
|
|
10
|
+
"swagger",
|
|
11
11
|
"pactflow",
|
|
12
12
|
"zephyr"
|
|
13
13
|
],
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TOOLS
|
|
3
|
-
*
|
|
4
|
-
* Defines tool configurations for API Hub operations.
|
|
5
|
-
* Each tool includes parameters, descriptions, and handler method names.
|
|
6
|
-
* This follows the pattern established in the pactflow module.
|
|
7
|
-
*/
|
|
8
|
-
import { CreatePortalArgsSchema, CreateProductArgsSchema, PortalArgsSchema, ProductArgsSchema, UpdatePortalArgsSchema, UpdateProductArgsSchema, } from "./portal-types.js";
|
|
9
|
-
import { ApiDefinitionParamsSchema, ApiSearchParamsSchema, CreateApiFromTemplateParamsSchema, CreateApiParamsSchema, ScanStandardizationParamsSchema, } from "./registry-types.js";
|
|
10
|
-
export const TOOLS = [
|
|
11
|
-
{
|
|
12
|
-
title: "List Portals",
|
|
13
|
-
summary: "Search for available portals within API Hub. Only portals where you have at least a designer role, either at the product level or organization level, are returned.",
|
|
14
|
-
parameters: [],
|
|
15
|
-
handler: "getPortals",
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
title: "Create Portal",
|
|
19
|
-
summary: "Create a new portal within API Hub.",
|
|
20
|
-
zodSchema: CreatePortalArgsSchema,
|
|
21
|
-
handler: "createPortal",
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
title: "Get Portal",
|
|
25
|
-
summary: "Retrieve information about a specific portal.",
|
|
26
|
-
zodSchema: PortalArgsSchema,
|
|
27
|
-
handler: "getPortal",
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
title: "Delete Portal",
|
|
31
|
-
summary: "Delete a specific portal.",
|
|
32
|
-
zodSchema: PortalArgsSchema,
|
|
33
|
-
handler: "deletePortal",
|
|
34
|
-
formatResponse: () => "Portal deleted successfully.",
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
title: "Update Portal",
|
|
38
|
-
summary: "Update a specific portal's configuration.",
|
|
39
|
-
zodSchema: UpdatePortalArgsSchema,
|
|
40
|
-
handler: "updatePortal",
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
title: "List Portal Products",
|
|
44
|
-
summary: "Get products for a specific portal that match your criteria.",
|
|
45
|
-
zodSchema: PortalArgsSchema,
|
|
46
|
-
handler: "getPortalProducts",
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
title: "Create Portal Product",
|
|
50
|
-
summary: "Create a new product for a specific portal.",
|
|
51
|
-
zodSchema: CreateProductArgsSchema,
|
|
52
|
-
handler: "createPortalProduct",
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
title: "Get Portal Product",
|
|
56
|
-
summary: "Retrieve information about a specific product resource.",
|
|
57
|
-
zodSchema: ProductArgsSchema,
|
|
58
|
-
handler: "getPortalProduct",
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
title: "Delete Portal Product",
|
|
62
|
-
summary: "Delete a product from a specific portal",
|
|
63
|
-
zodSchema: ProductArgsSchema,
|
|
64
|
-
handler: "deletePortalProduct",
|
|
65
|
-
formatResponse: () => "Product deleted successfully.",
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
title: "Update Portal Product",
|
|
69
|
-
summary: "Update a product's settings within a specific portal.",
|
|
70
|
-
zodSchema: UpdateProductArgsSchema,
|
|
71
|
-
handler: "updatePortalProduct",
|
|
72
|
-
},
|
|
73
|
-
// Registry API tools for SwaggerHub Design functionality
|
|
74
|
-
{
|
|
75
|
-
title: "Search APIs and Domains",
|
|
76
|
-
summary: "Search for APIs and Domains in SwaggerHub Registry using the comprehensive /specs endpoint and retrieve metadata including owner, name, description, summary, version, and specification.",
|
|
77
|
-
zodSchema: ApiSearchParamsSchema,
|
|
78
|
-
handler: "searchApis",
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
title: "Get API Definition",
|
|
82
|
-
summary: "Fetch resolved API definition from SwaggerHub Registry based on owner, API name, and version.",
|
|
83
|
-
zodSchema: ApiDefinitionParamsSchema,
|
|
84
|
-
handler: "getApiDefinition",
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
title: "Create or Update API",
|
|
88
|
-
summary: "Create a new API or update an existing API in SwaggerHub Registry for API Hub for Design. The API specification type (OpenAPI, AsyncAPI) is automatically detected from the definition content. APIs are always created with fixed values: version 1.0.0, private visibility, and automock disabled (these values cannot be changed). Returns HTTP 201 for creation, HTTP 200 for update. Response includes 'operation' field indicating whether it was a 'create' or 'update' operation along with API details and SwaggerHub URL.",
|
|
89
|
-
zodSchema: CreateApiParamsSchema,
|
|
90
|
-
handler: "createOrUpdateApi",
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
title: "Create API from Template",
|
|
94
|
-
summary: "Create a new API in SwaggerHub Registry using a predefined template. This endpoint creates APIs based on existing templates without requiring manual definition content. APIs are always created with fixed values: private visibility, no project assignment, and reconciliation enabled (these values cannot be changed). Returns HTTP 201 for creation, HTTP 200 for update. Response includes 'operation' field and API details with SwaggerHub URL.",
|
|
95
|
-
zodSchema: CreateApiFromTemplateParamsSchema,
|
|
96
|
-
handler: "createApiFromTemplate",
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
title: "Scan API Standardization",
|
|
100
|
-
summary: "Run a standardization scan against an API definition using the organization's standardization configuration. Accepts a YAML or JSON OpenAPI/AsyncAPI definition and returns a list of standardization errors and validation issues.",
|
|
101
|
-
zodSchema: ScanStandardizationParamsSchema,
|
|
102
|
-
handler: "scanStandardization",
|
|
103
|
-
},
|
|
104
|
-
];
|
package/dist/api-hub/client.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { MCP_SERVER_NAME, MCP_SERVER_VERSION } from "../common/info.js";
|
|
2
|
-
import { ApiHubAPI, ApiHubConfiguration, TOOLS, } from "./client/index.js";
|
|
3
|
-
// Tool definitions for API Hub API client
|
|
4
|
-
export class ApiHubClient {
|
|
5
|
-
config;
|
|
6
|
-
api;
|
|
7
|
-
name = "API Hub";
|
|
8
|
-
prefix = "api_hub";
|
|
9
|
-
constructor(token) {
|
|
10
|
-
this.config = new ApiHubConfiguration({ token });
|
|
11
|
-
this.api = new ApiHubAPI(this.config, `${MCP_SERVER_NAME}/${MCP_SERVER_VERSION}`);
|
|
12
|
-
}
|
|
13
|
-
// Delegate API methods to the ApiHubAPI instance
|
|
14
|
-
async getPortals() {
|
|
15
|
-
return this.api.getPortals();
|
|
16
|
-
}
|
|
17
|
-
async createPortal(body) {
|
|
18
|
-
return this.api.createPortal(body);
|
|
19
|
-
}
|
|
20
|
-
async getPortal(args) {
|
|
21
|
-
return this.api.getPortal(args.portalId);
|
|
22
|
-
}
|
|
23
|
-
async deletePortal(args) {
|
|
24
|
-
return this.api.deletePortal(args.portalId);
|
|
25
|
-
}
|
|
26
|
-
async updatePortal(args) {
|
|
27
|
-
const { portalId, ...body } = args;
|
|
28
|
-
return this.api.updatePortal(portalId, body);
|
|
29
|
-
}
|
|
30
|
-
async getPortalProducts(args) {
|
|
31
|
-
return this.api.getPortalProducts(args.portalId);
|
|
32
|
-
}
|
|
33
|
-
async createPortalProduct(args) {
|
|
34
|
-
const { portalId, ...body } = args;
|
|
35
|
-
return this.api.createPortalProduct(portalId, body);
|
|
36
|
-
}
|
|
37
|
-
async getPortalProduct(args) {
|
|
38
|
-
return this.api.getPortalProduct(args.productId);
|
|
39
|
-
}
|
|
40
|
-
async deletePortalProduct(args) {
|
|
41
|
-
return this.api.deletePortalProduct(args.productId);
|
|
42
|
-
}
|
|
43
|
-
async updatePortalProduct(args) {
|
|
44
|
-
const { productId, ...body } = args;
|
|
45
|
-
return this.api.updatePortalProduct(productId, body);
|
|
46
|
-
}
|
|
47
|
-
// Registry API methods for SwaggerHub Design functionality
|
|
48
|
-
async searchApis(args = {}) {
|
|
49
|
-
return this.api.searchApis(args);
|
|
50
|
-
}
|
|
51
|
-
async getApiDefinition(args) {
|
|
52
|
-
return this.api.getApiDefinition(args);
|
|
53
|
-
}
|
|
54
|
-
async createOrUpdateApi(args) {
|
|
55
|
-
return this.api.createOrUpdateApi(args);
|
|
56
|
-
}
|
|
57
|
-
async createApiFromTemplate(args) {
|
|
58
|
-
return this.api.createApiFromTemplate(args);
|
|
59
|
-
}
|
|
60
|
-
async scanStandardization(args) {
|
|
61
|
-
return this.api.scanStandardization(args);
|
|
62
|
-
}
|
|
63
|
-
registerTools(register, _getInput) {
|
|
64
|
-
TOOLS.forEach((tool) => {
|
|
65
|
-
const { handler, formatResponse, ...toolParams } = tool;
|
|
66
|
-
register(toolParams, async (args, _extra) => {
|
|
67
|
-
try {
|
|
68
|
-
// Dynamic method invocation
|
|
69
|
-
const handlerFn = this[handler];
|
|
70
|
-
if (typeof handlerFn !== "function") {
|
|
71
|
-
throw new Error(`Handler '${handler}' not found on ApiHubClient`);
|
|
72
|
-
}
|
|
73
|
-
const result = await handlerFn.call(this, args);
|
|
74
|
-
// Use custom formatter if available, otherwise return JSON
|
|
75
|
-
const formattedResult = formatResponse
|
|
76
|
-
? formatResponse(result)
|
|
77
|
-
: result;
|
|
78
|
-
const responseText = typeof formattedResult === "string"
|
|
79
|
-
? formattedResult
|
|
80
|
-
: JSON.stringify(formattedResult);
|
|
81
|
-
return {
|
|
82
|
-
content: [{ type: "text", text: responseText }],
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
catch (error) {
|
|
86
|
-
return {
|
|
87
|
-
content: [
|
|
88
|
-
{
|
|
89
|
-
type: "text",
|
|
90
|
-
text: `Error: ${error instanceof Error ? error.message : String(error)}`,
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
}
|