@testomatio/mcp-enterprise 3.0.0-beta.2 → 3.0.0-beta.4

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/analytics.js +55 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/mcp-enterprise",
3
- "version": "3.0.0-beta.2",
3
+ "version": "3.0.0-beta.4",
4
4
  "description": "Enterprise Model Context Protocol server for Testomat.io API with analytics tools",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -27,7 +27,7 @@
27
27
  "directory": "packages/enterprise"
28
28
  },
29
29
  "dependencies": {
30
- "@testomatio/mcp": "3.0.0-beta.2",
30
+ "@testomatio/mcp": "3.0.0-beta.4",
31
31
  "commander": "^12.0.0"
32
32
  },
33
33
  "files": [
package/src/analytics.js CHANGED
@@ -26,8 +26,19 @@ const ANALYTICS_STATS_KINDS = [
26
26
  'runs-summary',
27
27
  'success-rate-by-date',
28
28
  'automation-rate-by-date',
29
+ 'automation-by-date',
29
30
  'testruns-by-date',
30
31
  'priority-by-date',
32
+ 'failed-runs-by-priority',
33
+ 'latest-failed-runs-by-priority',
34
+ 'run-results-by-priority-status',
35
+ 'latest-run-results-by-priority-status',
36
+ 'milestone-completion',
37
+ 'milestone-tests',
38
+ 'milestone-runs',
39
+ 'milestone-plans',
40
+ 'milestone-requirements',
41
+ 'milestone-users',
31
42
  ];
32
43
 
33
44
  const commonAnalyticsProperties = {
@@ -46,7 +57,8 @@ const commonAnalyticsProperties = {
46
57
  },
47
58
  envs: {
48
59
  type: 'string',
49
- description: 'Comma-separated execution environments, for example: staging,production.',
60
+ description:
61
+ 'Comma-separated execution environments, for example: staging,production. Values must exactly match (case-sensitive) the project environments returned by `project_info`; an unknown value returns 422 with the valid list in `known_environments`.',
50
62
  },
51
63
  };
52
64
 
@@ -54,7 +66,7 @@ export const ANALYTICS_TOOLS = withListOptions([
54
66
  {
55
67
  name: 'analytics_tests',
56
68
  description:
57
- `Enterprise analytics: list tests matching an analytics report (/api/v2/{project_id}/analytics/tests/{kind}). Requires api_analytics subscription feature. ${ANALYTICS_TESTS_TQL_REFERENCE}`,
69
+ `Enterprise analytics: list tests matching an analytics report (/api/v2/{project_id}/analytics/tests/{kind}). Requires api_analytics subscription feature. For kind=flaky, each row has \`pass_rate\` (0-1, share of passed executions; same scale as min/max) and \`flakiness\` (0-1, 1.0 = even pass/fail split, 0 = always passing or always failing); \`flaky_rate\` is deprecated (raw 2-3 scale), ignore it. ${ANALYTICS_TESTS_TQL_REFERENCE}`,
58
70
  inputSchema: {
59
71
  type: 'object',
60
72
  properties: {
@@ -81,13 +93,19 @@ export const ANALYTICS_TOOLS = withListOptions([
81
93
  type: 'number',
82
94
  minimum: 0,
83
95
  maximum: 1,
84
- description: 'Flaky rate lower bound. Applies only to kind=flaky.',
96
+ description: 'Pass rate lower bound (0-1, default 0.1). Applies only to kind=flaky.',
85
97
  },
86
98
  max: {
87
99
  type: 'number',
88
100
  minimum: 0,
89
101
  maximum: 1,
90
- description: 'Flaky rate upper bound. Applies only to kind=flaky.',
102
+ description: 'Pass rate upper bound (0-1, default 0.9). Applies only to kind=flaky.',
103
+ },
104
+ order_by: {
105
+ type: 'string',
106
+ enum: ['flakiness', 'pass_rate'],
107
+ description:
108
+ 'Sort order for kind=flaky. `flakiness` (default) ranks tests closest to a 50/50 pass/fail split first; `pass_rate` ranks lowest pass rate first (mostly broken tests on top). Applies only to kind=flaky.',
91
109
  },
92
110
  threshold_ms: {
93
111
  type: 'integer',
@@ -103,6 +121,12 @@ export const ANALYTICS_TOOLS = withListOptions([
103
121
  type: 'string',
104
122
  description: 'Scope results to one run UID. Applies only to kind=flaky or kind=slow.',
105
123
  },
124
+ group_by: {
125
+ type: 'string',
126
+ enum: ['suite', 'priority', 'tag', 'label', 'env', 'test'],
127
+ description:
128
+ 'Return aggregate counts instead of a test list: rows of {key, label, test_count} sorted by test_count descending, not paginated. `key` is the suite UID for suite (label = suite title); the value itself for priority/tag/label/env. Supported only for kind=failing, skipped, flaky, slow, never-executed (`env` not supported for never-executed); other combinations return 422. `test` is supported only for kind=slow: rows of {key (test UID), label (title), executions, avg_run_time, max_run_time, p95_run_time, total_run_time} sorted by total_run_time descending (biggest CI-time consumers first), aggregated over every execution in the period that meets threshold_ms.',
129
+ },
106
130
  },
107
131
  required: ['kind'],
108
132
  additionalProperties: false,
@@ -118,13 +142,31 @@ export const ANALYTICS_TOOLS = withListOptions([
118
142
  kind: {
119
143
  type: 'string',
120
144
  enum: ANALYTICS_STATS_KINDS,
121
- description: 'Aggregated analytics report kind.',
145
+ description:
146
+ 'Aggregated analytics report kind. Trend series (one row per day): success-rate-by-date, automation-rate-by-date, automation-by-date, testruns-by-date, priority-by-date. Priority breakdowns: failed-runs-by-priority, run-results-by-priority-status, and their latest-* variants (most recent run only). Summaries: project-summary, runs-summary. Sprint/release reporting: milestone-completion, milestone-tests, milestone-runs, milestone-plans, milestone-requirements, milestone-users (require `milestone`).',
122
147
  },
123
148
  q: {
124
149
  type: 'string',
125
150
  description: ANALYTICS_STATS_TQL_INPUT_DESCRIPTION,
126
151
  },
127
152
  ...commonAnalyticsProperties,
153
+ page: {
154
+ type: 'integer',
155
+ minimum: 1,
156
+ description:
157
+ 'Page number. Applies only to runs-summary and milestone-runs, which are always paginated (defaults page=1, per_page=30) — check meta.total/meta.total_pages to fetch the rest. Ignored by other kinds.',
158
+ },
159
+ per_page: {
160
+ type: 'integer',
161
+ minimum: 1,
162
+ maximum: 100,
163
+ description: 'Rows per page (default 30). Applies only to runs-summary and milestone-runs.',
164
+ },
165
+ milestone: {
166
+ type: 'string',
167
+ description:
168
+ 'Milestone slug (the `id` returned by the `milestones` tool, `list` command). Required for milestone-* kinds: without it they return an empty result, not an error. An unknown slug returns 422. Ignored by other kinds.',
169
+ },
128
170
  },
129
171
  required: ['kind'],
130
172
  additionalProperties: false,
@@ -271,9 +313,11 @@ function analyticsTests({
271
313
  per_page: perPage,
272
314
  min,
273
315
  max,
316
+ order_by: orderBy,
274
317
  threshold_ms: thresholdMs,
275
318
  maturity_days: maturityDays,
276
319
  run,
320
+ group_by: groupBy,
277
321
  slim,
278
322
  } = {}) {
279
323
  return this.apiClient.list(`analytics/tests/${this.pickRequiredArg({ kind }, 'kind')}`, {
@@ -286,20 +330,25 @@ function analyticsTests({
286
330
  per_page: perPage,
287
331
  min,
288
332
  max,
333
+ order_by: orderBy,
289
334
  threshold_ms: thresholdMs,
290
335
  maturity_days: maturityDays,
291
336
  run,
337
+ group_by: groupBy,
292
338
  slim,
293
339
  });
294
340
  }
295
341
 
296
- function analyticsStats({ kind, q, days, from, to, envs } = {}) {
342
+ function analyticsStats({ kind, q, days, from, to, envs, milestone, page, per_page: perPage } = {}) {
297
343
  return this.apiClient.list(`analytics/stats/${this.pickRequiredArg({ kind }, 'kind')}`, {
298
344
  q,
299
345
  days,
300
346
  from,
301
347
  to,
348
+ milestone,
302
349
  envs,
350
+ page,
351
+ per_page: perPage,
303
352
  });
304
353
  }
305
354