@testomatio/mcp-enterprise 2.2.0-beta.3 → 2.2.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 CHANGED
@@ -6,6 +6,9 @@ This package includes all tools from `@testomatio/mcp` plus enterprise analytics
6
6
 
7
7
  - `analytics_tests`
8
8
  - `analytics_stats`
9
+ - `analytics_charts_list`
10
+ - `analytics_charts_get`
11
+ - `analytics_charts_results`
9
12
 
10
13
  ## Installation
11
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/mcp-enterprise",
3
- "version": "2.2.0-beta.3",
3
+ "version": "2.2.0",
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": "2.2.0-beta.3",
30
+ "@testomatio/mcp": "2.2.0",
31
31
  "commander": "^12.0.0"
32
32
  },
33
33
  "files": [
package/src/analytics.js CHANGED
@@ -130,7 +130,90 @@ export const ANALYTICS_TOOLS = withListOptions([
130
130
  additionalProperties: false,
131
131
  },
132
132
  },
133
- ], { extraNames: ['analytics_tests'] });
133
+ {
134
+ name: 'analytics_charts_list',
135
+ description:
136
+ 'Enterprise analytics: list saved analytics charts and queries (/api/v2/{project_id}/analytics/charts). Each item bundles one or more TQL queries under a single title, optionally rendered as a chart. Requires api_analytics subscription feature.',
137
+ inputSchema: {
138
+ type: 'object',
139
+ properties: {
140
+ has_chart: {
141
+ type: 'boolean',
142
+ description: 'When true, only items with a chart type set; when false, only plain saved queries with no chart.',
143
+ },
144
+ kind: {
145
+ type: 'string',
146
+ enum: ['tests', 'runs'],
147
+ description: 'Filter by context: charts over tests or over runs.',
148
+ },
149
+ my_charts: {
150
+ type: 'boolean',
151
+ description: 'When true, only items created by the authenticated user.',
152
+ },
153
+ only_widgets: {
154
+ type: 'boolean',
155
+ description: 'When true, only items marked as dashboard widgets.',
156
+ },
157
+ page: {
158
+ type: 'integer',
159
+ minimum: 1,
160
+ },
161
+ per_page: {
162
+ type: 'integer',
163
+ minimum: 1,
164
+ maximum: 100,
165
+ },
166
+ },
167
+ additionalProperties: false,
168
+ },
169
+ },
170
+ {
171
+ name: 'analytics_charts_get',
172
+ description:
173
+ 'Enterprise analytics: get a saved chart or query definition — title, chart type, context, and the ordered TQL queries that make it up (/api/v2/{project_id}/analytics/charts/{id}). Requires api_analytics subscription feature.',
174
+ inputSchema: {
175
+ type: 'object',
176
+ properties: {
177
+ chart_id: {
178
+ type: 'string',
179
+ description: 'Chart public UID.',
180
+ },
181
+ },
182
+ required: ['chart_id'],
183
+ additionalProperties: false,
184
+ },
185
+ },
186
+ {
187
+ name: 'analytics_charts_results',
188
+ description:
189
+ 'Enterprise analytics: current results of a saved chart (/api/v2/{project_id}/analytics/charts/{id}/result). Without `number`, returns the match count for every query in the chart; with `number` (zero-based query index), returns the matching tests or runs for that query, paginated. Requires api_analytics subscription feature.',
190
+ inputSchema: {
191
+ type: 'object',
192
+ properties: {
193
+ chart_id: {
194
+ type: 'string',
195
+ description: 'Chart public UID.',
196
+ },
197
+ number: {
198
+ type: 'integer',
199
+ minimum: 0,
200
+ description: 'Zero-based index of the query within the chart to fetch full results for. Omit to get totals for all queries instead.',
201
+ },
202
+ page: {
203
+ type: 'integer',
204
+ minimum: 1,
205
+ },
206
+ per_page: {
207
+ type: 'integer',
208
+ minimum: 1,
209
+ maximum: 100,
210
+ },
211
+ },
212
+ required: ['chart_id'],
213
+ additionalProperties: false,
214
+ },
215
+ },
216
+ ], { extraNames: ['analytics_tests', 'analytics_charts_results'] });
134
217
 
135
218
  export const ENTERPRISE_TOOL_DEFINITIONS = [
136
219
  ...TOOL_DEFINITIONS,
@@ -147,6 +230,34 @@ export function registerAnalyticsHandlers(handlers) {
147
230
  })
148
231
  );
149
232
  handlers.analytics_stats = async (args = {}) => this.asText(await analyticsStats.call(this, args));
233
+
234
+ handlers.analytics_charts_list = async (args = {}) => {
235
+ const { verbose, fields, ...listArgs } = args;
236
+ return this.asText(
237
+ slimList(await analyticsChartsList.call(this, listArgs), {
238
+ verbose,
239
+ fields,
240
+ entity: 'analytics_charts',
241
+ })
242
+ );
243
+ };
244
+
245
+ handlers.analytics_charts_get = async (args = {}) => {
246
+ const id = this.pickRequiredArg(args, 'chart_id');
247
+ return this.asText(await this.apiClient.get('analytics/charts', id));
248
+ };
249
+
250
+ handlers.analytics_charts_results = async (args = {}) => {
251
+ const { verbose, fields, ...restArgs } = args;
252
+ const payload = await analyticsChartResults.call(this, restArgs);
253
+ return this.asText(
254
+ slimList(payload, {
255
+ verbose,
256
+ fields,
257
+ entity: 'analytics_chart_results',
258
+ })
259
+ );
260
+ };
150
261
  }
151
262
 
152
263
  function analyticsTests({
@@ -191,3 +302,23 @@ function analyticsStats({ kind, q, days, from, to, envs } = {}) {
191
302
  envs,
192
303
  });
193
304
  }
305
+
306
+ function analyticsChartsList({ has_chart, kind, my_charts, only_widgets, page, per_page: perPage } = {}) {
307
+ return this.apiClient.list('analytics/charts', {
308
+ has_chart,
309
+ kind,
310
+ my_charts,
311
+ only_widgets,
312
+ page,
313
+ per_page: perPage,
314
+ });
315
+ }
316
+
317
+ function analyticsChartResults({ chart_id, number, page, per_page: perPage } = {}) {
318
+ const id = this.pickRequiredArg({ chart_id }, 'chart_id');
319
+ return this.apiClient.list(`analytics/charts/${id}/result`, {
320
+ number,
321
+ page,
322
+ per_page: perPage,
323
+ });
324
+ }