@sentry/mcp-server 0.30.0 → 0.31.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/auth/constants.cjs +9 -0
- package/dist/auth/constants.d.cts +31 -0
- package/dist/auth/constants.d.cts.map +1 -0
- package/dist/auth/constants.d.ts +31 -0
- package/dist/auth/constants.d.ts.map +1 -0
- package/dist/auth/constants.js +3 -0
- package/dist/auth/device-code-flow.cjs +10 -0
- package/dist/auth/device-code-flow.d.cts +34 -0
- package/dist/auth/device-code-flow.d.cts.map +1 -0
- package/dist/auth/device-code-flow.d.ts +34 -0
- package/dist/auth/device-code-flow.d.ts.map +1 -0
- package/dist/auth/device-code-flow.js +6 -0
- package/dist/auth/resolve-token.cjs +8 -0
- package/dist/auth/resolve-token.d.cts +17 -0
- package/dist/auth/resolve-token.d.cts.map +1 -0
- package/dist/auth/resolve-token.d.ts +17 -0
- package/dist/auth/resolve-token.d.ts.map +1 -0
- package/dist/auth/resolve-token.js +8 -0
- package/dist/auth/token-cache.cjs +5 -0
- package/dist/auth/token-cache.d.cts +11 -0
- package/dist/auth/token-cache.d.cts.map +1 -0
- package/dist/auth/token-cache.d.ts +11 -0
- package/dist/auth/token-cache.d.ts.map +1 -0
- package/dist/auth/token-cache.js +3 -0
- package/dist/auth/types.cjs +6 -0
- package/dist/auth/types.d.cts +2 -0
- package/dist/auth/types.d.ts +2 -0
- package/dist/auth/types.js +3 -0
- package/dist/auth-BIb4PBnL.js +79 -0
- package/dist/auth-BIb4PBnL.js.map +1 -0
- package/dist/auth-BK5LL8QY.cjs +90 -0
- package/dist/auth-BK5LL8QY.cjs.map +1 -0
- package/dist/cli/commands/auth.cjs +11 -0
- package/dist/cli/commands/auth.d.cts +8 -0
- package/dist/cli/commands/auth.d.cts.map +1 -0
- package/dist/cli/commands/auth.d.ts +8 -0
- package/dist/cli/commands/auth.d.ts.map +1 -0
- package/dist/cli/commands/auth.js +10 -0
- package/dist/cli/parse.cjs +1 -1
- package/dist/cli/parse.d.cts +1 -1
- package/dist/cli/parse.d.cts.map +1 -1
- package/dist/cli/parse.d.ts +1 -1
- package/dist/cli/parse.d.ts.map +1 -1
- package/dist/cli/parse.js +1 -1
- package/dist/cli/resolve.cjs +4 -2
- package/dist/cli/resolve.d.cts +9 -3
- package/dist/cli/resolve.d.cts.map +1 -1
- package/dist/cli/resolve.d.ts +9 -3
- package/dist/cli/resolve.d.ts.map +1 -1
- package/dist/cli/resolve.js +3 -2
- package/dist/cli/types.d.cts +2 -2
- package/dist/cli/types.d.ts +2 -2
- package/dist/cli/usage.cjs +1 -1
- package/dist/cli/usage.js +1 -1
- package/dist/{config-NKdlAxBc.js → config--FiEKpQR.js} +1 -1
- package/dist/{config-BYPjNBPX-CdPOenPb.js → config-BYPjNBPX-7d8TAxBc.js} +1 -1
- package/dist/{config-BYPjNBPX-CdPOenPb.js.map → config-BYPjNBPX-7d8TAxBc.js.map} +1 -1
- package/dist/{config-BYPjNBPX-CxPh7iM8.cjs → config-BYPjNBPX-Bqwc8iZW.cjs} +1 -1
- package/dist/{config-BYPjNBPX-CxPh7iM8.cjs.map → config-BYPjNBPX-Bqwc8iZW.cjs.map} +1 -1
- package/dist/{config-CLW41PUq.cjs → config-DU03TDiU.cjs} +1 -1
- package/dist/{resolve-Ci97NUwJ.js → constants-Ciwj7kb9.js} +30 -121
- package/dist/constants-Ciwj7kb9.js.map +1 -0
- package/dist/{resolve-CxQZsYhh.cjs → constants-DmV1Benp.cjs} +65 -132
- package/dist/constants-DmV1Benp.cjs.map +1 -0
- package/dist/device-code-flow-CpGZ3Eqv.cjs +154 -0
- package/dist/device-code-flow-CpGZ3Eqv.cjs.map +1 -0
- package/dist/device-code-flow-DmgeS5QN.js +124 -0
- package/dist/device-code-flow-DmgeS5QN.js.map +1 -0
- package/dist/index.cjs +876 -690
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +865 -679
- package/dist/index.js.map +1 -1
- package/dist/{parse-c8rvP4YQ.js → parse-BC0czE2L.js} +3 -1
- package/dist/{parse-c8rvP4YQ.js.map → parse-BC0czE2L.js.map} +1 -1
- package/dist/{parse-C6k7VZkG.cjs → parse-CBlXTQfk.cjs} +3 -1
- package/dist/{parse-C6k7VZkG.cjs.map → parse-CBlXTQfk.cjs.map} +1 -1
- package/dist/resolve-BfYJ9Cqy.cjs +168 -0
- package/dist/resolve-BfYJ9Cqy.cjs.map +1 -0
- package/dist/resolve-D0W2gbu8.js +133 -0
- package/dist/resolve-D0W2gbu8.js.map +1 -0
- package/dist/resolve-token-C2eTEtoo.cjs +52 -0
- package/dist/resolve-token-C2eTEtoo.cjs.map +1 -0
- package/dist/resolve-token-pfPBO9EK.js +47 -0
- package/dist/resolve-token-pfPBO9EK.js.map +1 -0
- package/dist/{stdio-BlFtz2dW.cjs → stdio-B08zZS4X.cjs} +3 -19
- package/dist/stdio-B08zZS4X.cjs.map +1 -0
- package/dist/{stdio-D7HAkmRe.js → stdio-CUhyR_jH.js} +3 -7
- package/dist/stdio-CUhyR_jH.js.map +1 -0
- package/dist/{token-CwkkxgwR.js → token-D7eiINbV.js} +2 -2
- package/dist/{token-CwkkxgwR.js.map → token-D7eiINbV.js.map} +1 -1
- package/dist/{token-C7V4_3ji.cjs → token-Dx4qrxlx.cjs} +3 -3
- package/dist/{token-C7V4_3ji.cjs.map → token-Dx4qrxlx.cjs.map} +1 -1
- package/dist/token-cache-BTEUyVx2.js +66 -0
- package/dist/token-cache-BTEUyVx2.js.map +1 -0
- package/dist/token-cache-iqkTOca3.cjs +84 -0
- package/dist/token-cache-iqkTOca3.cjs.map +1 -0
- package/dist/{token-error-BCFB3iKM.cjs → token-error-x_miDBP3.cjs} +1 -1
- package/dist/{token-error-BCFB3iKM.cjs.map → token-error-x_miDBP3.cjs.map} +1 -1
- package/dist/{token-util-D5kD3Z8e.js → token-util-DtX1UM9f.js} +1 -1
- package/dist/{token-util-CQ4Ghf_7.js → token-util-VkLmCUNV.js} +1 -1
- package/dist/{token-util-CQ4Ghf_7.js.map → token-util-VkLmCUNV.js.map} +1 -1
- package/dist/{token-util-8fvl2CtH.cjs → token-util-bEa_1v46.cjs} +2 -2
- package/dist/{token-util-CMaRPlqM.cjs → token-util-oe0G9a-s.cjs} +2 -2
- package/dist/{token-util-CMaRPlqM.cjs.map → token-util-oe0G9a-s.cjs.map} +1 -1
- package/dist/transports/stdio.cjs +2 -1
- package/dist/transports/stdio.js +2 -1
- package/dist/types-BN426G4g.d.ts +111 -0
- package/dist/types-BN426G4g.d.ts.map +1 -0
- package/dist/types-C8FoyqMN.js +54 -0
- package/dist/types-C8FoyqMN.js.map +1 -0
- package/dist/{types-C0DSLPbp.d.cts → types-CX4uOY82.d.ts} +14 -4
- package/dist/types-CX4uOY82.d.ts.map +1 -0
- package/dist/types-ClEPUb_D.d.cts +111 -0
- package/dist/types-ClEPUb_D.d.cts.map +1 -0
- package/dist/{types-BZvFOe59.d.ts → types-rlmLVpNO.d.cts} +14 -4
- package/dist/types-rlmLVpNO.d.cts.map +1 -0
- package/dist/types-xUmfecYm.cjs +78 -0
- package/dist/types-xUmfecYm.cjs.map +1 -0
- package/dist/{usage-BRTpzFg9.js → usage-DB-MGezA.js} +14 -4
- package/dist/usage-DB-MGezA.js.map +1 -0
- package/dist/{usage-DAChHAia.cjs → usage-DRK6TiDr.cjs} +14 -4
- package/dist/usage-DRK6TiDr.cjs.map +1 -0
- package/dist/version-CYYpU4RZ.js +7 -0
- package/dist/version-CYYpU4RZ.js.map +1 -0
- package/dist/version-Ca7qUBih.cjs +19 -0
- package/dist/version-Ca7qUBih.cjs.map +1 -0
- package/package.json +4 -4
- package/dist/resolve-Ci97NUwJ.js.map +0 -1
- package/dist/resolve-CxQZsYhh.cjs.map +0 -1
- package/dist/stdio-BlFtz2dW.cjs.map +0 -1
- package/dist/stdio-D7HAkmRe.js.map +0 -1
- package/dist/types-BZvFOe59.d.ts.map +0 -1
- package/dist/types-C0DSLPbp.d.cts.map +0 -1
- package/dist/usage-BRTpzFg9.js.map +0 -1
- package/dist/usage-DAChHAia.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const require_chunk = require('./chunk-Cv9WC9bY.cjs');
|
|
3
|
-
const require_resolve = require('./resolve-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
3
|
+
const require_resolve = require('./resolve-BfYJ9Cqy.cjs');
|
|
4
|
+
const require_constants = require('./constants-DmV1Benp.cjs');
|
|
5
|
+
const require_version = require('./version-Ca7qUBih.cjs');
|
|
6
|
+
const require_token_error$1 = require('./token-error-x_miDBP3.cjs');
|
|
7
|
+
const require_config_BYPjNBPX = require('./config-BYPjNBPX-Bqwc8iZW.cjs');
|
|
8
|
+
const require_stdio = require('./stdio-B08zZS4X.cjs');
|
|
9
|
+
const require_usage = require('./usage-DRK6TiDr.cjs');
|
|
10
|
+
const require_parse = require('./parse-CBlXTQfk.cjs');
|
|
11
|
+
require('./types-xUmfecYm.cjs');
|
|
12
|
+
require('./device-code-flow-CpGZ3Eqv.cjs');
|
|
13
|
+
require('./token-cache-iqkTOca3.cjs');
|
|
14
|
+
const require_resolve_token = require('./resolve-token-C2eTEtoo.cjs');
|
|
15
|
+
const require_auth = require('./auth-BK5LL8QY.cjs');
|
|
9
16
|
const zod = require_chunk.__toESM(require("zod"));
|
|
10
17
|
const node_util = require_chunk.__toESM(require("node:util"));
|
|
11
18
|
const __sentry_core = require_chunk.__toESM(require("@sentry/core"));
|
|
@@ -1365,8 +1372,8 @@ const asyncDisposables = /* @__PURE__ */ new Set();
|
|
|
1365
1372
|
/**
|
|
1366
1373
|
* Check if a config is for the meta logger.
|
|
1367
1374
|
*/
|
|
1368
|
-
function isLoggerConfigMeta(cfg
|
|
1369
|
-
return cfg
|
|
1375
|
+
function isLoggerConfigMeta(cfg) {
|
|
1376
|
+
return cfg.category.length === 0 || cfg.category.length === 1 && cfg.category[0] === "logtape" || cfg.category.length === 2 && cfg.category[0] === "logtape" && cfg.category[1] === "meta";
|
|
1370
1377
|
}
|
|
1371
1378
|
/**
|
|
1372
1379
|
* Configure sync loggers with the specified configuration.
|
|
@@ -1416,20 +1423,20 @@ function configureInternal(config, allowAsync) {
|
|
|
1416
1423
|
currentConfig = config;
|
|
1417
1424
|
let metaConfigured = false;
|
|
1418
1425
|
const configuredCategories = /* @__PURE__ */ new Set();
|
|
1419
|
-
for (const cfg
|
|
1420
|
-
if (isLoggerConfigMeta(cfg
|
|
1421
|
-
const categoryKey = Array.isArray(cfg
|
|
1426
|
+
for (const cfg of config.loggers) {
|
|
1427
|
+
if (isLoggerConfigMeta(cfg)) metaConfigured = true;
|
|
1428
|
+
const categoryKey = Array.isArray(cfg.category) ? JSON.stringify(cfg.category) : JSON.stringify([cfg.category]);
|
|
1422
1429
|
if (configuredCategories.has(categoryKey)) throw new ConfigError(`Duplicate logger configuration for category: ${categoryKey}. Each category can only be configured once.`);
|
|
1423
1430
|
configuredCategories.add(categoryKey);
|
|
1424
|
-
const logger$2 = LoggerImpl.getLogger(cfg
|
|
1425
|
-
for (const sinkId of cfg
|
|
1431
|
+
const logger$2 = LoggerImpl.getLogger(cfg.category);
|
|
1432
|
+
for (const sinkId of cfg.sinks ?? []) {
|
|
1426
1433
|
const sink = config.sinks[sinkId];
|
|
1427
1434
|
if (!sink) throw new ConfigError(`Sink not found: ${sinkId}.`);
|
|
1428
1435
|
logger$2.sinks.push(sink);
|
|
1429
1436
|
}
|
|
1430
|
-
logger$2.parentSinks = cfg
|
|
1431
|
-
if (cfg
|
|
1432
|
-
for (const filterId of cfg
|
|
1437
|
+
logger$2.parentSinks = cfg.parentSinks ?? "inherit";
|
|
1438
|
+
if (cfg.lowestLevel !== void 0) logger$2.lowestLevel = cfg.lowestLevel;
|
|
1439
|
+
for (const filterId of cfg.filters ?? []) {
|
|
1433
1440
|
const filter$1 = config.filters?.[filterId];
|
|
1434
1441
|
if (filter$1 === void 0) throw new ConfigError(`Filter not found: ${filterId}.`);
|
|
1435
1442
|
logger$2.filters.push(toFilter(filter$1));
|
|
@@ -1744,7 +1751,7 @@ function logIssue(error, contextsOrOptions, attachmentsArg) {
|
|
|
1744
1751
|
ensureLoggingConfigured();
|
|
1745
1752
|
const options = parseLogIssueOptions(contextsOrOptions, attachmentsArg);
|
|
1746
1753
|
const eventId = (0, __sentry_core.withScope)((scopeInstance) => {
|
|
1747
|
-
if (options.contexts) for (const [key, context$
|
|
1754
|
+
if (options.contexts) for (const [key, context$1] of Object.entries(options.contexts)) scopeInstance.setContext(key, context$1);
|
|
1748
1755
|
if (options.extra) scopeInstance.setContext("log", options.extra);
|
|
1749
1756
|
if (options.attachments) for (const [key, data] of Object.entries(options.attachments)) scopeInstance.addAttachment({
|
|
1750
1757
|
data,
|
|
@@ -1774,7 +1781,7 @@ function logIssue(error, contextsOrOptions, attachmentsArg) {
|
|
|
1774
1781
|
}
|
|
1775
1782
|
|
|
1776
1783
|
//#endregion
|
|
1777
|
-
//#region ../mcp-core/dist/schema-
|
|
1784
|
+
//#region ../mcp-core/dist/schema-ClnBXSjS.js
|
|
1778
1785
|
/**
|
|
1779
1786
|
* Schema for Sentry API error responses.
|
|
1780
1787
|
*
|
|
@@ -2421,9 +2428,15 @@ const ProfileFrameSchema = zod.z.object({
|
|
|
2421
2428
|
function: zod.z.string(),
|
|
2422
2429
|
in_app: zod.z.boolean(),
|
|
2423
2430
|
lineno: zod.z.number().nullable().optional(),
|
|
2431
|
+
colno: zod.z.number().nullable().optional(),
|
|
2424
2432
|
module: zod.z.string().nullable().optional(),
|
|
2425
2433
|
abs_path: zod.z.string().nullable().optional(),
|
|
2426
2434
|
platform: zod.z.string().nullable().optional(),
|
|
2435
|
+
instruction_addr: zod.z.string().nullable().optional(),
|
|
2436
|
+
class_name: zod.z.string().nullable().optional(),
|
|
2437
|
+
raw_function: zod.z.string().nullable().optional(),
|
|
2438
|
+
symbol: zod.z.string().nullable().optional(),
|
|
2439
|
+
lang: zod.z.string().nullable().optional(),
|
|
2427
2440
|
data: zod.z.record(zod.z.unknown()).optional()
|
|
2428
2441
|
}).passthrough();
|
|
2429
2442
|
/**
|
|
@@ -2435,7 +2448,8 @@ const ProfileFrameSchema = zod.z.object({
|
|
|
2435
2448
|
const ProfileSampleSchema = zod.z.object({
|
|
2436
2449
|
stack_id: zod.z.number(),
|
|
2437
2450
|
thread_id: zod.z.string(),
|
|
2438
|
-
timestamp: zod.z.number()
|
|
2451
|
+
timestamp: zod.z.number(),
|
|
2452
|
+
queue_address: zod.z.string().optional()
|
|
2439
2453
|
}).passthrough();
|
|
2440
2454
|
/**
|
|
2441
2455
|
* Schema for raw profile chunk data.
|
|
@@ -2451,6 +2465,7 @@ const ProfileSampleSchema = zod.z.object({
|
|
|
2451
2465
|
const ProfileChunkSchema = zod.z.object({
|
|
2452
2466
|
chunk_id: zod.z.string(),
|
|
2453
2467
|
profiler_id: zod.z.string(),
|
|
2468
|
+
event_id: zod.z.string().optional(),
|
|
2454
2469
|
environment: zod.z.string().nullable(),
|
|
2455
2470
|
platform: zod.z.string(),
|
|
2456
2471
|
release: zod.z.string(),
|
|
@@ -2459,7 +2474,10 @@ const ProfileChunkSchema = zod.z.object({
|
|
|
2459
2474
|
frames: zod.z.array(ProfileFrameSchema),
|
|
2460
2475
|
samples: zod.z.array(ProfileSampleSchema),
|
|
2461
2476
|
stacks: zod.z.array(zod.z.array(zod.z.number())),
|
|
2462
|
-
thread_metadata: zod.z.record(zod.z.object({
|
|
2477
|
+
thread_metadata: zod.z.record(zod.z.object({
|
|
2478
|
+
name: zod.z.string().nullable(),
|
|
2479
|
+
priority: zod.z.number().nullable().optional()
|
|
2480
|
+
}).passthrough())
|
|
2463
2481
|
})
|
|
2464
2482
|
}).passthrough();
|
|
2465
2483
|
/**
|
|
@@ -2685,7 +2703,7 @@ function createApiError(message, status, detail, responseBody) {
|
|
|
2685
2703
|
}
|
|
2686
2704
|
|
|
2687
2705
|
//#endregion
|
|
2688
|
-
//#region ../mcp-core/dist/client-
|
|
2706
|
+
//#region ../mcp-core/dist/client-D5MPii9Y.js
|
|
2689
2707
|
/**
|
|
2690
2708
|
* Mapping of common network error codes to user-friendly messages.
|
|
2691
2709
|
* These help users understand and resolve connection issues.
|
|
@@ -2780,7 +2798,7 @@ var SentryApiService = class {
|
|
|
2780
2798
|
* @returns True if using Sentry SaaS, false for self-hosted instances
|
|
2781
2799
|
*/
|
|
2782
2800
|
isSaas() {
|
|
2783
|
-
return
|
|
2801
|
+
return require_constants.isSentryHost(this.host);
|
|
2784
2802
|
}
|
|
2785
2803
|
/**
|
|
2786
2804
|
* Validates and applies time parameters to a URLSearchParams object.
|
|
@@ -2823,7 +2841,7 @@ var SentryApiService = class {
|
|
|
2823
2841
|
const url = host ? `https://${host}/api/0${path}` : `${this.apiPrefix}${path}`;
|
|
2824
2842
|
const headers = {
|
|
2825
2843
|
"Content-Type": "application/json",
|
|
2826
|
-
"User-Agent":
|
|
2844
|
+
"User-Agent": require_version.USER_AGENT
|
|
2827
2845
|
};
|
|
2828
2846
|
if (this.accessToken) headers.Authorization = `Bearer ${this.accessToken}`;
|
|
2829
2847
|
if (typeof globalThis.fetch === "undefined") throw new ConfigurationError("fetch is not available. Please use Node.js >= 18 or ensure fetch is available in your environment.");
|
|
@@ -2953,7 +2971,7 @@ var SentryApiService = class {
|
|
|
2953
2971
|
* ```
|
|
2954
2972
|
*/
|
|
2955
2973
|
getIssueUrl(organizationSlug, issueId) {
|
|
2956
|
-
return
|
|
2974
|
+
return require_constants.getIssueUrl(this.host, organizationSlug, issueId);
|
|
2957
2975
|
}
|
|
2958
2976
|
/**
|
|
2959
2977
|
* Generates a Sentry trace URL for performance investigation.
|
|
@@ -2971,7 +2989,7 @@ var SentryApiService = class {
|
|
|
2971
2989
|
* ```
|
|
2972
2990
|
*/
|
|
2973
2991
|
getTraceUrl(organizationSlug, traceId) {
|
|
2974
|
-
return
|
|
2992
|
+
return require_constants.getTraceUrl(this.host, organizationSlug, traceId);
|
|
2975
2993
|
}
|
|
2976
2994
|
/**
|
|
2977
2995
|
* Builds a URL for the legacy Discover API (used by errors dataset).
|
|
@@ -3955,7 +3973,7 @@ function validateRegionUrl(regionUrl, baseHost) {
|
|
|
3955
3973
|
}
|
|
3956
3974
|
|
|
3957
3975
|
//#endregion
|
|
3958
|
-
//#region ../mcp-core/dist/api-
|
|
3976
|
+
//#region ../mcp-core/dist/api-DPhKk745.js
|
|
3959
3977
|
/**
|
|
3960
3978
|
* Create a Sentry API service from server context with optional region override
|
|
3961
3979
|
* @param context - Server context containing host and access token
|
|
@@ -3963,20 +3981,20 @@ function validateRegionUrl(regionUrl, baseHost) {
|
|
|
3963
3981
|
* @returns Configured SentryApiService instance (always uses HTTPS)
|
|
3964
3982
|
* @throws {UserInputError} When regionUrl is provided but invalid
|
|
3965
3983
|
*/
|
|
3966
|
-
function apiServiceFromContext(context$
|
|
3967
|
-
let host = context$
|
|
3984
|
+
function apiServiceFromContext(context$1, opts = {}) {
|
|
3985
|
+
let host = context$1.sentryHost;
|
|
3968
3986
|
if (opts.regionUrl?.trim()) {
|
|
3969
|
-
const baseHost = context$
|
|
3987
|
+
const baseHost = context$1.sentryHost || "sentry.io";
|
|
3970
3988
|
host = validateRegionUrl(opts.regionUrl.trim(), baseHost);
|
|
3971
3989
|
}
|
|
3972
3990
|
return new SentryApiService({
|
|
3973
3991
|
host,
|
|
3974
|
-
accessToken: context$
|
|
3992
|
+
accessToken: context$1.accessToken
|
|
3975
3993
|
});
|
|
3976
3994
|
}
|
|
3977
3995
|
|
|
3978
3996
|
//#endregion
|
|
3979
|
-
//#region ../mcp-core/dist/whoami-
|
|
3997
|
+
//#region ../mcp-core/dist/whoami-DjZKB__R.js
|
|
3980
3998
|
var whoami_default = defineTool({
|
|
3981
3999
|
name: "whoami",
|
|
3982
4000
|
description: [
|
|
@@ -3992,11 +4010,11 @@ var whoami_default = defineTool({
|
|
|
3992
4010
|
readOnlyHint: true,
|
|
3993
4011
|
openWorldHint: true
|
|
3994
4012
|
},
|
|
3995
|
-
async handler(params, context$
|
|
3996
|
-
const apiService = apiServiceFromContext(context$
|
|
4013
|
+
async handler(params, context$1) {
|
|
4014
|
+
const apiService = apiServiceFromContext(context$1);
|
|
3997
4015
|
const user = await apiService.getAuthenticatedUser();
|
|
3998
4016
|
let output = `You are authenticated as ${user.name} (${user.email}).\n\nYour Sentry User ID is ${user.id}.`;
|
|
3999
|
-
const constraints = context$
|
|
4017
|
+
const constraints = context$1.constraints;
|
|
4000
4018
|
if (constraints.organizationSlug || constraints.projectSlug || constraints.regionUrl) {
|
|
4001
4019
|
output += "\n\n## Session Constraints\n\n";
|
|
4002
4020
|
if (constraints.organizationSlug) output += `- **Organization**: ${constraints.organizationSlug}\n`;
|
|
@@ -4009,7 +4027,7 @@ var whoami_default = defineTool({
|
|
|
4009
4027
|
});
|
|
4010
4028
|
|
|
4011
4029
|
//#endregion
|
|
4012
|
-
//#region ../mcp-core/dist/find-organizations-
|
|
4030
|
+
//#region ../mcp-core/dist/find-organizations-CAHgf7sF.js
|
|
4013
4031
|
const RESULT_LIMIT$2 = 25;
|
|
4014
4032
|
var find_organizations_default = defineTool({
|
|
4015
4033
|
name: "find_organizations",
|
|
@@ -4030,8 +4048,8 @@ var find_organizations_default = defineTool({
|
|
|
4030
4048
|
readOnlyHint: true,
|
|
4031
4049
|
openWorldHint: true
|
|
4032
4050
|
},
|
|
4033
|
-
async handler(params, context$
|
|
4034
|
-
const apiService = apiServiceFromContext(context$
|
|
4051
|
+
async handler(params, context$1) {
|
|
4052
|
+
const apiService = apiServiceFromContext(context$1);
|
|
4035
4053
|
const organizations = await apiService.listOrganizations({ query: params.query ?? void 0 });
|
|
4036
4054
|
let output = "# Organizations\n\n";
|
|
4037
4055
|
if (params.query) output += `**Search query:** "${params.query}"\n\n`;
|
|
@@ -4061,7 +4079,7 @@ var find_organizations_default = defineTool({
|
|
|
4061
4079
|
});
|
|
4062
4080
|
|
|
4063
4081
|
//#endregion
|
|
4064
|
-
//#region ../mcp-core/dist/find-teams-
|
|
4082
|
+
//#region ../mcp-core/dist/find-teams-DsvBfxS9.js
|
|
4065
4083
|
const RESULT_LIMIT$1 = 25;
|
|
4066
4084
|
var find_teams_default = defineTool({
|
|
4067
4085
|
name: "find_teams",
|
|
@@ -4090,8 +4108,8 @@ var find_teams_default = defineTool({
|
|
|
4090
4108
|
readOnlyHint: true,
|
|
4091
4109
|
openWorldHint: true
|
|
4092
4110
|
},
|
|
4093
|
-
async handler(params, context$
|
|
4094
|
-
const apiService = apiServiceFromContext(context$
|
|
4111
|
+
async handler(params, context$1) {
|
|
4112
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
4095
4113
|
const organizationSlug = params.organizationSlug;
|
|
4096
4114
|
if (!organizationSlug) throw new UserInputError("Organization slug is required. Please provide an organizationSlug parameter.");
|
|
4097
4115
|
(0, __sentry_core.setTag)("organization.slug", organizationSlug);
|
|
@@ -4109,7 +4127,7 @@ var find_teams_default = defineTool({
|
|
|
4109
4127
|
});
|
|
4110
4128
|
|
|
4111
4129
|
//#endregion
|
|
4112
|
-
//#region ../mcp-core/dist/find-projects-
|
|
4130
|
+
//#region ../mcp-core/dist/find-projects-jWQLrhiQ.js
|
|
4113
4131
|
const RESULT_LIMIT = 25;
|
|
4114
4132
|
var find_projects_default = defineTool({
|
|
4115
4133
|
name: "find_projects",
|
|
@@ -4134,8 +4152,8 @@ var find_projects_default = defineTool({
|
|
|
4134
4152
|
readOnlyHint: true,
|
|
4135
4153
|
openWorldHint: true
|
|
4136
4154
|
},
|
|
4137
|
-
async handler(params, context$
|
|
4138
|
-
const apiService = apiServiceFromContext(context$
|
|
4155
|
+
async handler(params, context$1) {
|
|
4156
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
4139
4157
|
const organizationSlug = params.organizationSlug;
|
|
4140
4158
|
if (!organizationSlug) throw new UserInputError("Organization slug is required. Please provide an organizationSlug parameter.");
|
|
4141
4159
|
(0, __sentry_core.setTag)("organization.slug", organizationSlug);
|
|
@@ -4153,7 +4171,7 @@ var find_projects_default = defineTool({
|
|
|
4153
4171
|
});
|
|
4154
4172
|
|
|
4155
4173
|
//#endregion
|
|
4156
|
-
//#region ../mcp-core/dist/find-releases-
|
|
4174
|
+
//#region ../mcp-core/dist/find-releases-UoICWW5P.js
|
|
4157
4175
|
var find_releases_default = defineTool({
|
|
4158
4176
|
name: "find_releases",
|
|
4159
4177
|
skills: ["inspect"],
|
|
@@ -4194,8 +4212,8 @@ var find_releases_default = defineTool({
|
|
|
4194
4212
|
readOnlyHint: true,
|
|
4195
4213
|
openWorldHint: true
|
|
4196
4214
|
},
|
|
4197
|
-
async handler(params, context$
|
|
4198
|
-
const apiService = apiServiceFromContext(context$
|
|
4215
|
+
async handler(params, context$1) {
|
|
4216
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
4199
4217
|
const organizationSlug = params.organizationSlug;
|
|
4200
4218
|
(0, __sentry_core.setTag)("organization.slug", organizationSlug);
|
|
4201
4219
|
const releases = await apiService.listReleases({
|
|
@@ -4609,8 +4627,8 @@ function formatExceptionInterfaceOutput(event, data) {
|
|
|
4609
4627
|
parts.push("```");
|
|
4610
4628
|
parts.push(frames.map((frame) => {
|
|
4611
4629
|
const header = formatFrameHeader(frame, void 0, event.platform);
|
|
4612
|
-
const context$
|
|
4613
|
-
return `${header}${context$
|
|
4630
|
+
const context$1 = renderInlineContext(frame);
|
|
4631
|
+
return `${header}${context$1}`;
|
|
4614
4632
|
}).join("\n"));
|
|
4615
4633
|
parts.push("```");
|
|
4616
4634
|
});
|
|
@@ -4689,8 +4707,8 @@ function formatThreadsInterfaceOutput(event, data) {
|
|
|
4689
4707
|
parts.push("```");
|
|
4690
4708
|
parts.push(frames.map((frame) => {
|
|
4691
4709
|
const header = formatFrameHeader(frame, void 0, event.platform);
|
|
4692
|
-
const context$
|
|
4693
|
-
return `${header}${context$
|
|
4710
|
+
const context$1 = renderInlineContext(frame);
|
|
4711
|
+
return `${header}${context$1}`;
|
|
4694
4712
|
}).join("\n"));
|
|
4695
4713
|
parts.push("```");
|
|
4696
4714
|
parts.push("");
|
|
@@ -5225,9 +5243,9 @@ function formatTags(tags) {
|
|
|
5225
5243
|
if (!tags || tags.length === 0) return "";
|
|
5226
5244
|
return `### Tags\n\n${tags.map((tag) => `**${tag.key}**: ${tag.value}`).join("\n")}\n\n`;
|
|
5227
5245
|
}
|
|
5228
|
-
function formatContext(context$
|
|
5229
|
-
if (!context$
|
|
5230
|
-
return `### Extra Data\n\nAdditional data attached to this event.\n\n${Object.entries(context$
|
|
5246
|
+
function formatContext(context$1) {
|
|
5247
|
+
if (!context$1 || Object.keys(context$1).length === 0) return "";
|
|
5248
|
+
return `### Extra Data\n\nAdditional data attached to this event.\n\n${Object.entries(context$1).map(([key, value]) => {
|
|
5231
5249
|
return `**${key}**: ${JSON.stringify(value, void 0, 2)}`;
|
|
5232
5250
|
}).join("\n")}\n\n`;
|
|
5233
5251
|
}
|
|
@@ -5412,7 +5430,7 @@ function enhanceNotFoundError(error, params) {
|
|
|
5412
5430
|
}
|
|
5413
5431
|
|
|
5414
5432
|
//#endregion
|
|
5415
|
-
//#region ../mcp-core/dist/get-issue-details-
|
|
5433
|
+
//#region ../mcp-core/dist/get-issue-details-B2vtmsfK.js
|
|
5416
5434
|
var get_issue_details_default = defineTool({
|
|
5417
5435
|
name: "get_issue_details",
|
|
5418
5436
|
skills: [
|
|
@@ -5421,7 +5439,7 @@ var get_issue_details_default = defineTool({
|
|
|
5421
5439
|
"seer"
|
|
5422
5440
|
],
|
|
5423
5441
|
requiredScopes: ["event:read"],
|
|
5424
|
-
|
|
5442
|
+
internalOnly: true,
|
|
5425
5443
|
description: [
|
|
5426
5444
|
"Get detailed information about a specific Sentry issue by ID.",
|
|
5427
5445
|
"",
|
|
@@ -5473,8 +5491,8 @@ var get_issue_details_default = defineTool({
|
|
|
5473
5491
|
readOnlyHint: true,
|
|
5474
5492
|
openWorldHint: true
|
|
5475
5493
|
},
|
|
5476
|
-
async handler(params, context$
|
|
5477
|
-
const apiService = apiServiceFromContext(context$
|
|
5494
|
+
async handler(params, context$1) {
|
|
5495
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
5478
5496
|
if (params.eventId) {
|
|
5479
5497
|
const orgSlug$1 = params.organizationSlug;
|
|
5480
5498
|
const eventId = params.eventId;
|
|
@@ -5524,7 +5542,7 @@ var get_issue_details_default = defineTool({
|
|
|
5524
5542
|
autofixState: autofixState$1,
|
|
5525
5543
|
performanceTrace: performanceTrace$1,
|
|
5526
5544
|
externalIssues: externalIssues$1,
|
|
5527
|
-
experimentalMode: context$
|
|
5545
|
+
experimentalMode: context$1.experimentalMode
|
|
5528
5546
|
});
|
|
5529
5547
|
}
|
|
5530
5548
|
if (!params.issueUrl && !params.issueId) throw new UserInputError("Either `issueId` or `issueUrl` must be provided");
|
|
@@ -5571,7 +5589,7 @@ var get_issue_details_default = defineTool({
|
|
|
5571
5589
|
autofixState,
|
|
5572
5590
|
performanceTrace,
|
|
5573
5591
|
externalIssues,
|
|
5574
|
-
experimentalMode: context$
|
|
5592
|
+
experimentalMode: context$1.experimentalMode
|
|
5575
5593
|
});
|
|
5576
5594
|
}
|
|
5577
5595
|
});
|
|
@@ -5594,12 +5612,12 @@ async function fetchIssueEnrichmentData({ apiService, organizationSlug, issueId
|
|
|
5594
5612
|
};
|
|
5595
5613
|
}
|
|
5596
5614
|
async function maybeFetchPerformanceTrace({ apiService, organizationSlug, event }) {
|
|
5597
|
-
const context$
|
|
5598
|
-
if (!context$
|
|
5615
|
+
const context$1 = shouldFetchTraceForEvent(event);
|
|
5616
|
+
if (!context$1) return void 0;
|
|
5599
5617
|
try {
|
|
5600
5618
|
return await apiService.getTrace({
|
|
5601
5619
|
organizationSlug,
|
|
5602
|
-
traceId: context$
|
|
5620
|
+
traceId: context$1.traceId,
|
|
5603
5621
|
limit: 1e4
|
|
5604
5622
|
});
|
|
5605
5623
|
} catch (error) {
|
|
@@ -5618,7 +5636,7 @@ function shouldFetchTraceForEvent(event) {
|
|
|
5618
5636
|
}
|
|
5619
5637
|
|
|
5620
5638
|
//#endregion
|
|
5621
|
-
//#region ../mcp-core/dist/get-issue-tag-values-
|
|
5639
|
+
//#region ../mcp-core/dist/get-issue-tag-values-Cvuw-dND.js
|
|
5622
5640
|
var get_issue_tag_values_default = defineTool({
|
|
5623
5641
|
name: "get_issue_tag_values",
|
|
5624
5642
|
skills: ["inspect"],
|
|
@@ -5676,8 +5694,8 @@ var get_issue_tag_values_default = defineTool({
|
|
|
5676
5694
|
readOnlyHint: true,
|
|
5677
5695
|
openWorldHint: true
|
|
5678
5696
|
},
|
|
5679
|
-
async handler(params, context$
|
|
5680
|
-
const apiService = apiServiceFromContext(context$
|
|
5697
|
+
async handler(params, context$1) {
|
|
5698
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
5681
5699
|
if (!params.issueUrl && !params.issueId) throw new UserInputError("Either `issueId` or `issueUrl` must be provided");
|
|
5682
5700
|
if (!params.issueUrl && !params.organizationSlug) throw new UserInputError("`organizationSlug` is required when providing `issueId`");
|
|
5683
5701
|
if (!params.tagKey) throw new UserInputError("`tagKey` is required. Common values: url, browser, environment, release, os, device, user");
|
|
@@ -5726,14 +5744,14 @@ var get_issue_tag_values_default = defineTool({
|
|
|
5726
5744
|
output += `\n*Showing top ${shownCount} of ${tagValues.totalValues} unique values*\n`;
|
|
5727
5745
|
}
|
|
5728
5746
|
output += "\n## Using this information\n\n";
|
|
5729
|
-
output += `- Use \`
|
|
5747
|
+
output += `- Use \`get_sentry_resource(resourceType='issue', organizationSlug='${orgSlug}', resourceId='${parsedIssueId}')\` to see the full issue details\n`;
|
|
5730
5748
|
output += `- Try other tag keys like: url, browser, environment, release, os, device, user\n`;
|
|
5731
5749
|
return output;
|
|
5732
5750
|
}
|
|
5733
5751
|
});
|
|
5734
5752
|
|
|
5735
5753
|
//#endregion
|
|
5736
|
-
//#region ../mcp-core/dist/get-trace-details-
|
|
5754
|
+
//#region ../mcp-core/dist/get-trace-details-COQwrZyO.js
|
|
5737
5755
|
const MAX_DEPTH = 2;
|
|
5738
5756
|
const MINIMUM_DURATION_THRESHOLD_MS = 10;
|
|
5739
5757
|
const MIN_MEANINGFUL_CHILD_DURATION = 5;
|
|
@@ -5743,7 +5761,7 @@ var get_trace_details_default = defineTool({
|
|
|
5743
5761
|
skills: ["inspect"],
|
|
5744
5762
|
requiredScopes: ["event:read"],
|
|
5745
5763
|
requiredCapabilities: ["traces"],
|
|
5746
|
-
|
|
5764
|
+
internalOnly: true,
|
|
5747
5765
|
description: [
|
|
5748
5766
|
"Get detailed information about a specific Sentry trace by ID.",
|
|
5749
5767
|
"",
|
|
@@ -5782,9 +5800,9 @@ var get_trace_details_default = defineTool({
|
|
|
5782
5800
|
readOnlyHint: true,
|
|
5783
5801
|
openWorldHint: true
|
|
5784
5802
|
},
|
|
5785
|
-
async handler(params, context$
|
|
5803
|
+
async handler(params, context$1) {
|
|
5786
5804
|
if (!/^[0-9a-fA-F]{32}$/.test(params.traceId)) throw new UserInputError("Trace ID must be a 32-character hexadecimal string");
|
|
5787
|
-
const apiService = apiServiceFromContext(context$
|
|
5805
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
5788
5806
|
(0, __sentry_core.setTag)("organization.slug", params.organizationSlug);
|
|
5789
5807
|
(0, __sentry_core.setTag)("trace.id", params.traceId);
|
|
5790
5808
|
const traceMeta = await apiService.getTraceMeta({
|
|
@@ -6034,7 +6052,7 @@ function formatTraceOutput({ organizationSlug, traceId, traceMeta, trace: trace$
|
|
|
6034
6052
|
}
|
|
6035
6053
|
|
|
6036
6054
|
//#endregion
|
|
6037
|
-
//#region ../mcp-core/dist/get-event-attachment-
|
|
6055
|
+
//#region ../mcp-core/dist/get-event-attachment-CBWB88Xp.js
|
|
6038
6056
|
var get_event_attachment_default = defineTool({
|
|
6039
6057
|
name: "get_event_attachment",
|
|
6040
6058
|
skills: ["inspect"],
|
|
@@ -6079,8 +6097,8 @@ var get_event_attachment_default = defineTool({
|
|
|
6079
6097
|
readOnlyHint: true,
|
|
6080
6098
|
openWorldHint: true
|
|
6081
6099
|
},
|
|
6082
|
-
async handler(params, context$
|
|
6083
|
-
const apiService = apiServiceFromContext(context$
|
|
6100
|
+
async handler(params, context$1) {
|
|
6101
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
6084
6102
|
(0, __sentry_core.setTag)("organization.slug", params.organizationSlug);
|
|
6085
6103
|
if (params.attachmentId) {
|
|
6086
6104
|
const attachment = await apiService.getEventAttachment({
|
|
@@ -6182,7 +6200,7 @@ function formatAssignedTo(assignedTo) {
|
|
|
6182
6200
|
}
|
|
6183
6201
|
|
|
6184
6202
|
//#endregion
|
|
6185
|
-
//#region ../mcp-core/dist/update-issue-
|
|
6203
|
+
//#region ../mcp-core/dist/update-issue-CTU4EyEW.js
|
|
6186
6204
|
var update_issue_default = defineTool({
|
|
6187
6205
|
name: "update_issue",
|
|
6188
6206
|
skills: ["triage"],
|
|
@@ -6246,8 +6264,8 @@ var update_issue_default = defineTool({
|
|
|
6246
6264
|
idempotentHint: true,
|
|
6247
6265
|
openWorldHint: true
|
|
6248
6266
|
},
|
|
6249
|
-
async handler(params, context$
|
|
6250
|
-
const apiService = apiServiceFromContext(context$
|
|
6267
|
+
async handler(params, context$1) {
|
|
6268
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
6251
6269
|
if (!params.issueUrl && !params.issueId) throw new UserInputError("Either `issueId` or `issueUrl` must be provided");
|
|
6252
6270
|
if (!params.issueUrl && !params.organizationSlug) throw new UserInputError("`organizationSlug` is required when providing `issueId`");
|
|
6253
6271
|
if (!params.status && !params.assignedTo) throw new UserInputError("At least one of `status` or `assignedTo` must be provided to update the issue");
|
|
@@ -6283,7 +6301,7 @@ var update_issue_default = defineTool({
|
|
|
6283
6301
|
output += `**Assigned To**: ${currentAssignee}\n`;
|
|
6284
6302
|
output += "\n# Using this information\n\n";
|
|
6285
6303
|
output += `- The issue has been successfully updated in Sentry\n`;
|
|
6286
|
-
output += `- You can view the issue details using: \`
|
|
6304
|
+
output += `- You can view the issue details using: \`get_sentry_resource(resourceType="issue", organizationSlug="${orgSlug}", resourceId="${updatedIssue.shortId}")\`\n`;
|
|
6287
6305
|
if (params.status === "resolved") output += `- The issue is now marked as resolved and will no longer generate alerts\n`;
|
|
6288
6306
|
else if (params.status === "ignored") output += `- The issue is now ignored and will not generate alerts until it escalates\n`;
|
|
6289
6307
|
return output;
|
|
@@ -6506,14 +6524,14 @@ var marker13$1 = `vercel.ai.error.${name12$1}`;
|
|
|
6506
6524
|
var symbol13$1 = Symbol.for(marker13$1);
|
|
6507
6525
|
var _a13$1, _b13;
|
|
6508
6526
|
var TypeValidationError = class _TypeValidationError extends (_b13 = AISDKError, _a13$1 = symbol13$1, _b13) {
|
|
6509
|
-
constructor({ value, cause, context: context$
|
|
6527
|
+
constructor({ value, cause, context: context$1 }) {
|
|
6510
6528
|
let contextPrefix = "Type validation failed";
|
|
6511
|
-
if (context$
|
|
6512
|
-
if ((context$
|
|
6529
|
+
if (context$1 == null ? void 0 : context$1.field) contextPrefix += ` for ${context$1.field}`;
|
|
6530
|
+
if ((context$1 == null ? void 0 : context$1.entityName) || (context$1 == null ? void 0 : context$1.entityId)) {
|
|
6513
6531
|
contextPrefix += " (";
|
|
6514
6532
|
const parts = [];
|
|
6515
|
-
if (context$
|
|
6516
|
-
if (context$
|
|
6533
|
+
if (context$1.entityName) parts.push(context$1.entityName);
|
|
6534
|
+
if (context$1.entityId) parts.push(`id: "${context$1.entityId}"`);
|
|
6517
6535
|
contextPrefix += parts.join(", ");
|
|
6518
6536
|
contextPrefix += ")";
|
|
6519
6537
|
}
|
|
@@ -6525,7 +6543,7 @@ Error message: ${getErrorMessage$1(cause)}`,
|
|
|
6525
6543
|
});
|
|
6526
6544
|
this[_a13$1] = true;
|
|
6527
6545
|
this.value = value;
|
|
6528
|
-
this.context = context$
|
|
6546
|
+
this.context = context$1;
|
|
6529
6547
|
}
|
|
6530
6548
|
static isInstance(error) {
|
|
6531
6549
|
return AISDKError.hasMarker(error, marker13$1);
|
|
@@ -6541,13 +6559,13 @@ Error message: ${getErrorMessage$1(cause)}`,
|
|
|
6541
6559
|
* @param {TypeValidationContext} params.context - Optional context about what is being validated.
|
|
6542
6560
|
* @returns {TypeValidationError} A TypeValidationError instance.
|
|
6543
6561
|
*/
|
|
6544
|
-
static wrap({ value, cause, context: context$
|
|
6562
|
+
static wrap({ value, cause, context: context$1 }) {
|
|
6545
6563
|
var _a15$1, _b15, _c;
|
|
6546
|
-
if (_TypeValidationError.isInstance(cause) && cause.value === value && ((_a15$1 = cause.context) == null ? void 0 : _a15$1.field) === (context$
|
|
6564
|
+
if (_TypeValidationError.isInstance(cause) && cause.value === value && ((_a15$1 = cause.context) == null ? void 0 : _a15$1.field) === (context$1 == null ? void 0 : context$1.field) && ((_b15 = cause.context) == null ? void 0 : _b15.entityName) === (context$1 == null ? void 0 : context$1.entityName) && ((_c = cause.context) == null ? void 0 : _c.entityId) === (context$1 == null ? void 0 : context$1.entityId)) return cause;
|
|
6547
6565
|
return new _TypeValidationError({
|
|
6548
6566
|
value,
|
|
6549
6567
|
cause,
|
|
6550
|
-
context: context$
|
|
6568
|
+
context: context$1
|
|
6551
6569
|
});
|
|
6552
6570
|
}
|
|
6553
6571
|
};
|
|
@@ -7910,7 +7928,7 @@ var zod3ToJsonSchema = (schema, options) => {
|
|
|
7910
7928
|
};
|
|
7911
7929
|
}, {}) : void 0;
|
|
7912
7930
|
const name2$4 = typeof options === "string" ? options : (options == null ? void 0 : options.nameStrategy) === "title" ? void 0 : options == null ? void 0 : options.name;
|
|
7913
|
-
const main = (_a2$4 = parseDef(schema._def, name2$4 === void 0 ? refs : {
|
|
7931
|
+
const main$1 = (_a2$4 = parseDef(schema._def, name2$4 === void 0 ? refs : {
|
|
7914
7932
|
...refs,
|
|
7915
7933
|
currentPath: [
|
|
7916
7934
|
...refs.basePath,
|
|
@@ -7919,11 +7937,11 @@ var zod3ToJsonSchema = (schema, options) => {
|
|
|
7919
7937
|
]
|
|
7920
7938
|
}, false)) != null ? _a2$4 : parseAnyDef();
|
|
7921
7939
|
const title = typeof options === "object" && options.name !== void 0 && options.nameStrategy === "title" ? options.name : void 0;
|
|
7922
|
-
if (title !== void 0) main.title = title;
|
|
7940
|
+
if (title !== void 0) main$1.title = title;
|
|
7923
7941
|
const combined = name2$4 === void 0 ? definitions ? {
|
|
7924
|
-
...main,
|
|
7942
|
+
...main$1,
|
|
7925
7943
|
[refs.definitionPath]: definitions
|
|
7926
|
-
} : main : {
|
|
7944
|
+
} : main$1 : {
|
|
7927
7945
|
$ref: [
|
|
7928
7946
|
...refs.$refStrategy === "relative" ? [] : refs.basePath,
|
|
7929
7947
|
refs.definitionPath,
|
|
@@ -7931,7 +7949,7 @@ var zod3ToJsonSchema = (schema, options) => {
|
|
|
7931
7949
|
].join("/"),
|
|
7932
7950
|
[refs.definitionPath]: {
|
|
7933
7951
|
...definitions,
|
|
7934
|
-
[name2$4]: main
|
|
7952
|
+
[name2$4]: main$1
|
|
7935
7953
|
}
|
|
7936
7954
|
};
|
|
7937
7955
|
combined.$schema = "http://json-schema.org/draft-07/schema#";
|
|
@@ -8019,20 +8037,20 @@ function zodSchema(zodSchema2, options) {
|
|
|
8019
8037
|
if (isZod4Schema(zodSchema2)) return zod4Schema(zodSchema2, options);
|
|
8020
8038
|
else return zod3Schema(zodSchema2, options);
|
|
8021
8039
|
}
|
|
8022
|
-
async function validateTypes({ value, schema, context: context$
|
|
8040
|
+
async function validateTypes({ value, schema, context: context$1 }) {
|
|
8023
8041
|
const result = await safeValidateTypes({
|
|
8024
8042
|
value,
|
|
8025
8043
|
schema,
|
|
8026
|
-
context: context$
|
|
8044
|
+
context: context$1
|
|
8027
8045
|
});
|
|
8028
8046
|
if (!result.success) throw TypeValidationError.wrap({
|
|
8029
8047
|
value,
|
|
8030
8048
|
cause: result.error,
|
|
8031
|
-
context: context$
|
|
8049
|
+
context: context$1
|
|
8032
8050
|
});
|
|
8033
8051
|
return result.value;
|
|
8034
8052
|
}
|
|
8035
|
-
async function safeValidateTypes({ value, schema, context: context$
|
|
8053
|
+
async function safeValidateTypes({ value, schema, context: context$1 }) {
|
|
8036
8054
|
const actualSchema = asSchema(schema);
|
|
8037
8055
|
try {
|
|
8038
8056
|
if (actualSchema.validate == null) return {
|
|
@@ -8051,7 +8069,7 @@ async function safeValidateTypes({ value, schema, context: context$2 }) {
|
|
|
8051
8069
|
error: TypeValidationError.wrap({
|
|
8052
8070
|
value,
|
|
8053
8071
|
cause: result.error,
|
|
8054
|
-
context: context$
|
|
8072
|
+
context: context$1
|
|
8055
8073
|
}),
|
|
8056
8074
|
rawValue: value
|
|
8057
8075
|
};
|
|
@@ -8061,7 +8079,7 @@ async function safeValidateTypes({ value, schema, context: context$2 }) {
|
|
|
8061
8079
|
error: TypeValidationError.wrap({
|
|
8062
8080
|
value,
|
|
8063
8081
|
cause: error,
|
|
8064
|
-
context: context$
|
|
8082
|
+
context: context$1
|
|
8065
8083
|
}),
|
|
8066
8084
|
rawValue: value
|
|
8067
8085
|
};
|
|
@@ -13027,7 +13045,7 @@ function createOpenAI(options = {}) {
|
|
|
13027
13045
|
var openai = createOpenAI();
|
|
13028
13046
|
|
|
13029
13047
|
//#endregion
|
|
13030
|
-
//#region ../mcp-core/dist/openai-provider-
|
|
13048
|
+
//#region ../mcp-core/dist/openai-provider-BT4fAGlz.js
|
|
13031
13049
|
const DEFAULT_OPENAI_MODEL = "gpt-5";
|
|
13032
13050
|
let configuredBaseUrl$1;
|
|
13033
13051
|
/**
|
|
@@ -13058,7 +13076,7 @@ function getOpenAIModel(model) {
|
|
|
13058
13076
|
const defaultModel = process.env.OPENAI_MODEL || DEFAULT_OPENAI_MODEL;
|
|
13059
13077
|
const factory$1 = createOpenAI({
|
|
13060
13078
|
...configuredBaseUrl$1 && { baseURL: configuredBaseUrl$1 },
|
|
13061
|
-
headers: { "User-Agent":
|
|
13079
|
+
headers: { "User-Agent": require_version.USER_AGENT }
|
|
13062
13080
|
});
|
|
13063
13081
|
return factory$1(model ?? defaultModel);
|
|
13064
13082
|
}
|
|
@@ -13678,14 +13696,14 @@ var CacheControlValidator = class {
|
|
|
13678
13696
|
this.breakpointCount = 0;
|
|
13679
13697
|
this.warnings = [];
|
|
13680
13698
|
}
|
|
13681
|
-
getCacheControl(providerMetadata, context$
|
|
13699
|
+
getCacheControl(providerMetadata, context$1) {
|
|
13682
13700
|
const cacheControlValue = getCacheControl(providerMetadata);
|
|
13683
13701
|
if (!cacheControlValue) return void 0;
|
|
13684
|
-
if (!context$
|
|
13702
|
+
if (!context$1.canCache) {
|
|
13685
13703
|
this.warnings.push({
|
|
13686
13704
|
type: "unsupported",
|
|
13687
13705
|
feature: "cache_control on non-cacheable context",
|
|
13688
|
-
details: `cache_control cannot be set on ${context$
|
|
13706
|
+
details: `cache_control cannot be set on ${context$1.type}. It will be ignored.`
|
|
13689
13707
|
});
|
|
13690
13708
|
return void 0;
|
|
13691
13709
|
}
|
|
@@ -15089,14 +15107,14 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
15089
15107
|
type: "json_schema",
|
|
15090
15108
|
schema: responseFormat.schema
|
|
15091
15109
|
} },
|
|
15092
|
-
...(anthropicOptions == null ? void 0 : anthropicOptions.mcpServers) && anthropicOptions.mcpServers.length > 0 && { mcp_servers: anthropicOptions.mcpServers.map((server
|
|
15093
|
-
type: server
|
|
15094
|
-
name: server
|
|
15095
|
-
url: server
|
|
15096
|
-
authorization_token: server
|
|
15097
|
-
tool_configuration: server
|
|
15098
|
-
allowed_tools: server
|
|
15099
|
-
enabled: server
|
|
15110
|
+
...(anthropicOptions == null ? void 0 : anthropicOptions.mcpServers) && anthropicOptions.mcpServers.length > 0 && { mcp_servers: anthropicOptions.mcpServers.map((server) => ({
|
|
15111
|
+
type: server.type,
|
|
15112
|
+
name: server.name,
|
|
15113
|
+
url: server.url,
|
|
15114
|
+
authorization_token: server.authorizationToken,
|
|
15115
|
+
tool_configuration: server.toolConfiguration ? {
|
|
15116
|
+
allowed_tools: server.toolConfiguration.allowedTools,
|
|
15117
|
+
enabled: server.toolConfiguration.enabled
|
|
15100
15118
|
} : void 0
|
|
15101
15119
|
})) },
|
|
15102
15120
|
...(anthropicOptions == null ? void 0 : anthropicOptions.container) && { container: anthropicOptions.container.skills && anthropicOptions.container.skills.length > 0 ? {
|
|
@@ -16574,7 +16592,7 @@ function createAnthropic(options = {}) {
|
|
|
16574
16592
|
var anthropic = createAnthropic();
|
|
16575
16593
|
|
|
16576
16594
|
//#endregion
|
|
16577
|
-
//#region ../mcp-core/dist/anthropic-provider-
|
|
16595
|
+
//#region ../mcp-core/dist/anthropic-provider-DKboDOaj.js
|
|
16578
16596
|
const DEFAULT_ANTHROPIC_MODEL = "claude-sonnet-4-5";
|
|
16579
16597
|
let configuredBaseUrl;
|
|
16580
16598
|
/**
|
|
@@ -16596,13 +16614,13 @@ function getAnthropicModel(model) {
|
|
|
16596
16614
|
const defaultModel = process.env.ANTHROPIC_MODEL || DEFAULT_ANTHROPIC_MODEL;
|
|
16597
16615
|
const factory$1 = createAnthropic({
|
|
16598
16616
|
...configuredBaseUrl && { baseURL: configuredBaseUrl },
|
|
16599
|
-
headers: { "User-Agent":
|
|
16617
|
+
headers: { "User-Agent": require_version.USER_AGENT }
|
|
16600
16618
|
});
|
|
16601
16619
|
return factory$1(model ?? defaultModel);
|
|
16602
16620
|
}
|
|
16603
16621
|
|
|
16604
16622
|
//#endregion
|
|
16605
|
-
//#region ../mcp-core/dist/provider-factory-
|
|
16623
|
+
//#region ../mcp-core/dist/provider-factory-qe51AMLu.js
|
|
16606
16624
|
let configuredProvider;
|
|
16607
16625
|
/**
|
|
16608
16626
|
* Configure the embedded agent provider explicitly.
|
|
@@ -16789,7 +16807,7 @@ var require_get_vercel_oidc_token = require_chunk.__commonJS({ "../../node_modul
|
|
|
16789
16807
|
err = error;
|
|
16790
16808
|
}
|
|
16791
16809
|
try {
|
|
16792
|
-
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([await Promise.resolve().then(() => require_chunk.__toDynamicImportESM()(require("./token-util-
|
|
16810
|
+
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([await Promise.resolve().then(() => require_chunk.__toDynamicImportESM()(require("./token-util-bEa_1v46.cjs"))), await Promise.resolve().then(() => require_chunk.__toDynamicImportESM()(require("./token-Dx4qrxlx.cjs")))]);
|
|
16793
16811
|
if (!token || isExpired(getTokenPayload(token))) {
|
|
16794
16812
|
await refreshToken();
|
|
16795
16813
|
token = getVercelOidcTokenSync();
|
|
@@ -18049,14 +18067,14 @@ var BaseContext = function() {
|
|
|
18049
18067
|
return self._currentContext.get(key);
|
|
18050
18068
|
};
|
|
18051
18069
|
self.setValue = function(key, value) {
|
|
18052
|
-
var context$
|
|
18053
|
-
context$
|
|
18054
|
-
return context$
|
|
18070
|
+
var context$1 = new BaseContext$1(self._currentContext);
|
|
18071
|
+
context$1._currentContext.set(key, value);
|
|
18072
|
+
return context$1;
|
|
18055
18073
|
};
|
|
18056
18074
|
self.deleteValue = function(key) {
|
|
18057
|
-
var context$
|
|
18058
|
-
context$
|
|
18059
|
-
return context$
|
|
18075
|
+
var context$1 = new BaseContext$1(self._currentContext);
|
|
18076
|
+
context$1._currentContext.delete(key);
|
|
18077
|
+
return context$1;
|
|
18060
18078
|
};
|
|
18061
18079
|
}
|
|
18062
18080
|
return BaseContext$1;
|
|
@@ -18177,12 +18195,12 @@ var ContextAPI = function() {
|
|
|
18177
18195
|
* @param thisArg optional receiver to be used for calling fn
|
|
18178
18196
|
* @param args optional arguments forwarded to fn
|
|
18179
18197
|
*/
|
|
18180
|
-
ContextAPI$1.prototype.with = function(context$
|
|
18198
|
+
ContextAPI$1.prototype.with = function(context$1, fn, thisArg) {
|
|
18181
18199
|
var _a$5;
|
|
18182
18200
|
var args = [];
|
|
18183
18201
|
for (var _i = 3; _i < arguments.length; _i++) args[_i - 3] = arguments[_i];
|
|
18184
18202
|
return (_a$5 = this._getContextManager()).with.apply(_a$5, __spreadArray([
|
|
18185
|
-
context$
|
|
18203
|
+
context$1,
|
|
18186
18204
|
fn,
|
|
18187
18205
|
thisArg
|
|
18188
18206
|
], __read(args), false));
|
|
@@ -18193,8 +18211,8 @@ var ContextAPI = function() {
|
|
|
18193
18211
|
* @param context context to bind to the event emitter or function. Defaults to the currently active context
|
|
18194
18212
|
* @param target function or event emitter to bind
|
|
18195
18213
|
*/
|
|
18196
|
-
ContextAPI$1.prototype.bind = function(context$
|
|
18197
|
-
return this._getContextManager().bind(context$
|
|
18214
|
+
ContextAPI$1.prototype.bind = function(context$1, target) {
|
|
18215
|
+
return this._getContextManager().bind(context$1, target);
|
|
18198
18216
|
};
|
|
18199
18217
|
ContextAPI$1.prototype._getContextManager = function() {
|
|
18200
18218
|
return getGlobal(API_NAME$1) || NOOP_CONTEXT_MANAGER;
|
|
@@ -18282,8 +18300,8 @@ var SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN");
|
|
|
18282
18300
|
*
|
|
18283
18301
|
* @param context context to get span from
|
|
18284
18302
|
*/
|
|
18285
|
-
function getSpan(context$
|
|
18286
|
-
return context$
|
|
18303
|
+
function getSpan(context$1) {
|
|
18304
|
+
return context$1.getValue(SPAN_KEY) || void 0;
|
|
18287
18305
|
}
|
|
18288
18306
|
/**
|
|
18289
18307
|
* Gets the span from the current context, if one exists.
|
|
@@ -18297,16 +18315,16 @@ function getActiveSpan$1() {
|
|
|
18297
18315
|
* @param context context to use as parent
|
|
18298
18316
|
* @param span span to set active
|
|
18299
18317
|
*/
|
|
18300
|
-
function setSpan(context$
|
|
18301
|
-
return context$
|
|
18318
|
+
function setSpan(context$1, span) {
|
|
18319
|
+
return context$1.setValue(SPAN_KEY, span);
|
|
18302
18320
|
}
|
|
18303
18321
|
/**
|
|
18304
18322
|
* Remove current span stored in the context
|
|
18305
18323
|
*
|
|
18306
18324
|
* @param context context to delete span from
|
|
18307
18325
|
*/
|
|
18308
|
-
function deleteSpan(context$
|
|
18309
|
-
return context$
|
|
18326
|
+
function deleteSpan(context$1) {
|
|
18327
|
+
return context$1.deleteValue(SPAN_KEY);
|
|
18310
18328
|
}
|
|
18311
18329
|
/**
|
|
18312
18330
|
* Wrap span context in a NoopSpan and set as span in a new
|
|
@@ -18315,17 +18333,17 @@ function deleteSpan(context$2) {
|
|
|
18315
18333
|
* @param context context to set active span on
|
|
18316
18334
|
* @param spanContext span context to be wrapped
|
|
18317
18335
|
*/
|
|
18318
|
-
function setSpanContext(context$
|
|
18319
|
-
return setSpan(context$
|
|
18336
|
+
function setSpanContext(context$1, spanContext) {
|
|
18337
|
+
return setSpan(context$1, new NonRecordingSpan(spanContext));
|
|
18320
18338
|
}
|
|
18321
18339
|
/**
|
|
18322
18340
|
* Get the span context of the span if it exists.
|
|
18323
18341
|
*
|
|
18324
18342
|
* @param context context to get values from
|
|
18325
18343
|
*/
|
|
18326
|
-
function getSpanContext(context$
|
|
18344
|
+
function getSpanContext(context$1) {
|
|
18327
18345
|
var _a$5;
|
|
18328
|
-
return (_a$5 = getSpan(context$
|
|
18346
|
+
return (_a$5 = getSpan(context$1)) === null || _a$5 === void 0 ? void 0 : _a$5.spanContext();
|
|
18329
18347
|
}
|
|
18330
18348
|
|
|
18331
18349
|
//#endregion
|
|
@@ -18363,11 +18381,11 @@ var contextApi = ContextAPI.getInstance();
|
|
|
18363
18381
|
*/
|
|
18364
18382
|
var NoopTracer = function() {
|
|
18365
18383
|
function NoopTracer$1() {}
|
|
18366
|
-
NoopTracer$1.prototype.startSpan = function(name$5, options, context$
|
|
18367
|
-
if (context$
|
|
18384
|
+
NoopTracer$1.prototype.startSpan = function(name$5, options, context$1) {
|
|
18385
|
+
if (context$1 === void 0) context$1 = contextApi.active();
|
|
18368
18386
|
var root = Boolean(options === null || options === void 0 ? void 0 : options.root);
|
|
18369
18387
|
if (root) return new NonRecordingSpan();
|
|
18370
|
-
var parentFromContext = context$
|
|
18388
|
+
var parentFromContext = context$1 && getSpanContext(context$1);
|
|
18371
18389
|
if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) return new NonRecordingSpan(parentFromContext);
|
|
18372
18390
|
else return new NonRecordingSpan();
|
|
18373
18391
|
};
|
|
@@ -18409,8 +18427,8 @@ var ProxyTracer = function() {
|
|
|
18409
18427
|
this.version = version;
|
|
18410
18428
|
this.options = options;
|
|
18411
18429
|
}
|
|
18412
|
-
ProxyTracer$1.prototype.startSpan = function(name$5, options, context$
|
|
18413
|
-
return this._getTracer().startSpan(name$5, options, context$
|
|
18430
|
+
ProxyTracer$1.prototype.startSpan = function(name$5, options, context$1) {
|
|
18431
|
+
return this._getTracer().startSpan(name$5, options, context$1);
|
|
18414
18432
|
};
|
|
18415
18433
|
ProxyTracer$1.prototype.startActiveSpan = function(_name, _options, _context, _fn) {
|
|
18416
18434
|
var tracer = this._getTracer();
|
|
@@ -18508,7 +18526,7 @@ var SpanStatusCode;
|
|
|
18508
18526
|
//#endregion
|
|
18509
18527
|
//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/context-api.js
|
|
18510
18528
|
/** Entrypoint for context API */
|
|
18511
|
-
var context
|
|
18529
|
+
var context = ContextAPI.getInstance();
|
|
18512
18530
|
|
|
18513
18531
|
//#endregion
|
|
18514
18532
|
//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/api/trace.js
|
|
@@ -19885,9 +19903,9 @@ function getTracer({ isEnabled = false, tracer } = {}) {
|
|
|
19885
19903
|
}
|
|
19886
19904
|
async function recordSpan({ name: name20, tracer, attributes: attributes$73, fn, endWhenDone = true }) {
|
|
19887
19905
|
return tracer.startActiveSpan(name20, { attributes: await attributes$73 }, async (span) => {
|
|
19888
|
-
const ctx = context
|
|
19906
|
+
const ctx = context.active();
|
|
19889
19907
|
try {
|
|
19890
|
-
const result = await context
|
|
19908
|
+
const result = await context.with(ctx, () => fn(span));
|
|
19891
19909
|
if (endWhenDone) span.end();
|
|
19892
19910
|
return result;
|
|
19893
19911
|
} catch (error) {
|
|
@@ -22085,7 +22103,7 @@ var _a19;
|
|
|
22085
22103
|
_a19 = symbol19;
|
|
22086
22104
|
|
|
22087
22105
|
//#endregion
|
|
22088
|
-
//#region ../mcp-core/dist/callEmbeddedAgent-
|
|
22106
|
+
//#region ../mcp-core/dist/callEmbeddedAgent-OjlsNjfN.js
|
|
22089
22107
|
/**
|
|
22090
22108
|
* Call an embedded agent with tool call capture
|
|
22091
22109
|
* This is the standard way to call embedded AI agents within MCP tools
|
|
@@ -27357,7 +27375,7 @@ function createDatasetAttributesTool(options) {
|
|
|
27357
27375
|
"logs"
|
|
27358
27376
|
]).describe("The dataset to query attributes for") }),
|
|
27359
27377
|
execute: async ({ dataset }) => {
|
|
27360
|
-
const { BASE_COMMON_FIELDS, DATASET_FIELDS, RECOMMENDED_FIELDS: RECOMMENDED_FIELDS$2, NUMERIC_FIELDS, DATASET_EXAMPLES } = await Promise.resolve().then(() => require("./config-
|
|
27378
|
+
const { BASE_COMMON_FIELDS, DATASET_FIELDS, RECOMMENDED_FIELDS: RECOMMENDED_FIELDS$2, NUMERIC_FIELDS, DATASET_EXAMPLES } = await Promise.resolve().then(() => require("./config-DU03TDiU.cjs"));
|
|
27361
27379
|
const { attributes: customAttributes, fieldTypes } = await fetchCustomAttributes(apiService, organizationSlug, dataset, projectId);
|
|
27362
27380
|
const allFields = {
|
|
27363
27381
|
...BASE_COMMON_FIELDS,
|
|
@@ -27392,7 +27410,7 @@ Use these examples as patterns for constructing your query.`;
|
|
|
27392
27410
|
}
|
|
27393
27411
|
|
|
27394
27412
|
//#endregion
|
|
27395
|
-
//#region ../mcp-core/dist/agent-
|
|
27413
|
+
//#region ../mcp-core/dist/agent-wsx2QONb.js
|
|
27396
27414
|
const searchEventsAgentOutputSchema = zod.z.object({
|
|
27397
27415
|
dataset: zod.z.enum([
|
|
27398
27416
|
"spans",
|
|
@@ -27664,7 +27682,7 @@ function formatSpanResults(params) {
|
|
|
27664
27682
|
}
|
|
27665
27683
|
|
|
27666
27684
|
//#endregion
|
|
27667
|
-
//#region ../mcp-core/dist/handler-
|
|
27685
|
+
//#region ../mcp-core/dist/handler-DNnyzfbW.js
|
|
27668
27686
|
var handler_default = defineTool({
|
|
27669
27687
|
name: "search_events",
|
|
27670
27688
|
skills: [
|
|
@@ -27723,8 +27741,8 @@ var handler_default = defineTool({
|
|
|
27723
27741
|
readOnlyHint: true,
|
|
27724
27742
|
openWorldHint: true
|
|
27725
27743
|
},
|
|
27726
|
-
async handler(params, context$
|
|
27727
|
-
const apiService = apiServiceFromContext(context$
|
|
27744
|
+
async handler(params, context$1) {
|
|
27745
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
27728
27746
|
const organizationSlug = params.organizationSlug;
|
|
27729
27747
|
(0, __sentry_core.setTag)("organization.slug", organizationSlug);
|
|
27730
27748
|
if (params.projectSlug) (0, __sentry_core.setTag)("project.slug", params.projectSlug);
|
|
@@ -27805,7 +27823,7 @@ var handler_default = defineTool({
|
|
|
27805
27823
|
});
|
|
27806
27824
|
|
|
27807
27825
|
//#endregion
|
|
27808
|
-
//#region ../mcp-core/dist/create-team-
|
|
27826
|
+
//#region ../mcp-core/dist/create-team-CIgYB9Qa.js
|
|
27809
27827
|
var create_team_default = defineTool({
|
|
27810
27828
|
name: "create_team",
|
|
27811
27829
|
skills: ["project-management"],
|
|
@@ -27841,8 +27859,8 @@ var create_team_default = defineTool({
|
|
|
27841
27859
|
destructiveHint: false,
|
|
27842
27860
|
openWorldHint: true
|
|
27843
27861
|
},
|
|
27844
|
-
async handler(params, context$
|
|
27845
|
-
const apiService = apiServiceFromContext(context$
|
|
27862
|
+
async handler(params, context$1) {
|
|
27863
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
27846
27864
|
const organizationSlug = params.organizationSlug;
|
|
27847
27865
|
(0, __sentry_core.setTag)("organization.slug", organizationSlug);
|
|
27848
27866
|
const team = await apiService.createTeam({
|
|
@@ -27860,7 +27878,7 @@ var create_team_default = defineTool({
|
|
|
27860
27878
|
});
|
|
27861
27879
|
|
|
27862
27880
|
//#endregion
|
|
27863
|
-
//#region ../mcp-core/dist/create-project-
|
|
27881
|
+
//#region ../mcp-core/dist/create-project-B-ud4_Gj.js
|
|
27864
27882
|
var create_project_default = defineTool({
|
|
27865
27883
|
name: "create_project",
|
|
27866
27884
|
skills: ["project-management"],
|
|
@@ -27902,8 +27920,8 @@ var create_project_default = defineTool({
|
|
|
27902
27920
|
destructiveHint: false,
|
|
27903
27921
|
openWorldHint: true
|
|
27904
27922
|
},
|
|
27905
|
-
async handler(params, context$
|
|
27906
|
-
const apiService = apiServiceFromContext(context$
|
|
27923
|
+
async handler(params, context$1) {
|
|
27924
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
27907
27925
|
const organizationSlug = params.organizationSlug;
|
|
27908
27926
|
(0, __sentry_core.setTag)("organization.slug", organizationSlug);
|
|
27909
27927
|
(0, __sentry_core.setTag)("team.slug", params.teamSlug);
|
|
@@ -27937,7 +27955,7 @@ var create_project_default = defineTool({
|
|
|
27937
27955
|
});
|
|
27938
27956
|
|
|
27939
27957
|
//#endregion
|
|
27940
|
-
//#region ../mcp-core/dist/update-project-
|
|
27958
|
+
//#region ../mcp-core/dist/update-project-DTNa3ZSG.js
|
|
27941
27959
|
var update_project_default = defineTool({
|
|
27942
27960
|
name: "update_project",
|
|
27943
27961
|
skills: ["project-management"],
|
|
@@ -27995,8 +28013,8 @@ var update_project_default = defineTool({
|
|
|
27995
28013
|
idempotentHint: true,
|
|
27996
28014
|
openWorldHint: true
|
|
27997
28015
|
},
|
|
27998
|
-
async handler(params, context$
|
|
27999
|
-
const apiService = apiServiceFromContext(context$
|
|
28016
|
+
async handler(params, context$1) {
|
|
28017
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
28000
28018
|
const organizationSlug = params.organizationSlug;
|
|
28001
28019
|
(0, __sentry_core.setTag)("organization.slug", organizationSlug);
|
|
28002
28020
|
(0, __sentry_core.setTag)("project.slug", params.projectSlug);
|
|
@@ -28055,7 +28073,7 @@ var update_project_default = defineTool({
|
|
|
28055
28073
|
});
|
|
28056
28074
|
|
|
28057
28075
|
//#endregion
|
|
28058
|
-
//#region ../mcp-core/dist/create-dsn-
|
|
28076
|
+
//#region ../mcp-core/dist/create-dsn-BMy0VEvv.js
|
|
28059
28077
|
var create_dsn_default = defineTool({
|
|
28060
28078
|
name: "create_dsn",
|
|
28061
28079
|
skills: ["project-management"],
|
|
@@ -28095,8 +28113,8 @@ var create_dsn_default = defineTool({
|
|
|
28095
28113
|
destructiveHint: false,
|
|
28096
28114
|
openWorldHint: true
|
|
28097
28115
|
},
|
|
28098
|
-
async handler(params, context$
|
|
28099
|
-
const apiService = apiServiceFromContext(context$
|
|
28116
|
+
async handler(params, context$1) {
|
|
28117
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
28100
28118
|
const organizationSlug = params.organizationSlug;
|
|
28101
28119
|
(0, __sentry_core.setTag)("organization.slug", organizationSlug);
|
|
28102
28120
|
(0, __sentry_core.setTag)("project.slug", params.projectSlug);
|
|
@@ -28115,7 +28133,7 @@ var create_dsn_default = defineTool({
|
|
|
28115
28133
|
});
|
|
28116
28134
|
|
|
28117
28135
|
//#endregion
|
|
28118
|
-
//#region ../mcp-core/dist/find-dsns-
|
|
28136
|
+
//#region ../mcp-core/dist/find-dsns-BNs_f7T4.js
|
|
28119
28137
|
var find_dsns_default = defineTool({
|
|
28120
28138
|
name: "find_dsns",
|
|
28121
28139
|
skills: ["project-management"],
|
|
@@ -28140,8 +28158,8 @@ var find_dsns_default = defineTool({
|
|
|
28140
28158
|
readOnlyHint: true,
|
|
28141
28159
|
openWorldHint: true
|
|
28142
28160
|
},
|
|
28143
|
-
async handler(params, context$
|
|
28144
|
-
const apiService = apiServiceFromContext(context$
|
|
28161
|
+
async handler(params, context$1) {
|
|
28162
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
28145
28163
|
const organizationSlug = params.organizationSlug;
|
|
28146
28164
|
(0, __sentry_core.setTag)("organization.slug", organizationSlug);
|
|
28147
28165
|
(0, __sentry_core.setTag)("project.slug", params.projectSlug);
|
|
@@ -28216,7 +28234,7 @@ async function retryWithBackoff(fn, { maxRetries = 3, initialDelay = 1e3, should
|
|
|
28216
28234
|
}
|
|
28217
28235
|
|
|
28218
28236
|
//#endregion
|
|
28219
|
-
//#region ../mcp-core/dist/analyze-issue-with-seer-
|
|
28237
|
+
//#region ../mcp-core/dist/analyze-issue-with-seer-B9kgNzVB.js
|
|
28220
28238
|
var analyze_issue_with_seer_default = defineTool({
|
|
28221
28239
|
name: "analyze_issue_with_seer",
|
|
28222
28240
|
skills: ["seer"],
|
|
@@ -28228,7 +28246,7 @@ var analyze_issue_with_seer_default = defineTool({
|
|
|
28228
28246
|
"- The user explicitly asks for root cause analysis, Seer analysis, or help fixing/debugging an issue",
|
|
28229
28247
|
"- You are unable to accurately determine the root cause from the issue details alone",
|
|
28230
28248
|
"",
|
|
28231
|
-
"Do NOT call this tool as an automatic follow-up to
|
|
28249
|
+
"Do NOT call this tool as an automatic follow-up to get_sentry_resource.",
|
|
28232
28250
|
"",
|
|
28233
28251
|
"What this tool provides:",
|
|
28234
28252
|
"- Root cause analysis with code-level explanations",
|
|
@@ -28274,8 +28292,8 @@ var analyze_issue_with_seer_default = defineTool({
|
|
|
28274
28292
|
destructiveHint: false,
|
|
28275
28293
|
openWorldHint: true
|
|
28276
28294
|
},
|
|
28277
|
-
async handler(params, context$
|
|
28278
|
-
const apiService = apiServiceFromContext(context$
|
|
28295
|
+
async handler(params, context$1) {
|
|
28296
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
28279
28297
|
const { organizationSlug: orgSlug, issueId: parsedIssueId } = parseIssueParams$1({
|
|
28280
28298
|
organizationSlug: params.organizationSlug,
|
|
28281
28299
|
issueId: params.issueId,
|
|
@@ -28441,12 +28459,12 @@ var search_docs_default = defineTool({
|
|
|
28441
28459
|
readOnlyHint: true,
|
|
28442
28460
|
openWorldHint: true
|
|
28443
28461
|
},
|
|
28444
|
-
async handler(params, context$
|
|
28462
|
+
async handler(params, context$1) {
|
|
28445
28463
|
let output = `# Documentation Search Results\n\n`;
|
|
28446
28464
|
output += `**Query**: "${params.query}"\n`;
|
|
28447
28465
|
if (params.guide) output += `**Guide**: ${params.guide}\n`;
|
|
28448
28466
|
output += `\n`;
|
|
28449
|
-
const host = context$
|
|
28467
|
+
const host = context$1.mcpUrl || "https://mcp.sentry.dev";
|
|
28450
28468
|
const searchUrl = new URL("/api/search", host);
|
|
28451
28469
|
const response = await fetchWithTimeout(searchUrl.toString(), {
|
|
28452
28470
|
method: "POST",
|
|
@@ -28487,7 +28505,7 @@ var search_docs_default = defineTool({
|
|
|
28487
28505
|
});
|
|
28488
28506
|
|
|
28489
28507
|
//#endregion
|
|
28490
|
-
//#region ../mcp-core/dist/get-doc-
|
|
28508
|
+
//#region ../mcp-core/dist/get-doc-B-dMSM8_.js
|
|
28491
28509
|
var get_doc_default = defineTool({
|
|
28492
28510
|
name: "get_doc",
|
|
28493
28511
|
skills: ["docs"],
|
|
@@ -28519,7 +28537,7 @@ var get_doc_default = defineTool({
|
|
|
28519
28537
|
readOnlyHint: true,
|
|
28520
28538
|
openWorldHint: true
|
|
28521
28539
|
},
|
|
28522
|
-
async handler(params, context$
|
|
28540
|
+
async handler(params, context$1) {
|
|
28523
28541
|
(0, __sentry_core.setTag)("doc.path", params.path);
|
|
28524
28542
|
let output = `# Documentation Content\n\n`;
|
|
28525
28543
|
output += `**Path**: ${params.path}\n\n`;
|
|
@@ -28530,7 +28548,7 @@ var get_doc_default = defineTool({
|
|
|
28530
28548
|
if (!allowedDomains.includes(docUrl.hostname)) throw new UserInputError(`Invalid domain. Documentation can only be fetched from allowed domains: ${allowedDomains.join(", ")}`);
|
|
28531
28549
|
const response = await fetchWithTimeout(docUrl.toString(), { headers: {
|
|
28532
28550
|
Accept: "text/plain, text/markdown",
|
|
28533
|
-
"User-Agent":
|
|
28551
|
+
"User-Agent": require_version.USER_AGENT
|
|
28534
28552
|
} }, 15e3);
|
|
28535
28553
|
if (!response.ok) {
|
|
28536
28554
|
if (response.status === 404) {
|
|
@@ -28806,7 +28824,7 @@ Always use the issueFields tool to discover available fields when needed.
|
|
|
28806
28824
|
Use the whoami tool when you need to resolve 'me' references.`;
|
|
28807
28825
|
|
|
28808
28826
|
//#endregion
|
|
28809
|
-
//#region ../mcp-core/dist/agent-
|
|
28827
|
+
//#region ../mcp-core/dist/agent-BveVnjqw.js
|
|
28810
28828
|
const searchIssuesAgentOutputSchema = zod.z.object({
|
|
28811
28829
|
query: zod.z.string().describe("The Sentry issue search query"),
|
|
28812
28830
|
sort: zod.z.enum([
|
|
@@ -28839,7 +28857,7 @@ async function searchIssuesAgent(options) {
|
|
|
28839
28857
|
}
|
|
28840
28858
|
|
|
28841
28859
|
//#endregion
|
|
28842
|
-
//#region ../mcp-core/dist/formatters-
|
|
28860
|
+
//#region ../mcp-core/dist/formatters-CgnSVeQb.js
|
|
28843
28861
|
/**
|
|
28844
28862
|
* Format an explanation for how a natural language query was translated
|
|
28845
28863
|
*/
|
|
@@ -28873,12 +28891,12 @@ function formatIssueResults(params) {
|
|
|
28873
28891
|
output += "Try adjusting your search criteria or time range.";
|
|
28874
28892
|
return output;
|
|
28875
28893
|
}
|
|
28876
|
-
const searchUrl =
|
|
28894
|
+
const searchUrl = require_constants.getIssuesSearchUrl(host, organizationSlug, query, projectSlugOrId);
|
|
28877
28895
|
output += `**View these results in Sentry**:\n${searchUrl}\n`;
|
|
28878
28896
|
output += `_Please share this link with the user to view the search results in their Sentry dashboard._\n\n`;
|
|
28879
28897
|
output += `Found **${issues.length}** issue${issues.length === 1 ? "" : "s"}:\n\n`;
|
|
28880
28898
|
issues.forEach((issue, index) => {
|
|
28881
|
-
const issueUrl =
|
|
28899
|
+
const issueUrl = require_constants.getIssueUrl(host, organizationSlug, issue.shortId);
|
|
28882
28900
|
output += `## ${index + 1}. [${issue.shortId}](${issueUrl})\n\n`;
|
|
28883
28901
|
output += `**${issue.title}**\n\n`;
|
|
28884
28902
|
output += `- **Status**: ${issue.status}\n`;
|
|
@@ -28897,11 +28915,11 @@ function formatIssueResults(params) {
|
|
|
28897
28915
|
output += "\n";
|
|
28898
28916
|
});
|
|
28899
28917
|
output += "## Next Steps\n\n";
|
|
28900
|
-
output += "- Get more details about a specific issue: Use the
|
|
28918
|
+
output += "- Get more details about a specific issue: Use get_sentry_resource with the issue ID or issue URL\n";
|
|
28901
28919
|
output += "- Update issue status: Use update_issue to resolve or assign issues\n";
|
|
28902
28920
|
output += "- View event counts: Use search_events for aggregated statistics\n";
|
|
28903
28921
|
const hasFeedback = issues.some((i) => i.issueCategory === "feedback");
|
|
28904
|
-
if (hasFeedback) output += "- View feedback details: Use
|
|
28922
|
+
if (hasFeedback) output += "- View feedback details: Use get_sentry_resource to see full feedback content and linked error events\n";
|
|
28905
28923
|
return output;
|
|
28906
28924
|
}
|
|
28907
28925
|
/**
|
|
@@ -28924,7 +28942,7 @@ function formatDate(dateString) {
|
|
|
28924
28942
|
}
|
|
28925
28943
|
|
|
28926
28944
|
//#endregion
|
|
28927
|
-
//#region ../mcp-core/dist/handler-
|
|
28945
|
+
//#region ../mcp-core/dist/handler-CzB1ic7R.js
|
|
28928
28946
|
var handler_default$1 = defineTool({
|
|
28929
28947
|
name: "search_issues",
|
|
28930
28948
|
skills: [
|
|
@@ -28954,7 +28972,7 @@ var handler_default$1 = defineTool({
|
|
|
28954
28972
|
"",
|
|
28955
28973
|
"ALSO DO NOT USE FOR:",
|
|
28956
28974
|
"- Individual error events with timestamps → use search_events",
|
|
28957
|
-
"- Details about a specific issue ID → use
|
|
28975
|
+
"- Details about a specific issue ID or Sentry issue URL → use get_sentry_resource",
|
|
28958
28976
|
"",
|
|
28959
28977
|
"REMEMBER: This tool returns a LIST of issues, not counts or statistics!",
|
|
28960
28978
|
"",
|
|
@@ -28983,8 +29001,8 @@ var handler_default$1 = defineTool({
|
|
|
28983
29001
|
readOnlyHint: true,
|
|
28984
29002
|
openWorldHint: true
|
|
28985
29003
|
},
|
|
28986
|
-
async handler(params, context$
|
|
28987
|
-
const apiService = apiServiceFromContext(context$
|
|
29004
|
+
async handler(params, context$1) {
|
|
29005
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
28988
29006
|
(0, __sentry_core.setTag)("organization.slug", params.organizationSlug);
|
|
28989
29007
|
if (params.projectSlugOrId) if (isNumericId(params.projectSlugOrId)) (0, __sentry_core.setTag)("project.id", params.projectSlugOrId);
|
|
28990
29008
|
else (0, __sentry_core.setTag)("project.slug", params.projectSlugOrId);
|
|
@@ -29459,7 +29477,7 @@ Received: ${params.issueUrl}`);
|
|
|
29459
29477
|
}
|
|
29460
29478
|
|
|
29461
29479
|
//#endregion
|
|
29462
|
-
//#region ../mcp-core/dist/agent-
|
|
29480
|
+
//#region ../mcp-core/dist/agent-CsDcSXOE.js
|
|
29463
29481
|
const searchIssueEventsAgentOutputSchema = zod.z.object({
|
|
29464
29482
|
query: zod.z.string().describe("Sentry query filters for tags/fields (NOT including issue: prefix - handler adds that)"),
|
|
29465
29483
|
fields: zod.z.array(zod.z.string()).describe("Array of field names to return in results"),
|
|
@@ -29501,7 +29519,7 @@ async function searchIssueEventsAgent(options) {
|
|
|
29501
29519
|
}
|
|
29502
29520
|
|
|
29503
29521
|
//#endregion
|
|
29504
|
-
//#region ../mcp-core/dist/handler-
|
|
29522
|
+
//#region ../mcp-core/dist/handler-BVjqQBxm.js
|
|
29505
29523
|
var handler_default$2 = defineTool({
|
|
29506
29524
|
name: "search_issue_events",
|
|
29507
29525
|
skills: ["inspect", "triage"],
|
|
@@ -29511,7 +29529,7 @@ var handler_default$2 = defineTool({
|
|
|
29511
29529
|
"",
|
|
29512
29530
|
"Use this to filter events by time, environment, release, user, trace ID, or other tags. The tool automatically constrains results to the specified issue.",
|
|
29513
29531
|
"",
|
|
29514
|
-
"For cross-issue searches use search_issues
|
|
29532
|
+
"For cross-issue searches use search_issues. For single issue or event details use get_sentry_resource.",
|
|
29515
29533
|
"",
|
|
29516
29534
|
"<examples>",
|
|
29517
29535
|
"search_issue_events(issueId='MCP-41', organizationSlug='my-org', naturalLanguageQuery='from last hour')",
|
|
@@ -29532,13 +29550,13 @@ var handler_default$2 = defineTool({
|
|
|
29532
29550
|
readOnlyHint: true,
|
|
29533
29551
|
openWorldHint: true
|
|
29534
29552
|
},
|
|
29535
|
-
async handler(params, context$
|
|
29553
|
+
async handler(params, context$1) {
|
|
29536
29554
|
const { organizationSlug, issueId } = parseIssueParams({
|
|
29537
29555
|
organizationSlug: params.organizationSlug,
|
|
29538
29556
|
issueId: params.issueId,
|
|
29539
29557
|
issueUrl: params.issueUrl
|
|
29540
29558
|
});
|
|
29541
|
-
const apiService = apiServiceFromContext(context$
|
|
29559
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
29542
29560
|
(0, __sentry_core.setTag)("organization.slug", organizationSlug);
|
|
29543
29561
|
(0, __sentry_core.setTag)("issue.id", issueId);
|
|
29544
29562
|
if (params.projectSlug) (0, __sentry_core.setTag)("project.slug", params.projectSlug);
|
|
@@ -29622,7 +29640,7 @@ The user may include various parameters to pass to those tools in their prompt.
|
|
|
29622
29640
|
You MUST return tool results directly without interpreting them.`;
|
|
29623
29641
|
|
|
29624
29642
|
//#endregion
|
|
29625
|
-
//#region ../mcp-core/dist/agent-
|
|
29643
|
+
//#region ../mcp-core/dist/agent-BAhhoVHO.js
|
|
29626
29644
|
/**
|
|
29627
29645
|
* Output schema for the embedded agent.
|
|
29628
29646
|
* The agent returns the final result string directly from its tool calls.
|
|
@@ -29643,27 +29661,29 @@ async function useSentryAgent(options) {
|
|
|
29643
29661
|
}
|
|
29644
29662
|
|
|
29645
29663
|
//#endregion
|
|
29646
|
-
//#region ../mcp-core/dist/types-
|
|
29664
|
+
//#region ../mcp-core/dist/types-bWxCxxir.js
|
|
29647
29665
|
/**
|
|
29648
29666
|
* Resolves a tool description to a string.
|
|
29649
29667
|
* Handles both static strings and dynamic description functions.
|
|
29650
29668
|
*/
|
|
29651
|
-
function resolveDescription(description$73, context$
|
|
29652
|
-
return typeof description$73 === "function" ? description$73(context$
|
|
29669
|
+
function resolveDescription(description$73, context$1) {
|
|
29670
|
+
return typeof description$73 === "function" ? description$73(context$1) : description$73;
|
|
29653
29671
|
}
|
|
29654
29672
|
/**
|
|
29655
|
-
* Determines if a tool should be visible
|
|
29673
|
+
* Determines if a tool should be externally visible through MCP surfaces.
|
|
29674
|
+
* - Tools with `internalOnly: true` are never exposed through server registration
|
|
29656
29675
|
* - Tools with `experimental: true` are only visible when experimentalMode is true
|
|
29657
29676
|
* - Tools with `hideInExperimentalMode: true` are hidden when experimentalMode is true
|
|
29658
29677
|
*/
|
|
29659
29678
|
function isToolVisibleInMode(tool$1, experimentalMode) {
|
|
29679
|
+
if (tool$1.internalOnly) return false;
|
|
29660
29680
|
if (tool$1.experimental && !experimentalMode) return false;
|
|
29661
29681
|
if (tool$1.hideInExperimentalMode && experimentalMode) return false;
|
|
29662
29682
|
return true;
|
|
29663
29683
|
}
|
|
29664
29684
|
|
|
29665
29685
|
//#endregion
|
|
29666
|
-
//#region ../mcp-core/dist/list-issues-
|
|
29686
|
+
//#region ../mcp-core/dist/list-issues-BNpP7kp_.js
|
|
29667
29687
|
var list_issues_default = defineTool({
|
|
29668
29688
|
name: "list_issues",
|
|
29669
29689
|
skills: [
|
|
@@ -29723,8 +29743,8 @@ var list_issues_default = defineTool({
|
|
|
29723
29743
|
readOnlyHint: true,
|
|
29724
29744
|
openWorldHint: true
|
|
29725
29745
|
},
|
|
29726
|
-
async handler(params, context$
|
|
29727
|
-
const apiService = apiServiceFromContext(context$
|
|
29746
|
+
async handler(params, context$1) {
|
|
29747
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
29728
29748
|
(0, __sentry_core.setTag)("organization.slug", params.organizationSlug);
|
|
29729
29749
|
if (params.projectSlugOrId) if (isNumericId(params.projectSlugOrId)) (0, __sentry_core.setTag)("project.id", params.projectSlugOrId);
|
|
29730
29750
|
else (0, __sentry_core.setTag)("project.slug", params.projectSlugOrId);
|
|
@@ -29746,7 +29766,7 @@ var list_issues_default = defineTool({
|
|
|
29746
29766
|
});
|
|
29747
29767
|
|
|
29748
29768
|
//#endregion
|
|
29749
|
-
//#region ../mcp-core/dist/list-events-
|
|
29769
|
+
//#region ../mcp-core/dist/list-events-Bb6MjTx5.js
|
|
29750
29770
|
const DEFAULT_FIELDS = {
|
|
29751
29771
|
errors: require_config_BYPjNBPX.RECOMMENDED_FIELDS.errors.basic,
|
|
29752
29772
|
logs: require_config_BYPjNBPX.RECOMMENDED_FIELDS.logs.basic,
|
|
@@ -29814,8 +29834,8 @@ var list_events_default = defineTool({
|
|
|
29814
29834
|
readOnlyHint: true,
|
|
29815
29835
|
openWorldHint: true
|
|
29816
29836
|
},
|
|
29817
|
-
async handler(params, context$
|
|
29818
|
-
const apiService = apiServiceFromContext(context$
|
|
29837
|
+
async handler(params, context$1) {
|
|
29838
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
29819
29839
|
(0, __sentry_core.setTag)("organization.slug", params.organizationSlug);
|
|
29820
29840
|
if (params.projectSlug) (0, __sentry_core.setTag)("project.slug", params.projectSlug);
|
|
29821
29841
|
let projectId;
|
|
@@ -29868,7 +29888,7 @@ var list_events_default = defineTool({
|
|
|
29868
29888
|
});
|
|
29869
29889
|
|
|
29870
29890
|
//#endregion
|
|
29871
|
-
//#region ../mcp-core/dist/list-issue-events-
|
|
29891
|
+
//#region ../mcp-core/dist/list-issue-events-BsxAzkCh.js
|
|
29872
29892
|
var list_issue_events_default = defineTool({
|
|
29873
29893
|
name: "list_issue_events",
|
|
29874
29894
|
skills: ["inspect", "triage"],
|
|
@@ -29915,13 +29935,13 @@ var list_issue_events_default = defineTool({
|
|
|
29915
29935
|
readOnlyHint: true,
|
|
29916
29936
|
openWorldHint: true
|
|
29917
29937
|
},
|
|
29918
|
-
async handler(params, context$
|
|
29938
|
+
async handler(params, context$1) {
|
|
29919
29939
|
const { organizationSlug, issueId } = parseIssueParams({
|
|
29920
29940
|
organizationSlug: params.organizationSlug,
|
|
29921
29941
|
issueId: params.issueId,
|
|
29922
29942
|
issueUrl: params.issueUrl
|
|
29923
29943
|
});
|
|
29924
|
-
const apiService = apiServiceFromContext(context$
|
|
29944
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
29925
29945
|
(0, __sentry_core.setTag)("organization.slug", organizationSlug);
|
|
29926
29946
|
(0, __sentry_core.setTag)("issue.id", issueId);
|
|
29927
29947
|
const eventsResponse = await apiService.listEventsForIssue({
|
|
@@ -29952,281 +29972,7 @@ var list_issue_events_default = defineTool({
|
|
|
29952
29972
|
});
|
|
29953
29973
|
|
|
29954
29974
|
//#endregion
|
|
29955
|
-
//#region ../mcp-core/dist/
|
|
29956
|
-
/**
|
|
29957
|
-
* Parses a Sentry URL and extracts resource type and identifiers.
|
|
29958
|
-
*
|
|
29959
|
-
* Supported URL patterns:
|
|
29960
|
-
* - Issue: `/issues/{issueId}` or `/organizations/{org}/issues/{issueId}`
|
|
29961
|
-
* - Event: `/issues/{issueId}/events/{eventId}`
|
|
29962
|
-
* - Trace: `/explore/traces/trace/{traceId}` or `/performance/trace/{traceId}`
|
|
29963
|
-
* - Profile: `/explore/profiling/profile/{project}/flamegraph/` with query params
|
|
29964
|
-
* - Replay: `/replays/{replayId}/`
|
|
29965
|
-
* - Monitor: `/crons/{monitorSlug}/` or `/monitors/{monitorSlug}/`
|
|
29966
|
-
* - Release: `/releases/{version}/`
|
|
29967
|
-
*
|
|
29968
|
-
* Organization slug is extracted from:
|
|
29969
|
-
* 1. Subdomain (e.g., `my-org.sentry.io`)
|
|
29970
|
-
* 2. Path (e.g., `/organizations/my-org/...` or `/my-org/issues/...`)
|
|
29971
|
-
*
|
|
29972
|
-
* @param url - A Sentry URL to parse
|
|
29973
|
-
* @returns Parsed URL with resource type and identifiers
|
|
29974
|
-
* @throws UserInputError if the URL is invalid or cannot be parsed
|
|
29975
|
-
*
|
|
29976
|
-
* @example
|
|
29977
|
-
* // Issue URL
|
|
29978
|
-
* parseSentryUrl("https://my-org.sentry.io/issues/PROJECT-123")
|
|
29979
|
-
* // { type: "issue", organizationSlug: "my-org", issueId: "PROJECT-123" }
|
|
29980
|
-
*
|
|
29981
|
-
* @example
|
|
29982
|
-
* // Replay URL
|
|
29983
|
-
* parseSentryUrl("https://my-org.sentry.io/replays/abc123def456/")
|
|
29984
|
-
* // { type: "replay", organizationSlug: "my-org", replayId: "abc123def456" }
|
|
29985
|
-
*
|
|
29986
|
-
* @example
|
|
29987
|
-
* // Monitor URL
|
|
29988
|
-
* parseSentryUrl("https://my-org.sentry.io/crons/my-cron-job/")
|
|
29989
|
-
* // { type: "monitor", organizationSlug: "my-org", monitorSlug: "my-cron-job" }
|
|
29990
|
-
*/
|
|
29991
|
-
function parseSentryUrl(url) {
|
|
29992
|
-
if (!url || typeof url !== "string") throw new UserInputError("Invalid Sentry URL. URL must be a non-empty string.");
|
|
29993
|
-
if (!url.startsWith("http://") && !url.startsWith("https://")) throw new UserInputError("Invalid Sentry URL. Must start with http:// or https://");
|
|
29994
|
-
let parsedUrl;
|
|
29995
|
-
try {
|
|
29996
|
-
parsedUrl = new URL(url);
|
|
29997
|
-
} catch {
|
|
29998
|
-
throw new UserInputError(`Invalid Sentry URL. Unable to parse URL: ${url}`);
|
|
29999
|
-
}
|
|
30000
|
-
const pathParts = parsedUrl.pathname.split("/").filter(Boolean);
|
|
30001
|
-
const organizationSlug = extractOrganizationSlug(parsedUrl, pathParts);
|
|
30002
|
-
return identifyResource(parsedUrl, pathParts, organizationSlug);
|
|
30003
|
-
}
|
|
30004
|
-
/**
|
|
30005
|
-
* Extracts organization slug from URL.
|
|
30006
|
-
*
|
|
30007
|
-
* Checks in order:
|
|
30008
|
-
* 1. `/organizations/{org}/...` path format
|
|
30009
|
-
* 2. `/{org}/issues/...` path format (org before known segments)
|
|
30010
|
-
* 3. Subdomain (e.g., `my-org.sentry.io`) - excluding region prefixes
|
|
30011
|
-
*/
|
|
30012
|
-
function extractOrganizationSlug(parsedUrl, pathParts) {
|
|
30013
|
-
if (pathParts.includes("organizations")) {
|
|
30014
|
-
const orgIndex = pathParts.indexOf("organizations");
|
|
30015
|
-
const slug = pathParts[orgIndex + 1];
|
|
30016
|
-
if (slug) return slug;
|
|
30017
|
-
}
|
|
30018
|
-
const knownSegments = [
|
|
30019
|
-
"issues",
|
|
30020
|
-
"explore",
|
|
30021
|
-
"performance",
|
|
30022
|
-
"projects",
|
|
30023
|
-
"settings",
|
|
30024
|
-
"replays",
|
|
30025
|
-
"releases",
|
|
30026
|
-
"crons",
|
|
30027
|
-
"monitors",
|
|
30028
|
-
"alerts",
|
|
30029
|
-
"feedback",
|
|
30030
|
-
"dashboards",
|
|
30031
|
-
"discover",
|
|
30032
|
-
"insights"
|
|
30033
|
-
];
|
|
30034
|
-
if (pathParts.length > 1 && knownSegments.includes(pathParts[1])) return pathParts[0];
|
|
30035
|
-
const hostParts = parsedUrl.hostname.split(".");
|
|
30036
|
-
const regionPrefixes = [
|
|
30037
|
-
"us",
|
|
30038
|
-
"eu",
|
|
30039
|
-
"de",
|
|
30040
|
-
"www"
|
|
30041
|
-
];
|
|
30042
|
-
if (hostParts.length >= 2 && !regionPrefixes.includes(hostParts[0])) return hostParts[0];
|
|
30043
|
-
throw new UserInputError("Invalid Sentry URL. Could not determine organization from URL.");
|
|
30044
|
-
}
|
|
30045
|
-
/**
|
|
30046
|
-
* Identifies the resource type and extracts relevant identifiers.
|
|
30047
|
-
*/
|
|
30048
|
-
function identifyResource(parsedUrl, pathParts, organizationSlug) {
|
|
30049
|
-
const profilingIndex = pathParts.indexOf("profiling");
|
|
30050
|
-
if (profilingIndex !== -1 && pathParts[profilingIndex + 1] === "profile") {
|
|
30051
|
-
const projectSlug = pathParts[profilingIndex + 2];
|
|
30052
|
-
const profilerId = parsedUrl.searchParams.get("profilerId") || void 0;
|
|
30053
|
-
const start = parsedUrl.searchParams.get("start") || void 0;
|
|
30054
|
-
const end = parsedUrl.searchParams.get("end") || void 0;
|
|
30055
|
-
return {
|
|
30056
|
-
type: "profile",
|
|
30057
|
-
organizationSlug,
|
|
30058
|
-
projectSlug,
|
|
30059
|
-
profilerId,
|
|
30060
|
-
start,
|
|
30061
|
-
end
|
|
30062
|
-
};
|
|
30063
|
-
}
|
|
30064
|
-
const replaysIndex = pathParts.indexOf("replays");
|
|
30065
|
-
if (replaysIndex !== -1) {
|
|
30066
|
-
const replayId = pathParts[replaysIndex + 1];
|
|
30067
|
-
if (replayId && replayId !== "selectors") return {
|
|
30068
|
-
type: "replay",
|
|
30069
|
-
organizationSlug,
|
|
30070
|
-
replayId
|
|
30071
|
-
};
|
|
30072
|
-
}
|
|
30073
|
-
const cronsIndex = pathParts.indexOf("crons");
|
|
30074
|
-
const monitorsIndex = pathParts.indexOf("monitors");
|
|
30075
|
-
const monitorPathIndex = cronsIndex !== -1 ? cronsIndex : monitorsIndex;
|
|
30076
|
-
if (monitorPathIndex !== -1) {
|
|
30077
|
-
const nextPart = pathParts[monitorPathIndex + 1];
|
|
30078
|
-
if (nextPart && nextPart !== "new") {
|
|
30079
|
-
const afterNext = pathParts[monitorPathIndex + 2];
|
|
30080
|
-
if (afterNext && afterNext !== "details") return {
|
|
30081
|
-
type: "monitor",
|
|
30082
|
-
organizationSlug,
|
|
30083
|
-
projectSlug: nextPart,
|
|
30084
|
-
monitorSlug: afterNext
|
|
30085
|
-
};
|
|
30086
|
-
return {
|
|
30087
|
-
type: "monitor",
|
|
30088
|
-
organizationSlug,
|
|
30089
|
-
monitorSlug: nextPart
|
|
30090
|
-
};
|
|
30091
|
-
}
|
|
30092
|
-
}
|
|
30093
|
-
const releasesIndex = pathParts.indexOf("releases");
|
|
30094
|
-
if (releasesIndex !== -1) {
|
|
30095
|
-
const releaseVersion = pathParts[releasesIndex + 1];
|
|
30096
|
-
if (releaseVersion && releaseVersion !== "new-events" && releaseVersion !== "all-events") return {
|
|
30097
|
-
type: "release",
|
|
30098
|
-
organizationSlug,
|
|
30099
|
-
releaseVersion
|
|
30100
|
-
};
|
|
30101
|
-
}
|
|
30102
|
-
const traceIndex = pathParts.indexOf("trace");
|
|
30103
|
-
if (traceIndex !== -1) {
|
|
30104
|
-
const traceId = pathParts[traceIndex + 1];
|
|
30105
|
-
if (traceId) {
|
|
30106
|
-
const nodeParam = parsedUrl.searchParams.get("node");
|
|
30107
|
-
let spanId;
|
|
30108
|
-
if (nodeParam?.startsWith("span-")) spanId = nodeParam.slice(5);
|
|
30109
|
-
return {
|
|
30110
|
-
type: "trace",
|
|
30111
|
-
organizationSlug,
|
|
30112
|
-
traceId,
|
|
30113
|
-
spanId
|
|
30114
|
-
};
|
|
30115
|
-
}
|
|
30116
|
-
}
|
|
30117
|
-
if (pathParts.includes("performance") && pathParts.includes("summary")) {
|
|
30118
|
-
const transaction = parsedUrl.searchParams.get("transaction") || void 0;
|
|
30119
|
-
if (transaction) return {
|
|
30120
|
-
type: "unknown",
|
|
30121
|
-
organizationSlug,
|
|
30122
|
-
transaction
|
|
30123
|
-
};
|
|
30124
|
-
}
|
|
30125
|
-
const issuesIndex = pathParts.indexOf("issues");
|
|
30126
|
-
if (issuesIndex !== -1) {
|
|
30127
|
-
const issueId = pathParts[issuesIndex + 1];
|
|
30128
|
-
if (issueId) {
|
|
30129
|
-
const eventsIndex = pathParts.indexOf("events", issuesIndex);
|
|
30130
|
-
if (eventsIndex !== -1) {
|
|
30131
|
-
const eventId = pathParts[eventsIndex + 1];
|
|
30132
|
-
if (eventId) return {
|
|
30133
|
-
type: "event",
|
|
30134
|
-
organizationSlug,
|
|
30135
|
-
issueId,
|
|
30136
|
-
eventId
|
|
30137
|
-
};
|
|
30138
|
-
}
|
|
30139
|
-
return {
|
|
30140
|
-
type: "issue",
|
|
30141
|
-
organizationSlug,
|
|
30142
|
-
issueId
|
|
30143
|
-
};
|
|
30144
|
-
}
|
|
30145
|
-
}
|
|
30146
|
-
return {
|
|
30147
|
-
type: "unknown",
|
|
30148
|
-
organizationSlug
|
|
30149
|
-
};
|
|
30150
|
-
}
|
|
30151
|
-
/**
|
|
30152
|
-
* Checks if a URL appears to be a Sentry profile URL.
|
|
30153
|
-
*
|
|
30154
|
-
* @param url - URL to check
|
|
30155
|
-
* @returns True if the URL looks like a profile URL
|
|
30156
|
-
*/
|
|
30157
|
-
function isProfileUrl(url) {
|
|
30158
|
-
try {
|
|
30159
|
-
const parsed = parseSentryUrl(url);
|
|
30160
|
-
return parsed.type === "profile";
|
|
30161
|
-
} catch {
|
|
30162
|
-
return false;
|
|
30163
|
-
}
|
|
30164
|
-
}
|
|
30165
|
-
|
|
30166
|
-
//#endregion
|
|
30167
|
-
//#region ../mcp-core/dist/breadcrumbs-BNKwvbpZ.js
|
|
30168
|
-
/**
|
|
30169
|
-
* Fetches breadcrumbs from the latest event for an issue and formats them.
|
|
30170
|
-
*/
|
|
30171
|
-
async function fetchAndFormatBreadcrumbs(apiService, organizationSlug, issueId) {
|
|
30172
|
-
const event = await apiService.getLatestEventForIssue({
|
|
30173
|
-
organizationSlug,
|
|
30174
|
-
issueId
|
|
30175
|
-
});
|
|
30176
|
-
const breadcrumbEntry = event.entries.find((e) => e.type === "breadcrumbs");
|
|
30177
|
-
const entryData = breadcrumbEntry?.data;
|
|
30178
|
-
const breadcrumbs = entryData?.values ?? [];
|
|
30179
|
-
return formatBreadcrumbs(breadcrumbs, issueId, event.id);
|
|
30180
|
-
}
|
|
30181
|
-
function formatBreadcrumbs(breadcrumbs, issueId, eventId) {
|
|
30182
|
-
if (breadcrumbs.length === 0) return [
|
|
30183
|
-
`# Breadcrumbs for ${issueId}`,
|
|
30184
|
-
"",
|
|
30185
|
-
`**Event ID**: ${eventId}`,
|
|
30186
|
-
"",
|
|
30187
|
-
"No breadcrumbs found in the latest event for this issue."
|
|
30188
|
-
].join("\n");
|
|
30189
|
-
const output = [
|
|
30190
|
-
`# Breadcrumbs for ${issueId}`,
|
|
30191
|
-
"",
|
|
30192
|
-
`**Event ID**: ${eventId}`,
|
|
30193
|
-
`**Total Breadcrumbs**: ${breadcrumbs.length}`,
|
|
30194
|
-
"",
|
|
30195
|
-
"```"
|
|
30196
|
-
];
|
|
30197
|
-
for (const crumb of breadcrumbs) {
|
|
30198
|
-
const timestamp = crumb.timestamp ? new Date(crumb.timestamp).toISOString() : " ".repeat(24);
|
|
30199
|
-
const level = (crumb.level ?? "info").padEnd(7);
|
|
30200
|
-
const category = crumb.category ?? crumb.type ?? "-";
|
|
30201
|
-
const message = cleanAndTruncate(crumb.message ?? "", 120);
|
|
30202
|
-
const data = formatBreadcrumbData(crumb.data);
|
|
30203
|
-
const parts = [`${timestamp} ${level} [${category}]`];
|
|
30204
|
-
if (message) parts.push(message);
|
|
30205
|
-
if (data) parts.push(data);
|
|
30206
|
-
output.push(parts.join(" "));
|
|
30207
|
-
}
|
|
30208
|
-
output.push("```");
|
|
30209
|
-
output.push("", "Breadcrumbs show the trail of events leading up to the error, in chronological order.", `Use \`get_sentry_resource(resourceType='issue', organizationSlug='...', resourceId='${issueId}')\` for full issue details.`);
|
|
30210
|
-
return output.join("\n");
|
|
30211
|
-
}
|
|
30212
|
-
/**
|
|
30213
|
-
* Formats breadcrumb data as a compact inline JSON string.
|
|
30214
|
-
*/
|
|
30215
|
-
function formatBreadcrumbData(data) {
|
|
30216
|
-
if (!data || Object.keys(data).length === 0) return "";
|
|
30217
|
-
return cleanAndTruncate(JSON.stringify(data), 200);
|
|
30218
|
-
}
|
|
30219
|
-
/**
|
|
30220
|
-
* Strips newlines and truncates a string to maxLen characters.
|
|
30221
|
-
*/
|
|
30222
|
-
function cleanAndTruncate(str, maxLen) {
|
|
30223
|
-
const clean = str.replace(/[\r\n]+/g, " ");
|
|
30224
|
-
if (clean.length <= maxLen) return clean;
|
|
30225
|
-
return `${clean.slice(0, maxLen)}...`;
|
|
30226
|
-
}
|
|
30227
|
-
|
|
30228
|
-
//#endregion
|
|
30229
|
-
//#region ../mcp-core/dist/analyzer-0vRQplm0.js
|
|
29975
|
+
//#region ../mcp-core/dist/analyzer-DtlTbDTS.js
|
|
30230
29976
|
/**
|
|
30231
29977
|
* Analyzes flamegraph data to extract hot paths (most CPU-intensive call stacks).
|
|
30232
29978
|
*
|
|
@@ -30485,7 +30231,7 @@ function hasProfileData(flamegraph) {
|
|
|
30485
30231
|
}
|
|
30486
30232
|
|
|
30487
30233
|
//#endregion
|
|
30488
|
-
//#region ../mcp-core/dist/formatter-
|
|
30234
|
+
//#region ../mcp-core/dist/formatter-C6FOnwJc.js
|
|
30489
30235
|
/**
|
|
30490
30236
|
* Maps a change type to its corresponding status icon.
|
|
30491
30237
|
*/
|
|
@@ -30699,9 +30445,426 @@ function formatFlamegraphComparison(baseline, current, options) {
|
|
|
30699
30445
|
}
|
|
30700
30446
|
return sections.join("\n");
|
|
30701
30447
|
}
|
|
30448
|
+
/**
|
|
30449
|
+
* Formats raw profile chunk analysis.
|
|
30450
|
+
*
|
|
30451
|
+
* Produces markdown output with:
|
|
30452
|
+
* - Chunk metadata
|
|
30453
|
+
* - Sample summary
|
|
30454
|
+
* - Frame breakdown
|
|
30455
|
+
* - Thread information
|
|
30456
|
+
*
|
|
30457
|
+
* @param chunk Profile chunk data from API
|
|
30458
|
+
* @param options Formatting options
|
|
30459
|
+
* @returns Markdown-formatted analysis
|
|
30460
|
+
*/
|
|
30461
|
+
function formatProfileChunkAnalysis(chunk, options) {
|
|
30462
|
+
const sections = [];
|
|
30463
|
+
sections.push("# Profile Chunk Details");
|
|
30464
|
+
sections.push("");
|
|
30465
|
+
sections.push("## Metadata");
|
|
30466
|
+
sections.push(`- **Chunk ID**: ${chunk.chunk_id}`);
|
|
30467
|
+
sections.push(`- **Profiler ID**: ${chunk.profiler_id}`);
|
|
30468
|
+
sections.push(`- **Platform**: ${chunk.platform}`);
|
|
30469
|
+
sections.push(`- **Release**: ${chunk.release}`);
|
|
30470
|
+
if (chunk.environment) sections.push(`- **Environment**: ${chunk.environment}`);
|
|
30471
|
+
sections.push("");
|
|
30472
|
+
sections.push("## Sample Summary");
|
|
30473
|
+
sections.push(`- **Total Frames**: ${chunk.profile.frames.length}`);
|
|
30474
|
+
sections.push(`- **Total Samples**: ${chunk.profile.samples.length}`);
|
|
30475
|
+
sections.push(`- **Total Stacks**: ${chunk.profile.stacks.length}`);
|
|
30476
|
+
sections.push(`- **Threads**: ${Object.keys(chunk.profile.thread_metadata).length}`);
|
|
30477
|
+
sections.push("");
|
|
30478
|
+
sections.push("## Thread Information");
|
|
30479
|
+
sections.push("");
|
|
30480
|
+
for (const [threadId, metadata] of Object.entries(chunk.profile.thread_metadata)) {
|
|
30481
|
+
const threadSamples = chunk.profile.samples.filter((s) => s.thread_id === threadId);
|
|
30482
|
+
sections.push(`- **Thread ${threadId}**: ${metadata.name || "unnamed"} (${threadSamples.length} samples)`);
|
|
30483
|
+
}
|
|
30484
|
+
sections.push("");
|
|
30485
|
+
const frameCounts = /* @__PURE__ */ new Map();
|
|
30486
|
+
for (const stack of chunk.profile.stacks) for (const frameIdx of stack) frameCounts.set(frameIdx, (frameCounts.get(frameIdx) || 0) + 1);
|
|
30487
|
+
const sortedFrames = Array.from(frameCounts.entries()).sort((a, b) => b[1] - a[1]).slice(0, 10);
|
|
30488
|
+
if (sortedFrames.length > 0) {
|
|
30489
|
+
sections.push("## Top Frames by Occurrence");
|
|
30490
|
+
sections.push("");
|
|
30491
|
+
sections.push("| Function | File:Line | Count | Type |");
|
|
30492
|
+
sections.push("|----------|-----------|-------|------|");
|
|
30493
|
+
for (const [frameIdx, count] of sortedFrames) {
|
|
30494
|
+
const frame = chunk.profile.frames[frameIdx];
|
|
30495
|
+
if (!frame) continue;
|
|
30496
|
+
if (options.focusOnUserCode && !frame.in_app) continue;
|
|
30497
|
+
const funcName = frame.class_name ? `${frame.class_name}.${frame.function}` : frame.function;
|
|
30498
|
+
const rawLocation = frame.filename && frame.lineno ? `${frame.filename}:${frame.lineno}` : frame.module || frame.abs_path || "unknown";
|
|
30499
|
+
const location = truncateLocation(rawLocation, 40);
|
|
30500
|
+
const type = frame.in_app ? "User Code" : "Library";
|
|
30501
|
+
sections.push(`| \`${funcName}\` | ${location} | ${count} | ${type} |`);
|
|
30502
|
+
}
|
|
30503
|
+
}
|
|
30504
|
+
return sections.join("\n");
|
|
30505
|
+
}
|
|
30506
|
+
|
|
30507
|
+
//#endregion
|
|
30508
|
+
//#region ../mcp-core/dist/get-profile-details-C1Lo7ikm.js
|
|
30509
|
+
var get_profile_details_default = defineTool({
|
|
30510
|
+
name: "get_profile_details",
|
|
30511
|
+
skills: ["inspect"],
|
|
30512
|
+
requiredScopes: ["event:read"],
|
|
30513
|
+
requiredCapabilities: ["profiles"],
|
|
30514
|
+
hideInExperimentalMode: true,
|
|
30515
|
+
description: [
|
|
30516
|
+
"Retrieve raw profile chunk data to inspect individual function calls, threads, and stack traces.",
|
|
30517
|
+
"",
|
|
30518
|
+
"USE THIS TOOL WHEN:",
|
|
30519
|
+
"- User wants to inspect raw profiling samples for a specific profiler session",
|
|
30520
|
+
"- User needs to see individual thread activity and stack traces",
|
|
30521
|
+
"- User wants detailed frame-level data (function names, file locations, call counts)",
|
|
30522
|
+
"",
|
|
30523
|
+
"RETURNS:",
|
|
30524
|
+
"- Profile chunk metadata (platform, release, environment)",
|
|
30525
|
+
"- Per-thread sample counts and names",
|
|
30526
|
+
"- Top frames by occurrence with file locations",
|
|
30527
|
+
"- User code vs library code breakdown",
|
|
30528
|
+
"",
|
|
30529
|
+
"NOTE: This tool requires a `profilerId` which identifies a specific profiling session.",
|
|
30530
|
+
"Use `get_profile` for aggregated flamegraph analysis by transaction name.",
|
|
30531
|
+
"",
|
|
30532
|
+
"<examples>",
|
|
30533
|
+
"### Inspect a profiler session",
|
|
30534
|
+
"```",
|
|
30535
|
+
"get_profile_details(",
|
|
30536
|
+
" organizationSlug='my-org',",
|
|
30537
|
+
" projectSlugOrId='backend',",
|
|
30538
|
+
" profilerId='041bde57b9844e36b8b7e5734efae5f7',",
|
|
30539
|
+
" start='2024-01-01T00:00:00',",
|
|
30540
|
+
" end='2024-01-01T01:00:00'",
|
|
30541
|
+
")",
|
|
30542
|
+
"```",
|
|
30543
|
+
"</examples>",
|
|
30544
|
+
"",
|
|
30545
|
+
"<hints>",
|
|
30546
|
+
"- Use `focusOnUserCode: true` (default) to filter out library/system frames",
|
|
30547
|
+
"- The profilerId can be found in Sentry profile URLs or event data",
|
|
30548
|
+
"</hints>"
|
|
30549
|
+
].join("\n"),
|
|
30550
|
+
inputSchema: {
|
|
30551
|
+
organizationSlug: ParamOrganizationSlug,
|
|
30552
|
+
regionUrl: ParamRegionUrl.nullable().default(null),
|
|
30553
|
+
projectSlugOrId: zod.z.union([zod.z.string(), zod.z.number()]).describe("Project slug or numeric ID"),
|
|
30554
|
+
profilerId: zod.z.string().trim().describe("Profiler session ID (UUID from Sentry profile data)"),
|
|
30555
|
+
start: zod.z.string().trim().describe("Start time for the profile chunk query (ISO 8601 format, e.g., '2024-01-01T00:00:00')"),
|
|
30556
|
+
end: zod.z.string().trim().describe("End time for the profile chunk query (ISO 8601 format, e.g., '2024-01-01T01:00:00')"),
|
|
30557
|
+
focusOnUserCode: zod.z.boolean().default(true).describe("Show only user code (in_app: true). Set to false to include library code.")
|
|
30558
|
+
},
|
|
30559
|
+
annotations: {
|
|
30560
|
+
readOnlyHint: true,
|
|
30561
|
+
openWorldHint: false
|
|
30562
|
+
},
|
|
30563
|
+
async handler(params, context$1) {
|
|
30564
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
30565
|
+
const { organizationSlug, projectSlugOrId, profilerId, start, end, focusOnUserCode } = params;
|
|
30566
|
+
(0, __sentry_core.setTag)("organization.slug", organizationSlug);
|
|
30567
|
+
(0, __sentry_core.setTag)("profiler.id", profilerId);
|
|
30568
|
+
let projectId;
|
|
30569
|
+
if (typeof projectSlugOrId === "number" || isNumericId(String(projectSlugOrId))) {
|
|
30570
|
+
projectId = projectSlugOrId;
|
|
30571
|
+
(0, __sentry_core.setTag)("project.id", String(projectSlugOrId));
|
|
30572
|
+
} else {
|
|
30573
|
+
const project = await apiService.getProject({
|
|
30574
|
+
organizationSlug,
|
|
30575
|
+
projectSlugOrId: String(projectSlugOrId)
|
|
30576
|
+
});
|
|
30577
|
+
projectId = project.id;
|
|
30578
|
+
(0, __sentry_core.setTag)("project.slug", String(projectSlugOrId));
|
|
30579
|
+
(0, __sentry_core.setTag)("project.id", String(project.id));
|
|
30580
|
+
}
|
|
30581
|
+
const chunk = await apiService.getProfileChunk({
|
|
30582
|
+
organizationSlug,
|
|
30583
|
+
profilerId,
|
|
30584
|
+
projectId,
|
|
30585
|
+
start,
|
|
30586
|
+
end
|
|
30587
|
+
});
|
|
30588
|
+
return formatProfileChunkAnalysis(chunk, { focusOnUserCode });
|
|
30589
|
+
}
|
|
30590
|
+
});
|
|
30702
30591
|
|
|
30703
30592
|
//#endregion
|
|
30704
|
-
//#region ../mcp-core/dist/
|
|
30593
|
+
//#region ../mcp-core/dist/url-helpers-DrUfn62h.js
|
|
30594
|
+
/**
|
|
30595
|
+
* Parses a Sentry URL and extracts resource type and identifiers.
|
|
30596
|
+
*
|
|
30597
|
+
* Supported URL patterns:
|
|
30598
|
+
* - Issue: `/issues/{issueId}` or `/organizations/{org}/issues/{issueId}`
|
|
30599
|
+
* - Event: `/issues/{issueId}/events/{eventId}`
|
|
30600
|
+
* - Trace: `/explore/traces/trace/{traceId}` or `/performance/trace/{traceId}`
|
|
30601
|
+
* - Profile: `/explore/profiling/profile/{project}/flamegraph/` with query params
|
|
30602
|
+
* - Replay: `/replays/{replayId}/`
|
|
30603
|
+
* - Monitor: `/crons/{monitorSlug}/` or `/monitors/{monitorSlug}/`
|
|
30604
|
+
* - Release: `/releases/{version}/`
|
|
30605
|
+
*
|
|
30606
|
+
* Organization slug is extracted from:
|
|
30607
|
+
* 1. Subdomain (e.g., `my-org.sentry.io`)
|
|
30608
|
+
* 2. Path (e.g., `/organizations/my-org/...` or `/my-org/issues/...`)
|
|
30609
|
+
*
|
|
30610
|
+
* @param url - A Sentry URL to parse
|
|
30611
|
+
* @returns Parsed URL with resource type and identifiers
|
|
30612
|
+
* @throws UserInputError if the URL is invalid or cannot be parsed
|
|
30613
|
+
*
|
|
30614
|
+
* @example
|
|
30615
|
+
* // Issue URL
|
|
30616
|
+
* parseSentryUrl("https://my-org.sentry.io/issues/PROJECT-123")
|
|
30617
|
+
* // { type: "issue", organizationSlug: "my-org", issueId: "PROJECT-123" }
|
|
30618
|
+
*
|
|
30619
|
+
* @example
|
|
30620
|
+
* // Replay URL
|
|
30621
|
+
* parseSentryUrl("https://my-org.sentry.io/replays/abc123def456/")
|
|
30622
|
+
* // { type: "replay", organizationSlug: "my-org", replayId: "abc123def456" }
|
|
30623
|
+
*
|
|
30624
|
+
* @example
|
|
30625
|
+
* // Monitor URL
|
|
30626
|
+
* parseSentryUrl("https://my-org.sentry.io/crons/my-cron-job/")
|
|
30627
|
+
* // { type: "monitor", organizationSlug: "my-org", monitorSlug: "my-cron-job" }
|
|
30628
|
+
*/
|
|
30629
|
+
function parseSentryUrl(url) {
|
|
30630
|
+
if (!url || typeof url !== "string") throw new UserInputError("Invalid Sentry URL. URL must be a non-empty string.");
|
|
30631
|
+
if (!url.startsWith("http://") && !url.startsWith("https://")) throw new UserInputError("Invalid Sentry URL. Must start with http:// or https://");
|
|
30632
|
+
let parsedUrl;
|
|
30633
|
+
try {
|
|
30634
|
+
parsedUrl = new URL(url);
|
|
30635
|
+
} catch {
|
|
30636
|
+
throw new UserInputError(`Invalid Sentry URL. Unable to parse URL: ${url}`);
|
|
30637
|
+
}
|
|
30638
|
+
const pathParts = parsedUrl.pathname.split("/").filter(Boolean);
|
|
30639
|
+
const organizationSlug = extractOrganizationSlug(parsedUrl, pathParts);
|
|
30640
|
+
return identifyResource(parsedUrl, pathParts, organizationSlug);
|
|
30641
|
+
}
|
|
30642
|
+
/**
|
|
30643
|
+
* Extracts organization slug from URL.
|
|
30644
|
+
*
|
|
30645
|
+
* Checks in order:
|
|
30646
|
+
* 1. `/organizations/{org}/...` path format
|
|
30647
|
+
* 2. `/{org}/issues/...` path format (org before known segments)
|
|
30648
|
+
* 3. Subdomain (e.g., `my-org.sentry.io`) - excluding region prefixes
|
|
30649
|
+
*/
|
|
30650
|
+
function extractOrganizationSlug(parsedUrl, pathParts) {
|
|
30651
|
+
if (pathParts.includes("organizations")) {
|
|
30652
|
+
const orgIndex = pathParts.indexOf("organizations");
|
|
30653
|
+
const slug = pathParts[orgIndex + 1];
|
|
30654
|
+
if (slug) return slug;
|
|
30655
|
+
}
|
|
30656
|
+
const knownSegments = [
|
|
30657
|
+
"issues",
|
|
30658
|
+
"explore",
|
|
30659
|
+
"performance",
|
|
30660
|
+
"projects",
|
|
30661
|
+
"settings",
|
|
30662
|
+
"replays",
|
|
30663
|
+
"releases",
|
|
30664
|
+
"crons",
|
|
30665
|
+
"monitors",
|
|
30666
|
+
"alerts",
|
|
30667
|
+
"feedback",
|
|
30668
|
+
"dashboards",
|
|
30669
|
+
"discover",
|
|
30670
|
+
"insights"
|
|
30671
|
+
];
|
|
30672
|
+
if (pathParts.length > 1 && knownSegments.includes(pathParts[1])) return pathParts[0];
|
|
30673
|
+
const hostParts = parsedUrl.hostname.split(".");
|
|
30674
|
+
const regionPrefixes = [
|
|
30675
|
+
"us",
|
|
30676
|
+
"eu",
|
|
30677
|
+
"de",
|
|
30678
|
+
"www"
|
|
30679
|
+
];
|
|
30680
|
+
if (hostParts.length >= 2 && !regionPrefixes.includes(hostParts[0])) return hostParts[0];
|
|
30681
|
+
throw new UserInputError("Invalid Sentry URL. Could not determine organization from URL.");
|
|
30682
|
+
}
|
|
30683
|
+
/**
|
|
30684
|
+
* Identifies the resource type and extracts relevant identifiers.
|
|
30685
|
+
*/
|
|
30686
|
+
function identifyResource(parsedUrl, pathParts, organizationSlug) {
|
|
30687
|
+
const profilingIndex = pathParts.indexOf("profiling");
|
|
30688
|
+
if (profilingIndex !== -1 && pathParts[profilingIndex + 1] === "profile") {
|
|
30689
|
+
const projectSlug = pathParts[profilingIndex + 2];
|
|
30690
|
+
const profilerId = parsedUrl.searchParams.get("profilerId") || void 0;
|
|
30691
|
+
const start = parsedUrl.searchParams.get("start") || void 0;
|
|
30692
|
+
const end = parsedUrl.searchParams.get("end") || void 0;
|
|
30693
|
+
return {
|
|
30694
|
+
type: "profile",
|
|
30695
|
+
organizationSlug,
|
|
30696
|
+
projectSlug,
|
|
30697
|
+
profilerId,
|
|
30698
|
+
start,
|
|
30699
|
+
end
|
|
30700
|
+
};
|
|
30701
|
+
}
|
|
30702
|
+
const replaysIndex = pathParts.indexOf("replays");
|
|
30703
|
+
if (replaysIndex !== -1) {
|
|
30704
|
+
const replayId = pathParts[replaysIndex + 1];
|
|
30705
|
+
if (replayId && replayId !== "selectors") return {
|
|
30706
|
+
type: "replay",
|
|
30707
|
+
organizationSlug,
|
|
30708
|
+
replayId
|
|
30709
|
+
};
|
|
30710
|
+
}
|
|
30711
|
+
const cronsIndex = pathParts.indexOf("crons");
|
|
30712
|
+
const monitorsIndex = pathParts.indexOf("monitors");
|
|
30713
|
+
const monitorPathIndex = cronsIndex !== -1 ? cronsIndex : monitorsIndex;
|
|
30714
|
+
if (monitorPathIndex !== -1) {
|
|
30715
|
+
const nextPart = pathParts[monitorPathIndex + 1];
|
|
30716
|
+
if (nextPart && nextPart !== "new") {
|
|
30717
|
+
const afterNext = pathParts[monitorPathIndex + 2];
|
|
30718
|
+
if (afterNext && afterNext !== "details") return {
|
|
30719
|
+
type: "monitor",
|
|
30720
|
+
organizationSlug,
|
|
30721
|
+
projectSlug: nextPart,
|
|
30722
|
+
monitorSlug: afterNext
|
|
30723
|
+
};
|
|
30724
|
+
return {
|
|
30725
|
+
type: "monitor",
|
|
30726
|
+
organizationSlug,
|
|
30727
|
+
monitorSlug: nextPart
|
|
30728
|
+
};
|
|
30729
|
+
}
|
|
30730
|
+
}
|
|
30731
|
+
const releasesIndex = pathParts.indexOf("releases");
|
|
30732
|
+
if (releasesIndex !== -1) {
|
|
30733
|
+
const releaseVersion = pathParts[releasesIndex + 1];
|
|
30734
|
+
if (releaseVersion && releaseVersion !== "new-events" && releaseVersion !== "all-events") return {
|
|
30735
|
+
type: "release",
|
|
30736
|
+
organizationSlug,
|
|
30737
|
+
releaseVersion
|
|
30738
|
+
};
|
|
30739
|
+
}
|
|
30740
|
+
const traceIndex = pathParts.indexOf("trace");
|
|
30741
|
+
if (traceIndex !== -1) {
|
|
30742
|
+
const traceId = pathParts[traceIndex + 1];
|
|
30743
|
+
if (traceId) {
|
|
30744
|
+
const nodeParam = parsedUrl.searchParams.get("node");
|
|
30745
|
+
let spanId;
|
|
30746
|
+
if (nodeParam?.startsWith("span-")) spanId = nodeParam.slice(5);
|
|
30747
|
+
return {
|
|
30748
|
+
type: "trace",
|
|
30749
|
+
organizationSlug,
|
|
30750
|
+
traceId,
|
|
30751
|
+
spanId
|
|
30752
|
+
};
|
|
30753
|
+
}
|
|
30754
|
+
}
|
|
30755
|
+
if (pathParts.includes("performance") && pathParts.includes("summary")) {
|
|
30756
|
+
const transaction = parsedUrl.searchParams.get("transaction") || void 0;
|
|
30757
|
+
if (transaction) return {
|
|
30758
|
+
type: "unknown",
|
|
30759
|
+
organizationSlug,
|
|
30760
|
+
transaction
|
|
30761
|
+
};
|
|
30762
|
+
}
|
|
30763
|
+
const issuesIndex = pathParts.indexOf("issues");
|
|
30764
|
+
if (issuesIndex !== -1) {
|
|
30765
|
+
const issueId = pathParts[issuesIndex + 1];
|
|
30766
|
+
if (issueId) {
|
|
30767
|
+
const eventsIndex = pathParts.indexOf("events", issuesIndex);
|
|
30768
|
+
if (eventsIndex !== -1) {
|
|
30769
|
+
const eventId = pathParts[eventsIndex + 1];
|
|
30770
|
+
if (eventId) return {
|
|
30771
|
+
type: "event",
|
|
30772
|
+
organizationSlug,
|
|
30773
|
+
issueId,
|
|
30774
|
+
eventId
|
|
30775
|
+
};
|
|
30776
|
+
}
|
|
30777
|
+
return {
|
|
30778
|
+
type: "issue",
|
|
30779
|
+
organizationSlug,
|
|
30780
|
+
issueId
|
|
30781
|
+
};
|
|
30782
|
+
}
|
|
30783
|
+
}
|
|
30784
|
+
return {
|
|
30785
|
+
type: "unknown",
|
|
30786
|
+
organizationSlug
|
|
30787
|
+
};
|
|
30788
|
+
}
|
|
30789
|
+
/**
|
|
30790
|
+
* Checks if a URL appears to be a Sentry profile URL.
|
|
30791
|
+
*
|
|
30792
|
+
* @param url - URL to check
|
|
30793
|
+
* @returns True if the URL looks like a profile URL
|
|
30794
|
+
*/
|
|
30795
|
+
function isProfileUrl(url) {
|
|
30796
|
+
try {
|
|
30797
|
+
const parsed = parseSentryUrl(url);
|
|
30798
|
+
return parsed.type === "profile";
|
|
30799
|
+
} catch {
|
|
30800
|
+
return false;
|
|
30801
|
+
}
|
|
30802
|
+
}
|
|
30803
|
+
|
|
30804
|
+
//#endregion
|
|
30805
|
+
//#region ../mcp-core/dist/breadcrumbs-CtmAoeT-.js
|
|
30806
|
+
/**
|
|
30807
|
+
* Fetches breadcrumbs from the latest event for an issue and formats them.
|
|
30808
|
+
*/
|
|
30809
|
+
async function fetchAndFormatBreadcrumbs(apiService, organizationSlug, issueId) {
|
|
30810
|
+
const event = await apiService.getLatestEventForIssue({
|
|
30811
|
+
organizationSlug,
|
|
30812
|
+
issueId
|
|
30813
|
+
});
|
|
30814
|
+
const breadcrumbEntry = event.entries.find((e) => e.type === "breadcrumbs");
|
|
30815
|
+
const entryData = breadcrumbEntry?.data;
|
|
30816
|
+
const breadcrumbs = entryData?.values ?? [];
|
|
30817
|
+
return formatBreadcrumbs(breadcrumbs, issueId, event.id);
|
|
30818
|
+
}
|
|
30819
|
+
function formatBreadcrumbs(breadcrumbs, issueId, eventId) {
|
|
30820
|
+
if (breadcrumbs.length === 0) return [
|
|
30821
|
+
`# Breadcrumbs for ${issueId}`,
|
|
30822
|
+
"",
|
|
30823
|
+
`**Event ID**: ${eventId}`,
|
|
30824
|
+
"",
|
|
30825
|
+
"No breadcrumbs found in the latest event for this issue."
|
|
30826
|
+
].join("\n");
|
|
30827
|
+
const output = [
|
|
30828
|
+
`# Breadcrumbs for ${issueId}`,
|
|
30829
|
+
"",
|
|
30830
|
+
`**Event ID**: ${eventId}`,
|
|
30831
|
+
`**Total Breadcrumbs**: ${breadcrumbs.length}`,
|
|
30832
|
+
"",
|
|
30833
|
+
"```"
|
|
30834
|
+
];
|
|
30835
|
+
for (const crumb of breadcrumbs) {
|
|
30836
|
+
const timestamp = crumb.timestamp ? new Date(crumb.timestamp).toISOString() : " ".repeat(24);
|
|
30837
|
+
const level = (crumb.level ?? "info").padEnd(7);
|
|
30838
|
+
const category = crumb.category ?? crumb.type ?? "-";
|
|
30839
|
+
const message = cleanAndTruncate(crumb.message ?? "", 120);
|
|
30840
|
+
const data = formatBreadcrumbData(crumb.data);
|
|
30841
|
+
const parts = [`${timestamp} ${level} [${category}]`];
|
|
30842
|
+
if (message) parts.push(message);
|
|
30843
|
+
if (data) parts.push(data);
|
|
30844
|
+
output.push(parts.join(" "));
|
|
30845
|
+
}
|
|
30846
|
+
output.push("```");
|
|
30847
|
+
output.push("", "Breadcrumbs show the trail of events leading up to the error, in chronological order.", `Use \`get_sentry_resource(resourceType='issue', organizationSlug='...', resourceId='${issueId}')\` for full issue details.`);
|
|
30848
|
+
return output.join("\n");
|
|
30849
|
+
}
|
|
30850
|
+
/**
|
|
30851
|
+
* Formats breadcrumb data as a compact inline JSON string.
|
|
30852
|
+
*/
|
|
30853
|
+
function formatBreadcrumbData(data) {
|
|
30854
|
+
if (!data || Object.keys(data).length === 0) return "";
|
|
30855
|
+
return cleanAndTruncate(JSON.stringify(data), 200);
|
|
30856
|
+
}
|
|
30857
|
+
/**
|
|
30858
|
+
* Strips newlines and truncates a string to maxLen characters.
|
|
30859
|
+
*/
|
|
30860
|
+
function cleanAndTruncate(str, maxLen) {
|
|
30861
|
+
const clean = str.replace(/[\r\n]+/g, " ");
|
|
30862
|
+
if (clean.length <= maxLen) return clean;
|
|
30863
|
+
return `${clean.slice(0, maxLen)}...`;
|
|
30864
|
+
}
|
|
30865
|
+
|
|
30866
|
+
//#endregion
|
|
30867
|
+
//#region ../mcp-core/dist/get-profile-CZ7avA74.js
|
|
30705
30868
|
/**
|
|
30706
30869
|
* Resolves profile parameters from URL or explicit params.
|
|
30707
30870
|
* URL takes precedence if provided and valid.
|
|
@@ -30798,8 +30961,8 @@ var get_profile_default = defineTool({
|
|
|
30798
30961
|
readOnlyHint: true,
|
|
30799
30962
|
openWorldHint: false
|
|
30800
30963
|
},
|
|
30801
|
-
async handler(params, context$
|
|
30802
|
-
const apiService = apiServiceFromContext(context$
|
|
30964
|
+
async handler(params, context$1) {
|
|
30965
|
+
const apiService = apiServiceFromContext(context$1, { regionUrl: params.regionUrl ?? void 0 });
|
|
30803
30966
|
const resolved = resolveProfileParams({
|
|
30804
30967
|
profileUrl: params.profileUrl,
|
|
30805
30968
|
organizationSlug: params.organizationSlug,
|
|
@@ -30910,7 +31073,7 @@ var get_profile_default = defineTool({
|
|
|
30910
31073
|
});
|
|
30911
31074
|
|
|
30912
31075
|
//#endregion
|
|
30913
|
-
//#region ../mcp-core/dist/get-sentry-resource-
|
|
31076
|
+
//#region ../mcp-core/dist/get-sentry-resource-Duc5U8N-.js
|
|
30914
31077
|
/** Types with full API integration. */
|
|
30915
31078
|
const FULLY_SUPPORTED_TYPES = [
|
|
30916
31079
|
"issue",
|
|
@@ -31082,9 +31245,12 @@ function generateUnsupportedResourceMessage(resolved) {
|
|
|
31082
31245
|
}
|
|
31083
31246
|
var get_sentry_resource_default = defineTool({
|
|
31084
31247
|
name: "get_sentry_resource",
|
|
31085
|
-
skills: [
|
|
31248
|
+
skills: [
|
|
31249
|
+
"inspect",
|
|
31250
|
+
"triage",
|
|
31251
|
+
"seer"
|
|
31252
|
+
],
|
|
31086
31253
|
requiredScopes: ["event:read"],
|
|
31087
|
-
experimental: true,
|
|
31088
31254
|
description: [
|
|
31089
31255
|
"Fetch a Sentry resource by URL or by type and ID.",
|
|
31090
31256
|
"",
|
|
@@ -31114,7 +31280,7 @@ var get_sentry_resource_default = defineTool({
|
|
|
31114
31280
|
readOnlyHint: true,
|
|
31115
31281
|
openWorldHint: true
|
|
31116
31282
|
},
|
|
31117
|
-
async handler(params, context$
|
|
31283
|
+
async handler(params, context$1) {
|
|
31118
31284
|
const resolved = resolveResourceParams({
|
|
31119
31285
|
url: params.url,
|
|
31120
31286
|
resourceType: params.resourceType,
|
|
@@ -31129,20 +31295,20 @@ var get_sentry_resource_default = defineTool({
|
|
|
31129
31295
|
organizationSlug: resolved.organizationSlug,
|
|
31130
31296
|
issueId: resolved.issueId,
|
|
31131
31297
|
regionUrl: null
|
|
31132
|
-
}, context$
|
|
31298
|
+
}, context$1);
|
|
31133
31299
|
case "event": return get_issue_details_default.handler({
|
|
31134
31300
|
organizationSlug: resolved.organizationSlug,
|
|
31135
31301
|
issueId: resolved.issueId,
|
|
31136
31302
|
eventId: resolved.eventId,
|
|
31137
31303
|
regionUrl: null
|
|
31138
|
-
}, context$
|
|
31304
|
+
}, context$1);
|
|
31139
31305
|
case "trace": return get_trace_details_default.handler({
|
|
31140
31306
|
organizationSlug: resolved.organizationSlug,
|
|
31141
31307
|
traceId: resolved.traceId,
|
|
31142
31308
|
regionUrl: null
|
|
31143
|
-
}, context$
|
|
31309
|
+
}, context$1);
|
|
31144
31310
|
case "breadcrumbs": {
|
|
31145
|
-
const apiService = apiServiceFromContext(context$
|
|
31311
|
+
const apiService = apiServiceFromContext(context$1);
|
|
31146
31312
|
try {
|
|
31147
31313
|
return await fetchAndFormatBreadcrumbs(apiService, resolved.organizationSlug, resolved.issueId);
|
|
31148
31314
|
} catch (error) {
|
|
@@ -31161,7 +31327,7 @@ var get_sentry_resource_default = defineTool({
|
|
|
31161
31327
|
statsPeriod: "7d",
|
|
31162
31328
|
focusOnUserCode: true,
|
|
31163
31329
|
maxHotPaths: 10
|
|
31164
|
-
}, context$
|
|
31330
|
+
}, context$1);
|
|
31165
31331
|
default: {
|
|
31166
31332
|
const _exhaustiveCheck = resolved.type;
|
|
31167
31333
|
throw new Error(`Unhandled resource type: ${_exhaustiveCheck}`);
|
|
@@ -31171,7 +31337,7 @@ var get_sentry_resource_default = defineTool({
|
|
|
31171
31337
|
});
|
|
31172
31338
|
|
|
31173
31339
|
//#endregion
|
|
31174
|
-
//#region ../mcp-core/dist/error-handling-
|
|
31340
|
+
//#region ../mcp-core/dist/error-handling-C2zknUda.js
|
|
31175
31341
|
/**
|
|
31176
31342
|
* Type guard to identify user input validation errors.
|
|
31177
31343
|
*/
|
|
@@ -31329,7 +31495,7 @@ async function formatErrorForUser(error, options) {
|
|
|
31329
31495
|
}
|
|
31330
31496
|
|
|
31331
31497
|
//#endregion
|
|
31332
|
-
//#region ../mcp-core/dist/constraint-helpers-
|
|
31498
|
+
//#region ../mcp-core/dist/constraint-helpers-C2JDBPW9.js
|
|
31333
31499
|
/**
|
|
31334
31500
|
* Determines which tool parameter keys should be filtered out of the schema
|
|
31335
31501
|
* because they will be injected from constraints.
|
|
@@ -33005,7 +33171,7 @@ var DefaultMCPClient = class {
|
|
|
33005
33171
|
};
|
|
33006
33172
|
|
|
33007
33173
|
//#endregion
|
|
33008
|
-
//#region ../mcp-core/dist/server-
|
|
33174
|
+
//#region ../mcp-core/dist/server-C17cuymn.js
|
|
33009
33175
|
/**
|
|
33010
33176
|
* Format tool calls into a readable trace
|
|
33011
33177
|
*/
|
|
@@ -33066,15 +33232,15 @@ var handler_default$3 = defineTool({
|
|
|
33066
33232
|
readOnlyHint: true,
|
|
33067
33233
|
openWorldHint: true
|
|
33068
33234
|
},
|
|
33069
|
-
async handler(params, context$
|
|
33235
|
+
async handler(params, context$1) {
|
|
33070
33236
|
const [clientTransport, serverTransport] = __modelcontextprotocol_sdk_inMemory_js.InMemoryTransport.createLinkedPair();
|
|
33071
33237
|
const toolsToExclude = new Set(["use_sentry", ...SIMPLE_REPLACEMENT_TOOLS]);
|
|
33072
|
-
const toolsForAgent = Object.fromEntries(Object.entries(tools_default).filter(([key, tool$1]) => !toolsToExclude.has(key) && isToolVisibleInMode(tool$1, context$
|
|
33073
|
-
const server
|
|
33074
|
-
context: context$
|
|
33238
|
+
const toolsForAgent = Object.fromEntries(Object.entries(tools_default).filter(([key, tool$1]) => !toolsToExclude.has(key) && isToolVisibleInMode(tool$1, context$1.experimentalMode ?? false)));
|
|
33239
|
+
const server = buildServer({
|
|
33240
|
+
context: context$1,
|
|
33075
33241
|
tools: toolsForAgent
|
|
33076
33242
|
});
|
|
33077
|
-
await server
|
|
33243
|
+
await server.server.connect(serverTransport);
|
|
33078
33244
|
const mcpClient = await createMCPClient({
|
|
33079
33245
|
name: "mcp.sentry.dev (use-sentry)",
|
|
33080
33246
|
transport: clientTransport
|
|
@@ -33093,7 +33259,7 @@ var handler_default$3 = defineTool({
|
|
|
33093
33259
|
return output;
|
|
33094
33260
|
} finally {
|
|
33095
33261
|
await mcpClient.close();
|
|
33096
|
-
await server
|
|
33262
|
+
await server.server.close();
|
|
33097
33263
|
}
|
|
33098
33264
|
}
|
|
33099
33265
|
});
|
|
@@ -33142,6 +33308,7 @@ var tools_default = {
|
|
|
33142
33308
|
list_issues: list_issues_default,
|
|
33143
33309
|
list_events: list_events_default,
|
|
33144
33310
|
list_issue_events: list_issue_events_default,
|
|
33311
|
+
get_profile_details: get_profile_details_default,
|
|
33145
33312
|
get_sentry_resource: get_sentry_resource_default
|
|
33146
33313
|
};
|
|
33147
33314
|
/**
|
|
@@ -33171,28 +33338,33 @@ var tools_default = {
|
|
|
33171
33338
|
* ```typescript
|
|
33172
33339
|
* import { buildServer } from "@sentry/mcp-core/server";
|
|
33173
33340
|
* import { createMcpHandler } from "agents/mcp";
|
|
33341
|
+
* import { CfWorkerJsonSchemaValidator } from "@modelcontextprotocol/sdk/validation/cfworker";
|
|
33174
33342
|
*
|
|
33175
33343
|
* const serverContext = buildContextFromOAuth();
|
|
33176
33344
|
* // Context is captured in closures during buildServer()
|
|
33177
|
-
*
|
|
33345
|
+
* // Use CfWorkerJsonSchemaValidator for Cloudflare Workers (ajv is not compatible)
|
|
33346
|
+
* const server = buildServer({
|
|
33347
|
+
* context: serverContext,
|
|
33348
|
+
* jsonSchemaValidator: new CfWorkerJsonSchemaValidator(),
|
|
33349
|
+
* });
|
|
33178
33350
|
*
|
|
33179
33351
|
* // Context already available to tool handlers via closures
|
|
33180
33352
|
* return createMcpHandler(server, { route: "/mcp" })(request, env, ctx);
|
|
33181
33353
|
* ```
|
|
33182
33354
|
*/
|
|
33183
|
-
function buildServer({ context: context$
|
|
33184
|
-
const server
|
|
33355
|
+
function buildServer({ context: context$1, agentMode = false, experimentalMode = false, tools: customTools, jsonSchemaValidator }) {
|
|
33356
|
+
const server = new __modelcontextprotocol_sdk_server_mcp_js.McpServer({
|
|
33185
33357
|
name: MCP_SERVER_NAME,
|
|
33186
|
-
version:
|
|
33187
|
-
});
|
|
33358
|
+
version: require_version.LIB_VERSION
|
|
33359
|
+
}, { jsonSchemaValidator });
|
|
33188
33360
|
configureServer({
|
|
33189
|
-
server
|
|
33190
|
-
context: context$
|
|
33361
|
+
server,
|
|
33362
|
+
context: context$1,
|
|
33191
33363
|
agentMode,
|
|
33192
33364
|
experimentalMode,
|
|
33193
33365
|
tools: customTools
|
|
33194
33366
|
});
|
|
33195
|
-
return (0, __sentry_core.wrapMcpServerWithSentry)(server
|
|
33367
|
+
return (0, __sentry_core.wrapMcpServerWithSentry)(server);
|
|
33196
33368
|
}
|
|
33197
33369
|
/**
|
|
33198
33370
|
* Configures an MCP server with tools filtered by granted skills.
|
|
@@ -33203,7 +33375,7 @@ function buildServer({ context: context$2, agentMode = false, experimentalMode =
|
|
|
33203
33375
|
*
|
|
33204
33376
|
* In agent mode, only the use_sentry tool is registered, bypassing authorization checks.
|
|
33205
33377
|
*/
|
|
33206
|
-
function configureServer({ server
|
|
33378
|
+
function configureServer({ server, context: context$1, agentMode = false, experimentalMode = false, tools: customTools }) {
|
|
33207
33379
|
let toolsToRegister = agentMode ? { use_sentry: tools_default.use_sentry } : customTools ?? tools_default;
|
|
33208
33380
|
if (!agentMode && !customTools) {
|
|
33209
33381
|
const hasAgent = hasAgentProvider();
|
|
@@ -33211,8 +33383,8 @@ function configureServer({ server: server$1, context: context$2, agentMode = fal
|
|
|
33211
33383
|
toolsToRegister = Object.fromEntries(Object.entries(toolsToRegister).filter(([key]) => !toolsToExclude.has(key)));
|
|
33212
33384
|
}
|
|
33213
33385
|
if (!agentMode) toolsToRegister = Object.fromEntries(Object.entries(toolsToRegister).filter(([, tool$1]) => isToolVisibleInMode(tool$1, experimentalMode)));
|
|
33214
|
-
const grantedSkills = context$
|
|
33215
|
-
server
|
|
33386
|
+
const grantedSkills = context$1.grantedSkills ? new Set(context$1.grantedSkills) : void 0;
|
|
33387
|
+
server.server.onerror = (error) => {
|
|
33216
33388
|
const transportLogOptions = {
|
|
33217
33389
|
loggerScope: ["server", "transport"],
|
|
33218
33390
|
contexts: { transport: { phase: "server.onerror" } }
|
|
@@ -33248,32 +33420,32 @@ function configureServer({ server: server$1, context: context$2, agentMode = fal
|
|
|
33248
33420
|
if (tool$1.skills && tool$1.skills.length > 0) allowed = require_resolve.isEnabledBySkills(grantedSkills, tool$1.skills);
|
|
33249
33421
|
}
|
|
33250
33422
|
if (!allowed) continue;
|
|
33251
|
-
if (toolKey === "find_organizations" && context$
|
|
33252
|
-
if (experimentalMode && context$
|
|
33253
|
-
const caps = context$
|
|
33423
|
+
if (toolKey === "find_organizations" && context$1.constraints.organizationSlug || toolKey === "find_projects" && context$1.constraints.projectSlug) continue;
|
|
33424
|
+
if (experimentalMode && context$1.constraints.projectSlug && context$1.constraints.projectCapabilities && tool$1.requiredCapabilities?.length) {
|
|
33425
|
+
const caps = context$1.constraints.projectCapabilities;
|
|
33254
33426
|
const hasAllCapabilities = tool$1.requiredCapabilities.every((cap) => caps[cap] === true);
|
|
33255
33427
|
if (!hasAllCapabilities) continue;
|
|
33256
33428
|
}
|
|
33257
|
-
const constraintKeysToFilter = new Set(getConstraintKeysToFilter(context$
|
|
33429
|
+
const constraintKeysToFilter = new Set(getConstraintKeysToFilter(context$1.constraints, tool$1.inputSchema));
|
|
33258
33430
|
const filteredInputSchema = Object.fromEntries(Object.entries(tool$1.inputSchema).filter(([key]) => !constraintKeysToFilter.has(key)));
|
|
33259
33431
|
const resolvedDescription = resolveDescription(tool$1.description, { experimentalMode });
|
|
33260
|
-
server
|
|
33432
|
+
server.tool(tool$1.name, resolvedDescription, filteredInputSchema, tool$1.annotations, async (params, extra) => {
|
|
33261
33433
|
const activeSpan = (0, __sentry_core.getActiveSpan)();
|
|
33262
33434
|
if (activeSpan) {
|
|
33263
|
-
if (context$
|
|
33264
|
-
if (context$
|
|
33435
|
+
if (context$1.constraints.organizationSlug) activeSpan.setAttribute("sentry-mcp.constraint-organization", context$1.constraints.organizationSlug);
|
|
33436
|
+
if (context$1.constraints.projectSlug) activeSpan.setAttribute("sentry-mcp.constraint-project", context$1.constraints.projectSlug);
|
|
33265
33437
|
}
|
|
33266
|
-
if (context$
|
|
33267
|
-
if (context$
|
|
33438
|
+
if (context$1.userId) (0, __sentry_core.setUser)({ id: context$1.userId });
|
|
33439
|
+
if (context$1.clientId) (0, __sentry_core.setTag)("client.id", context$1.clientId);
|
|
33268
33440
|
(0, __sentry_core.setTag)("mode.agent", agentMode);
|
|
33269
33441
|
(0, __sentry_core.setTag)("mode.experimental", experimentalMode);
|
|
33270
33442
|
try {
|
|
33271
|
-
const applicableConstraints = getConstraintParametersToInject(context$
|
|
33443
|
+
const applicableConstraints = getConstraintParametersToInject(context$1.constraints, tool$1.inputSchema);
|
|
33272
33444
|
const paramsWithConstraints = {
|
|
33273
33445
|
...params,
|
|
33274
33446
|
...applicableConstraints
|
|
33275
33447
|
};
|
|
33276
|
-
const output = await tool$1.handler(paramsWithConstraints, context$
|
|
33448
|
+
const output = await tool$1.handler(paramsWithConstraints, context$1);
|
|
33277
33449
|
if (activeSpan) activeSpan.setStatus({ code: 1 });
|
|
33278
33450
|
if (typeof output === "string") return { content: [{
|
|
33279
33451
|
type: "text",
|
|
@@ -33289,7 +33461,7 @@ function configureServer({ server: server$1, context: context$2, agentMode = fal
|
|
|
33289
33461
|
return {
|
|
33290
33462
|
content: [{
|
|
33291
33463
|
type: "text",
|
|
33292
|
-
text: await formatErrorForUser(error, { transport: context$
|
|
33464
|
+
text: await formatErrorForUser(error, { transport: context$1.transport })
|
|
33293
33465
|
}],
|
|
33294
33466
|
isError: true
|
|
33295
33467
|
};
|
|
@@ -33299,7 +33471,7 @@ function configureServer({ server: server$1, context: context$2, agentMode = fal
|
|
|
33299
33471
|
}
|
|
33300
33472
|
|
|
33301
33473
|
//#endregion
|
|
33302
|
-
//#region ../mcp-core/dist/sentry-
|
|
33474
|
+
//#region ../mcp-core/dist/sentry-KBnLkfrV.js
|
|
33303
33475
|
const SCRUB_PATTERNS = [
|
|
33304
33476
|
{
|
|
33305
33477
|
pattern: /\bsk-[a-zA-Z0-9]{48}\b/g,
|
|
@@ -33413,176 +33585,190 @@ function die(message) {
|
|
|
33413
33585
|
console.error(usageText);
|
|
33414
33586
|
process.exit(1);
|
|
33415
33587
|
}
|
|
33416
|
-
|
|
33417
|
-
|
|
33418
|
-
|
|
33419
|
-
|
|
33420
|
-
|
|
33421
|
-
if (cli.version) {
|
|
33422
|
-
console.log(`${packageName} ${require_stdio.LIB_VERSION}`);
|
|
33423
|
-
process.exit(0);
|
|
33424
|
-
}
|
|
33425
|
-
if (cli.unknownArgs.length > 0) {
|
|
33426
|
-
console.error("Error: Invalid argument(s):", cli.unknownArgs.join(", "));
|
|
33427
|
-
console.error(usageText);
|
|
33428
|
-
process.exit(1);
|
|
33429
|
-
}
|
|
33430
|
-
const env = require_parse.parseEnv(process.env);
|
|
33431
|
-
const cfg = (() => {
|
|
33432
|
-
try {
|
|
33433
|
-
return require_resolve.finalize(require_parse.merge(cli, env));
|
|
33434
|
-
} catch (err) {
|
|
33435
|
-
die(err instanceof Error ? err.message : String(err));
|
|
33588
|
+
async function main() {
|
|
33589
|
+
const rawArgs = process.argv.slice(2);
|
|
33590
|
+
if (rawArgs[0] === "auth") {
|
|
33591
|
+
await require_auth.authCommand(rawArgs.slice(1));
|
|
33592
|
+
return;
|
|
33436
33593
|
}
|
|
33437
|
-
|
|
33438
|
-
if (
|
|
33439
|
-
|
|
33440
|
-
|
|
33441
|
-
|
|
33442
|
-
|
|
33443
|
-
|
|
33444
|
-
|
|
33445
|
-
|
|
33446
|
-
|
|
33447
|
-
|
|
33448
|
-
|
|
33449
|
-
|
|
33450
|
-
}
|
|
33451
|
-
|
|
33452
|
-
|
|
33453
|
-
|
|
33454
|
-
|
|
33455
|
-
|
|
33456
|
-
|
|
33457
|
-
|
|
33458
|
-
|
|
33459
|
-
|
|
33460
|
-
|
|
33461
|
-
|
|
33462
|
-
|
|
33463
|
-
|
|
33464
|
-
|
|
33465
|
-
|
|
33466
|
-
|
|
33467
|
-
|
|
33468
|
-
|
|
33469
|
-
|
|
33470
|
-
|
|
33471
|
-
|
|
33472
|
-
|
|
33473
|
-
|
|
33474
|
-
|
|
33475
|
-
|
|
33476
|
-
|
|
33477
|
-
|
|
33478
|
-
|
|
33479
|
-
|
|
33480
|
-
|
|
33481
|
-
|
|
33482
|
-
|
|
33483
|
-
|
|
33484
|
-
|
|
33485
|
-
|
|
33486
|
-
|
|
33487
|
-
|
|
33488
|
-
|
|
33489
|
-
|
|
33490
|
-
|
|
33491
|
-
|
|
33492
|
-
|
|
33594
|
+
const cli = require_parse.parseArgv(rawArgs);
|
|
33595
|
+
if (cli.help) {
|
|
33596
|
+
console.log(usageText);
|
|
33597
|
+
process.exit(0);
|
|
33598
|
+
}
|
|
33599
|
+
if (cli.version) {
|
|
33600
|
+
console.log(`${packageName} ${require_version.LIB_VERSION}`);
|
|
33601
|
+
process.exit(0);
|
|
33602
|
+
}
|
|
33603
|
+
if (cli.unknownArgs.length > 0) {
|
|
33604
|
+
console.error("Error: Invalid argument(s):", cli.unknownArgs.join(", "));
|
|
33605
|
+
console.error(usageText);
|
|
33606
|
+
process.exit(1);
|
|
33607
|
+
}
|
|
33608
|
+
const env = require_parse.parseEnv(process.env);
|
|
33609
|
+
const partialCfg = (() => {
|
|
33610
|
+
try {
|
|
33611
|
+
return require_resolve.finalize(require_parse.merge(cli, env));
|
|
33612
|
+
} catch (err) {
|
|
33613
|
+
die(err instanceof Error ? err.message : String(err));
|
|
33614
|
+
}
|
|
33615
|
+
})();
|
|
33616
|
+
const cfg = await require_resolve_token.resolveAccessToken(partialCfg).catch((err) => {
|
|
33617
|
+
die(err instanceof Error ? err.message : String(err));
|
|
33618
|
+
});
|
|
33619
|
+
if (cfg.agentProvider) setAgentProvider(cfg.agentProvider);
|
|
33620
|
+
setProviderBaseUrls({
|
|
33621
|
+
openaiBaseUrl: cfg.openaiBaseUrl,
|
|
33622
|
+
anthropicBaseUrl: cfg.anthropicBaseUrl
|
|
33623
|
+
});
|
|
33624
|
+
if (cfg.openaiModel) process.env.OPENAI_MODEL = cfg.openaiModel;
|
|
33625
|
+
if (cfg.anthropicModel) process.env.ANTHROPIC_MODEL = cfg.anthropicModel;
|
|
33626
|
+
function hasProviderConflict() {
|
|
33627
|
+
const hasAnthropic = Boolean(process.env.ANTHROPIC_API_KEY);
|
|
33628
|
+
const hasOpenAI = Boolean(process.env.OPENAI_API_KEY);
|
|
33629
|
+
const hasExplicitProvider = cfg.agentProvider || process.env.EMBEDDED_AGENT_PROVIDER;
|
|
33630
|
+
return hasAnthropic && hasOpenAI && !hasExplicitProvider;
|
|
33631
|
+
}
|
|
33632
|
+
function getConfiguredProvider() {
|
|
33633
|
+
return cfg.agentProvider || process.env.EMBEDDED_AGENT_PROVIDER?.toLowerCase();
|
|
33634
|
+
}
|
|
33635
|
+
function hasProviderMismatch() {
|
|
33636
|
+
const configured = getConfiguredProvider();
|
|
33637
|
+
if (!configured) return { mismatch: false };
|
|
33638
|
+
const hasAnthropic = Boolean(process.env.ANTHROPIC_API_KEY);
|
|
33639
|
+
const hasOpenAI = Boolean(process.env.OPENAI_API_KEY);
|
|
33640
|
+
if (configured === "openai" && !hasOpenAI && hasAnthropic) return {
|
|
33641
|
+
mismatch: true,
|
|
33642
|
+
configured: "openai",
|
|
33643
|
+
availableKey: "ANTHROPIC_API_KEY"
|
|
33644
|
+
};
|
|
33645
|
+
if (configured === "anthropic" && !hasAnthropic && hasOpenAI) return {
|
|
33646
|
+
mismatch: true,
|
|
33647
|
+
configured: "anthropic",
|
|
33648
|
+
availableKey: "OPENAI_API_KEY"
|
|
33649
|
+
};
|
|
33650
|
+
return { mismatch: false };
|
|
33651
|
+
}
|
|
33652
|
+
function getProviderSource() {
|
|
33653
|
+
if (cli.agentProvider) return "explicitly configured";
|
|
33654
|
+
if (process.env.EMBEDDED_AGENT_PROVIDER) return "from EMBEDDED_AGENT_PROVIDER";
|
|
33655
|
+
return "auto-detected";
|
|
33656
|
+
}
|
|
33657
|
+
const resolvedProvider = getResolvedProviderType();
|
|
33658
|
+
if (!resolvedProvider) {
|
|
33659
|
+
const mismatchInfo = hasProviderMismatch();
|
|
33660
|
+
if (hasProviderConflict()) {
|
|
33661
|
+
console.warn("Warning: Both ANTHROPIC_API_KEY and OPENAI_API_KEY are set, but no provider is explicitly configured.");
|
|
33662
|
+
console.warn("Please set EMBEDDED_AGENT_PROVIDER='openai' or 'anthropic' to specify which provider to use.");
|
|
33663
|
+
console.warn("AI-powered search tools will be unavailable until a provider is selected.");
|
|
33664
|
+
} else if (mismatchInfo.mismatch) {
|
|
33665
|
+
const expectedKey = mismatchInfo.configured === "openai" ? "OPENAI_API_KEY" : "ANTHROPIC_API_KEY";
|
|
33666
|
+
const configuredViaCliFlag = Boolean(cli.agentProvider);
|
|
33667
|
+
const providerSetting = configuredViaCliFlag ? `--agent-provider=${mismatchInfo.configured}` : `EMBEDDED_AGENT_PROVIDER='${mismatchInfo.configured}'`;
|
|
33668
|
+
const changeProviderHint = configuredViaCliFlag ? "Change --agent-provider to match your available API key" : "Change EMBEDDED_AGENT_PROVIDER to match your available API key";
|
|
33669
|
+
console.warn(`Warning: ${providerSetting} but ${expectedKey} is not set.`);
|
|
33670
|
+
console.warn(`Found ${mismatchInfo.availableKey} instead. Either:`);
|
|
33671
|
+
console.warn(` - Set ${expectedKey} to use the ${mismatchInfo.configured} provider, or`);
|
|
33672
|
+
console.warn(` - ${changeProviderHint}`);
|
|
33673
|
+
console.warn("AI-powered search tools will be unavailable until this is resolved.");
|
|
33674
|
+
} else {
|
|
33675
|
+
console.warn("Warning: No LLM API key found (OPENAI_API_KEY or ANTHROPIC_API_KEY).");
|
|
33676
|
+
console.warn("The following AI-powered search tools will be unavailable:");
|
|
33677
|
+
console.warn(" - search_events, search_issues, search_issue_events, use_sentry");
|
|
33678
|
+
console.warn("Use list_issues and list_events for direct Sentry query syntax instead.");
|
|
33679
|
+
}
|
|
33680
|
+
console.warn("");
|
|
33493
33681
|
} else {
|
|
33494
|
-
|
|
33495
|
-
console.warn(
|
|
33496
|
-
|
|
33497
|
-
|
|
33498
|
-
|
|
33499
|
-
|
|
33500
|
-
}
|
|
33501
|
-
|
|
33502
|
-
|
|
33503
|
-
|
|
33504
|
-
|
|
33505
|
-
|
|
33506
|
-
|
|
33507
|
-
|
|
33508
|
-
|
|
33509
|
-
|
|
33510
|
-
|
|
33511
|
-
|
|
33512
|
-
|
|
33513
|
-
|
|
33514
|
-
|
|
33515
|
-
|
|
33516
|
-
|
|
33517
|
-
|
|
33518
|
-
|
|
33519
|
-
|
|
33520
|
-
|
|
33521
|
-
|
|
33522
|
-
|
|
33523
|
-
|
|
33524
|
-
|
|
33525
|
-
|
|
33526
|
-
|
|
33527
|
-
|
|
33528
|
-
|
|
33529
|
-
|
|
33530
|
-
|
|
33531
|
-
|
|
33532
|
-
|
|
33533
|
-
|
|
33534
|
-
|
|
33535
|
-
|
|
33536
|
-
|
|
33537
|
-
|
|
33538
|
-
}
|
|
33539
|
-
|
|
33540
|
-
|
|
33541
|
-
|
|
33542
|
-
|
|
33543
|
-
|
|
33544
|
-
async
|
|
33545
|
-
|
|
33546
|
-
|
|
33547
|
-
|
|
33548
|
-
|
|
33549
|
-
|
|
33550
|
-
process.on("
|
|
33551
|
-
|
|
33552
|
-
|
|
33553
|
-
|
|
33554
|
-
|
|
33555
|
-
|
|
33556
|
-
|
|
33557
|
-
|
|
33558
|
-
|
|
33559
|
-
|
|
33560
|
-
|
|
33561
|
-
|
|
33562
|
-
}
|
|
33563
|
-
|
|
33564
|
-
|
|
33565
|
-
|
|
33566
|
-
|
|
33567
|
-
|
|
33568
|
-
|
|
33569
|
-
}
|
|
33570
|
-
|
|
33571
|
-
|
|
33572
|
-
|
|
33573
|
-
|
|
33574
|
-
|
|
33575
|
-
|
|
33576
|
-
|
|
33577
|
-
|
|
33578
|
-
|
|
33579
|
-
|
|
33580
|
-
|
|
33581
|
-
}
|
|
33582
|
-
|
|
33583
|
-
console.error("
|
|
33584
|
-
__sentry_node.captureException(err);
|
|
33585
|
-
await __sentry_node.flush(SENTRY_TIMEOUT);
|
|
33682
|
+
const providerSource = getProviderSource();
|
|
33683
|
+
console.warn(`Using ${resolvedProvider} for AI-powered search tools (${providerSource}).`);
|
|
33684
|
+
if (providerSource === "auto-detected") {
|
|
33685
|
+
console.warn("Deprecation warning: Auto-detection of LLM provider is deprecated.");
|
|
33686
|
+
console.warn(`Please set EMBEDDED_AGENT_PROVIDER='${resolvedProvider}' explicitly.`);
|
|
33687
|
+
console.warn("Auto-detection will be removed in a future release.");
|
|
33688
|
+
}
|
|
33689
|
+
console.warn("");
|
|
33690
|
+
}
|
|
33691
|
+
__sentry_node.init({
|
|
33692
|
+
dsn: cfg.sentryDsn,
|
|
33693
|
+
sendDefaultPii: true,
|
|
33694
|
+
tracesSampleRate: 1,
|
|
33695
|
+
beforeSend: sentryBeforeSend,
|
|
33696
|
+
initialScope: { tags: {
|
|
33697
|
+
"mcp.server_version": require_version.LIB_VERSION,
|
|
33698
|
+
"mcp.transport": "stdio",
|
|
33699
|
+
"mcp.agent_mode": cli.agent ? "true" : "false",
|
|
33700
|
+
"mcp.experimental_mode": cli.experimental ? "true" : "false",
|
|
33701
|
+
"sentry.host": cfg.sentryHost,
|
|
33702
|
+
"mcp.mcp-url": cfg.mcpUrl
|
|
33703
|
+
} },
|
|
33704
|
+
release: process.env.SENTRY_RELEASE,
|
|
33705
|
+
integrations: [
|
|
33706
|
+
__sentry_node.consoleLoggingIntegration(),
|
|
33707
|
+
__sentry_node.zodErrorsIntegration(),
|
|
33708
|
+
__sentry_node.vercelAIIntegration({
|
|
33709
|
+
recordInputs: true,
|
|
33710
|
+
recordOutputs: true
|
|
33711
|
+
})
|
|
33712
|
+
],
|
|
33713
|
+
environment: "stdio"
|
|
33714
|
+
});
|
|
33715
|
+
if (cli.agent) {
|
|
33716
|
+
console.warn("Agent mode enabled: Only use_sentry tool is available.");
|
|
33717
|
+
console.warn("The use_sentry tool provides access to all Sentry operations through natural language.");
|
|
33718
|
+
console.warn("");
|
|
33719
|
+
}
|
|
33720
|
+
if (cli.experimental) {
|
|
33721
|
+
console.warn("Experimental mode enabled: Forward-looking tool variants and experimental features are available.");
|
|
33722
|
+
console.warn("");
|
|
33723
|
+
}
|
|
33724
|
+
const SENTRY_TIMEOUT = 5e3;
|
|
33725
|
+
async function shutdown(signal) {
|
|
33726
|
+
console.error(`${signal} received, shutting down...`);
|
|
33727
|
+
await __sentry_node.flush(SENTRY_TIMEOUT);
|
|
33728
|
+
process.exit(0);
|
|
33729
|
+
}
|
|
33730
|
+
process.on("SIGTERM", () => shutdown("SIGTERM"));
|
|
33731
|
+
process.on("SIGINT", () => shutdown("SIGINT"));
|
|
33732
|
+
process.on("uncaughtException", async (error) => {
|
|
33733
|
+
console.error("Uncaught exception:", error);
|
|
33734
|
+
__sentry_node.captureException(error);
|
|
33735
|
+
await __sentry_node.flush(SENTRY_TIMEOUT);
|
|
33736
|
+
process.exit(1);
|
|
33737
|
+
});
|
|
33738
|
+
process.on("unhandledRejection", async (reason) => {
|
|
33739
|
+
console.error("Unhandled rejection:", reason);
|
|
33740
|
+
__sentry_node.captureException(reason);
|
|
33741
|
+
await __sentry_node.flush(SENTRY_TIMEOUT);
|
|
33742
|
+
process.exit(1);
|
|
33743
|
+
});
|
|
33744
|
+
const context$1 = {
|
|
33745
|
+
accessToken: cfg.accessToken,
|
|
33746
|
+
grantedSkills: cfg.finalSkills,
|
|
33747
|
+
constraints: {
|
|
33748
|
+
organizationSlug: cfg.organizationSlug ?? null,
|
|
33749
|
+
projectSlug: cfg.projectSlug ?? null
|
|
33750
|
+
},
|
|
33751
|
+
sentryHost: cfg.sentryHost,
|
|
33752
|
+
mcpUrl: cfg.mcpUrl,
|
|
33753
|
+
openaiBaseUrl: cfg.openaiBaseUrl,
|
|
33754
|
+
agentMode: cli.agent,
|
|
33755
|
+
experimentalMode: cli.experimental,
|
|
33756
|
+
transport: "stdio"
|
|
33757
|
+
};
|
|
33758
|
+
const server = buildServer({
|
|
33759
|
+
context: context$1,
|
|
33760
|
+
agentMode: cli.agent,
|
|
33761
|
+
experimentalMode: cli.experimental
|
|
33762
|
+
});
|
|
33763
|
+
require_stdio.startStdio(server, context$1).catch(async (err) => {
|
|
33764
|
+
console.error("Server error:", err);
|
|
33765
|
+
__sentry_node.captureException(err);
|
|
33766
|
+
await __sentry_node.flush(SENTRY_TIMEOUT);
|
|
33767
|
+
process.exit(1);
|
|
33768
|
+
});
|
|
33769
|
+
}
|
|
33770
|
+
main().catch((err) => {
|
|
33771
|
+
console.error("Fatal error:", err);
|
|
33586
33772
|
process.exit(1);
|
|
33587
33773
|
});
|
|
33588
33774
|
|