@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
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Tool } from "../../../common/tools.js";
|
|
3
|
+
import { toolInputParameters } from "../../input-schemas.js";
|
|
4
|
+
const inputSchema = z.object({
|
|
5
|
+
projectId: toolInputParameters.projectId,
|
|
6
|
+
spanGroupId: toolInputParameters.spanGroupId,
|
|
7
|
+
filters: toolInputParameters.performanceFilters
|
|
8
|
+
});
|
|
9
|
+
class GetSpanGroup extends Tool {
|
|
10
|
+
specification = {
|
|
11
|
+
title: "Get Span Group",
|
|
12
|
+
summary: "Get detailed performance metrics for a specific span group",
|
|
13
|
+
purpose: "Analyze performance characteristics of a specific operation",
|
|
14
|
+
useCases: [
|
|
15
|
+
"View detailed statistics (p50, p75, p90, p95, p99) for an operation",
|
|
16
|
+
"Check if performance targets are configured",
|
|
17
|
+
"Monitor span count to understand operation volume"
|
|
18
|
+
],
|
|
19
|
+
inputSchema,
|
|
20
|
+
examples: [
|
|
21
|
+
{
|
|
22
|
+
description: "Get details for an API endpoint span group",
|
|
23
|
+
parameters: { spanGroupId: "[HttpClient]GET-api.example.com" },
|
|
24
|
+
expectedOutput: "Statistics, category, and performance target info"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
description: "Get span group details with device filtering",
|
|
28
|
+
parameters: {
|
|
29
|
+
spanGroupId: "[HttpClient]GET-api.example.com",
|
|
30
|
+
filters: {
|
|
31
|
+
"device.browser_name": [{ type: "eq", value: "Chrome" }]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
expectedOutput: "Statistics filtered for Chrome browser only"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
hints: [
|
|
38
|
+
"Use List Span Groups first to discover available span group IDs",
|
|
39
|
+
"IDs are automatically URL-encoded - provide the raw ID",
|
|
40
|
+
"Statistics include p50, p75, p90, p95, p99 percentiles"
|
|
41
|
+
]
|
|
42
|
+
};
|
|
43
|
+
handle = async (args, _extra) => {
|
|
44
|
+
const params = inputSchema.parse(args);
|
|
45
|
+
const project = await this.client.getInputProject(params.projectId);
|
|
46
|
+
const spanGroupResults = await this.client.projectApi.getProjectSpanGroup(
|
|
47
|
+
project.id,
|
|
48
|
+
params.spanGroupId,
|
|
49
|
+
params.filters
|
|
50
|
+
);
|
|
51
|
+
const spanGroupTimelineResult = await this.client.projectApi.getProjectSpanGroupTimeline(
|
|
52
|
+
project.id,
|
|
53
|
+
params.spanGroupId,
|
|
54
|
+
params.filters
|
|
55
|
+
);
|
|
56
|
+
const spanGroupDistributionResult = await this.client.projectApi.getProjectSpanGroupDistribution(
|
|
57
|
+
project.id,
|
|
58
|
+
params.spanGroupId,
|
|
59
|
+
params.filters
|
|
60
|
+
);
|
|
61
|
+
const result = {
|
|
62
|
+
...spanGroupResults.body,
|
|
63
|
+
timeline: spanGroupTimelineResult.body,
|
|
64
|
+
distribution: spanGroupDistributionResult.body
|
|
65
|
+
};
|
|
66
|
+
return {
|
|
67
|
+
content: [{ type: "text", text: JSON.stringify(result) }]
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
GetSpanGroup
|
|
73
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Tool, ToolError } from "../../../common/tools.js";
|
|
3
|
+
import { toolInputParameters } from "../../input-schemas.js";
|
|
4
|
+
const inputSchema = z.object({
|
|
5
|
+
projectId: toolInputParameters.projectId,
|
|
6
|
+
traceId: z.string().describe("Trace ID"),
|
|
7
|
+
from: z.string().describe("Start time (ISO 8601 format)"),
|
|
8
|
+
to: z.string().describe("End time (ISO 8601 format)"),
|
|
9
|
+
targetSpanId: z.string().optional().describe("Optional target span ID to focus on"),
|
|
10
|
+
perPage: toolInputParameters.perPage,
|
|
11
|
+
nextUrl: toolInputParameters.nextUrl
|
|
12
|
+
});
|
|
13
|
+
class GetTrace extends Tool {
|
|
14
|
+
specification = {
|
|
15
|
+
title: "Get Trace",
|
|
16
|
+
summary: "Get all spans within a specific trace",
|
|
17
|
+
purpose: "View the complete trace of operations for a request/transaction",
|
|
18
|
+
useCases: [
|
|
19
|
+
"Debug slow requests by viewing all operations in the trace",
|
|
20
|
+
"Understand the flow of a request through the system",
|
|
21
|
+
"Identify bottlenecks in distributed systems"
|
|
22
|
+
],
|
|
23
|
+
inputSchema,
|
|
24
|
+
examples: [
|
|
25
|
+
{
|
|
26
|
+
description: "Get all spans for a trace",
|
|
27
|
+
parameters: {
|
|
28
|
+
traceId: "abc123",
|
|
29
|
+
from: "2024-01-01T00:00:00Z",
|
|
30
|
+
to: "2024-01-01T23:59:59Z"
|
|
31
|
+
},
|
|
32
|
+
expectedOutput: "Array of all spans in the trace with timing and hierarchy"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
description: "Get spans for a trace with pagination and target span",
|
|
36
|
+
parameters: {
|
|
37
|
+
traceId: "def456",
|
|
38
|
+
from: "2024-01-01T00:00:00Z",
|
|
39
|
+
to: "2024-01-01T23:59:59Z",
|
|
40
|
+
targetSpanId: "span-789",
|
|
41
|
+
perPage: 50
|
|
42
|
+
},
|
|
43
|
+
expectedOutput: "Array of up to 50 spans focused around the target span"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
hints: [
|
|
47
|
+
"Traces show the complete execution path of a request",
|
|
48
|
+
"Use from/to parameters to narrow the time window",
|
|
49
|
+
"targetSpanId can be used to focus on a specific span in the trace"
|
|
50
|
+
]
|
|
51
|
+
};
|
|
52
|
+
handle = async (args, _extra) => {
|
|
53
|
+
const params = inputSchema.parse(args);
|
|
54
|
+
const project = await this.client.getInputProject(params.projectId);
|
|
55
|
+
if (!params.traceId || !params.from || !params.to) {
|
|
56
|
+
throw new ToolError("traceId, from, and to are required");
|
|
57
|
+
}
|
|
58
|
+
const result = await this.client.projectApi.listSpansByTraceId(
|
|
59
|
+
project.id,
|
|
60
|
+
params.traceId,
|
|
61
|
+
params.from,
|
|
62
|
+
params.to,
|
|
63
|
+
params.targetSpanId,
|
|
64
|
+
params.perPage,
|
|
65
|
+
params.nextUrl
|
|
66
|
+
);
|
|
67
|
+
return {
|
|
68
|
+
content: [
|
|
69
|
+
{
|
|
70
|
+
type: "text",
|
|
71
|
+
text: JSON.stringify({
|
|
72
|
+
data: result.body,
|
|
73
|
+
next_url: result.nextUrl,
|
|
74
|
+
count: result.body?.length
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export {
|
|
82
|
+
GetTrace
|
|
83
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Tool } from "../../../common/tools.js";
|
|
3
|
+
import { toolInputParameters } from "../../input-schemas.js";
|
|
4
|
+
const inputSchema = z.object({
|
|
5
|
+
projectId: toolInputParameters.projectId,
|
|
6
|
+
sort: z.enum([
|
|
7
|
+
"total_spans",
|
|
8
|
+
"last_seen",
|
|
9
|
+
"name",
|
|
10
|
+
"display_name",
|
|
11
|
+
"network_http_method",
|
|
12
|
+
"rendering_slow_frame_span_percentage",
|
|
13
|
+
"rendering_frozen_frame_span_percentage",
|
|
14
|
+
"duration_p50",
|
|
15
|
+
"duration_p75",
|
|
16
|
+
"duration_p90",
|
|
17
|
+
"duration_p95",
|
|
18
|
+
"duration_p99",
|
|
19
|
+
"system_metrics_cpu_total_mean_p50",
|
|
20
|
+
"system_metrics_cpu_total_mean_p75",
|
|
21
|
+
"system_metrics_cpu_total_mean_p90",
|
|
22
|
+
"system_metrics_cpu_total_mean_p95",
|
|
23
|
+
"system_metrics_cpu_total_mean_p99",
|
|
24
|
+
"system_metrics_memory_device_mean_p50",
|
|
25
|
+
"system_metrics_memory_device_mean_p75",
|
|
26
|
+
"system_metrics_memory_device_mean_p90",
|
|
27
|
+
"system_metrics_memory_device_mean_p95",
|
|
28
|
+
"system_metrics_memory_device_mean_p99",
|
|
29
|
+
"rendering_metrics_fps_mean_p50",
|
|
30
|
+
"rendering_metrics_fps_mean_p75",
|
|
31
|
+
"rendering_metrics_fps_mean_p90",
|
|
32
|
+
"rendering_metrics_fps_mean_p95",
|
|
33
|
+
"rendering_metrics_fps_mean_p99",
|
|
34
|
+
"http_response_4xx_percentage",
|
|
35
|
+
"http_response_5xx_percentage"
|
|
36
|
+
]).optional().describe("Field to sort by"),
|
|
37
|
+
direction: toolInputParameters.direction,
|
|
38
|
+
perPage: toolInputParameters.perPage,
|
|
39
|
+
starredOnly: z.boolean().optional().describe("Show only starred span groups"),
|
|
40
|
+
nextUrl: toolInputParameters.nextUrl,
|
|
41
|
+
filters: toolInputParameters.performanceFilters
|
|
42
|
+
});
|
|
43
|
+
class ListSpanGroups extends Tool {
|
|
44
|
+
specification = {
|
|
45
|
+
title: "List Span Groups",
|
|
46
|
+
summary: "List span groups (operations) tracked for performance monitoring",
|
|
47
|
+
purpose: "Discover and analyze different operations being monitored",
|
|
48
|
+
useCases: [
|
|
49
|
+
"View all operations being tracked for performance",
|
|
50
|
+
"Find slow operations by sorting by duration metrics",
|
|
51
|
+
"Filter to starred/important span groups"
|
|
52
|
+
],
|
|
53
|
+
inputSchema,
|
|
54
|
+
examples: [
|
|
55
|
+
{
|
|
56
|
+
description: "List slowest operations",
|
|
57
|
+
parameters: {
|
|
58
|
+
sort: "duration_p95",
|
|
59
|
+
direction: "desc",
|
|
60
|
+
perPage: 10
|
|
61
|
+
},
|
|
62
|
+
expectedOutput: "Array of span groups sorted by 95th percentile duration"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
description: "List starred span groups with filtering",
|
|
66
|
+
parameters: {
|
|
67
|
+
starredOnly: true,
|
|
68
|
+
filters: {
|
|
69
|
+
"span_group.category": [{ type: "eq", value: "full_page_load" }]
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
expectedOutput: "Array of starred span groups filtered by category"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
hints: [
|
|
76
|
+
"Span groups represent different operation types (page loads, API calls, etc.)",
|
|
77
|
+
"Use sort by duration_p95 or duration_p99 to find the slowest operations",
|
|
78
|
+
"Star important span groups for quick access",
|
|
79
|
+
"Use nextUrl for pagination"
|
|
80
|
+
]
|
|
81
|
+
};
|
|
82
|
+
handle = async (args, _extra) => {
|
|
83
|
+
const params = inputSchema.parse(args);
|
|
84
|
+
const project = await this.client.getInputProject(params.projectId);
|
|
85
|
+
const result = await this.client.projectApi.listProjectSpanGroups(
|
|
86
|
+
project.id,
|
|
87
|
+
params.sort,
|
|
88
|
+
params.direction,
|
|
89
|
+
params.perPage,
|
|
90
|
+
void 0,
|
|
91
|
+
params.filters,
|
|
92
|
+
params.starredOnly,
|
|
93
|
+
params.nextUrl
|
|
94
|
+
);
|
|
95
|
+
return {
|
|
96
|
+
content: [
|
|
97
|
+
{
|
|
98
|
+
type: "text",
|
|
99
|
+
text: JSON.stringify({
|
|
100
|
+
data: result.body,
|
|
101
|
+
next_url: result.nextUrl,
|
|
102
|
+
count: result.body?.length
|
|
103
|
+
})
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export {
|
|
110
|
+
ListSpanGroups
|
|
111
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Tool } from "../../../common/tools.js";
|
|
3
|
+
import { toolInputParameters } from "../../input-schemas.js";
|
|
4
|
+
const inputSchema = z.object({
|
|
5
|
+
projectId: toolInputParameters.projectId,
|
|
6
|
+
spanGroupId: toolInputParameters.spanGroupId,
|
|
7
|
+
sort: z.enum([
|
|
8
|
+
"duration",
|
|
9
|
+
"timestamp",
|
|
10
|
+
"full_page_load_lcp",
|
|
11
|
+
"full_page_load_fid",
|
|
12
|
+
"full_page_load_cls",
|
|
13
|
+
"full_page_load_ttfb",
|
|
14
|
+
"full_page_load_fcp",
|
|
15
|
+
"rendering_slow_frame_percentage",
|
|
16
|
+
"rendering_frozen_frame_percentage",
|
|
17
|
+
"system_metrics_cpu_total_mean",
|
|
18
|
+
"system_metrics_memory_device_mean",
|
|
19
|
+
"rendering_metrics_fps_mean",
|
|
20
|
+
"rendering_metrics_fps_minimum",
|
|
21
|
+
"rendering_metrics_fps_maximum",
|
|
22
|
+
"http_response_code"
|
|
23
|
+
]).optional().describe("Field to sort by"),
|
|
24
|
+
direction: toolInputParameters.direction,
|
|
25
|
+
perPage: toolInputParameters.perPage,
|
|
26
|
+
nextUrl: toolInputParameters.nextUrl,
|
|
27
|
+
filters: toolInputParameters.performanceFilters
|
|
28
|
+
});
|
|
29
|
+
class ListSpans extends Tool {
|
|
30
|
+
specification = {
|
|
31
|
+
title: "List Spans",
|
|
32
|
+
summary: "Get individual spans belonging to a span group",
|
|
33
|
+
purpose: "Examine individual operation instances within a span group",
|
|
34
|
+
useCases: [
|
|
35
|
+
"Analyze individual slow operations",
|
|
36
|
+
"Debug performance issues by examining specific traces",
|
|
37
|
+
"Find patterns in operation attributes"
|
|
38
|
+
],
|
|
39
|
+
inputSchema,
|
|
40
|
+
examples: [
|
|
41
|
+
{
|
|
42
|
+
description: "Get slowest spans for an operation",
|
|
43
|
+
parameters: {
|
|
44
|
+
spanGroupId: "[HttpClient]GET-api.example.com",
|
|
45
|
+
sort: "duration",
|
|
46
|
+
direction: "desc",
|
|
47
|
+
perPage: 10
|
|
48
|
+
},
|
|
49
|
+
expectedOutput: "Array of the 10 slowest span instances"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
description: "Get spans filtered by OS with pagination",
|
|
53
|
+
parameters: {
|
|
54
|
+
spanGroupId: "[HttpClient]GET-api.example.com",
|
|
55
|
+
sort: "timestamp",
|
|
56
|
+
filters: {
|
|
57
|
+
"os.name": [{ type: "eq", value: "iOS" }]
|
|
58
|
+
},
|
|
59
|
+
nextUrl: "/projects/123/spans?offset=30&per_page=30"
|
|
60
|
+
},
|
|
61
|
+
expectedOutput: "Array of spans from iOS devices with next page navigation"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
hints: [
|
|
65
|
+
"Sort by duration descending to find the slowest instances",
|
|
66
|
+
"Each span includes trace ID for further investigation"
|
|
67
|
+
]
|
|
68
|
+
};
|
|
69
|
+
handle = async (args, _extra) => {
|
|
70
|
+
const params = inputSchema.parse(args);
|
|
71
|
+
const project = await this.client.getInputProject(params.projectId);
|
|
72
|
+
const result = await this.client.projectApi.listSpansBySpanGroupId(
|
|
73
|
+
project.id,
|
|
74
|
+
params.spanGroupId,
|
|
75
|
+
params.filters,
|
|
76
|
+
params.sort,
|
|
77
|
+
params.direction,
|
|
78
|
+
params.perPage,
|
|
79
|
+
params.nextUrl
|
|
80
|
+
);
|
|
81
|
+
return {
|
|
82
|
+
content: [
|
|
83
|
+
{
|
|
84
|
+
type: "text",
|
|
85
|
+
text: JSON.stringify({
|
|
86
|
+
data: result.body,
|
|
87
|
+
next_url: result.nextUrl,
|
|
88
|
+
count: result.body?.length
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
ListSpans
|
|
97
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Tool } from "../../../common/tools.js";
|
|
3
|
+
import { toolInputParameters } from "../../input-schemas.js";
|
|
4
|
+
const inputSchema = z.object({
|
|
5
|
+
projectId: toolInputParameters.projectId
|
|
6
|
+
});
|
|
7
|
+
class ListTraceFields extends Tool {
|
|
8
|
+
specification = {
|
|
9
|
+
title: "List Trace Fields",
|
|
10
|
+
summary: "Get available trace fields/attributes for filtering",
|
|
11
|
+
purpose: "Discover what custom attributes are available for filtering",
|
|
12
|
+
useCases: [
|
|
13
|
+
"Find available custom attributes for performance filtering",
|
|
14
|
+
"Understand what metadata is attached to traces",
|
|
15
|
+
"Build dynamic filters based on available fields"
|
|
16
|
+
],
|
|
17
|
+
inputSchema,
|
|
18
|
+
examples: [
|
|
19
|
+
{
|
|
20
|
+
description: "Get all trace fields",
|
|
21
|
+
parameters: {},
|
|
22
|
+
expectedOutput: "Array of field names and types available for filtering"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
hints: [
|
|
26
|
+
"Trace fields are custom attributes added to spans",
|
|
27
|
+
"Use these fields for filtering other performance queries"
|
|
28
|
+
]
|
|
29
|
+
};
|
|
30
|
+
handle = async (args, _extra) => {
|
|
31
|
+
const params = inputSchema.parse(args);
|
|
32
|
+
const project = await this.client.getInputProject(params.projectId);
|
|
33
|
+
const traceFields = await this.client.getProjectTraceFields(project);
|
|
34
|
+
return {
|
|
35
|
+
content: [{ type: "text", text: JSON.stringify(traceFields) }]
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
ListTraceFields
|
|
41
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Tool } from "../../../common/tools.js";
|
|
3
|
+
import { toolInputParameters } from "../../input-schemas.js";
|
|
4
|
+
const inputSchema = z.object({
|
|
5
|
+
projectId: toolInputParameters.projectId,
|
|
6
|
+
endpoints: z.array(z.string()).describe(
|
|
7
|
+
"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."
|
|
8
|
+
)
|
|
9
|
+
});
|
|
10
|
+
class SetNetworkEndpointGroupings extends Tool {
|
|
11
|
+
specification = {
|
|
12
|
+
title: "Set Network Endpoint Groupings",
|
|
13
|
+
summary: "Set the network endpoint grouping rules for a project",
|
|
14
|
+
purpose: "Configure URL patterns to control how network spans are grouped in performance monitoring",
|
|
15
|
+
useCases: [
|
|
16
|
+
"Consolidate similar API endpoints into single span groups",
|
|
17
|
+
"Group dynamic URLs using path parameters (e.g., /api/users/{userId} groups /api/users/123, /api/users/456)",
|
|
18
|
+
"Match multiple subdomains using wildcards (e.g., https://*.example.com groups api.example.com, cdn.example.com)",
|
|
19
|
+
"Simplify performance monitoring by reducing span group clutter"
|
|
20
|
+
],
|
|
21
|
+
inputSchema,
|
|
22
|
+
examples: [
|
|
23
|
+
{
|
|
24
|
+
description: "Group API endpoints with path parameters",
|
|
25
|
+
parameters: {
|
|
26
|
+
endpoints: [
|
|
27
|
+
"/api/users/{userId}",
|
|
28
|
+
"/api/products/{productId}",
|
|
29
|
+
"/api/orders/{orderId}/items/{itemId}"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
expectedOutput: "Success response confirming the update"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
description: "Group endpoints with domain wildcards and path parameters",
|
|
36
|
+
parameters: {
|
|
37
|
+
endpoints: [
|
|
38
|
+
"https://*.example.com/api/v1/{resourceId}",
|
|
39
|
+
"https://api.example.com/v2/users/{userId}",
|
|
40
|
+
"/graphql"
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
expectedOutput: "Success response confirming the update"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
description: "Convert colon-prefixed parameters to curly braces (e.g., from Express/React Router)",
|
|
47
|
+
parameters: {
|
|
48
|
+
endpoints: [
|
|
49
|
+
"/{organizationSlug}/{projectSlug}/performance/view-load",
|
|
50
|
+
"/api/{version}/items/{itemId}"
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
expectedOutput: "Success response confirming the update"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
hints: [
|
|
57
|
+
"Use Get Network Grouping first to see current patterns",
|
|
58
|
+
"Use OpenAPI path templating with curly braces for path parameters: /users/{userId}, /orders/{orderId}/items/{itemId}",
|
|
59
|
+
"Convert colon-prefixed parameters to curly braces: :organizationSlug becomes {organizationSlug}, :projectSlug becomes {projectSlug}",
|
|
60
|
+
"Wildcards (*) can be used in domains to match subdomains: https://*.example.com/api",
|
|
61
|
+
"This replaces all existing patterns - include all patterns you want to keep",
|
|
62
|
+
"Well-designed patterns reduce noise in performance monitoring"
|
|
63
|
+
],
|
|
64
|
+
readOnly: false,
|
|
65
|
+
idempotent: true
|
|
66
|
+
};
|
|
67
|
+
handle = async (args, _extra) => {
|
|
68
|
+
const params = inputSchema.parse(args);
|
|
69
|
+
const project = await this.client.getInputProject(params.projectId);
|
|
70
|
+
const result = await this.client.projectApi.updateProjectNetworkGroupingRuleset(
|
|
71
|
+
project.id,
|
|
72
|
+
params.endpoints
|
|
73
|
+
);
|
|
74
|
+
return {
|
|
75
|
+
content: [
|
|
76
|
+
{
|
|
77
|
+
type: "text",
|
|
78
|
+
text: JSON.stringify({
|
|
79
|
+
success: result.status === 200 || result.status === 204,
|
|
80
|
+
projectId: project.id,
|
|
81
|
+
endpoints: params.endpoints
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
SetNetworkEndpointGroupings
|
|
90
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Tool, ToolError } from "../../../common/tools.js";
|
|
2
|
+
import { toolInputParameters } from "../../input-schemas.js";
|
|
3
|
+
class GetCurrentProject extends Tool {
|
|
4
|
+
specification = {
|
|
5
|
+
title: "Get Current Project",
|
|
6
|
+
summary: "Retrieve the 'current' project on which tools should operate by default. This allows BugSnag tools to be called with no projectId parameter.",
|
|
7
|
+
purpose: "Gets information about the 'current' BugSnag project, including ID and API key",
|
|
8
|
+
useCases: ["Understand if a current project has been set"],
|
|
9
|
+
inputSchema: toolInputParameters.empty,
|
|
10
|
+
hints: [
|
|
11
|
+
"If a project is returned, it can be assumed that the user expects interactions with BugSnag tools to refer to this project",
|
|
12
|
+
"If this tool returns no current project then other BugSnag tools will require an explicit project ID parameter",
|
|
13
|
+
"Call the List Projects tool to see all projects that the user has access to. Get the project ID from this list either by asking the user for the project name or slug",
|
|
14
|
+
"You might find a BugSnag API key in the user's code where they configure the BugSnag SDK that can be matched to a project 'apiKey' field from the project list"
|
|
15
|
+
]
|
|
16
|
+
};
|
|
17
|
+
handle = async (_args, _extra) => {
|
|
18
|
+
const project = await this.client.getCurrentProject();
|
|
19
|
+
if (!project) {
|
|
20
|
+
throw new ToolError(
|
|
21
|
+
"No current project is configured in the MCP server - use List Projects to see the available projects and use the project ID as a parameter to other BugSnag tools. You can ask the user to select the project based on the name or slug, or use the apiKey field and see if there's a BugSnag API key set in the user's code when they configure the BugSnag SDK"
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
content: [{ type: "text", text: JSON.stringify(project) }]
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
GetCurrentProject
|
|
31
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Tool } from "../../../common/tools.js";
|
|
3
|
+
import { toolInputParameters } from "../../input-schemas.js";
|
|
4
|
+
const inputSchema = z.object({
|
|
5
|
+
projectId: toolInputParameters.projectId
|
|
6
|
+
});
|
|
7
|
+
class ListProjectEventFilters extends Tool {
|
|
8
|
+
specification = {
|
|
9
|
+
title: "List Project Event Filters",
|
|
10
|
+
summary: "Get available event filter fields for a project",
|
|
11
|
+
purpose: "Discover valid filter field names and options that can be used with the List Errors or Get Error tools",
|
|
12
|
+
useCases: [
|
|
13
|
+
"Discover what filter fields are available before searching for errors",
|
|
14
|
+
"Find the correct field names for filtering by user, environment, or custom metadata",
|
|
15
|
+
"Understand filter options and data types for building complex queries"
|
|
16
|
+
],
|
|
17
|
+
inputSchema,
|
|
18
|
+
examples: [
|
|
19
|
+
{
|
|
20
|
+
description: "Get all available filter fields",
|
|
21
|
+
parameters: {},
|
|
22
|
+
expectedOutput: "JSON array of EventField objects containing display_id, custom flag, and filter/pivot options"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
hints: [
|
|
26
|
+
"Use this tool before the List Errors or Get Error tools to understand available filters",
|
|
27
|
+
"Look for display_id field in the response - these are the field names to use in filters"
|
|
28
|
+
]
|
|
29
|
+
};
|
|
30
|
+
handle = async (args, _extra) => {
|
|
31
|
+
const params = inputSchema.parse(args);
|
|
32
|
+
const eventFilters = await this.client.getProjectEventFields(
|
|
33
|
+
await this.client.getInputProject(params.projectId)
|
|
34
|
+
);
|
|
35
|
+
return {
|
|
36
|
+
content: [{ type: "text", text: JSON.stringify(eventFilters) }]
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
ListProjectEventFilters
|
|
42
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Tool, ToolError } from "../../../common/tools.js";
|
|
3
|
+
const inputSchema = z.object({
|
|
4
|
+
apiKey: z.string().optional().describe("The API key of the BugSnag project, if known.")
|
|
5
|
+
});
|
|
6
|
+
class ListProjects extends Tool {
|
|
7
|
+
specification = {
|
|
8
|
+
title: "List Projects",
|
|
9
|
+
summary: "List all projects in the organization that the current user has access to, or find a project matching an API key.",
|
|
10
|
+
purpose: "Retrieve available projects for browsing and selecting which project to analyze.",
|
|
11
|
+
useCases: [
|
|
12
|
+
"Get an overview of all projects in the organization",
|
|
13
|
+
"Locate a project by its API key if known from the user's code"
|
|
14
|
+
],
|
|
15
|
+
inputSchema,
|
|
16
|
+
hints: [
|
|
17
|
+
"Project IDs from this list can be used with other tools when no project API key is configured"
|
|
18
|
+
]
|
|
19
|
+
};
|
|
20
|
+
handle = async (args, _extra) => {
|
|
21
|
+
const params = inputSchema.parse(args);
|
|
22
|
+
let projects = await this.client.getProjects();
|
|
23
|
+
if (!projects || projects.length === 0) {
|
|
24
|
+
throw new ToolError("No BugSnag projects found for the current user.");
|
|
25
|
+
}
|
|
26
|
+
if (params.apiKey) {
|
|
27
|
+
const matchedProject = projects.find(
|
|
28
|
+
(p) => p.api_key === params.apiKey
|
|
29
|
+
);
|
|
30
|
+
projects = matchedProject ? [matchedProject] : [];
|
|
31
|
+
}
|
|
32
|
+
const content = {
|
|
33
|
+
data: projects,
|
|
34
|
+
count: projects.length
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
content: [{ type: "text", text: JSON.stringify(content) }]
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
ListProjects
|
|
43
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Tool, ToolError } from "../../../common/tools.js";
|
|
3
|
+
import { toolInputParameters } from "../../input-schemas.js";
|
|
4
|
+
const inputSchema = z.object({
|
|
5
|
+
projectId: toolInputParameters.projectId,
|
|
6
|
+
buildId: toolInputParameters.buildId
|
|
7
|
+
});
|
|
8
|
+
class GetBuild extends Tool {
|
|
9
|
+
specification = {
|
|
10
|
+
title: "Get Build",
|
|
11
|
+
summary: "Get more details for a specific build by its ID",
|
|
12
|
+
purpose: "Retrieve detailed information about a build for analysis and debugging",
|
|
13
|
+
useCases: [
|
|
14
|
+
"View build metadata such as version, source control info, and error counts",
|
|
15
|
+
"Analyze a specific build to correlate with error spikes or deployments",
|
|
16
|
+
"See the stability targets for a project and if the build meets them"
|
|
17
|
+
],
|
|
18
|
+
inputSchema,
|
|
19
|
+
examples: [
|
|
20
|
+
{
|
|
21
|
+
description: "Get details for a specific build",
|
|
22
|
+
parameters: {
|
|
23
|
+
buildId: "5f8d0d55c9e77c0017a1b2c3"
|
|
24
|
+
},
|
|
25
|
+
expectedOutput: "JSON object with build details including version, source control info, error counts and stability data."
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
hints: ["Build IDs can be found using the List builds tool"],
|
|
29
|
+
readOnly: true,
|
|
30
|
+
idempotent: true,
|
|
31
|
+
outputDescription: "JSON object containing build details along with stability metrics such as user and session stability, and whether it meets project targets"
|
|
32
|
+
};
|
|
33
|
+
handle = async (args, _extra) => {
|
|
34
|
+
const params = inputSchema.parse(args);
|
|
35
|
+
const project = await this.client.getInputProject(params.projectId);
|
|
36
|
+
const response = await this.client.projectApi.getProjectReleaseById(
|
|
37
|
+
project.id,
|
|
38
|
+
params.buildId
|
|
39
|
+
);
|
|
40
|
+
if (!response.body)
|
|
41
|
+
throw new ToolError(`No build for ${params.buildId} found.`);
|
|
42
|
+
const build = this.client.addStabilityData(response.body, project);
|
|
43
|
+
return {
|
|
44
|
+
content: [{ type: "text", text: JSON.stringify(build) }]
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
GetBuild
|
|
50
|
+
};
|