@smartbear/mcp 0.34.0 → 0.35.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.
@@ -1,4 +1,4 @@
1
- const version = "0.34.0";
1
+ const version = "0.35.0";
2
2
  const config = { "mcpServerName": "SmartBear MCP Server" };
3
3
  const packageJson = {
4
4
  version,
@@ -0,0 +1,106 @@
1
+ import { QMETRY_PATHS } from "../config/rest-endpoints.js";
2
+ import { qmetryRequest } from "./api/client-api.js";
3
+ import { resolveDefaults } from "./utils.js";
4
+ async function getGateConfiguration(token, baseUrl, project, payload) {
5
+ const { resolvedBaseUrl, resolvedProject } = resolveDefaults(
6
+ baseUrl,
7
+ project
8
+ );
9
+ if (!payload.projectId || Number.isNaN(Number(payload.projectId))) {
10
+ throw new Error(
11
+ "[getGateConfiguration] Missing or invalid required parameter: 'projectId'. Must be a valid numeric project ID."
12
+ );
13
+ }
14
+ if (!payload.agentIdentifier) {
15
+ throw new Error(
16
+ "[getGateConfiguration] Missing or invalid required parameter: 'agentIdentifier'."
17
+ );
18
+ }
19
+ const path = `${QMETRY_PATHS.AI_AGENT.GET_GATE_CONFIG.replace(
20
+ ":projectId",
21
+ String(payload.projectId)
22
+ )}?agentIdentifier=${encodeURIComponent(payload.agentIdentifier)}`;
23
+ return qmetryRequest({
24
+ method: "GET",
25
+ path,
26
+ token,
27
+ baseUrl: resolvedBaseUrl,
28
+ project: resolvedProject
29
+ });
30
+ }
31
+ async function executeGateReport(token, baseUrl, project, payload) {
32
+ const { resolvedBaseUrl, resolvedProject } = resolveDefaults(
33
+ baseUrl,
34
+ project
35
+ );
36
+ if (!payload.reportName) {
37
+ throw new Error(
38
+ "[executeGateReport] Missing or invalid required parameter: 'reportName'."
39
+ );
40
+ }
41
+ if (!payload.gateIdentifier) {
42
+ throw new Error(
43
+ "[executeGateReport] Missing or invalid required parameter: 'gateIdentifier'."
44
+ );
45
+ }
46
+ if (!payload.projectId || Number.isNaN(Number(payload.projectId))) {
47
+ throw new Error(
48
+ "[executeGateReport] Missing or invalid required parameter: 'projectId'. Must be a valid numeric project ID."
49
+ );
50
+ }
51
+ const body = {
52
+ reportName: payload.reportName,
53
+ gateIdentifier: payload.gateIdentifier,
54
+ projectId: payload.projectId
55
+ };
56
+ if (payload.releaseId !== void 0) {
57
+ body.releaseId = payload.releaseId;
58
+ }
59
+ if (payload.cycleIds !== void 0) {
60
+ body.cycleIds = payload.cycleIds;
61
+ }
62
+ if (payload.page !== void 0) {
63
+ body.page = payload.page;
64
+ }
65
+ body.limit = payload.limit ?? 100;
66
+ return qmetryRequest({
67
+ method: "POST",
68
+ path: QMETRY_PATHS.AI_AGENT.EXECUTE_REPORT,
69
+ token,
70
+ baseUrl: resolvedBaseUrl,
71
+ project: resolvedProject,
72
+ body
73
+ });
74
+ }
75
+ async function exportHtmlReport(token, baseUrl, project, payload) {
76
+ const { resolvedBaseUrl, resolvedProject } = resolveDefaults(
77
+ baseUrl,
78
+ project
79
+ );
80
+ if (!payload.htmlContent) {
81
+ throw new Error(
82
+ "[exportHtmlReport] Missing required parameter: 'htmlContent'."
83
+ );
84
+ }
85
+ if (!payload.fileName) {
86
+ throw new Error(
87
+ "[exportHtmlReport] Missing required parameter: 'fileName'."
88
+ );
89
+ }
90
+ return qmetryRequest({
91
+ method: "POST",
92
+ path: QMETRY_PATHS.AI_AGENT.EXPORT_HTML_REPORT,
93
+ token,
94
+ baseUrl: resolvedBaseUrl,
95
+ project: resolvedProject,
96
+ body: {
97
+ htmlContent: payload.htmlContent,
98
+ fileName: payload.fileName
99
+ }
100
+ });
101
+ }
102
+ export {
103
+ executeGateReport,
104
+ exportHtmlReport,
105
+ getGateConfiguration
106
+ };
@@ -14,7 +14,6 @@ async function qmetryRequest({
14
14
  }) {
15
15
  const url = `${baseUrl}${path}`;
16
16
  const headers = {
17
- apikey: token,
18
17
  project: project || QMETRY_DEFAULTS.PROJECT_KEY,
19
18
  "User-Agent": getUserAgent(),
20
19
  "qmetry-source": "smartbear-mcp"
@@ -31,6 +30,12 @@ async function qmetryRequest({
31
30
  if (body) {
32
31
  headers["Content-Type"] = "application/json";
33
32
  }
33
+ const transportMode = process.env.MCP_TRANSPORT?.toLowerCase() || "stdio";
34
+ if (transportMode === "http") {
35
+ headers.Authorization = `Bearer ${token}`;
36
+ } else {
37
+ headers.apikey = token;
38
+ }
34
39
  const init = {
35
40
  method,
36
41
  headers
@@ -52,7 +57,8 @@ async function qmetryRequest({
52
57
  if (!res.ok) {
53
58
  await handleQMetryApiError(res, baseUrl, project, path);
54
59
  }
55
- return await res.json();
60
+ const data = await res.json();
61
+ return data;
56
62
  }
57
63
  export {
58
64
  qmetryRequest
@@ -1,4 +1,5 @@
1
1
  import { QMetryToolsHandlers } from "../config/constants.js";
2
+ import { exportHtmlReport, executeGateReport, getGateConfiguration } from "./ai-agent.js";
2
3
  import { getAutomationStatus, importAutomationResults } from "./automation.js";
3
4
  import { fetchIssueExecutions, linkIssuesToTestcaseRun, fetchIssues, updateIssue, createIssue, fetchIssuesLinkedToTestCase } from "./issues.js";
4
5
  import { updateCycle, createCycle, createRelease, getPlatforms, getBuilds, getReleasesCycles, getProjectInfo, getProjects } from "./project.js";
@@ -53,7 +54,10 @@ const QMETRY_HANDLER_MAP = {
53
54
  [QMetryToolsHandlers.FETCH_TEST_RUN_UDF_METADATA]: fetchTestRunUdfMetadata,
54
55
  [QMetryToolsHandlers.FETCH_TEST_RUN_UDF_VALUES]: fetchTestRunUdfValues,
55
56
  [QMetryToolsHandlers.FETCH_ISSUE_EXECUTIONS]: fetchIssueExecutions,
56
- [QMetryToolsHandlers.FETCH_CASCADE_CHILD_VALUES]: fetchCascadeChildValues
57
+ [QMetryToolsHandlers.FETCH_CASCADE_CHILD_VALUES]: fetchCascadeChildValues,
58
+ [QMetryToolsHandlers.FETCH_GATE_CONFIGURATION]: getGateConfiguration,
59
+ [QMetryToolsHandlers.EXECUTE_GATE_REPORT]: executeGateReport,
60
+ [QMetryToolsHandlers.EXPORT_HTML_REPORT]: exportHtmlReport
57
61
  };
58
62
  export {
59
63
  QMETRY_HANDLER_MAP
@@ -0,0 +1,120 @@
1
+ import { QMetryToolsHandlers } from "../../config/constants.js";
2
+ import { GetGateConfigurationArgsSchema, ExecuteGateReportArgsSchema, ExportHtmlReportArgsSchema } from "../../types/ai-agent.js";
3
+ const AI_AGENT_TOOLS = [
4
+ {
5
+ handler: QMetryToolsHandlers.FETCH_GATE_CONFIGURATION,
6
+ title: "Fetch Quality Gate Configuration",
7
+ toolset: "AI Agent",
8
+ summary: "Fetch the quality gate configuration for a project and AI agent, including assessment scope and gate criteria.",
9
+ purpose: "Retrieves the quality gate configuration for a given project and AI agent identifier. The backend validates AI Agent enablement, resolves the project and agent, and returns the project-specific or default gate configuration with assessment scope injected.",
10
+ inputSchema: GetGateConfigurationArgsSchema,
11
+ useCases: [
12
+ "Retrieve gate criteria and thresholds before generating a quality gate report",
13
+ "Check which quality gates are configured for a project and agent",
14
+ "Inspect assessment scope and gate parameters for release readiness evaluation"
15
+ ],
16
+ examples: [
17
+ {
18
+ description: "Fetch gate configuration for project 45851 and agent 'RR'",
19
+ parameters: {
20
+ projectId: 45851,
21
+ agentIdentifier: "RR"
22
+ },
23
+ expectedOutput: "Gate configuration object with assessment scope, gate criteria, and thresholds."
24
+ }
25
+ ],
26
+ hints: [
27
+ "REQUIRED: 'projectId' must be a valid numeric project ID (not the project key).",
28
+ "REQUIRED: 'agentIdentifier' must match a registered AI agent identifier.",
29
+ "Call this tool before 'Execute Quality Gate Report' to understand the gate criteria and available gates.",
30
+ "If AI Agent is not enabled for the project, the backend will return an appropriate error."
31
+ ],
32
+ readOnly: true,
33
+ destructive: false,
34
+ idempotent: true
35
+ },
36
+ {
37
+ handler: QMetryToolsHandlers.EXECUTE_GATE_REPORT,
38
+ title: "Execute Quality Gate Report",
39
+ toolset: "AI Agent",
40
+ summary: "Execute a quality gate report by forwarding the request to the backend analytics engine and returning the results.",
41
+ purpose: "Submits a quality gate report request to the backend. The backend validates AI Agent provisioning, resolves the report and gate query, substitutes SQL tokens, validates parameters, executes the analytics query, and returns the report data. The MCP tool simply forwards the request and returns the response.",
42
+ inputSchema: ExecuteGateReportArgsSchema,
43
+ useCases: [
44
+ "Generate a release readiness report for a specific project, release, and cycle",
45
+ "Execute a quality gate assessment to evaluate project health against gate criteria",
46
+ "Run a gate report scoped to specific cycles within a release",
47
+ "Produce analytics data for quality gate evaluation and decision-making"
48
+ ],
49
+ examples: [
50
+ {
51
+ description: "Execute a release readiness report for project 45851, release 90698, cycle 129140",
52
+ parameters: {
53
+ reportName: "RR",
54
+ gateIdentifier: "GATE1",
55
+ projectId: 45851,
56
+ releaseId: 90698,
57
+ cycleIds: [129140]
58
+ },
59
+ expectedOutput: '{ "data": [...], "total": 0, "success": true, "page": {} }'
60
+ },
61
+ {
62
+ description: "Execute a gate report without release/cycle scoping",
63
+ parameters: {
64
+ reportName: "RR",
65
+ gateIdentifier: "GATE1",
66
+ projectId: 45851
67
+ },
68
+ expectedOutput: '{ "data": [...], "total": 0, "success": true, "page": {} }'
69
+ }
70
+ ],
71
+ hints: [
72
+ "REQUIRED: 'reportName' identifies the report type (e.g. 'RR' for Release Readiness).",
73
+ "REQUIRED: 'gateIdentifier' identifies which gate to evaluate (e.g. 'GATE1').",
74
+ "REQUIRED: 'projectId' must be a valid numeric project ID.",
75
+ "OPTIONAL: 'releaseId' scopes the report to a specific release.",
76
+ "OPTIONAL: 'cycleIds' scopes the report to specific test cycles within the release.",
77
+ "OPTIONAL: 'page' specifies the page number for paginated report results.",
78
+ "OPTIONAL: 'limit' sets the maximum number of records per page (defaults to 100).",
79
+ "Call 'Fetch Quality Gate Configuration' first to discover available gates and report parameters.",
80
+ "The response is returned exactly as received from the backend — no transformation is applied."
81
+ ],
82
+ readOnly: true,
83
+ destructive: false,
84
+ idempotent: true
85
+ },
86
+ {
87
+ handler: QMetryToolsHandlers.EXPORT_HTML_REPORT,
88
+ title: "Export HTML Report",
89
+ toolset: "AI Agent",
90
+ summary: "Export HTML content as a downloadable report file via the backend.",
91
+ purpose: "Submits HTML content and a file name to the backend, which generates and returns a report file. Use this to export AI-generated reports (e.g. release readiness) as shareable HTML documents.",
92
+ inputSchema: ExportHtmlReportArgsSchema,
93
+ useCases: [
94
+ "Export a generated release readiness report as an HTML file",
95
+ "Save AI-generated quality gate analysis as a downloadable report",
96
+ "Create a shareable HTML document from report content"
97
+ ],
98
+ examples: [
99
+ {
100
+ description: "Export a release readiness report",
101
+ parameters: {
102
+ htmlContent: "<h1>Release Readiness Report</h1><p>Generated by AI Agent.</p>",
103
+ fileName: "release-readiness-report"
104
+ },
105
+ expectedOutput: "Report file generated and returned by the backend."
106
+ }
107
+ ],
108
+ hints: [
109
+ "REQUIRED: 'htmlContent' is the full HTML string to export.",
110
+ "REQUIRED: 'fileName' is the report file name (without extension).",
111
+ "Typically called after generating report content from 'Execute Quality Gate Report' results."
112
+ ],
113
+ readOnly: false,
114
+ destructive: false,
115
+ idempotent: true
116
+ }
117
+ ];
118
+ export {
119
+ AI_AGENT_TOOLS
120
+ };
@@ -1,3 +1,4 @@
1
+ import { AI_AGENT_TOOLS } from "./ai-agent-tools.js";
1
2
  import { AUTOMATION_TOOLS } from "./automation-tools.js";
2
3
  import { ISSUE_TOOLS } from "./issue-tools.js";
3
4
  import { PROJECT_TOOLS } from "./project-tools.js";
@@ -12,9 +13,11 @@ const TOOLS = [
12
13
  ...TESTSUITE_TOOLS,
13
14
  ...ISSUE_TOOLS,
14
15
  ...AUTOMATION_TOOLS,
15
- ...UDF_TOOLS
16
+ ...UDF_TOOLS,
17
+ ...AI_AGENT_TOOLS
16
18
  ];
17
19
  export {
20
+ AI_AGENT_TOOLS,
18
21
  AUTOMATION_TOOLS,
19
22
  ISSUE_TOOLS,
20
23
  PROJECT_TOOLS,
@@ -6,7 +6,9 @@ import { getProjectInfo } from "./client/project.js";
6
6
  import { TOOLS } from "./client/tools/index.js";
7
7
  import { QMETRY_DEFAULTS, QMetryToolsHandlers } from "./config/constants.js";
8
8
  const ConfigurationSchema = zod__default.object({
9
- api_key: zod__default.string().describe("QMetry API key for authentication"),
9
+ api_key: zod__default.string().optional().describe(
10
+ "QMetry API key for authentication (not required when using OAuth)"
11
+ ),
10
12
  base_url: zod__default.string().url().optional().describe(
11
13
  "Optional QMetry base URL for custom or region-specific endpoints"
12
14
  )
@@ -30,8 +32,23 @@ class QmetryClient {
30
32
  isConfigured() {
31
33
  return true;
32
34
  }
35
+ getAuthToken() {
36
+ try {
37
+ return this.getToken();
38
+ } catch {
39
+ return null;
40
+ }
41
+ }
33
42
  getToken() {
34
- let contextToken = getRequestHeader("Qmetry-Token") || getRequestHeader("apikey");
43
+ let contextToken = getRequestHeader("Authorization");
44
+ if (contextToken) {
45
+ const token = Array.isArray(contextToken) ? contextToken[0] : contextToken;
46
+ if (token.startsWith("Bearer ")) {
47
+ return token.substring(7);
48
+ }
49
+ return token;
50
+ }
51
+ contextToken = getRequestHeader("Qmetry-Token") || getRequestHeader("apikey");
35
52
  if (Array.isArray(contextToken)) {
36
53
  contextToken = contextToken[0];
37
54
  }
@@ -1,5 +1,5 @@
1
1
  const QMETRY_DEFAULTS = {
2
- BASE_URL: "https://testmanagement.qmetry.com",
2
+ BASE_URL: process.env.QMETRY_BASE_URL || "https://testmanagement.qmetry.com",
3
3
  PROJECT_KEY: "default"
4
4
  };
5
5
  const UDF_MODULES = [
@@ -101,7 +101,10 @@ const QMetryToolsHandlers = {
101
101
  FETCH_TEST_RUN_UDF_METADATA: "fetchTestRunUdfMetadata",
102
102
  FETCH_TEST_RUN_UDF_VALUES: "fetchTestRunUdfValues",
103
103
  FETCH_ISSUE_EXECUTIONS: "getIssueExecutions",
104
- FETCH_CASCADE_CHILD_VALUES: "fetchCascadeChildValues"
104
+ FETCH_CASCADE_CHILD_VALUES: "fetchCascadeChildValues",
105
+ FETCH_GATE_CONFIGURATION: "getGateConfiguration",
106
+ EXECUTE_GATE_REPORT: "executeGateReport",
107
+ EXPORT_HTML_REPORT: "exportHtmlReport"
105
108
  };
106
109
  export {
107
110
  QMETRY_DEFAULTS,
@@ -51,6 +51,11 @@ const QMETRY_PATHS = {
51
51
  BULK_UPDATE_TEST_RUN_UDFS: "/rest/execution/udf/bulkupdate",
52
52
  TEST_RUN_UDF_METADATA: "/rest/admin/udf/metadata",
53
53
  FETCH_CASCADE_CHILD_VALUES: "/rest/admin/udf/cascade/childValue"
54
+ },
55
+ AI_AGENT: {
56
+ GET_GATE_CONFIG: "/rest/aiagent/project/:projectId/gate-config",
57
+ EXECUTE_REPORT: "/rest/aiagent/report",
58
+ EXPORT_HTML_REPORT: "/rest/aiagent/htmlreport"
54
59
  }
55
60
  };
56
61
  export {
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ import { CommonFields } from "./common.js";
3
+ const GetGateConfigurationArgsSchema = z.object({
4
+ projectKey: CommonFields.projectKeyOptional,
5
+ baseUrl: CommonFields.baseUrl,
6
+ projectId: z.coerce.number().describe(
7
+ "Numeric project ID for which to fetch the quality gate configuration. This is the internal numeric identifier, not the project key."
8
+ ),
9
+ agentIdentifier: z.string().describe(
10
+ "Unique identifier of the AI agent whose gate configuration should be retrieved."
11
+ )
12
+ });
13
+ const ExecuteGateReportArgsSchema = z.object({
14
+ projectKey: CommonFields.projectKeyOptional,
15
+ baseUrl: CommonFields.baseUrl,
16
+ reportName: z.string().describe("Report name identifier (e.g. 'RR' for Release Readiness)."),
17
+ gateIdentifier: z.string().describe("Gate identifier to execute the report against (e.g. 'GATE1')."),
18
+ projectId: z.coerce.number().describe("Numeric project ID for the report scope."),
19
+ releaseId: z.coerce.number().optional().describe("Optional release ID to scope the report to a specific release."),
20
+ cycleIds: z.array(z.coerce.number()).optional().describe(
21
+ "Optional array of cycle IDs to scope the report to specific cycles."
22
+ ),
23
+ page: z.coerce.number().optional().describe("Optional page number for paginated report results."),
24
+ limit: z.coerce.number().optional().default(100).describe(
25
+ "Maximum number of records to return per page. Defaults to 100 if not specified."
26
+ )
27
+ });
28
+ const ExportHtmlReportArgsSchema = z.object({
29
+ projectKey: CommonFields.projectKeyOptional,
30
+ baseUrl: CommonFields.baseUrl,
31
+ htmlContent: z.string().describe("HTML content to be exported as a report."),
32
+ fileName: z.string().describe("Name for the exported report file (without extension).")
33
+ });
34
+ export {
35
+ ExecuteGateReportArgsSchema,
36
+ ExportHtmlReportArgsSchema,
37
+ GetGateConfigurationArgsSchema
38
+ };
@@ -757,6 +757,15 @@ const FetchAutomationStatusPayloadSchema = z.object({
757
757
  "Numeric request ID from import automation response. CRITICAL: parameter name is 'requestID' — do NOT use 'requestId', 'jobId', or other variants. Accepts a string or number."
758
758
  )
759
759
  });
760
+ z.object({
761
+ projectKey: CommonFields.projectKeyOptional,
762
+ baseUrl: CommonFields.baseUrl,
763
+ query: z.string().describe(
764
+ "SQL query to execute against QMetry analytics. Supports tables like requirements, testcases, testexecutions, testsuites, issues, and their relationship tables (requirementtestcase, testexecutionissue, etc.). Use JOINs to combine data across entities for custom reporting."
765
+ ),
766
+ page: z.number().optional().describe("Page number for pagination (starts from 0)").default(0),
767
+ filterValue: z.array(z.any()).optional().describe("Filter values for parameterized queries").default([])
768
+ });
760
769
  export {
761
770
  AutomationHierarchyEnum,
762
771
  BuildArgsSchema,
@@ -155,6 +155,22 @@ class FunctionalTestingAPI {
155
155
  }
156
156
  };
157
157
  }
158
+ async createSuite(args) {
159
+ const response = await this.ftFetch(
160
+ `suites`,
161
+ {
162
+ method: "POST",
163
+ headers: this.getFtHeaders(),
164
+ body: JSON.stringify({
165
+ name: args.name,
166
+ agentName: args.agentName,
167
+ runApiTests: args.runApiTests
168
+ })
169
+ },
170
+ errorMessageFor("create Functional Testing suite")
171
+ );
172
+ return response.json();
173
+ }
158
174
  async listSuites() {
159
175
  const response = await this.ftFetch(
160
176
  `suites`,
@@ -1,4 +1,4 @@
1
- import { CreateFunctionalTestingTestResponseSchema, CreateFunctionalTestingTestParamsSchema, RunFunctionalTestingTestParamsSchema, GetFunctionalTestingExecutionTestSchema, ListFunctionalTestingSuiteExecutionsSchema, CancelFunctionalTestingSuiteExecutionSchema, RunFunctionalTestingSuiteParamsSchema, GetFunctionalTestingSuiteExecutionSchema, GetFunctionalTestHistoryParamsSchema } from "./functional-testing-types.js";
1
+ import { CreateFunctionalTestingTestResponseSchema, CreateFunctionalTestingTestParamsSchema, RunFunctionalTestingTestParamsSchema, GetFunctionalTestingExecutionTestSchema, ListFunctionalTestingSuiteExecutionsSchema, CancelFunctionalTestingSuiteExecutionSchema, CreateFunctionalTestingSuiteResponseSchema, CreateFunctionalTestingSuiteParamsSchema, RunFunctionalTestingSuiteParamsSchema, GetFunctionalTestingSuiteExecutionSchema, GetFunctionalTestHistoryParamsSchema } from "./functional-testing-types.js";
2
2
  const FUNCTIONAL_TESTING_TOOLS = [
3
3
  {
4
4
  title: "List Tests",
@@ -11,7 +11,7 @@ const FUNCTIONAL_TESTING_TOOLS = [
11
11
  {
12
12
  title: "Create Test",
13
13
  toolset: "Functional Testing",
14
- summary: "Creates a new API test in your Swagger Functional Testing workspace. This tool only creates API tests (not browser or native-mobile tests). Use this when you need to programmatically create a test with a defined set of API request steps. Each step requires a URL and may specify an HTTP method (defaults to GET), request body, headers, and redirect handling. Returns the ID and the URL to definition of the newly created test; the ID can be used with `swagger_run_test` to run it.",
14
+ summary: "Creates a new API test in your Swagger Functional Testing workspace. This tool only creates API tests (not browser or native-mobile tests). Use this when you need to programmatically create a test with a defined set of API request steps. Each step requires a URL and may specify an HTTP method (defaults to GET), request body, headers, and redirect handling. Returns the ID and the URL to definition of the newly created test; the ID can be used with `swagger_run_test` to run it, or grouped with other test IDs into a Suite via `swagger_create_suite`.",
15
15
  inputSchema: CreateFunctionalTestingTestParamsSchema,
16
16
  outputSchema: CreateFunctionalTestingTestResponseSchema,
17
17
  handler: "createFunctionalTestingTest",
@@ -54,6 +54,16 @@ const FUNCTIONAL_TESTING_TOOLS = [
54
54
  readOnly: false,
55
55
  idempotent: false
56
56
  },
57
+ {
58
+ title: "Create Suite",
59
+ toolset: "Functional Testing",
60
+ summary: "Creates a new test suite in your Swagger Functional Testing workspace with a specified name and `runApiTests`, one or more required ordered blocks of tests. Use this tool when you need to group existing tests into a suite for collective execution. Within a block, tests run sequentially by default — set `parallel: true` on a block to run its tests in parallel instead. Blocks themselves always run one after another. Set `maxRetryAttempts` (0-3) on a block to automatically retry its failed tests before they count as failed. Optionally accepts `agentName` to save a tunnel agent override for future runs of the suite.",
61
+ inputSchema: CreateFunctionalTestingSuiteParamsSchema,
62
+ outputSchema: CreateFunctionalTestingSuiteResponseSchema,
63
+ handler: "createFunctionalTestingSuite",
64
+ idempotent: false,
65
+ readOnly: false
66
+ },
57
67
  {
58
68
  title: "List Suites",
59
69
  toolset: "Functional Testing",
@@ -12,6 +12,45 @@ const CancelFunctionalTestingSuiteExecutionSchema = z.object({
12
12
  suiteId: z.string().describe("ID of the Functional Testing suite the execution belongs to").trim().min(1),
13
13
  executionId: z.string().describe("ID of the Functional Testing suite execution to cancel").trim().min(1)
14
14
  });
15
+ const RunApiTestsBlockSchema = z.object({
16
+ testIds: z.array(z.number()).min(1).describe("IDs of existing tests to include in this block."),
17
+ parallel: z.boolean().optional().describe(
18
+ "Whether to run this block's tests in parallel instead of sequentially. Defaults to false (sequential). When true, tests run at the account's maximum parallelism."
19
+ ),
20
+ maxRetryAttempts: z.number().int().min(0).max(3).optional().describe(
21
+ "Number of times to retry a failed test in this block before it counts as failed (0-3). Omit or set to 0 for no retry."
22
+ ),
23
+ title: z.string().trim().min(1).optional().describe(
24
+ "Label for this block, shown in the suite workflow. Must be unique among the suite's blocks."
25
+ )
26
+ });
27
+ const CreateFunctionalTestingSuiteParamsSchema = z.object({
28
+ name: z.string().describe("Name for the new suite").trim().min(1),
29
+ agentName: z.string().trim().min(1).optional().describe(
30
+ "Tunnel agent name to save as this suite's tunnel override for future runs."
31
+ ),
32
+ runApiTests: z.array(RunApiTestsBlockSchema).min(1).describe(
33
+ 'Required — ordered groups ("blocks") of tests to run one after another. Must include at least one entry; suites cannot be created without a workflow. Within a block, tests run sequentially unless `parallel` is set. Block `title`s must be unique within the suite.'
34
+ )
35
+ }).superRefine((data, ctx) => {
36
+ const seen = /* @__PURE__ */ new Set();
37
+ data.runApiTests.forEach((block, index) => {
38
+ if (!block.title) return;
39
+ if (seen.has(block.title)) {
40
+ ctx.addIssue({
41
+ code: "custom",
42
+ message: `Duplicate block title "${block.title}". Block titles must be unique within the suite.`,
43
+ path: ["runApiTests", index, "title"]
44
+ });
45
+ }
46
+ seen.add(block.title);
47
+ });
48
+ });
49
+ const CreateFunctionalTestingSuiteResponseSchema = z.object({
50
+ id: z.number().describe("ID of the newly created suite"),
51
+ slug: z.string().describe("Slug of the newly created suite"),
52
+ url: z.string().describe("Link to the created suite in Swagger Functional Testing UI")
53
+ });
15
54
  const RunFunctionalTestingSuiteParamsSchema = z.object({
16
55
  suiteId: z.string().describe("ID of the Functional Testing suite to run").trim().min(1),
17
56
  tunnelAgentName: z.string().describe(
@@ -53,6 +92,8 @@ const CreateFunctionalTestingTestResponseSchema = z.object({
53
92
  });
54
93
  export {
55
94
  CancelFunctionalTestingSuiteExecutionSchema,
95
+ CreateFunctionalTestingSuiteParamsSchema,
96
+ CreateFunctionalTestingSuiteResponseSchema,
56
97
  CreateFunctionalTestingTestHeaderSchema,
57
98
  CreateFunctionalTestingTestParamsSchema,
58
99
  CreateFunctionalTestingTestResponseSchema,
@@ -62,6 +103,7 @@ export {
62
103
  GetFunctionalTestingSuiteExecutionSchema,
63
104
  HTTP_METHODS,
64
105
  ListFunctionalTestingSuiteExecutionsSchema,
106
+ RunApiTestsBlockSchema,
65
107
  RunFunctionalTestingSuiteParamsSchema,
66
108
  RunFunctionalTestingTestParamsSchema
67
109
  };
@@ -213,6 +213,9 @@ class SwaggerClient {
213
213
  async listFunctionalTestingSuites() {
214
214
  return this.withFunctionalTesting((ftApi) => ftApi.listSuites());
215
215
  }
216
+ async createFunctionalTestingSuite(args) {
217
+ return this.withFunctionalTesting((ftApi) => ftApi.createSuite(args));
218
+ }
216
219
  async getFunctionalTestingTestHistory(args) {
217
220
  return this.withFunctionalTesting((ftApi) => ftApi.getTestHistory(args));
218
221
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartbear/mcp",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "MCP server for interacting SmartBear Products",
5
5
  "keywords": [
6
6
  "smartbear",