@smartbear/mcp 0.12.0 → 0.13.1
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 +30 -6
- package/dist/bugsnag/client/api/CurrentUser.js +50 -26
- package/dist/bugsnag/client/api/Error.js +158 -57
- package/dist/bugsnag/client/api/Project.js +398 -243
- package/dist/bugsnag/client/api/api.js +4087 -3837
- package/dist/bugsnag/client/api/base.js +155 -173
- package/dist/bugsnag/client/api/configuration.js +28 -25
- package/dist/bugsnag/client/filters.js +11 -20
- package/dist/bugsnag/client.js +1398 -1277
- package/dist/bugsnag/input-schemas.js +39 -57
- package/dist/collaborator/client.js +335 -371
- package/dist/common/bugsnag.js +5 -3
- package/dist/common/cache.js +50 -57
- package/dist/common/client-registry.js +106 -119
- package/dist/common/info.js +7 -3
- package/dist/common/register-clients.js +0 -16
- package/dist/common/server.js +270 -228
- package/dist/common/tools.js +19 -0
- package/dist/common/transport-http.js +252 -343
- package/dist/common/transport-stdio.js +40 -37
- package/dist/common/zod-utils.js +20 -0
- package/dist/index.js +18 -23
- package/dist/package.json.js +11 -0
- package/dist/pactflow/client/ai.js +142 -169
- package/dist/pactflow/client/base.js +41 -51
- package/dist/pactflow/client/prompt-utils.js +93 -84
- package/dist/pactflow/client/prompts.js +95 -92
- package/dist/pactflow/client/tools.js +94 -83
- package/dist/pactflow/client/utils.js +60 -64
- package/dist/pactflow/client.js +399 -320
- package/dist/qmetry/client/api/client-api.js +43 -41
- package/dist/qmetry/client/api/error-handler.js +264 -310
- package/dist/qmetry/client/auto-resolve.js +78 -99
- package/dist/qmetry/client/automation.js +139 -162
- package/dist/qmetry/client/handlers.js +49 -46
- package/dist/qmetry/client/issues.js +133 -115
- package/dist/qmetry/client/project.js +153 -174
- package/dist/qmetry/client/requirement.js +82 -70
- package/dist/qmetry/client/testcase.js +240 -208
- package/dist/qmetry/client/testsuite.js +332 -293
- package/dist/qmetry/client/tools/automation-tools.js +291 -288
- package/dist/qmetry/client/tools/index.js +16 -13
- package/dist/qmetry/client/tools/issue-tools.js +534 -543
- package/dist/qmetry/client/tools/project-tools.js +635 -656
- package/dist/qmetry/client/tools/requirement-tools.js +525 -528
- package/dist/qmetry/client/tools/testcase-tools.js +773 -786
- package/dist/qmetry/client/tools/testsuite-tools.js +1069 -1083
- package/dist/qmetry/client/utils.js +8 -14
- package/dist/qmetry/client.js +111 -109
- package/dist/qmetry/config/constants.js +48 -44
- package/dist/qmetry/config/rest-endpoints.js +51 -48
- package/dist/qmetry/types/automation.js +7 -7
- package/dist/qmetry/types/common.js +763 -1049
- package/dist/qmetry/types/issues.js +26 -19
- package/dist/qmetry/types/project.js +32 -25
- package/dist/qmetry/types/requirements.js +26 -21
- package/dist/qmetry/types/testcase.js +55 -44
- package/dist/qmetry/types/testsuite.js +66 -52
- package/dist/reflect/client.js +284 -226
- package/dist/swagger/client/api.js +645 -662
- package/dist/swagger/client/configuration.js +31 -33
- package/dist/swagger/client/portal-types.js +204 -244
- package/dist/swagger/client/registry-types.js +62 -96
- package/dist/swagger/client/tools.js +148 -158
- package/dist/swagger/client/user-management-types.js +11 -22
- package/dist/swagger/client.js +143 -135
- package/dist/swagger/config-utils.js +10 -16
- package/dist/zephyr/client.js +43 -42
- package/dist/zephyr/common/api-client.js +35 -30
- package/dist/zephyr/common/auth-service.js +16 -13
- package/dist/zephyr/common/rest-api-schemas.js +3173 -5146
- package/dist/zephyr/tool/environment/get-environments.js +66 -66
- package/dist/zephyr/tool/priority/get-priorities.js +41 -41
- package/dist/zephyr/tool/project/get-project.js +37 -37
- package/dist/zephyr/tool/project/get-projects.js +46 -46
- package/dist/zephyr/tool/status/get-statuses.js +47 -47
- package/dist/zephyr/tool/test-case/get-test-case.js +37 -37
- package/dist/zephyr/tool/test-case/get-test-cases.js +62 -62
- package/dist/zephyr/tool/test-cycle/get-test-cycle.js +37 -37
- package/dist/zephyr/tool/test-cycle/get-test-cycles.js +70 -70
- package/dist/zephyr/tool/test-execution/get-test-execution.js +37 -37
- package/dist/zephyr/tool/test-execution/get-test-executions.js +43 -43
- package/package.json +5 -5
- package/dist/bugsnag/client/api/index.js +0 -6
- package/dist/common/types.js +0 -6
- package/dist/qmetry/client/tools/types.js +0 -1
- package/dist/swagger/client/index.js +0 -6
- package/dist/tests/unit/bugsnag/utils/factories.js +0 -86
- package/dist/zephyr/tool/zephyr-tool.js +0 -1
|
@@ -1,90 +1,99 @@
|
|
|
1
|
-
import { ToolError } from "../../common/
|
|
2
|
-
import {
|
|
1
|
+
import { ToolError } from "../../common/tools.js";
|
|
2
|
+
import { MatcherRecommendationInputSchema, EndpointMatcherSchema } from "./ai.js";
|
|
3
3
|
import { OADMatcherPrompt } from "./prompts.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
4
|
+
async function getOADMatcherRecommendations(openAPI, server) {
|
|
5
|
+
const matcherResponse = await server.createMessage({
|
|
6
|
+
messages: [
|
|
7
|
+
{
|
|
8
|
+
role: "user",
|
|
9
|
+
content: {
|
|
10
|
+
type: "text",
|
|
11
|
+
text: OADMatcherPrompt.replace("{0}", JSON.stringify(openAPI))
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
maxTokens: 1e3
|
|
16
|
+
});
|
|
17
|
+
const regex = /```json[c5]?([\s\S]*?)```/i;
|
|
18
|
+
const content = matcherResponse.content;
|
|
19
|
+
if (content.type !== "text") {
|
|
20
|
+
throw new Error(
|
|
21
|
+
`Received unexpected response type from matcher recommendations: ${content.type}`
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
const match = regex.exec(content.text);
|
|
25
|
+
if (match) {
|
|
26
|
+
const jsonText = match[1].trim();
|
|
27
|
+
const parsed = JSON.parse(jsonText);
|
|
28
|
+
const matcherRecommendations = MatcherRecommendationInputSchema.parse(parsed);
|
|
29
|
+
return matcherRecommendations;
|
|
30
|
+
} else {
|
|
31
|
+
throw new ToolError(
|
|
32
|
+
"Unable to parse recommendations please provide OpenAPI matchers manually."
|
|
33
|
+
);
|
|
34
|
+
}
|
|
36
35
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
36
|
+
async function getUserMatcherSelection(recommendations, getInput) {
|
|
37
|
+
const recommendationsMap = /* @__PURE__ */ new Map();
|
|
38
|
+
recommendations.forEach((rec, index) => {
|
|
39
|
+
recommendationsMap.set(`Recommendation ${index + 1}`, JSON.stringify(rec));
|
|
40
|
+
});
|
|
41
|
+
const result = await getInput({
|
|
42
|
+
message: `Select one of the generated matchers you would want to use
|
|
43
|
+
|
|
44
|
+
${recommendations.map(
|
|
45
|
+
(rec, index) => `
|
|
46
|
+
|
|
47
|
+
Recommendation ${index + 1}:
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
${JSON.stringify(rec)}`
|
|
51
|
+
).join("\n\n")}`,
|
|
52
|
+
requestedSchema: {
|
|
53
|
+
type: "object",
|
|
54
|
+
properties: {
|
|
55
|
+
generatedMatchers: {
|
|
56
|
+
type: "string",
|
|
57
|
+
title: "Generated Matchers",
|
|
58
|
+
description: "Use the matchers generated for the OpenAPI document",
|
|
59
|
+
enum: recommendations.map(
|
|
60
|
+
(_, index) => `Recommendation ${index + 1}`
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
required: ["generatedMatchers"]
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
if (result.action === "accept") {
|
|
68
|
+
return EndpointMatcherSchema.parse(
|
|
69
|
+
JSON.parse(
|
|
70
|
+
recommendationsMap.get(result.content?.generatedMatchers) || ""
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
} else {
|
|
74
|
+
const result2 = await getInput({
|
|
75
|
+
message: "Enter the matchers you would want to use for the OpenAPI document",
|
|
76
|
+
requestedSchema: {
|
|
77
|
+
type: "object",
|
|
78
|
+
properties: {
|
|
79
|
+
enteredMatchers: {
|
|
80
|
+
type: "string",
|
|
81
|
+
title: "Enter the matchers you would want to use for the OpenAPI document",
|
|
82
|
+
description: "Enter the matchers you would want to use for the OpenAPI document"
|
|
83
|
+
}
|
|
64
84
|
},
|
|
85
|
+
required: ["enteredMatchers"]
|
|
86
|
+
}
|
|
65
87
|
});
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
else {
|
|
71
|
-
const result = await getInput({
|
|
72
|
-
message: "Enter the matchers you would want to use for the OpenAPI document",
|
|
73
|
-
requestedSchema: {
|
|
74
|
-
type: "object",
|
|
75
|
-
properties: {
|
|
76
|
-
enteredMatchers: {
|
|
77
|
-
type: "string",
|
|
78
|
-
title: "Enter the matchers you would want to use for the OpenAPI document",
|
|
79
|
-
description: "Enter the matchers you would want to use for the OpenAPI document",
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
required: ["enteredMatchers"],
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
if (result.action === "accept") {
|
|
86
|
-
return EndpointMatcherSchema.parse(JSON.parse(result.content?.enteredMatchers));
|
|
87
|
-
}
|
|
88
|
-
return {};
|
|
88
|
+
if (result2.action === "accept") {
|
|
89
|
+
return EndpointMatcherSchema.parse(
|
|
90
|
+
JSON.parse(result2.content?.enteredMatchers)
|
|
91
|
+
);
|
|
89
92
|
}
|
|
93
|
+
return {};
|
|
94
|
+
}
|
|
90
95
|
}
|
|
96
|
+
export {
|
|
97
|
+
getOADMatcherRecommendations,
|
|
98
|
+
getUserMatcherSelection
|
|
99
|
+
};
|
|
@@ -1,85 +1,84 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
3
2
|
import { EndpointMatcherSchema } from "./ai.js";
|
|
4
3
|
const OADMatcherPromptOpenAPIDocExample = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
4
|
+
openapi: "3.1.0",
|
|
5
|
+
info: {
|
|
6
|
+
title: "My API",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
description: "A sample API for demonstration purposes."
|
|
9
|
+
},
|
|
10
|
+
paths: {
|
|
11
|
+
"/users": {
|
|
12
|
+
get: {
|
|
13
|
+
summary: "Get all users",
|
|
14
|
+
responses: {
|
|
15
|
+
"200": {
|
|
16
|
+
description: "A list of users",
|
|
17
|
+
content: {
|
|
18
|
+
"application/json": {
|
|
19
|
+
schema: {
|
|
20
|
+
type: "array",
|
|
21
|
+
items: {
|
|
22
|
+
$ref: "#/components/schemas/User"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
components: {
|
|
33
|
+
schemas: {
|
|
34
|
+
User: {
|
|
35
|
+
type: "object",
|
|
36
|
+
properties: {
|
|
37
|
+
id: {
|
|
38
|
+
type: "integer",
|
|
39
|
+
format: "int64"
|
|
40
|
+
},
|
|
41
|
+
name: {
|
|
42
|
+
type: "string"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
49
48
|
};
|
|
50
49
|
const OADMatcherPromptRecommendationExample = [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
50
|
+
{
|
|
51
|
+
path: "/users",
|
|
52
|
+
methods: ["GET"],
|
|
53
|
+
statusCodes: [200, "2XX"],
|
|
54
|
+
operationId: "get*"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
path: "/users/*",
|
|
58
|
+
methods: ["GET"],
|
|
59
|
+
statusCodes: ["2XX"],
|
|
60
|
+
operationId: "*User*"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
path: "/users",
|
|
64
|
+
methods: ["GET"],
|
|
65
|
+
statusCodes: [200],
|
|
66
|
+
operationId: "getAllUsers"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
path: "/users/**",
|
|
70
|
+
methods: ["GET"],
|
|
71
|
+
statusCodes: ["2XX", 404],
|
|
72
|
+
operationId: "get*"
|
|
73
|
+
}
|
|
75
74
|
];
|
|
76
|
-
|
|
75
|
+
const OADMatcherPrompt = `
|
|
77
76
|
|
|
78
77
|
Generate a list of recommendations(maximum of 5) in JSON to use with an OpenAPI matcher.
|
|
79
78
|
Zod Schema for the matcher to be generated is provided below in the markdown block of javascript use this to generate the recommendations for the matcher. Recommendations should contain all the fields from the schema and only output the JSON in a markdown formatted block.
|
|
80
79
|
|
|
81
80
|
\`\`\`javascript
|
|
82
|
-
const EndpointMatcherSchema = ${JSON.stringify(
|
|
81
|
+
const EndpointMatcherSchema = ${JSON.stringify(EndpointMatcherSchema.toJSONSchema())};
|
|
83
82
|
\`\`\`
|
|
84
83
|
|
|
85
84
|
Example OpenAPI document:-
|
|
@@ -106,26 +105,30 @@ Now provided the below OpenAPI document:-
|
|
|
106
105
|
|
|
107
106
|
Give JSON recommendations only provide the JSON block in markdown don't include any additional text.
|
|
108
107
|
`;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
callback: ({ openAPI }) => ({
|
|
120
|
-
messages: [
|
|
121
|
-
{
|
|
122
|
-
role: "user",
|
|
123
|
-
content: {
|
|
124
|
-
type: "text",
|
|
125
|
-
text: OADMatcherPrompt.replace("{0}", openAPI),
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
}),
|
|
108
|
+
const PROMPTS = [
|
|
109
|
+
{
|
|
110
|
+
name: "OpenAPI Matcher recommendations",
|
|
111
|
+
params: {
|
|
112
|
+
description: "Get OpenAPI matcher recommendations using sampling",
|
|
113
|
+
title: "OpenAPI Matcher recommendations",
|
|
114
|
+
argsSchema: {
|
|
115
|
+
openAPI: z.string()
|
|
116
|
+
}
|
|
130
117
|
},
|
|
118
|
+
callback: ({ openAPI }) => ({
|
|
119
|
+
messages: [
|
|
120
|
+
{
|
|
121
|
+
role: "user",
|
|
122
|
+
content: {
|
|
123
|
+
type: "text",
|
|
124
|
+
text: OADMatcherPrompt.replace("{0}", openAPI)
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
})
|
|
129
|
+
}
|
|
131
130
|
];
|
|
131
|
+
export {
|
|
132
|
+
OADMatcherPrompt,
|
|
133
|
+
PROMPTS
|
|
134
|
+
};
|
|
@@ -1,87 +1,98 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TOOLS
|
|
3
|
-
*
|
|
4
|
-
* Extends the default `ToolParams` with:
|
|
5
|
-
* - `handler`: Name of the `PactflowClient` method to execute.
|
|
6
|
-
* - `clients`: List of `ClientType`s allowed to use the tool.
|
|
7
|
-
* - `formatResponse` (optional): Formats the tool's output before returning.
|
|
8
|
-
*
|
|
9
|
-
* In `PactflowClient.registerTools()`, tools are filtered by `clientType`
|
|
10
|
-
* and registered with their corresponding handler.
|
|
11
|
-
*/
|
|
12
1
|
import { z } from "zod";
|
|
13
2
|
import { GenerationInputSchema, RefineInputSchema } from "./ai.js";
|
|
14
3
|
import { CanIDeploySchema, MatrixSchema } from "./base.js";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
4
|
+
const TOOLS = [
|
|
5
|
+
{
|
|
6
|
+
title: "Generate Pact Tests",
|
|
7
|
+
summary: "Generate Pact tests using PactFlow AI. You can provide one or more of the following input types: (1) request/response pairs for specific interactions, (2) code files to analyze and extract interactions from, and/or (3) OpenAPI document to generate tests for specific endpoints. When providing an OpenAPI document, a matcher is required to specify which endpoints to generate tests for.",
|
|
8
|
+
purpose: "Generate Pact tests for API interactions",
|
|
9
|
+
inputSchema: GenerationInputSchema,
|
|
10
|
+
handler: "generate",
|
|
11
|
+
clients: ["pactflow"],
|
|
12
|
+
// ONLY pactflow
|
|
13
|
+
enableElicitation: true,
|
|
14
|
+
tags: ["pactflow-ai"]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
title: "Review Pact Tests",
|
|
18
|
+
summary: "Review Pact tests using PactFlow AI. You can provide the following inputs: (1) Pact tests to be reviewed along with metadata",
|
|
19
|
+
purpose: "Review Pact tests for API interactions",
|
|
20
|
+
inputSchema: RefineInputSchema,
|
|
21
|
+
handler: "review",
|
|
22
|
+
clients: ["pactflow"],
|
|
23
|
+
enableElicitation: true,
|
|
24
|
+
tags: ["pactflow-ai"]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
title: "Get Provider States",
|
|
28
|
+
summary: "Retrieve the states of a specific provider",
|
|
29
|
+
purpose: "A provider state in Pact defines the specific preconditions that must be met on the provider side before a consumer-provider interaction can be tested. It sets up the provider in the right context—such as ensuring a particular user or record exists—so that the provider can return the response the consumer expects. This makes contract tests reliable, repeatable, and isolated by injecting or configuring the necessary data and conditions directly into the provider before each test runs.",
|
|
30
|
+
parameters: [
|
|
31
|
+
{
|
|
32
|
+
name: "provider",
|
|
33
|
+
type: z.string(),
|
|
34
|
+
description: "name of the provider to retrieve states for",
|
|
35
|
+
required: true
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
handler: "getProviderStates",
|
|
39
|
+
clients: ["pactflow", "pact_broker"]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
title: "Can I Deploy",
|
|
43
|
+
summary: "Performs a comprehensive compatibility check to determine whether a specific version of a service (pacticipant) can be safely deployed into a given environment. It analyzes the complete contract matrix of consumer-provider relationships to confirm that all required integrations are verified and compatible.",
|
|
44
|
+
purpose: "To serve as a deployment safety check within the PactBroker and PactFlow ecosystem, leveraging contract testing results to validate whether a specific service / pacticipant version is compatible with all integrated services. This feature prevents unsafe releases, reduces integration risks, and enables teams to confidently automate deployments across environments with a clear, auditable record of verification results.",
|
|
45
|
+
inputSchema: CanIDeploySchema,
|
|
46
|
+
handler: "canIDeploy",
|
|
47
|
+
clients: ["pactflow", "pact_broker"]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
title: "Matrix",
|
|
51
|
+
summary: "Retrieve the comprehensive contract verification matrix that shows the relationship between consumer and provider versions, their associated pact files, and verification results stored in the Pact Broker or Pactflow. The matrix provides detailed visibility into which consumer and provider versions have been successfully verified against each other, and highlights failures with detailed information about the cause.",
|
|
52
|
+
purpose: "The Matrix serves as a powerful tool for teams to understand the state of their contract testing ecosystem. It enables tracking of all interactions between consumer and provider versions over time, with detailed insights into verification successes and failures. This helps teams rapidly identify compatibility issues, understand why specific verifications failed, and make informed decisions about deployments. Matrix offers a more intuitive and consolidated view of the verification status, making it easier to spot trends or problematic versions. Additionally, the Matrix supports complex queries using selectors, and can answer specific 'can-i-deploy' questions, ensuring that only compatible versions are deployed to production environments.",
|
|
53
|
+
useCases: [
|
|
54
|
+
"Quickly identify which consumer and provider version combinations have passed or failed verification.",
|
|
55
|
+
"Diagnose and investigate why a particular consumer-provider verification failed.",
|
|
56
|
+
"Visualize the overall contract compatibility across two pacticipants / services.",
|
|
57
|
+
"Perform advanced queries using selectors to understand compatibility within specific branches, environments, or version ranges.",
|
|
58
|
+
"Support informed deployment decisions by answering 'can I deploy version X of this service to production?'",
|
|
59
|
+
"Expose contract verification details to non-frequent API users in a more accessible format."
|
|
60
|
+
],
|
|
61
|
+
inputSchema: MatrixSchema,
|
|
62
|
+
handler: "getMatrix",
|
|
63
|
+
clients: ["pactflow", "pact_broker"]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
title: "Check PactFlow AI Entitlements",
|
|
67
|
+
summary: "Check your PactFlow AI entitlements and credit balance if you encounter 401 Unauthorized errors or permission/credit issues when using PactFlow AI features.",
|
|
68
|
+
purpose: "Retrieve AI entitlement information when PactFlow AI operations fail with 401 unauthorized errors. Use this to diagnose permission issues, check remaining credits, and verify account eligibility for AI features.",
|
|
69
|
+
useCases: [
|
|
70
|
+
"Diagnose 401 unauthorized errors when attempting to use PactFlow AI features",
|
|
71
|
+
"Check remaining AI credits when PactFlow AI operations are rejected due to insufficient credits",
|
|
72
|
+
"Verify account entitlements when users receive permission denied errors for PactFlow AI functionality",
|
|
73
|
+
"Troubleshoot PactFlow AI access issues by retrieving current entitlement status and credit balance",
|
|
74
|
+
"Provide detailed error context when PactFlow AI features are unavailable due to account limitations"
|
|
75
|
+
],
|
|
76
|
+
handler: "checkAIEntitlements",
|
|
77
|
+
clients: ["pactflow"]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
title: "Get Metrics",
|
|
81
|
+
summary: "Fetch metrics across the entire workspace",
|
|
82
|
+
purpose: "Fetch metrics across the workspace. Use this to get an overview of contract testing usage, resource consumption and account-wide statistics.",
|
|
83
|
+
inputSchema: z.object({}),
|
|
84
|
+
handler: "getMetrics",
|
|
85
|
+
clients: ["pactflow", "pact_broker"]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
title: "Get Team Metrics",
|
|
89
|
+
summary: "Fetch metrics for all teams",
|
|
90
|
+
purpose: "Fetch metrics for all teams within PactFlow. Use this to get an overview of team-specific contract testing usage, resource consumption and usage statistics.",
|
|
91
|
+
inputSchema: z.object({}),
|
|
92
|
+
handler: "getTeamMetrics",
|
|
93
|
+
clients: ["pactflow"]
|
|
94
|
+
}
|
|
87
95
|
];
|
|
96
|
+
export {
|
|
97
|
+
TOOLS
|
|
98
|
+
};
|