@smartbear/mcp 0.15.0 → 0.16.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/dist/bugsnag/client.js +42 -1310
- package/dist/bugsnag/input-schemas.js +18 -18
- package/dist/bugsnag/tool/error/get-error.js +98 -0
- package/dist/bugsnag/tool/error/list-project-errors.js +102 -0
- package/dist/bugsnag/tool/error/update-error.js +256 -0
- package/dist/bugsnag/tool/event/get-event-details-from-dashboard-url.js +55 -0
- package/dist/bugsnag/tool/event/get-event.js +38 -0
- package/dist/bugsnag/tool/performance/get-network-endpoint-groupings.js +46 -0
- package/dist/bugsnag/tool/performance/get-span-group.js +73 -0
- package/dist/bugsnag/tool/performance/get-trace.js +83 -0
- package/dist/bugsnag/tool/performance/list-span-groups.js +111 -0
- package/dist/bugsnag/tool/performance/list-spans.js +97 -0
- package/dist/bugsnag/tool/performance/list-trace-fields.js +41 -0
- package/dist/bugsnag/tool/performance/set-network-endpoint-groupings.js +90 -0
- package/dist/bugsnag/tool/project/get-current-project.js +31 -0
- package/dist/bugsnag/tool/project/list-project-event-filters.js +42 -0
- package/dist/bugsnag/tool/project/list-projects.js +43 -0
- package/dist/bugsnag/tool/release/get-build.js +50 -0
- package/dist/bugsnag/tool/release/get-release.js +68 -0
- package/dist/bugsnag/tool/release/list-releases.js +88 -0
- package/dist/common/prompts.js +9 -0
- package/dist/common/server.js +16 -0
- package/dist/common/transport-http.js +2 -0
- package/dist/package.json.js +1 -1
- package/dist/reflect/client.js +66 -1
- package/dist/reflect/config/constants.js +3 -1
- package/dist/reflect/prompt/sap-test.js +29 -0
- package/dist/reflect/tool/recording/add-prompt-step.js +60 -0
- package/dist/reflect/tool/recording/add-segment.js +56 -0
- package/dist/reflect/tool/recording/connect-to-session.js +89 -0
- package/dist/reflect/tool/recording/delete-previous-step.js +47 -0
- package/dist/reflect/tool/recording/get-screenshot.js +55 -0
- package/dist/reflect/tool/tests/list-segments.js +68 -0
- package/dist/reflect/websocket-manager.js +92 -0
- package/dist/zephyr/common/rest-api-schemas.js +213 -272
- package/dist/zephyr/tool/issue-link/get-test-executions.js +1 -1
- package/dist/zephyr/tool/test-case/create-issue-link.js +4 -2
- package/dist/zephyr/tool/test-case/create-test-script.js +4 -2
- package/dist/zephyr/tool/test-case/create-test-steps.js +4 -2
- package/dist/zephyr/tool/test-case/create-web-link.js +5 -2
- package/dist/zephyr/tool/test-case/get-test-steps.js +4 -2
- package/dist/zephyr/tool/test-cycle/create-issue-link.js +4 -2
- package/dist/zephyr/tool/test-cycle/create-web-link.js +4 -2
- package/dist/zephyr/tool/test-execution/create-issue-link.js +4 -2
- package/dist/zephyr/tool/test-execution/get-test-steps.js +4 -2
- package/dist/zephyr/tool/test-execution/update-test-execution.js +5 -2
- package/package.json +11 -9
package/dist/bugsnag/client.js
CHANGED
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { MCP_SERVER_NAME, MCP_SERVER_VERSION } from "../common/info.js";
|
|
3
3
|
import { ToolError } from "../common/tools.js";
|
|
4
|
-
import { ErrorUpdateRequest } from "./client/api/api.js";
|
|
5
4
|
import { CurrentUserAPI } from "./client/api/CurrentUser.js";
|
|
6
5
|
import { Configuration } from "./client/api/configuration.js";
|
|
7
6
|
import { ErrorAPI } from "./client/api/Error.js";
|
|
8
7
|
import { ProjectAPI } from "./client/api/Project.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { GetError } from "./tool/error/get-error.js";
|
|
9
|
+
import { ListProjectErrors } from "./tool/error/list-project-errors.js";
|
|
10
|
+
import { UpdateError } from "./tool/error/update-error.js";
|
|
11
|
+
import { GetEvent } from "./tool/event/get-event.js";
|
|
12
|
+
import { GetEventDetailsFromDashboardUrl } from "./tool/event/get-event-details-from-dashboard-url.js";
|
|
13
|
+
import { GetNetworkEndpointGroupings } from "./tool/performance/get-network-endpoint-groupings.js";
|
|
14
|
+
import { GetSpanGroup } from "./tool/performance/get-span-group.js";
|
|
15
|
+
import { GetTrace } from "./tool/performance/get-trace.js";
|
|
16
|
+
import { ListSpanGroups } from "./tool/performance/list-span-groups.js";
|
|
17
|
+
import { ListSpans } from "./tool/performance/list-spans.js";
|
|
18
|
+
import { ListTraceFields } from "./tool/performance/list-trace-fields.js";
|
|
19
|
+
import { SetNetworkEndpointGroupings } from "./tool/performance/set-network-endpoint-groupings.js";
|
|
20
|
+
import { GetCurrentProject } from "./tool/project/get-current-project.js";
|
|
21
|
+
import { ListProjectEventFilters } from "./tool/project/list-project-event-filters.js";
|
|
22
|
+
import { ListProjects } from "./tool/project/list-projects.js";
|
|
23
|
+
import { GetBuild } from "./tool/release/get-build.js";
|
|
24
|
+
import { GetRelease } from "./tool/release/get-release.js";
|
|
25
|
+
import { ListReleases } from "./tool/release/list-releases.js";
|
|
11
26
|
const HUB_PREFIX = "00000";
|
|
12
27
|
const DEFAULT_DOMAIN = "bugsnag.com";
|
|
13
28
|
const HUB_DOMAIN = "bugsnag.smartbear.com";
|
|
@@ -22,27 +37,10 @@ const EXCLUDED_EVENT_FIELDS = /* @__PURE__ */ new Set([
|
|
|
22
37
|
"search"
|
|
23
38
|
// This is searches multiple fields and is more a convenience for humans, we're removing to avoid over-matching
|
|
24
39
|
]);
|
|
25
|
-
const PERMITTED_UPDATE_OPERATIONS = [
|
|
26
|
-
"override_severity",
|
|
27
|
-
"open",
|
|
28
|
-
"fix",
|
|
29
|
-
"ignore",
|
|
30
|
-
"discard",
|
|
31
|
-
"undiscard",
|
|
32
|
-
"snooze",
|
|
33
|
-
"link_issue",
|
|
34
|
-
"unlink_issue"
|
|
35
|
-
];
|
|
36
|
-
const PERMITTED_REOPEN_CONDITIONS = [
|
|
37
|
-
"occurs_after",
|
|
38
|
-
"n_occurrences_in_m_hours",
|
|
39
|
-
"n_additional_occurrences",
|
|
40
|
-
"n_additional_users"
|
|
41
|
-
];
|
|
42
40
|
const ConfigurationSchema = z.object({
|
|
43
41
|
auth_token: z.string().describe("BugSnag personal authentication token"),
|
|
44
42
|
project_api_key: z.string().describe("BugSnag project API key").optional(),
|
|
45
|
-
endpoint: z.url().describe("BugSnag endpoint URL").optional()
|
|
43
|
+
endpoint: z.string().url().describe("BugSnag endpoint URL").optional()
|
|
46
44
|
});
|
|
47
45
|
class BugsnagClient {
|
|
48
46
|
cache;
|
|
@@ -266,1295 +264,29 @@ class BugsnagClient {
|
|
|
266
264
|
};
|
|
267
265
|
}
|
|
268
266
|
async registerTools(register, getInput) {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
};
|
|
293
|
-
}
|
|
294
|
-
);
|
|
295
|
-
const listProjectsInputSchema = z.object({
|
|
296
|
-
apiKey: z.string().optional().describe("The API key of the BugSnag project, if known.")
|
|
297
|
-
});
|
|
298
|
-
register(
|
|
299
|
-
{
|
|
300
|
-
title: "List Projects",
|
|
301
|
-
summary: "List all projects in the organization that the current user has access to, or find a project matching an API key.",
|
|
302
|
-
purpose: "Retrieve available projects for browsing and selecting which project to analyze.",
|
|
303
|
-
useCases: [
|
|
304
|
-
"Get an overview of all projects in the organization",
|
|
305
|
-
"Locate a project by its API key if known from the user's code"
|
|
306
|
-
],
|
|
307
|
-
inputSchema: listProjectsInputSchema,
|
|
308
|
-
hints: [
|
|
309
|
-
"Project IDs from this list can be used with other tools when no project API key is configured"
|
|
310
|
-
]
|
|
311
|
-
},
|
|
312
|
-
async (args, _extra) => {
|
|
313
|
-
const params = listProjectsInputSchema.parse(args);
|
|
314
|
-
let projects = await this.getProjects();
|
|
315
|
-
if (!projects || projects.length === 0) {
|
|
316
|
-
throw new ToolError(
|
|
317
|
-
"No BugSnag projects found for the current user."
|
|
318
|
-
);
|
|
319
|
-
}
|
|
320
|
-
if (params.apiKey) {
|
|
321
|
-
const matchedProject = projects.find(
|
|
322
|
-
(p) => p.api_key === params.apiKey
|
|
323
|
-
);
|
|
324
|
-
projects = matchedProject ? [matchedProject] : [];
|
|
325
|
-
}
|
|
326
|
-
const content = {
|
|
327
|
-
data: projects,
|
|
328
|
-
count: projects.length
|
|
329
|
-
};
|
|
330
|
-
return {
|
|
331
|
-
content: [{ type: "text", text: JSON.stringify(content) }]
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
);
|
|
335
|
-
const getErrorInputSchema = z.object({
|
|
336
|
-
projectId: toolInputParameters.projectId,
|
|
337
|
-
errorId: toolInputParameters.errorId.describe(
|
|
338
|
-
"Unique identifier of the error to retrieve"
|
|
339
|
-
),
|
|
340
|
-
filters: toolInputParameters.filters.describe(
|
|
341
|
-
"Apply filters to narrow down the error list. Use the List Project Event Filters tool to discover available filter fields. Time filters support extended ISO 8601 format (e.g. 2018-05-20T00:00:00Z) or relative format (e.g. 7d, 24h)."
|
|
342
|
-
)
|
|
343
|
-
});
|
|
344
|
-
register(
|
|
345
|
-
{
|
|
346
|
-
title: "Get Error",
|
|
347
|
-
summary: "Get full details on an error, including aggregated and summarized data across all events (occurrences) and details of the latest event (occurrence), such as breadcrumbs, metadata and the stacktrace. Use the filters parameter to narrow down the summaries further.",
|
|
348
|
-
purpose: "Retrieve all the information required on a specified error to understand who it is affecting and why.",
|
|
349
|
-
useCases: [
|
|
350
|
-
"Investigate a specific error found through the List Project Errors tool",
|
|
351
|
-
"Understand which types of user are affected by the error using summarized event data",
|
|
352
|
-
"Get error details for debugging and root cause analysis",
|
|
353
|
-
"Retrieve error metadata for incident reports and documentation"
|
|
354
|
-
],
|
|
355
|
-
inputSchema: getErrorInputSchema,
|
|
356
|
-
outputDescription: "JSON object containing: - error_details: Aggregated data about the error, including first and last seen occurrence - latest_event: Detailed information about the most recent occurrence of the error, including stacktrace, breadcrumbs, user and context - pivots: List of pivots (summaries) for the error, which can be used to analyze patterns in occurrences - url: A link to the error in the dashboard - this should be shown to the user for them to perform further analysis",
|
|
357
|
-
examples: [
|
|
358
|
-
{
|
|
359
|
-
description: "Get details for a specific error",
|
|
360
|
-
parameters: {
|
|
361
|
-
errorId: "6863e2af8c857c0a5023b411"
|
|
362
|
-
},
|
|
363
|
-
expectedOutput: "JSON object with error details including message, stack trace, occurrence count, and metadata"
|
|
364
|
-
}
|
|
365
|
-
],
|
|
366
|
-
hints: [
|
|
367
|
-
"Error IDs can be found using the List Project Errors tool",
|
|
368
|
-
"Use this after filtering errors to get detailed information about specific errors",
|
|
369
|
-
"Use Get Event Details tool if you need detailed information about a specific event (occurrence) rather than the aggregated error",
|
|
370
|
-
"If you used a filter to get this error, you can pass the same filters here to restrict the results or apply further filters",
|
|
371
|
-
"The URL provided in the response points should be shown to the user in all cases as it allows them to view the error in the dashboard and perform further analysis"
|
|
372
|
-
]
|
|
373
|
-
},
|
|
374
|
-
async (args, _extra) => {
|
|
375
|
-
const params = getErrorInputSchema.parse(args);
|
|
376
|
-
const project = await this.getInputProject(params.projectId);
|
|
377
|
-
const errorDetails = (await this.errorsApi.viewErrorOnProject(project.id, params.errorId)).body;
|
|
378
|
-
if (!errorDetails) {
|
|
379
|
-
throw new ToolError(
|
|
380
|
-
`Error with ID ${params.errorId} not found in project ${project.id}.`
|
|
381
|
-
);
|
|
382
|
-
}
|
|
383
|
-
const filters = {
|
|
384
|
-
error: [{ type: "eq", value: params.errorId }],
|
|
385
|
-
...params.filters
|
|
386
|
-
};
|
|
387
|
-
await this.validateEventFields(project, filters);
|
|
388
|
-
let latestEvent = null;
|
|
389
|
-
try {
|
|
390
|
-
const latestEvents = (await this.errorsApi.listEventsOnProject(
|
|
391
|
-
project.id,
|
|
392
|
-
null,
|
|
393
|
-
"timestamp",
|
|
394
|
-
"desc",
|
|
395
|
-
1,
|
|
396
|
-
filters,
|
|
397
|
-
true
|
|
398
|
-
)).body;
|
|
399
|
-
if (latestEvents && latestEvents.length > 0) {
|
|
400
|
-
latestEvent = latestEvents[0];
|
|
401
|
-
latestEvent.threads = void 0;
|
|
402
|
-
}
|
|
403
|
-
} catch (e) {
|
|
404
|
-
console.warn("Failed to fetch latest event:", e);
|
|
405
|
-
}
|
|
406
|
-
const content = {
|
|
407
|
-
error_details: errorDetails,
|
|
408
|
-
latest_event: latestEvent,
|
|
409
|
-
pivots: (await this.errorsApi.getPivotValuesOnAnError(
|
|
410
|
-
project.id,
|
|
411
|
-
params.errorId,
|
|
412
|
-
filters,
|
|
413
|
-
5
|
|
414
|
-
)).body || [],
|
|
415
|
-
url: await this.getErrorUrl(
|
|
416
|
-
project,
|
|
417
|
-
params.errorId,
|
|
418
|
-
toUrlSearchParams(filters).toString()
|
|
419
|
-
)
|
|
420
|
-
};
|
|
421
|
-
return {
|
|
422
|
-
content: [{ type: "text", text: JSON.stringify(content) }]
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
);
|
|
426
|
-
const getEventInputSchema = z.object({
|
|
427
|
-
projectId: toolInputParameters.projectId,
|
|
428
|
-
eventId: toolInputParameters.eventId
|
|
429
|
-
});
|
|
430
|
-
register(
|
|
431
|
-
{
|
|
432
|
-
title: "Get Event",
|
|
433
|
-
summary: "Get detailed information about a specific event",
|
|
434
|
-
purpose: "Retrieve event details directly from its ID",
|
|
435
|
-
useCases: [
|
|
436
|
-
"Get the full details of an event, including any thread stack traces"
|
|
437
|
-
],
|
|
438
|
-
inputSchema: getEventInputSchema,
|
|
439
|
-
examples: [
|
|
440
|
-
{
|
|
441
|
-
description: "Get event details of an event",
|
|
442
|
-
parameters: {
|
|
443
|
-
eventId: "6863e2af012caf1d5c320000"
|
|
444
|
-
},
|
|
445
|
-
expectedOutput: "JSON object with complete event details including stack trace (error trace and other threads, if present), metadata, and context"
|
|
446
|
-
}
|
|
447
|
-
]
|
|
448
|
-
},
|
|
449
|
-
async (args, _extra) => {
|
|
450
|
-
const params = getEventInputSchema.parse(args);
|
|
451
|
-
const project = await this.getInputProject(params.projectId);
|
|
452
|
-
const response = await this.getEvent(params.eventId, project.id);
|
|
453
|
-
return {
|
|
454
|
-
content: [{ type: "text", text: JSON.stringify(response) }]
|
|
455
|
-
};
|
|
456
|
-
}
|
|
457
|
-
);
|
|
458
|
-
const getEventDetailsFromDashboardUrlInputSchema = z.object({
|
|
459
|
-
link: z.string().describe(
|
|
460
|
-
"Full URL to the event details page in the BugSnag dashboard (web interface), containing project slug and event_id parameter."
|
|
461
|
-
)
|
|
462
|
-
});
|
|
463
|
-
register(
|
|
464
|
-
{
|
|
465
|
-
title: "Get Event Details From Dashboard URL",
|
|
466
|
-
summary: "Get detailed information about a specific event using its dashboard URL",
|
|
467
|
-
purpose: "Retrieve event details directly from a dashboard URL for quick debugging",
|
|
468
|
-
useCases: [
|
|
469
|
-
"Get event details when given a dashboard URL from a user or notification",
|
|
470
|
-
"Extract event information from shared links or browser URLs",
|
|
471
|
-
"Quick lookup of event details without needing separate project and event IDs"
|
|
472
|
-
],
|
|
473
|
-
inputSchema: getEventDetailsFromDashboardUrlInputSchema,
|
|
474
|
-
examples: [
|
|
475
|
-
{
|
|
476
|
-
description: "Get event details from a dashboard URL",
|
|
477
|
-
parameters: {
|
|
478
|
-
link: "https://app.bugsnag.com/my-org/my-project/errors/6863e2af8c857c0a5023b411?event_id=6863e2af012caf1d5c320000"
|
|
479
|
-
},
|
|
480
|
-
expectedOutput: "JSON object with complete event details including stack trace, metadata, and context"
|
|
481
|
-
}
|
|
482
|
-
],
|
|
483
|
-
hints: [
|
|
484
|
-
"The URL must contain both project slug in the path and event_id in query parameters",
|
|
485
|
-
"This is useful when users share BugSnag dashboard URLs and you need to extract the event data"
|
|
486
|
-
]
|
|
487
|
-
},
|
|
488
|
-
async (args, _extra) => {
|
|
489
|
-
const params = getEventDetailsFromDashboardUrlInputSchema.parse(args);
|
|
490
|
-
const url = new URL(params.link);
|
|
491
|
-
const eventId = url.searchParams.get("event_id");
|
|
492
|
-
const projectSlug = url.pathname.split("/")[2];
|
|
493
|
-
if (!projectSlug || !eventId)
|
|
494
|
-
throw new ToolError(
|
|
495
|
-
"Both projectSlug and eventId must be present in the link"
|
|
496
|
-
);
|
|
497
|
-
const projects = await this.getProjects();
|
|
498
|
-
const projectId = projects.find((p) => p.slug === projectSlug)?.id;
|
|
499
|
-
if (!projectId) {
|
|
500
|
-
throw new ToolError("Project with the specified slug not found.");
|
|
501
|
-
}
|
|
502
|
-
const response = await this.getEvent(eventId, projectId);
|
|
503
|
-
return {
|
|
504
|
-
content: [{ type: "text", text: JSON.stringify(response) }]
|
|
505
|
-
};
|
|
506
|
-
}
|
|
507
|
-
);
|
|
508
|
-
const listProjectErrorsInputSchema = z.object({
|
|
509
|
-
projectId: toolInputParameters.projectId,
|
|
510
|
-
filters: toolInputParameters.filters.describe(
|
|
511
|
-
"Apply filters to narrow down the error list. Use the List Project Event Filters tool to discover available filter fields. Time filters support extended ISO 8601 format (e.g. 2018-05-20T00:00:00Z) or relative format (e.g. 7d, 24h)."
|
|
512
|
-
),
|
|
513
|
-
sort: toolInputParameters.sort,
|
|
514
|
-
direction: toolInputParameters.direction,
|
|
515
|
-
perPage: toolInputParameters.perPage,
|
|
516
|
-
nextUrl: toolInputParameters.nextUrl
|
|
517
|
-
});
|
|
518
|
-
register(
|
|
519
|
-
{
|
|
520
|
-
title: "List Project Errors",
|
|
521
|
-
summary: "List and search errors in a project using customizable filters and pagination",
|
|
522
|
-
purpose: "Retrieve filtered list of errors from a project for analysis, debugging, and reporting",
|
|
523
|
-
useCases: [
|
|
524
|
-
"Debug recent application errors by filtering for open errors in the last 7 days",
|
|
525
|
-
"Generate error reports for stakeholders by filtering specific error types or severity levels",
|
|
526
|
-
"Monitor error trends over time using date range filters",
|
|
527
|
-
"Find errors affecting specific users or environments using metadata filters"
|
|
528
|
-
],
|
|
529
|
-
inputSchema: listProjectErrorsInputSchema,
|
|
530
|
-
examples: [
|
|
531
|
-
{
|
|
532
|
-
description: "Find errors affecting a specific user in the last 24 hours",
|
|
533
|
-
parameters: {
|
|
534
|
-
filters: {
|
|
535
|
-
"user.email": [{ type: "eq", value: "user@example.com" }],
|
|
536
|
-
"event.since": [{ type: "eq", value: "24h" }]
|
|
537
|
-
}
|
|
538
|
-
},
|
|
539
|
-
expectedOutput: "JSON object with a list of errors in the 'data' field, a count of the current page of results in the 'count' field, and a total count of all results in the 'total' field"
|
|
540
|
-
},
|
|
541
|
-
{
|
|
542
|
-
description: "Get the 10 open errors with the most users affected in the last 30 days",
|
|
543
|
-
parameters: {
|
|
544
|
-
filters: {
|
|
545
|
-
"event.since": [{ type: "eq", value: "30d" }],
|
|
546
|
-
"error.status": [{ type: "eq", value: "open" }]
|
|
547
|
-
},
|
|
548
|
-
sort: "users",
|
|
549
|
-
direction: "desc",
|
|
550
|
-
perPage: 10
|
|
551
|
-
},
|
|
552
|
-
expectedOutput: "JSON object with a list of errors in the 'data' field, a count of the current page of results in the 'count' field, and a total count of all results in the 'total' field"
|
|
553
|
-
},
|
|
554
|
-
{
|
|
555
|
-
description: "Get the next 50 results",
|
|
556
|
-
parameters: {
|
|
557
|
-
nextUrl: "https://api.bugsnag.com/projects/515fb9337c1074f6fd000003/errors?base=2025-08-29T13%3A11%3A37Z&direction=desc&filters%5Berror.status%5D%5B%5D%5Btype%5D=eq&filters%5Berror.status%5D%5B%5D%5Bvalue%5D=open&offset=10&per_page=10&sort=users",
|
|
558
|
-
perPage: 50
|
|
559
|
-
},
|
|
560
|
-
expectedOutput: "JSON object with a list of errors, with a URL to the next page if more results are available and a total count of all errors matched"
|
|
561
|
-
}
|
|
562
|
-
],
|
|
563
|
-
hints: [
|
|
564
|
-
"Use List Project Event Filters tool first to discover valid filter field names for your project",
|
|
565
|
-
"Combine multiple filters to narrow results - filters are applied with AND logic",
|
|
566
|
-
"For time filters: use relative format (7d, 24h) for recent periods or ISO 8601 UTC format (2018-05-20T00:00:00Z) for specific dates",
|
|
567
|
-
"Common time filters: event.since (from this time), event.before (until this time)",
|
|
568
|
-
"The 'event.since' filter and 'error.status' filters are always applied and if not specified are set to '30d' and 'open' respectively",
|
|
569
|
-
"There may not be any errors matching the filters - this is not a problem with the tool, in fact it might be a good thing that the user's application had no errors",
|
|
570
|
-
"This tool returns paged results. The 'page_error_count' field indicates the number of results returned in the current page, and the 'total_error_count' field indicates the total number of results across all pages.",
|
|
571
|
-
"If the output contains a 'next_url' value, there are more results available - call this tool again supplying the next URL as a parameter to retrieve the next page.",
|
|
572
|
-
"Do not modify the next URL as this can cause incorrect results. The only other parameter that can be used with 'next' is 'per_page' to control the page size."
|
|
573
|
-
]
|
|
574
|
-
},
|
|
575
|
-
async (args, _extra) => {
|
|
576
|
-
const params = listProjectErrorsInputSchema.parse(args);
|
|
577
|
-
const project = await this.getInputProject(params.projectId);
|
|
578
|
-
const filters = {
|
|
579
|
-
"event.since": [{ type: "eq", value: "30d" }],
|
|
580
|
-
"error.status": [{ type: "eq", value: "open" }],
|
|
581
|
-
...params.filters
|
|
582
|
-
};
|
|
583
|
-
await this.validateEventFields(project, filters);
|
|
584
|
-
const response = await this.errorsApi.listProjectErrors(
|
|
585
|
-
project.id,
|
|
586
|
-
null,
|
|
587
|
-
params.sort,
|
|
588
|
-
params.direction,
|
|
589
|
-
params.perPage,
|
|
590
|
-
filters,
|
|
591
|
-
params.nextUrl
|
|
592
|
-
);
|
|
593
|
-
const result = {
|
|
594
|
-
data: response.body,
|
|
595
|
-
next_url: response.nextUrl ?? void 0,
|
|
596
|
-
data_count: response.body?.length,
|
|
597
|
-
total_count: response.totalCount ?? void 0
|
|
598
|
-
};
|
|
599
|
-
return {
|
|
600
|
-
content: [{ type: "text", text: JSON.stringify(result) }]
|
|
601
|
-
};
|
|
602
|
-
}
|
|
603
|
-
);
|
|
604
|
-
const listProjectEventFiltersInputSchema = z.object({
|
|
605
|
-
projectId: toolInputParameters.projectId
|
|
606
|
-
});
|
|
607
|
-
register(
|
|
608
|
-
{
|
|
609
|
-
title: "List Project Event Filters",
|
|
610
|
-
summary: "Get available event filter fields for a project",
|
|
611
|
-
purpose: "Discover valid filter field names and options that can be used with the List Errors or Get Error tools",
|
|
612
|
-
useCases: [
|
|
613
|
-
"Discover what filter fields are available before searching for errors",
|
|
614
|
-
"Find the correct field names for filtering by user, environment, or custom metadata",
|
|
615
|
-
"Understand filter options and data types for building complex queries"
|
|
616
|
-
],
|
|
617
|
-
inputSchema: listProjectEventFiltersInputSchema,
|
|
618
|
-
examples: [
|
|
619
|
-
{
|
|
620
|
-
description: "Get all available filter fields",
|
|
621
|
-
parameters: {},
|
|
622
|
-
expectedOutput: "JSON array of EventField objects containing display_id, custom flag, and filter/pivot options"
|
|
623
|
-
}
|
|
624
|
-
],
|
|
625
|
-
hints: [
|
|
626
|
-
"Use this tool before the List Errors or Get Error tools to understand available filters",
|
|
627
|
-
"Look for display_id field in the response - these are the field names to use in filters"
|
|
628
|
-
]
|
|
629
|
-
},
|
|
630
|
-
async (args, _extra) => {
|
|
631
|
-
const params = listProjectEventFiltersInputSchema.parse(args);
|
|
632
|
-
const eventFilters = await this.getProjectEventFields(
|
|
633
|
-
await this.getInputProject(params.projectId)
|
|
634
|
-
);
|
|
635
|
-
return {
|
|
636
|
-
content: [{ type: "text", text: JSON.stringify(eventFilters) }]
|
|
637
|
-
};
|
|
638
|
-
}
|
|
639
|
-
);
|
|
640
|
-
const updateErrorInputSchema = z.object({
|
|
641
|
-
projectId: toolInputParameters.projectId,
|
|
642
|
-
errorId: toolInputParameters.errorId,
|
|
643
|
-
operation: z.enum(PERMITTED_UPDATE_OPERATIONS).describe("The operation to apply to the error"),
|
|
644
|
-
issue_url: z.string().optional().describe(
|
|
645
|
-
"The URL of the issue to link to the error - required when operation is 'link_issue'"
|
|
646
|
-
),
|
|
647
|
-
reopenRules: z.object({
|
|
648
|
-
reopenIf: z.enum(PERMITTED_REOPEN_CONDITIONS).describe("Condition for when the error should be reopened"),
|
|
649
|
-
additionalUsers: z.number().min(1).max(1e5).optional().describe(
|
|
650
|
-
"for n_additional_users reopen rules, the number of additional users to be affected by an Error before the Error is automatically reopened."
|
|
651
|
-
),
|
|
652
|
-
seconds: z.number().min(1).optional().describe(
|
|
653
|
-
"for occurs_after reopen rules, the number of seconds that the Error should be snoozed for."
|
|
654
|
-
),
|
|
655
|
-
occurrences: z.number().min(1).optional().describe(
|
|
656
|
-
"for n_occurrences_in_m_hours reopen rules, the number of occurrences to allow in the number of hours indicated by the hours field, before the Error is automatically reopened."
|
|
657
|
-
),
|
|
658
|
-
hours: z.number().min(1).optional().describe(
|
|
659
|
-
"for n_occurrences_in_m_hours reopen rules, the number of hours."
|
|
660
|
-
),
|
|
661
|
-
additionalOccurrences: z.number().min(1).optional().describe(
|
|
662
|
-
"or n_additional_occurrences reopen rules, the number of additional occurrences allowed before reopening."
|
|
663
|
-
)
|
|
664
|
-
}).optional().describe(
|
|
665
|
-
"Reopen rules for snooze operation - required when operation is 'snooze'"
|
|
666
|
-
)
|
|
667
|
-
});
|
|
668
|
-
register(
|
|
669
|
-
{
|
|
670
|
-
title: "Update Error",
|
|
671
|
-
summary: "Update the status of an error",
|
|
672
|
-
purpose: "Change an error's workflow state, such as marking it as resolved or ignored",
|
|
673
|
-
useCases: [
|
|
674
|
-
"Mark an error as open, fixed or ignored",
|
|
675
|
-
"Discard or un-discard an error",
|
|
676
|
-
"Update the severity of an error",
|
|
677
|
-
"Snooze an error with defined conditions for when it should be reopened"
|
|
678
|
-
],
|
|
679
|
-
inputSchema: updateErrorInputSchema,
|
|
680
|
-
examples: [
|
|
681
|
-
{
|
|
682
|
-
description: "Mark an error as fixed",
|
|
683
|
-
parameters: {
|
|
684
|
-
errorId: "6863e2af8c857c0a5023b411",
|
|
685
|
-
operation: "fix"
|
|
686
|
-
},
|
|
687
|
-
expectedOutput: "Success response indicating the error was marked as fixed"
|
|
688
|
-
},
|
|
689
|
-
{
|
|
690
|
-
description: "Snooze an error for 1 hour",
|
|
691
|
-
parameters: {
|
|
692
|
-
errorId: "6863e2af8c857c0a5023b411",
|
|
693
|
-
operation: "snooze",
|
|
694
|
-
reopenRules: {
|
|
695
|
-
reopenIf: "occurs_after",
|
|
696
|
-
seconds: 3600
|
|
697
|
-
}
|
|
698
|
-
},
|
|
699
|
-
expectedOutput: "Success response indicating the error was snoozed for 1 hour"
|
|
700
|
-
},
|
|
701
|
-
{
|
|
702
|
-
description: "Snooze an error until 5 additional users are affected",
|
|
703
|
-
parameters: {
|
|
704
|
-
errorId: "6863e2af8c857c0a5023b411",
|
|
705
|
-
operation: "snooze",
|
|
706
|
-
reopenRules: {
|
|
707
|
-
reopenIf: "n_additional_users",
|
|
708
|
-
additionalUsers: 5
|
|
709
|
-
}
|
|
710
|
-
},
|
|
711
|
-
expectedOutput: "Success response indicating the error was snoozed until 5 additional users are affected"
|
|
712
|
-
},
|
|
713
|
-
{
|
|
714
|
-
description: "Snooze an error until 10 occurrences in 24 hours",
|
|
715
|
-
parameters: {
|
|
716
|
-
errorId: "6863e2af8c857c0a5023b411",
|
|
717
|
-
operation: "snooze",
|
|
718
|
-
reopenRules: {
|
|
719
|
-
reopenIf: "n_occurrences_in_m_hours",
|
|
720
|
-
occurrences: 10,
|
|
721
|
-
hours: 24
|
|
722
|
-
}
|
|
723
|
-
},
|
|
724
|
-
expectedOutput: "Success response indicating the error was snoozed until 10 occurrences in 24 hours"
|
|
725
|
-
},
|
|
726
|
-
{
|
|
727
|
-
description: "Link a Jira issue to an error",
|
|
728
|
-
parameters: {
|
|
729
|
-
errorId: "6863e2af8c857c0a5023b411",
|
|
730
|
-
operation: "link_issue",
|
|
731
|
-
issue_url: "https://smartbear.atlassian.net/browse/PIPE-9547"
|
|
732
|
-
},
|
|
733
|
-
expectedOutput: "Success response indicating the Jira issue was linked to the error"
|
|
734
|
-
},
|
|
735
|
-
{
|
|
736
|
-
description: "Unlink a Jira issue from an error",
|
|
737
|
-
parameters: {
|
|
738
|
-
errorId: "6863e2af8c857c0a5023b411",
|
|
739
|
-
operation: "unlink_issue"
|
|
740
|
-
},
|
|
741
|
-
expectedOutput: "Success response indicating the Jira issue was unlinked from the error"
|
|
742
|
-
}
|
|
743
|
-
],
|
|
744
|
-
hints: [
|
|
745
|
-
"Only use valid operations - BugSnag may reject invalid values",
|
|
746
|
-
"When using 'snooze' operation, reopenRules parameter is required",
|
|
747
|
-
"When using 'link_issue' operation, issue_url parameter is required",
|
|
748
|
-
"Use 'unlink_issue' to remove the link between an error and its issue",
|
|
749
|
-
"For 'occurs_after' reopen rules, specify 'seconds' parameter",
|
|
750
|
-
"For 'n_additional_users' reopen rules, specify 'additionalUsers' parameter (max 100,000)",
|
|
751
|
-
"For 'n_occurrences_in_m_hours' reopen rules, specify both 'occurrences' and 'hours' parameters",
|
|
752
|
-
"For 'n_additional_occurrences' reopen rules, specify 'additionalOccurrences' parameter",
|
|
753
|
-
"Snoozing temporarily silences an error until the specified reopen condition is met"
|
|
754
|
-
],
|
|
755
|
-
readOnly: false,
|
|
756
|
-
idempotent: false
|
|
757
|
-
},
|
|
758
|
-
async (args, _extra) => {
|
|
759
|
-
const params = updateErrorInputSchema.parse(args);
|
|
760
|
-
const project = await this.getInputProject(params.projectId);
|
|
761
|
-
if (params.operation === "snooze" && !params.reopenRules) {
|
|
762
|
-
throw new ToolError(
|
|
763
|
-
"reopenRules parameter is required when using 'snooze' operation"
|
|
764
|
-
);
|
|
765
|
-
}
|
|
766
|
-
if (params.operation === "link_issue" && !params.issue_url) {
|
|
767
|
-
throw new ToolError(
|
|
768
|
-
"'issue_url' parameter is required for 'link_issue' operation"
|
|
769
|
-
);
|
|
770
|
-
}
|
|
771
|
-
if (params.reopenRules) {
|
|
772
|
-
const { reopenIf } = params.reopenRules;
|
|
773
|
-
if (reopenIf === "occurs_after" && !params.reopenRules.seconds) {
|
|
774
|
-
throw new ToolError(
|
|
775
|
-
"'seconds' parameter is required for 'occurs_after' reopen rules"
|
|
776
|
-
);
|
|
777
|
-
}
|
|
778
|
-
if (reopenIf === "n_additional_users" && !params.reopenRules.additionalUsers) {
|
|
779
|
-
throw new ToolError(
|
|
780
|
-
"'additionalUsers' parameter is required for 'n_additional_users' reopen rules"
|
|
781
|
-
);
|
|
782
|
-
}
|
|
783
|
-
if (reopenIf === "n_occurrences_in_m_hours" && (!params.reopenRules.occurrences || !params.reopenRules.hours)) {
|
|
784
|
-
throw new ToolError(
|
|
785
|
-
"Both 'occurrences' and 'hours' parameters are required for 'n_occurrences_in_m_hours' reopen rules"
|
|
786
|
-
);
|
|
787
|
-
}
|
|
788
|
-
if (reopenIf === "n_additional_occurrences" && !params.reopenRules.additionalOccurrences) {
|
|
789
|
-
throw new ToolError(
|
|
790
|
-
"'additionalOccurrences' parameter is required for 'n_additional_occurrences' reopen rules"
|
|
791
|
-
);
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
let severity;
|
|
795
|
-
if (params.operation === "override_severity") {
|
|
796
|
-
const result2 = await getInput({
|
|
797
|
-
message: "Please provide the new severity for the error (e.g. 'info', 'warning', 'error', 'critical')",
|
|
798
|
-
requestedSchema: {
|
|
799
|
-
type: "object",
|
|
800
|
-
properties: {
|
|
801
|
-
severity: {
|
|
802
|
-
type: "string",
|
|
803
|
-
enum: ["info", "warning", "error"],
|
|
804
|
-
description: "The new severity level for the error"
|
|
805
|
-
}
|
|
806
|
-
},
|
|
807
|
-
required: ["severity"]
|
|
808
|
-
}
|
|
809
|
-
});
|
|
810
|
-
if (result2.action === "accept" && result2.content?.severity) {
|
|
811
|
-
severity = result2.content.severity;
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
let reopenRules;
|
|
815
|
-
if (params.reopenRules) {
|
|
816
|
-
reopenRules = {
|
|
817
|
-
reopen_if: params.reopenRules.reopenIf
|
|
818
|
-
};
|
|
819
|
-
if (params.reopenRules.additionalUsers !== void 0) {
|
|
820
|
-
reopenRules.additional_users = params.reopenRules.additionalUsers;
|
|
821
|
-
}
|
|
822
|
-
if (params.reopenRules.seconds !== void 0) {
|
|
823
|
-
reopenRules.seconds = params.reopenRules.seconds;
|
|
824
|
-
}
|
|
825
|
-
if (params.reopenRules.occurrences !== void 0) {
|
|
826
|
-
reopenRules.occurrences = params.reopenRules.occurrences;
|
|
827
|
-
}
|
|
828
|
-
if (params.reopenRules.hours !== void 0) {
|
|
829
|
-
reopenRules.hours = params.reopenRules.hours;
|
|
830
|
-
}
|
|
831
|
-
if (params.reopenRules.additionalOccurrences !== void 0) {
|
|
832
|
-
reopenRules.additional_occurrences = params.reopenRules.additionalOccurrences;
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
const errorUpdateRequestBody = {
|
|
836
|
-
operation: Object.values(ErrorUpdateRequest.OperationEnum).find(
|
|
837
|
-
(value) => value === params.operation
|
|
838
|
-
)
|
|
839
|
-
};
|
|
840
|
-
if (severity !== void 0) {
|
|
841
|
-
errorUpdateRequestBody.severity = severity;
|
|
842
|
-
}
|
|
843
|
-
if (reopenRules !== void 0) {
|
|
844
|
-
errorUpdateRequestBody.reopen_rules = reopenRules;
|
|
845
|
-
}
|
|
846
|
-
if (params.operation === "link_issue" && params.issue_url) {
|
|
847
|
-
errorUpdateRequestBody.issue_url = params.issue_url;
|
|
848
|
-
errorUpdateRequestBody.verify_issue_url = true;
|
|
849
|
-
}
|
|
850
|
-
const result = await this.errorsApi.updateErrorOnProject(
|
|
851
|
-
project.id,
|
|
852
|
-
params.errorId,
|
|
853
|
-
errorUpdateRequestBody
|
|
854
|
-
);
|
|
855
|
-
return {
|
|
856
|
-
content: [
|
|
857
|
-
{
|
|
858
|
-
type: "text",
|
|
859
|
-
text: JSON.stringify({
|
|
860
|
-
success: result.status === 200 || result.status === 204
|
|
861
|
-
})
|
|
862
|
-
}
|
|
863
|
-
]
|
|
864
|
-
};
|
|
865
|
-
}
|
|
866
|
-
);
|
|
867
|
-
const listReleasesInputSchema = z.object({
|
|
868
|
-
projectId: toolInputParameters.projectId,
|
|
869
|
-
releaseStage: toolInputParameters.releaseStage,
|
|
870
|
-
visibleOnly: z.boolean().describe(
|
|
871
|
-
"Whether to only include releases that are marked as visible in the dashboard"
|
|
872
|
-
).default(false),
|
|
873
|
-
perPage: toolInputParameters.perPage,
|
|
874
|
-
nextUrl: toolInputParameters.nextUrl
|
|
875
|
-
});
|
|
876
|
-
register(
|
|
877
|
-
{
|
|
878
|
-
title: "List Releases",
|
|
879
|
-
summary: "List releases for a project",
|
|
880
|
-
purpose: "Retrieve a list of release summaries to analyze deployment history and associated errors",
|
|
881
|
-
useCases: [
|
|
882
|
-
"View recent releases to correlate with error spikes",
|
|
883
|
-
"Filter releases by stage (e.g. production, staging) for targeted analysis"
|
|
884
|
-
],
|
|
885
|
-
inputSchema: listReleasesInputSchema,
|
|
886
|
-
examples: [
|
|
887
|
-
{
|
|
888
|
-
description: "List production releases for a project",
|
|
889
|
-
parameters: {},
|
|
890
|
-
expectedOutput: "JSON array of release objects in the production stage"
|
|
891
|
-
},
|
|
892
|
-
{
|
|
893
|
-
description: "List staging releases for a project",
|
|
894
|
-
parameters: {
|
|
895
|
-
releaseStage: "staging"
|
|
896
|
-
},
|
|
897
|
-
expectedOutput: "JSON array of release objects in the staging stage"
|
|
898
|
-
},
|
|
899
|
-
{
|
|
900
|
-
description: "Get the next page of results",
|
|
901
|
-
parameters: {
|
|
902
|
-
nextUrl: "/projects/515fb9337c1074f6fd000003/releases?offset=30&per_page=30"
|
|
903
|
-
},
|
|
904
|
-
expectedOutput: "JSON array of release objects with metadata from the next page"
|
|
905
|
-
}
|
|
906
|
-
],
|
|
907
|
-
hints: [
|
|
908
|
-
"Use the Get Release tool to get more details on a specific release, including the builds it contains",
|
|
909
|
-
"The release stage defaults to 'production' if not specified",
|
|
910
|
-
"Use visibleOnly to filter out releases that have been marked as hidden in the dashboard"
|
|
911
|
-
],
|
|
912
|
-
readOnly: true,
|
|
913
|
-
idempotent: true,
|
|
914
|
-
outputDescription: "JSON array of release summary objects with metadata, with a URL to the next page if more results are available"
|
|
915
|
-
},
|
|
916
|
-
async (args, _extra) => {
|
|
917
|
-
const params = listReleasesInputSchema.parse(args);
|
|
918
|
-
const project = await this.getInputProject(params.projectId);
|
|
919
|
-
const response = await this.projectApi.listProjectReleaseGroups(
|
|
920
|
-
project.id,
|
|
921
|
-
params.releaseStage,
|
|
922
|
-
false,
|
|
923
|
-
// Not top-only
|
|
924
|
-
params.visibleOnly,
|
|
925
|
-
params.perPage,
|
|
926
|
-
params.nextUrl
|
|
927
|
-
);
|
|
928
|
-
let releases = [];
|
|
929
|
-
if (response.body) {
|
|
930
|
-
releases = response.body.map(
|
|
931
|
-
(r) => this.addStabilityData(r, project)
|
|
932
|
-
);
|
|
933
|
-
}
|
|
934
|
-
return {
|
|
935
|
-
content: [
|
|
936
|
-
{
|
|
937
|
-
type: "text",
|
|
938
|
-
text: JSON.stringify({
|
|
939
|
-
data: releases,
|
|
940
|
-
next_url: response.nextUrl ?? void 0,
|
|
941
|
-
data_count: releases.length,
|
|
942
|
-
total_count: response.totalCount ?? void 0
|
|
943
|
-
})
|
|
944
|
-
}
|
|
945
|
-
]
|
|
946
|
-
};
|
|
947
|
-
}
|
|
948
|
-
);
|
|
949
|
-
const getReleaseInputSchema = z.object({
|
|
950
|
-
projectId: toolInputParameters.projectId,
|
|
951
|
-
releaseId: toolInputParameters.releaseId
|
|
952
|
-
});
|
|
953
|
-
register(
|
|
954
|
-
{
|
|
955
|
-
title: "Get Release",
|
|
956
|
-
summary: "Get more details for a specific release by its ID, including source control information and associated builds",
|
|
957
|
-
purpose: "Retrieve detailed information about a release for analysis and debugging",
|
|
958
|
-
useCases: [
|
|
959
|
-
"View release metadata such as version, source control info, and error counts",
|
|
960
|
-
"Analyze the stability data and targets for a release",
|
|
961
|
-
"See the builds that make up the release"
|
|
962
|
-
],
|
|
963
|
-
inputSchema: getReleaseInputSchema,
|
|
964
|
-
examples: [
|
|
965
|
-
{
|
|
966
|
-
description: "Get details for a specific release",
|
|
967
|
-
parameters: {
|
|
968
|
-
releaseId: "5f8d0d55c9e77c0017a1b2c3"
|
|
969
|
-
},
|
|
970
|
-
expectedOutput: "JSON object with release details including version, source control info, error counts and stability data."
|
|
971
|
-
}
|
|
972
|
-
],
|
|
973
|
-
hints: ["Release IDs can be found using the List releases tool"],
|
|
974
|
-
readOnly: true,
|
|
975
|
-
idempotent: true,
|
|
976
|
-
outputDescription: "JSON object containing release details along with stability metrics such as user and session stability, and whether it meets project targets"
|
|
977
|
-
},
|
|
978
|
-
async (args, _extra) => {
|
|
979
|
-
const params = getReleaseInputSchema.parse(args);
|
|
980
|
-
const project = await this.getInputProject(params.projectId);
|
|
981
|
-
const releaseResponse = await this.projectApi.getReleaseGroup(
|
|
982
|
-
params.releaseId
|
|
983
|
-
);
|
|
984
|
-
if (!releaseResponse.body)
|
|
985
|
-
throw new ToolError(`No release for ${params.releaseId} found.`);
|
|
986
|
-
const release = this.addStabilityData(releaseResponse.body, project);
|
|
987
|
-
let builds = [];
|
|
988
|
-
if (releaseResponse.body) {
|
|
989
|
-
const buildsResponse = await this.projectApi.listBuildsInRelease(
|
|
990
|
-
params.releaseId
|
|
991
|
-
);
|
|
992
|
-
if (buildsResponse.body) {
|
|
993
|
-
builds = buildsResponse.body.map(
|
|
994
|
-
(b) => this.addStabilityData(b, project)
|
|
995
|
-
);
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
return {
|
|
999
|
-
content: [
|
|
1000
|
-
{
|
|
1001
|
-
type: "text",
|
|
1002
|
-
text: JSON.stringify({
|
|
1003
|
-
release,
|
|
1004
|
-
builds
|
|
1005
|
-
})
|
|
1006
|
-
}
|
|
1007
|
-
]
|
|
1008
|
-
};
|
|
1009
|
-
}
|
|
1010
|
-
);
|
|
1011
|
-
const getBuildInputSchema = z.object({
|
|
1012
|
-
projectId: toolInputParameters.projectId,
|
|
1013
|
-
buildId: toolInputParameters.buildId
|
|
1014
|
-
});
|
|
1015
|
-
register(
|
|
1016
|
-
{
|
|
1017
|
-
title: "Get Build",
|
|
1018
|
-
summary: "Get more details for a specific build by its ID",
|
|
1019
|
-
purpose: "Retrieve detailed information about a build for analysis and debugging",
|
|
1020
|
-
useCases: [
|
|
1021
|
-
"View build metadata such as version, source control info, and error counts",
|
|
1022
|
-
"Analyze a specific build to correlate with error spikes or deployments",
|
|
1023
|
-
"See the stability targets for a project and if the build meets them"
|
|
1024
|
-
],
|
|
1025
|
-
inputSchema: getBuildInputSchema,
|
|
1026
|
-
examples: [
|
|
1027
|
-
{
|
|
1028
|
-
description: "Get details for a specific build",
|
|
1029
|
-
parameters: {
|
|
1030
|
-
buildId: "5f8d0d55c9e77c0017a1b2c3"
|
|
1031
|
-
},
|
|
1032
|
-
expectedOutput: "JSON object with build details including version, source control info, error counts and stability data."
|
|
1033
|
-
}
|
|
1034
|
-
],
|
|
1035
|
-
hints: ["Build IDs can be found using the List builds tool"],
|
|
1036
|
-
readOnly: true,
|
|
1037
|
-
idempotent: true,
|
|
1038
|
-
outputDescription: "JSON object containing build details along with stability metrics such as user and session stability, and whether it meets project targets"
|
|
1039
|
-
},
|
|
1040
|
-
async (args, _extra) => {
|
|
1041
|
-
const params = getBuildInputSchema.parse(args);
|
|
1042
|
-
const project = await this.getInputProject(params.projectId);
|
|
1043
|
-
const response = await this.projectApi.getProjectReleaseById(
|
|
1044
|
-
project.id,
|
|
1045
|
-
params.buildId
|
|
1046
|
-
);
|
|
1047
|
-
if (!response.body)
|
|
1048
|
-
throw new ToolError(`No build for ${params.buildId} found.`);
|
|
1049
|
-
const build = this.addStabilityData(response.body, project);
|
|
1050
|
-
return {
|
|
1051
|
-
content: [{ type: "text", text: JSON.stringify(build) }]
|
|
1052
|
-
};
|
|
1053
|
-
}
|
|
1054
|
-
);
|
|
1055
|
-
const listSpanGroupsInputSchema = z.object({
|
|
1056
|
-
projectId: toolInputParameters.projectId,
|
|
1057
|
-
sort: z.enum([
|
|
1058
|
-
"total_spans",
|
|
1059
|
-
"last_seen",
|
|
1060
|
-
"name",
|
|
1061
|
-
"display_name",
|
|
1062
|
-
"network_http_method",
|
|
1063
|
-
"rendering_slow_frame_span_percentage",
|
|
1064
|
-
"rendering_frozen_frame_span_percentage",
|
|
1065
|
-
"duration_p50",
|
|
1066
|
-
"duration_p75",
|
|
1067
|
-
"duration_p90",
|
|
1068
|
-
"duration_p95",
|
|
1069
|
-
"duration_p99",
|
|
1070
|
-
"system_metrics_cpu_total_mean_p50",
|
|
1071
|
-
"system_metrics_cpu_total_mean_p75",
|
|
1072
|
-
"system_metrics_cpu_total_mean_p90",
|
|
1073
|
-
"system_metrics_cpu_total_mean_p95",
|
|
1074
|
-
"system_metrics_cpu_total_mean_p99",
|
|
1075
|
-
"system_metrics_memory_device_mean_p50",
|
|
1076
|
-
"system_metrics_memory_device_mean_p75",
|
|
1077
|
-
"system_metrics_memory_device_mean_p90",
|
|
1078
|
-
"system_metrics_memory_device_mean_p95",
|
|
1079
|
-
"system_metrics_memory_device_mean_p99",
|
|
1080
|
-
"rendering_metrics_fps_mean_p50",
|
|
1081
|
-
"rendering_metrics_fps_mean_p75",
|
|
1082
|
-
"rendering_metrics_fps_mean_p90",
|
|
1083
|
-
"rendering_metrics_fps_mean_p95",
|
|
1084
|
-
"rendering_metrics_fps_mean_p99",
|
|
1085
|
-
"http_response_4xx_percentage",
|
|
1086
|
-
"http_response_5xx_percentage"
|
|
1087
|
-
]).optional().describe("Field to sort by"),
|
|
1088
|
-
direction: toolInputParameters.direction,
|
|
1089
|
-
perPage: toolInputParameters.perPage,
|
|
1090
|
-
starredOnly: z.boolean().optional().describe("Show only starred span groups"),
|
|
1091
|
-
nextUrl: toolInputParameters.nextUrl,
|
|
1092
|
-
filters: toolInputParameters.performanceFilters
|
|
1093
|
-
});
|
|
1094
|
-
register(
|
|
1095
|
-
{
|
|
1096
|
-
title: "List Span Groups",
|
|
1097
|
-
summary: "List span groups (operations) tracked for performance monitoring",
|
|
1098
|
-
purpose: "Discover and analyze different operations being monitored",
|
|
1099
|
-
useCases: [
|
|
1100
|
-
"View all operations being tracked for performance",
|
|
1101
|
-
"Find slow operations by sorting by duration metrics",
|
|
1102
|
-
"Filter to starred/important span groups"
|
|
1103
|
-
],
|
|
1104
|
-
inputSchema: listSpanGroupsInputSchema,
|
|
1105
|
-
examples: [
|
|
1106
|
-
{
|
|
1107
|
-
description: "List slowest operations",
|
|
1108
|
-
parameters: {
|
|
1109
|
-
sort: "duration_p95",
|
|
1110
|
-
direction: "desc",
|
|
1111
|
-
perPage: 10
|
|
1112
|
-
},
|
|
1113
|
-
expectedOutput: "Array of span groups sorted by 95th percentile duration"
|
|
1114
|
-
},
|
|
1115
|
-
{
|
|
1116
|
-
description: "List starred span groups with filtering",
|
|
1117
|
-
parameters: {
|
|
1118
|
-
starredOnly: true,
|
|
1119
|
-
filters: {
|
|
1120
|
-
"span_group.category": [
|
|
1121
|
-
{ type: "eq", value: "full_page_load" }
|
|
1122
|
-
]
|
|
1123
|
-
}
|
|
1124
|
-
},
|
|
1125
|
-
expectedOutput: "Array of starred span groups filtered by category"
|
|
1126
|
-
}
|
|
1127
|
-
],
|
|
1128
|
-
hints: [
|
|
1129
|
-
"Span groups represent different operation types (page loads, API calls, etc.)",
|
|
1130
|
-
"Use sort by duration_p95 or duration_p99 to find the slowest operations",
|
|
1131
|
-
"Star important span groups for quick access",
|
|
1132
|
-
"Use nextUrl for pagination"
|
|
1133
|
-
]
|
|
1134
|
-
},
|
|
1135
|
-
async (args, _extra) => {
|
|
1136
|
-
const params = listSpanGroupsInputSchema.parse(args);
|
|
1137
|
-
const project = await this.getInputProject(params.projectId);
|
|
1138
|
-
const result = await this.projectApi.listProjectSpanGroups(
|
|
1139
|
-
project.id,
|
|
1140
|
-
params.sort,
|
|
1141
|
-
params.direction,
|
|
1142
|
-
params.perPage,
|
|
1143
|
-
void 0,
|
|
1144
|
-
params.filters,
|
|
1145
|
-
params.starredOnly,
|
|
1146
|
-
params.nextUrl
|
|
1147
|
-
);
|
|
1148
|
-
return {
|
|
1149
|
-
content: [
|
|
1150
|
-
{
|
|
1151
|
-
type: "text",
|
|
1152
|
-
text: JSON.stringify({
|
|
1153
|
-
data: result.body,
|
|
1154
|
-
next_url: result.nextUrl,
|
|
1155
|
-
count: result.body?.length
|
|
1156
|
-
})
|
|
1157
|
-
}
|
|
1158
|
-
]
|
|
1159
|
-
};
|
|
1160
|
-
}
|
|
1161
|
-
);
|
|
1162
|
-
const getSpanGroupInputSchema = z.object({
|
|
1163
|
-
projectId: toolInputParameters.projectId,
|
|
1164
|
-
spanGroupId: toolInputParameters.spanGroupId,
|
|
1165
|
-
filters: toolInputParameters.performanceFilters
|
|
1166
|
-
});
|
|
1167
|
-
register(
|
|
1168
|
-
{
|
|
1169
|
-
title: "Get Span Group",
|
|
1170
|
-
summary: "Get detailed performance metrics for a specific span group",
|
|
1171
|
-
purpose: "Analyze performance characteristics of a specific operation",
|
|
1172
|
-
useCases: [
|
|
1173
|
-
"View detailed statistics (p50, p75, p90, p95, p99) for an operation",
|
|
1174
|
-
"Check if performance targets are configured",
|
|
1175
|
-
"Monitor span count to understand operation volume"
|
|
1176
|
-
],
|
|
1177
|
-
inputSchema: getSpanGroupInputSchema,
|
|
1178
|
-
examples: [
|
|
1179
|
-
{
|
|
1180
|
-
description: "Get details for an API endpoint span group",
|
|
1181
|
-
parameters: { spanGroupId: "[HttpClient]GET-api.example.com" },
|
|
1182
|
-
expectedOutput: "Statistics, category, and performance target info"
|
|
1183
|
-
},
|
|
1184
|
-
{
|
|
1185
|
-
description: "Get span group details with device filtering",
|
|
1186
|
-
parameters: {
|
|
1187
|
-
spanGroupId: "[HttpClient]GET-api.example.com",
|
|
1188
|
-
filters: {
|
|
1189
|
-
"device.browser_name": [{ type: "eq", value: "Chrome" }]
|
|
1190
|
-
}
|
|
1191
|
-
},
|
|
1192
|
-
expectedOutput: "Statistics filtered for Chrome browser only"
|
|
1193
|
-
}
|
|
1194
|
-
],
|
|
1195
|
-
hints: [
|
|
1196
|
-
"Use List Span Groups first to discover available span group IDs",
|
|
1197
|
-
"IDs are automatically URL-encoded - provide the raw ID",
|
|
1198
|
-
"Statistics include p50, p75, p90, p95, p99 percentiles"
|
|
1199
|
-
]
|
|
1200
|
-
},
|
|
1201
|
-
async (args, _extra) => {
|
|
1202
|
-
const params = getSpanGroupInputSchema.parse(args);
|
|
1203
|
-
const project = await this.getInputProject(params.projectId);
|
|
1204
|
-
const spanGroupResults = await this.projectApi.getProjectSpanGroup(
|
|
1205
|
-
project.id,
|
|
1206
|
-
params.spanGroupId,
|
|
1207
|
-
params.filters
|
|
1208
|
-
);
|
|
1209
|
-
const spanGroupTimelineResult = await this.projectApi.getProjectSpanGroupTimeline(
|
|
1210
|
-
project.id,
|
|
1211
|
-
params.spanGroupId,
|
|
1212
|
-
params.filters
|
|
1213
|
-
);
|
|
1214
|
-
const spanGroupDistributionResult = await this.projectApi.getProjectSpanGroupDistribution(
|
|
1215
|
-
project.id,
|
|
1216
|
-
params.spanGroupId,
|
|
1217
|
-
params.filters
|
|
1218
|
-
);
|
|
1219
|
-
const result = {
|
|
1220
|
-
...spanGroupResults.body,
|
|
1221
|
-
timeline: spanGroupTimelineResult.body,
|
|
1222
|
-
distribution: spanGroupDistributionResult.body
|
|
1223
|
-
};
|
|
1224
|
-
return {
|
|
1225
|
-
content: [{ type: "text", text: JSON.stringify(result) }]
|
|
1226
|
-
};
|
|
1227
|
-
}
|
|
1228
|
-
);
|
|
1229
|
-
const listSpansInputSchema = z.object({
|
|
1230
|
-
projectId: toolInputParameters.projectId,
|
|
1231
|
-
spanGroupId: toolInputParameters.spanGroupId,
|
|
1232
|
-
sort: z.enum([
|
|
1233
|
-
"duration",
|
|
1234
|
-
"timestamp",
|
|
1235
|
-
"full_page_load_lcp",
|
|
1236
|
-
"full_page_load_fid",
|
|
1237
|
-
"full_page_load_cls",
|
|
1238
|
-
"full_page_load_ttfb",
|
|
1239
|
-
"full_page_load_fcp",
|
|
1240
|
-
"rendering_slow_frame_percentage",
|
|
1241
|
-
"rendering_frozen_frame_percentage",
|
|
1242
|
-
"system_metrics_cpu_total_mean",
|
|
1243
|
-
"system_metrics_memory_device_mean",
|
|
1244
|
-
"rendering_metrics_fps_mean",
|
|
1245
|
-
"rendering_metrics_fps_minimum",
|
|
1246
|
-
"rendering_metrics_fps_maximum",
|
|
1247
|
-
"http_response_code"
|
|
1248
|
-
]).optional().describe("Field to sort by"),
|
|
1249
|
-
direction: toolInputParameters.direction,
|
|
1250
|
-
perPage: toolInputParameters.perPage,
|
|
1251
|
-
nextUrl: toolInputParameters.nextUrl,
|
|
1252
|
-
filters: toolInputParameters.performanceFilters
|
|
1253
|
-
});
|
|
1254
|
-
register(
|
|
1255
|
-
{
|
|
1256
|
-
title: "List Spans",
|
|
1257
|
-
summary: "Get individual spans belonging to a span group",
|
|
1258
|
-
purpose: "Examine individual operation instances within a span group",
|
|
1259
|
-
useCases: [
|
|
1260
|
-
"Analyze individual slow operations",
|
|
1261
|
-
"Debug performance issues by examining specific traces",
|
|
1262
|
-
"Find patterns in operation attributes"
|
|
1263
|
-
],
|
|
1264
|
-
inputSchema: listSpansInputSchema,
|
|
1265
|
-
examples: [
|
|
1266
|
-
{
|
|
1267
|
-
description: "Get slowest spans for an operation",
|
|
1268
|
-
parameters: {
|
|
1269
|
-
spanGroupId: "[HttpClient]GET-api.example.com",
|
|
1270
|
-
sort: "duration",
|
|
1271
|
-
direction: "desc",
|
|
1272
|
-
perPage: 10
|
|
1273
|
-
},
|
|
1274
|
-
expectedOutput: "Array of the 10 slowest span instances"
|
|
1275
|
-
},
|
|
1276
|
-
{
|
|
1277
|
-
description: "Get spans filtered by OS with pagination",
|
|
1278
|
-
parameters: {
|
|
1279
|
-
spanGroupId: "[HttpClient]GET-api.example.com",
|
|
1280
|
-
sort: "timestamp",
|
|
1281
|
-
filters: {
|
|
1282
|
-
"os.name": [{ type: "eq", value: "iOS" }]
|
|
1283
|
-
},
|
|
1284
|
-
nextUrl: "/projects/123/spans?offset=30&per_page=30"
|
|
1285
|
-
},
|
|
1286
|
-
expectedOutput: "Array of spans from iOS devices with next page navigation"
|
|
1287
|
-
}
|
|
1288
|
-
],
|
|
1289
|
-
hints: [
|
|
1290
|
-
"Sort by duration descending to find the slowest instances",
|
|
1291
|
-
"Each span includes trace ID for further investigation"
|
|
1292
|
-
]
|
|
1293
|
-
},
|
|
1294
|
-
async (args, _extra) => {
|
|
1295
|
-
const params = listSpansInputSchema.parse(args);
|
|
1296
|
-
const project = await this.getInputProject(params.projectId);
|
|
1297
|
-
const result = await this.projectApi.listSpansBySpanGroupId(
|
|
1298
|
-
project.id,
|
|
1299
|
-
params.spanGroupId,
|
|
1300
|
-
params.filters,
|
|
1301
|
-
params.sort,
|
|
1302
|
-
params.direction,
|
|
1303
|
-
params.perPage,
|
|
1304
|
-
params.nextUrl
|
|
1305
|
-
);
|
|
1306
|
-
return {
|
|
1307
|
-
content: [
|
|
1308
|
-
{
|
|
1309
|
-
type: "text",
|
|
1310
|
-
text: JSON.stringify({
|
|
1311
|
-
data: result.body,
|
|
1312
|
-
next_url: result.nextUrl,
|
|
1313
|
-
count: result.body?.length
|
|
1314
|
-
})
|
|
1315
|
-
}
|
|
1316
|
-
]
|
|
1317
|
-
};
|
|
1318
|
-
}
|
|
1319
|
-
);
|
|
1320
|
-
const getTraceInputSchema = z.object({
|
|
1321
|
-
projectId: toolInputParameters.projectId,
|
|
1322
|
-
traceId: z.string().describe("Trace ID"),
|
|
1323
|
-
from: z.string().describe("Start time (ISO 8601 format)"),
|
|
1324
|
-
to: z.string().describe("End time (ISO 8601 format)"),
|
|
1325
|
-
targetSpanId: z.string().optional().describe("Optional target span ID to focus on"),
|
|
1326
|
-
perPage: toolInputParameters.perPage,
|
|
1327
|
-
nextUrl: toolInputParameters.nextUrl
|
|
1328
|
-
});
|
|
1329
|
-
register(
|
|
1330
|
-
{
|
|
1331
|
-
title: "Get Trace",
|
|
1332
|
-
summary: "Get all spans within a specific trace",
|
|
1333
|
-
purpose: "View the complete trace of operations for a request/transaction",
|
|
1334
|
-
useCases: [
|
|
1335
|
-
"Debug slow requests by viewing all operations in the trace",
|
|
1336
|
-
"Understand the flow of a request through the system",
|
|
1337
|
-
"Identify bottlenecks in distributed systems"
|
|
1338
|
-
],
|
|
1339
|
-
inputSchema: getTraceInputSchema,
|
|
1340
|
-
examples: [
|
|
1341
|
-
{
|
|
1342
|
-
description: "Get all spans for a trace",
|
|
1343
|
-
parameters: {
|
|
1344
|
-
traceId: "abc123",
|
|
1345
|
-
from: "2024-01-01T00:00:00Z",
|
|
1346
|
-
to: "2024-01-01T23:59:59Z"
|
|
1347
|
-
},
|
|
1348
|
-
expectedOutput: "Array of all spans in the trace with timing and hierarchy"
|
|
1349
|
-
},
|
|
1350
|
-
{
|
|
1351
|
-
description: "Get spans for a trace with pagination and target span",
|
|
1352
|
-
parameters: {
|
|
1353
|
-
traceId: "def456",
|
|
1354
|
-
from: "2024-01-01T00:00:00Z",
|
|
1355
|
-
to: "2024-01-01T23:59:59Z",
|
|
1356
|
-
targetSpanId: "span-789",
|
|
1357
|
-
perPage: 50
|
|
1358
|
-
},
|
|
1359
|
-
expectedOutput: "Array of up to 50 spans focused around the target span"
|
|
1360
|
-
}
|
|
1361
|
-
],
|
|
1362
|
-
hints: [
|
|
1363
|
-
"Traces show the complete execution path of a request",
|
|
1364
|
-
"Use from/to parameters to narrow the time window",
|
|
1365
|
-
"targetSpanId can be used to focus on a specific span in the trace"
|
|
1366
|
-
]
|
|
1367
|
-
},
|
|
1368
|
-
async (args, _extra) => {
|
|
1369
|
-
const params = getTraceInputSchema.parse(args);
|
|
1370
|
-
const project = await this.getInputProject(params.projectId);
|
|
1371
|
-
if (!params.traceId || !params.from || !params.to) {
|
|
1372
|
-
throw new ToolError("traceId, from, and to are required");
|
|
1373
|
-
}
|
|
1374
|
-
const result = await this.projectApi.listSpansByTraceId(
|
|
1375
|
-
project.id,
|
|
1376
|
-
params.traceId,
|
|
1377
|
-
params.from,
|
|
1378
|
-
params.to,
|
|
1379
|
-
params.targetSpanId,
|
|
1380
|
-
params.perPage,
|
|
1381
|
-
params.nextUrl
|
|
1382
|
-
);
|
|
1383
|
-
return {
|
|
1384
|
-
content: [
|
|
1385
|
-
{
|
|
1386
|
-
type: "text",
|
|
1387
|
-
text: JSON.stringify({
|
|
1388
|
-
data: result.body,
|
|
1389
|
-
next_url: result.nextUrl,
|
|
1390
|
-
count: result.body?.length
|
|
1391
|
-
})
|
|
1392
|
-
}
|
|
1393
|
-
]
|
|
1394
|
-
};
|
|
1395
|
-
}
|
|
1396
|
-
);
|
|
1397
|
-
const listTraceFieldsInputSchema = z.object({
|
|
1398
|
-
projectId: toolInputParameters.projectId
|
|
1399
|
-
});
|
|
1400
|
-
register(
|
|
1401
|
-
{
|
|
1402
|
-
title: "List Trace Fields",
|
|
1403
|
-
summary: "Get available trace fields/attributes for filtering",
|
|
1404
|
-
purpose: "Discover what custom attributes are available for filtering",
|
|
1405
|
-
useCases: [
|
|
1406
|
-
"Find available custom attributes for performance filtering",
|
|
1407
|
-
"Understand what metadata is attached to traces",
|
|
1408
|
-
"Build dynamic filters based on available fields"
|
|
1409
|
-
],
|
|
1410
|
-
inputSchema: listTraceFieldsInputSchema,
|
|
1411
|
-
examples: [
|
|
1412
|
-
{
|
|
1413
|
-
description: "Get all trace fields",
|
|
1414
|
-
parameters: {},
|
|
1415
|
-
expectedOutput: "Array of field names and types available for filtering"
|
|
1416
|
-
}
|
|
1417
|
-
],
|
|
1418
|
-
hints: [
|
|
1419
|
-
"Trace fields are custom attributes added to spans",
|
|
1420
|
-
"Use these fields for filtering other performance queries"
|
|
1421
|
-
]
|
|
1422
|
-
},
|
|
1423
|
-
async (args, _extra) => {
|
|
1424
|
-
const params = listTraceFieldsInputSchema.parse(args);
|
|
1425
|
-
const project = await this.getInputProject(params.projectId);
|
|
1426
|
-
const traceFields = await this.getProjectTraceFields(project);
|
|
1427
|
-
return {
|
|
1428
|
-
content: [{ type: "text", text: JSON.stringify(traceFields) }]
|
|
1429
|
-
};
|
|
1430
|
-
}
|
|
1431
|
-
);
|
|
1432
|
-
const getNetworkGroupingInputSchema = z.object({
|
|
1433
|
-
projectId: toolInputParameters.projectId
|
|
1434
|
-
});
|
|
1435
|
-
register(
|
|
1436
|
-
{
|
|
1437
|
-
title: "Get Network Endpoint Groupings",
|
|
1438
|
-
summary: "Get the network endpoint grouping rules for a project",
|
|
1439
|
-
purpose: "Retrieve the URL patterns used to group network spans for performance monitoring",
|
|
1440
|
-
useCases: [
|
|
1441
|
-
"View current network endpoint grouping configuration",
|
|
1442
|
-
"Understand how network requests are being grouped in performance monitoring",
|
|
1443
|
-
"Check grouping patterns before making updates"
|
|
1444
|
-
],
|
|
1445
|
-
inputSchema: getNetworkGroupingInputSchema,
|
|
1446
|
-
examples: [
|
|
1447
|
-
{
|
|
1448
|
-
description: "Get network grouping rules for a project",
|
|
1449
|
-
parameters: {},
|
|
1450
|
-
expectedOutput: "Array of endpoint URL patterns"
|
|
1451
|
-
}
|
|
1452
|
-
],
|
|
1453
|
-
hints: [
|
|
1454
|
-
"Network grouping patterns help consolidate similar requests into single span groups",
|
|
1455
|
-
"Patterns use OpenAPI path templating syntax with curly braces for path parameters (e.g., /users/{userId})",
|
|
1456
|
-
"Wildcards (*) can be used in domains to match multiple subdomains (e.g., https://*.example.com)"
|
|
1457
|
-
],
|
|
1458
|
-
readOnly: true,
|
|
1459
|
-
idempotent: true
|
|
1460
|
-
},
|
|
1461
|
-
async (args, _extra) => {
|
|
1462
|
-
const params = getNetworkGroupingInputSchema.parse(args);
|
|
1463
|
-
const project = await this.getInputProject(params.projectId);
|
|
1464
|
-
const result = await this.projectApi.getProjectNetworkGroupingRuleset(
|
|
1465
|
-
project.id
|
|
1466
|
-
);
|
|
1467
|
-
return {
|
|
1468
|
-
content: [
|
|
1469
|
-
{ type: "text", text: JSON.stringify(result.body.endpoints || []) }
|
|
1470
|
-
]
|
|
1471
|
-
};
|
|
1472
|
-
}
|
|
1473
|
-
);
|
|
1474
|
-
const setNetworkGroupingInputSchema = z.object({
|
|
1475
|
-
projectId: toolInputParameters.projectId,
|
|
1476
|
-
endpoints: z.array(z.string()).describe(
|
|
1477
|
-
"Array of URL patterns by which network spans are grouped. Endpoints follow OpenAPI path templating syntax (https://swagger.io/specification/#path-templating) where path parameters use curly braces (e.g., /users/{id}). If you encounter colon-prefixed parameters (e.g., :userId from Express/React Router), convert them to curly braces (e.g., {userId}). Wildcards (*) can be used in domains (e.g., https://*.example.com) to match multiple subdomains."
|
|
1478
|
-
)
|
|
1479
|
-
});
|
|
1480
|
-
register(
|
|
1481
|
-
{
|
|
1482
|
-
title: "Set Network Endpoint Groupings",
|
|
1483
|
-
summary: "Set the network endpoint grouping rules for a project",
|
|
1484
|
-
purpose: "Configure URL patterns to control how network spans are grouped in performance monitoring",
|
|
1485
|
-
useCases: [
|
|
1486
|
-
"Consolidate similar API endpoints into single span groups",
|
|
1487
|
-
"Group dynamic URLs using path parameters (e.g., /api/users/{userId} groups /api/users/123, /api/users/456)",
|
|
1488
|
-
"Match multiple subdomains using wildcards (e.g., https://*.example.com groups api.example.com, cdn.example.com)",
|
|
1489
|
-
"Simplify performance monitoring by reducing span group clutter"
|
|
1490
|
-
],
|
|
1491
|
-
inputSchema: setNetworkGroupingInputSchema,
|
|
1492
|
-
examples: [
|
|
1493
|
-
{
|
|
1494
|
-
description: "Group API endpoints with path parameters",
|
|
1495
|
-
parameters: {
|
|
1496
|
-
endpoints: [
|
|
1497
|
-
"/api/users/{userId}",
|
|
1498
|
-
"/api/products/{productId}",
|
|
1499
|
-
"/api/orders/{orderId}/items/{itemId}"
|
|
1500
|
-
]
|
|
1501
|
-
},
|
|
1502
|
-
expectedOutput: "Success response confirming the update"
|
|
1503
|
-
},
|
|
1504
|
-
{
|
|
1505
|
-
description: "Group endpoints with domain wildcards and path parameters",
|
|
1506
|
-
parameters: {
|
|
1507
|
-
endpoints: [
|
|
1508
|
-
"https://*.example.com/api/v1/{resourceId}",
|
|
1509
|
-
"https://api.example.com/v2/users/{userId}",
|
|
1510
|
-
"/graphql"
|
|
1511
|
-
]
|
|
1512
|
-
},
|
|
1513
|
-
expectedOutput: "Success response confirming the update"
|
|
1514
|
-
},
|
|
1515
|
-
{
|
|
1516
|
-
description: "Convert colon-prefixed parameters to curly braces (e.g., from Express/React Router)",
|
|
1517
|
-
parameters: {
|
|
1518
|
-
endpoints: [
|
|
1519
|
-
"/{organizationSlug}/{projectSlug}/performance/view-load",
|
|
1520
|
-
"/api/{version}/items/{itemId}"
|
|
1521
|
-
]
|
|
1522
|
-
},
|
|
1523
|
-
expectedOutput: "Success response confirming the update"
|
|
1524
|
-
}
|
|
1525
|
-
],
|
|
1526
|
-
hints: [
|
|
1527
|
-
"Use Get Network Grouping first to see current patterns",
|
|
1528
|
-
"Use OpenAPI path templating with curly braces for path parameters: /users/{userId}, /orders/{orderId}/items/{itemId}",
|
|
1529
|
-
"Convert colon-prefixed parameters to curly braces: :organizationSlug becomes {organizationSlug}, :projectSlug becomes {projectSlug}",
|
|
1530
|
-
"Wildcards (*) can be used in domains to match subdomains: https://*.example.com/api",
|
|
1531
|
-
"This replaces all existing patterns - include all patterns you want to keep",
|
|
1532
|
-
"Well-designed patterns reduce noise in performance monitoring"
|
|
1533
|
-
],
|
|
1534
|
-
readOnly: false,
|
|
1535
|
-
idempotent: true
|
|
1536
|
-
},
|
|
1537
|
-
async (args, _extra) => {
|
|
1538
|
-
const params = setNetworkGroupingInputSchema.parse(args);
|
|
1539
|
-
const project = await this.getInputProject(params.projectId);
|
|
1540
|
-
const result = await this.projectApi.updateProjectNetworkGroupingRuleset(
|
|
1541
|
-
project.id,
|
|
1542
|
-
params.endpoints
|
|
1543
|
-
);
|
|
1544
|
-
return {
|
|
1545
|
-
content: [
|
|
1546
|
-
{
|
|
1547
|
-
type: "text",
|
|
1548
|
-
text: JSON.stringify({
|
|
1549
|
-
success: result.status === 200 || result.status === 204,
|
|
1550
|
-
projectId: project.id,
|
|
1551
|
-
endpoints: params.endpoints
|
|
1552
|
-
})
|
|
1553
|
-
}
|
|
1554
|
-
]
|
|
1555
|
-
};
|
|
1556
|
-
}
|
|
1557
|
-
);
|
|
267
|
+
const tools = [
|
|
268
|
+
new GetCurrentProject(this),
|
|
269
|
+
new ListProjects(this),
|
|
270
|
+
new ListProjectEventFilters(this),
|
|
271
|
+
new GetError(this),
|
|
272
|
+
new ListProjectErrors(this),
|
|
273
|
+
new UpdateError(this, getInput),
|
|
274
|
+
new GetEvent(this),
|
|
275
|
+
new GetEventDetailsFromDashboardUrl(this),
|
|
276
|
+
new ListReleases(this),
|
|
277
|
+
new GetRelease(this),
|
|
278
|
+
new GetBuild(this),
|
|
279
|
+
new ListSpanGroups(this),
|
|
280
|
+
new GetSpanGroup(this),
|
|
281
|
+
new ListSpans(this),
|
|
282
|
+
new GetTrace(this),
|
|
283
|
+
new ListTraceFields(this),
|
|
284
|
+
new GetNetworkEndpointGroupings(this),
|
|
285
|
+
new SetNetworkEndpointGroupings(this)
|
|
286
|
+
];
|
|
287
|
+
for (const tool of tools) {
|
|
288
|
+
register(tool.specification, tool.handle);
|
|
289
|
+
}
|
|
1558
290
|
}
|
|
1559
291
|
registerResources(register) {
|
|
1560
292
|
register("event", "{id}", async (uri, variables, _extra) => {
|