@sentry/mcp-server 0.24.0 → 0.25.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.
Files changed (67) hide show
  1. package/dist/cli/parse.cjs +1 -1
  2. package/dist/cli/parse.d.cts +1 -1
  3. package/dist/cli/parse.d.cts.map +1 -1
  4. package/dist/cli/parse.d.ts +1 -1
  5. package/dist/cli/parse.d.ts.map +1 -1
  6. package/dist/cli/parse.js +1 -1
  7. package/dist/cli/resolve.cjs +1 -2
  8. package/dist/cli/resolve.d.cts +2 -3
  9. package/dist/cli/resolve.d.cts.map +1 -1
  10. package/dist/cli/resolve.d.ts +2 -3
  11. package/dist/cli/resolve.d.ts.map +1 -1
  12. package/dist/cli/resolve.js +2 -2
  13. package/dist/cli/types.d.cts +1 -1
  14. package/dist/cli/types.d.ts +1 -1
  15. package/dist/cli/usage.cjs +1 -1
  16. package/dist/cli/usage.d.cts +1 -2
  17. package/dist/cli/usage.d.cts.map +1 -1
  18. package/dist/cli/usage.d.ts +1 -2
  19. package/dist/cli/usage.d.ts.map +1 -1
  20. package/dist/cli/usage.js +1 -1
  21. package/dist/config-BEgU9ylR.js +3 -0
  22. package/dist/{config-DtimzxvV-D3ccpxhQ.cjs → config-BoFBjXRq-CGHqlnJ9.cjs} +296 -4
  23. package/dist/config-BoFBjXRq-CGHqlnJ9.cjs.map +1 -0
  24. package/dist/{config-DtimzxvV-BItTrGiz.js → config-BoFBjXRq-CMdBQOkQ.js} +291 -5
  25. package/dist/config-BoFBjXRq-CMdBQOkQ.js.map +1 -0
  26. package/dist/config-rZ982IEm.cjs +7 -0
  27. package/dist/index.cjs +333 -164
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.js +329 -160
  30. package/dist/index.js.map +1 -1
  31. package/dist/{parse-Dn9XeQSj.js → parse-46t_fITC.js} +2 -26
  32. package/dist/parse-46t_fITC.js.map +1 -0
  33. package/dist/{parse-By6nDBNs.cjs → parse-BjIH83SX.cjs} +2 -26
  34. package/dist/parse-BjIH83SX.cjs.map +1 -0
  35. package/dist/resolve-CdTP9riu.cjs +286 -0
  36. package/dist/resolve-CdTP9riu.cjs.map +1 -0
  37. package/dist/resolve-Cg3SH2zt.js +232 -0
  38. package/dist/resolve-Cg3SH2zt.js.map +1 -0
  39. package/dist/{stdio-iRuX-anh.cjs → stdio-Cl-Ib8bu.cjs} +4 -4
  40. package/dist/{stdio-iRuX-anh.cjs.map → stdio-Cl-Ib8bu.cjs.map} +1 -1
  41. package/dist/{stdio-Cp-EJZB9.js → stdio-CwqdTAhY.js} +4 -4
  42. package/dist/{stdio-Cp-EJZB9.js.map → stdio-CwqdTAhY.js.map} +1 -1
  43. package/dist/transports/stdio.cjs +1 -1
  44. package/dist/transports/stdio.js +1 -1
  45. package/dist/{types-CM88pHH_.d.ts → types-D5f00mg9.d.ts} +2 -11
  46. package/dist/types-D5f00mg9.d.ts.map +1 -0
  47. package/dist/{types-CnLRMjvf.d.cts → types-DpmAC3S8.d.cts} +2 -11
  48. package/dist/types-DpmAC3S8.d.cts.map +1 -0
  49. package/dist/{usage-DMGbIpV-.js → usage-BzYvqaru.js} +3 -11
  50. package/dist/usage-BzYvqaru.js.map +1 -0
  51. package/dist/{usage-iwGZsu3a.cjs → usage-DD58xBe3.cjs} +3 -11
  52. package/dist/usage-DD58xBe3.cjs.map +1 -0
  53. package/package.json +5 -4
  54. package/dist/config-Bs1p6XwV.js +0 -3
  55. package/dist/config-DFewJLVx.cjs +0 -6
  56. package/dist/config-DtimzxvV-BItTrGiz.js.map +0 -1
  57. package/dist/config-DtimzxvV-D3ccpxhQ.cjs.map +0 -1
  58. package/dist/parse-By6nDBNs.cjs.map +0 -1
  59. package/dist/parse-Dn9XeQSj.js.map +0 -1
  60. package/dist/resolve-BCdS4js5.js +0 -590
  61. package/dist/resolve-BCdS4js5.js.map +0 -1
  62. package/dist/resolve-BMmRdCFJ.cjs +0 -692
  63. package/dist/resolve-BMmRdCFJ.cjs.map +0 -1
  64. package/dist/types-CM88pHH_.d.ts.map +0 -1
  65. package/dist/types-CnLRMjvf.d.cts.map +0 -1
  66. package/dist/usage-DMGbIpV-.js.map +0 -1
  67. package/dist/usage-iwGZsu3a.cjs.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,18 +1,194 @@
1
1
  #!/usr/bin/env node
2
2
  const require_chunk = require('./chunk-DoeelZqw.cjs');
3
- const require_resolve = require('./resolve-BMmRdCFJ.cjs');
4
- const require_stdio = require('./stdio-iRuX-anh.cjs');
5
- const require_config_DtimzxvV = require('./config-DtimzxvV-D3ccpxhQ.cjs');
6
- const require_usage = require('./usage-iwGZsu3a.cjs');
7
- const require_parse = require('./parse-By6nDBNs.cjs');
3
+ const require_resolve = require('./resolve-CdTP9riu.cjs');
4
+ const require_stdio = require('./stdio-Cl-Ib8bu.cjs');
5
+ const require_config_BoFBjXRq = require('./config-BoFBjXRq-CGHqlnJ9.cjs');
6
+ const require_usage = require('./usage-DD58xBe3.cjs');
7
+ const require_parse = require('./parse-BjIH83SX.cjs');
8
8
  const zod = require_chunk.__toESM(require("zod"));
9
9
  const node_util = require_chunk.__toESM(require("node:util"));
10
10
  const __sentry_core = require_chunk.__toESM(require("@sentry/core"));
11
- const __sentry_node = require_chunk.__toESM(require("@sentry/node"));
12
11
  const zod_v3 = require_chunk.__toESM(require("zod/v3"));
13
12
  const __modelcontextprotocol_sdk_server_mcp_js = require_chunk.__toESM(require("@modelcontextprotocol/sdk/server/mcp.js"));
14
13
  const __modelcontextprotocol_sdk_inMemory_js = require_chunk.__toESM(require("@modelcontextprotocol/sdk/inMemory.js"));
14
+ const __sentry_node = require_chunk.__toESM(require("@sentry/node"));
15
+
16
+ //#region ../mcp-core/dist/constants-D8axTonA.js
17
+ /**
18
+ * Constants for Sentry MCP server.
19
+ *
20
+ * Defines platform and framework combinations available in Sentry documentation.
21
+ */
22
+ /**
23
+ * MCP Server identification
24
+ */
25
+ const MCP_SERVER_NAME = "Sentry MCP";
26
+ /**
27
+ * Allowed region domains for sentry.io
28
+ * Only these specific domains are permitted when using Sentry's cloud service
29
+ * This is used to prevent SSRF attacks by restricting regionUrl to known domains
30
+ */
31
+ const SENTRY_ALLOWED_REGION_DOMAINS = new Set([
32
+ "sentry.io",
33
+ "us.sentry.io",
34
+ "de.sentry.io"
35
+ ]);
36
+ /**
37
+ * Common Sentry platforms that have documentation available
38
+ */
39
+ const SENTRY_PLATFORMS_BASE = [
40
+ "javascript",
41
+ "python",
42
+ "java",
43
+ "dotnet",
44
+ "go",
45
+ "php",
46
+ "ruby",
47
+ "android",
48
+ "apple",
49
+ "unity",
50
+ "unreal",
51
+ "rust",
52
+ "elixir",
53
+ "kotlin",
54
+ "native",
55
+ "dart",
56
+ "godot",
57
+ "nintendo-switch",
58
+ "playstation",
59
+ "powershell",
60
+ "react-native",
61
+ "xbox"
62
+ ];
63
+ /**
64
+ * Platform-specific frameworks that have Sentry guides
65
+ */
66
+ const SENTRY_FRAMEWORKS = {
67
+ javascript: [
68
+ "nextjs",
69
+ "react",
70
+ "gatsby",
71
+ "remix",
72
+ "vue",
73
+ "angular",
74
+ "hono",
75
+ "svelte",
76
+ "express",
77
+ "fastify",
78
+ "astro",
79
+ "bun",
80
+ "capacitor",
81
+ "cloudflare",
82
+ "connect",
83
+ "cordova",
84
+ "deno",
85
+ "electron",
86
+ "ember",
87
+ "nuxt",
88
+ "solid",
89
+ "solidstart",
90
+ "sveltekit",
91
+ "tanstack-react",
92
+ "wasm",
93
+ "node",
94
+ "koa",
95
+ "nestjs",
96
+ "hapi"
97
+ ],
98
+ python: [
99
+ "django",
100
+ "flask",
101
+ "fastapi",
102
+ "celery",
103
+ "tornado",
104
+ "pyramid",
105
+ "aiohttp",
106
+ "anthropic",
107
+ "airflow",
108
+ "aws-lambda",
109
+ "boto3",
110
+ "bottle",
111
+ "chalice",
112
+ "dramatiq",
113
+ "falcon",
114
+ "langchain",
115
+ "litestar",
116
+ "logging",
117
+ "loguru",
118
+ "openai",
119
+ "quart",
120
+ "ray",
121
+ "redis",
122
+ "rq",
123
+ "sanic",
124
+ "sqlalchemy",
125
+ "starlette"
126
+ ],
127
+ dart: ["flutter"],
128
+ dotnet: [
129
+ "aspnetcore",
130
+ "maui",
131
+ "wpf",
132
+ "winforms",
133
+ "aspnet",
134
+ "aws-lambda",
135
+ "azure-functions",
136
+ "blazor-webassembly",
137
+ "entityframework",
138
+ "google-cloud-functions",
139
+ "extensions-logging",
140
+ "log4net",
141
+ "nlog",
142
+ "serilog",
143
+ "uwp",
144
+ "xamarin"
145
+ ],
146
+ java: [
147
+ "spring",
148
+ "spring-boot",
149
+ "android",
150
+ "jul",
151
+ "log4j2",
152
+ "logback",
153
+ "servlet"
154
+ ],
155
+ go: [
156
+ "echo",
157
+ "fasthttp",
158
+ "fiber",
159
+ "gin",
160
+ "http",
161
+ "iris",
162
+ "logrus",
163
+ "negroni",
164
+ "slog",
165
+ "zerolog"
166
+ ],
167
+ php: ["laravel", "symfony"],
168
+ ruby: [
169
+ "delayed_job",
170
+ "rack",
171
+ "rails",
172
+ "resque",
173
+ "sidekiq"
174
+ ],
175
+ android: ["kotlin"],
176
+ apple: [
177
+ "ios",
178
+ "macos",
179
+ "watchos",
180
+ "tvos",
181
+ "visionos"
182
+ ],
183
+ kotlin: ["multiplatform"]
184
+ };
185
+ /**
186
+ * All valid guides for Sentry docs search filtering.
187
+ * A guide can be either a platform (e.g., 'javascript') or a platform/framework combination (e.g., 'javascript/nextjs').
188
+ */
189
+ const SENTRY_GUIDES = [...SENTRY_PLATFORMS_BASE, ...Object.entries(SENTRY_FRAMEWORKS).flatMap(([platform, guides]) => guides.map((guide) => `${platform}/${guide}`))];
15
190
 
191
+ //#endregion
16
192
  //#region ../mcp-core/dist/errors-BXmNwD2K.js
17
193
  /**
18
194
  * Error thrown when user input validation fails.
@@ -37,7 +213,7 @@ var ConfigurationError = class extends Error {
37
213
  };
38
214
 
39
215
  //#endregion
40
- //#region ../mcp-core/dist/slug-validation-BKH2JUpn.js
216
+ //#region ../mcp-core/dist/slug-validation-BdDL1fV5.js
41
217
  /**
42
218
  * Maximum reasonable length for a slug.
43
219
  */
@@ -126,7 +302,7 @@ function validateSlugOrId(val, ctx) {
126
302
  }
127
303
 
128
304
  //#endregion
129
- //#region ../mcp-core/dist/schema-yM01CDL7.js
305
+ //#region ../mcp-core/dist/schema-Bl7AGsln.js
130
306
  const ParamOrganizationSlug = zod.z.string().toLowerCase().trim().superRefine(validateSlug).describe("The organization's slug. You can find a existing list of organizations you have access to using the `find_organizations()` tool.");
131
307
  const ParamTeamSlug = zod.z.string().toLowerCase().trim().superRefine(validateSlug).describe("The team's slug. You can find a list of existing teams in an organization using the `find_teams()` tool.");
132
308
  const ParamProjectSlug = zod.z.string().toLowerCase().trim().superRefine(validateSlug).describe("The project's slug. You can find a list of existing projects in an organization using the `find_projects()` tool.");
@@ -154,12 +330,12 @@ const ParamIssueStatus = zod.z.enum([
154
330
  "ignored"
155
331
  ]).describe("The new status for the issue. Valid values are 'resolved', 'resolvedInNextRelease', 'unresolved', and 'ignored'.");
156
332
  const ParamAssignedTo = zod.z.string().trim().describe("The assignee in format 'user:ID' or 'team:ID' where ID is numeric. Example: 'user:123456' or 'team:789'. Use the whoami tool to find your user ID.");
157
- const ParamSentryGuide = zod.z.enum(require_resolve.SENTRY_GUIDES).describe("Optional guide filter to limit search results to specific documentation sections. Use either a platform (e.g., 'javascript', 'python') or platform/guide combination (e.g., 'javascript/nextjs', 'python/django').");
333
+ const ParamSentryGuide = zod.z.enum(SENTRY_GUIDES).describe("Optional guide filter to limit search results to specific documentation sections. Use either a platform (e.g., 'javascript', 'python') or platform/guide combination (e.g., 'javascript/nextjs', 'python/django').");
158
334
  const ParamEventId = zod.z.string().trim().describe("The ID of the event.");
159
335
  const ParamAttachmentId = zod.z.string().trim().describe("The ID of the attachment to download.");
160
336
 
161
337
  //#endregion
162
- //#region ../mcp-core/dist/define-DUKsI6o0.js
338
+ //#region ../mcp-core/dist/define-vgYYpneQ.js
163
339
  function defineTool(config) {
164
340
  return config;
165
341
  }
@@ -316,8 +492,8 @@ var LoggerImpl = class LoggerImpl$1 {
316
492
  */
317
493
  resetDescendants() {
318
494
  for (const child of Object.values(this.children)) {
319
- const logger$1 = child instanceof LoggerImpl$1 ? child : child.deref();
320
- if (logger$1 != null) logger$1.resetDescendants();
495
+ const logger$2 = child instanceof LoggerImpl$1 ? child : child.deref();
496
+ if (logger$2 != null) logger$2.resetDescendants();
321
497
  }
322
498
  this.reset();
323
499
  }
@@ -481,8 +657,8 @@ var LoggerImpl = class LoggerImpl$1 {
481
657
  var LoggerCtx = class LoggerCtx$1 {
482
658
  logger;
483
659
  properties;
484
- constructor(logger$1, properties) {
485
- this.logger = logger$1;
660
+ constructor(logger$2, properties) {
661
+ this.logger = logger$2;
486
662
  this.properties = properties;
487
663
  }
488
664
  get category() {
@@ -1232,20 +1408,20 @@ function configureInternal(config, allowAsync) {
1232
1408
  const categoryKey = Array.isArray(cfg$1.category) ? JSON.stringify(cfg$1.category) : JSON.stringify([cfg$1.category]);
1233
1409
  if (configuredCategories.has(categoryKey)) throw new ConfigError(`Duplicate logger configuration for category: ${categoryKey}. Each category can only be configured once.`);
1234
1410
  configuredCategories.add(categoryKey);
1235
- const logger$1 = LoggerImpl.getLogger(cfg$1.category);
1411
+ const logger$2 = LoggerImpl.getLogger(cfg$1.category);
1236
1412
  for (const sinkId of cfg$1.sinks ?? []) {
1237
1413
  const sink = config.sinks[sinkId];
1238
1414
  if (!sink) throw new ConfigError(`Sink not found: ${sinkId}.`);
1239
- logger$1.sinks.push(sink);
1415
+ logger$2.sinks.push(sink);
1240
1416
  }
1241
- logger$1.parentSinks = cfg$1.parentSinks ?? "inherit";
1242
- if (cfg$1.lowestLevel !== void 0) logger$1.lowestLevel = cfg$1.lowestLevel;
1417
+ logger$2.parentSinks = cfg$1.parentSinks ?? "inherit";
1418
+ if (cfg$1.lowestLevel !== void 0) logger$2.lowestLevel = cfg$1.lowestLevel;
1243
1419
  for (const filterId of cfg$1.filters ?? []) {
1244
1420
  const filter$1 = config.filters?.[filterId];
1245
1421
  if (filter$1 === void 0) throw new ConfigError(`Filter not found: ${filterId}.`);
1246
- logger$1.filters.push(toFilter(filter$1));
1422
+ logger$2.filters.push(toFilter(filter$1));
1247
1423
  }
1248
- strongRefs.add(logger$1);
1424
+ strongRefs.add(logger$2);
1249
1425
  }
1250
1426
  LoggerImpl.getLogger().contextLocalStorage = config.contextLocalStorage;
1251
1427
  for (const sink of Object.values(config.sinks)) {
@@ -1329,7 +1505,7 @@ var ConfigError = class extends Error {
1329
1505
  };
1330
1506
 
1331
1507
  //#endregion
1332
- //#region ../mcp-core/dist/logging-DipAE5VU.js
1508
+ //#region ../mcp-core/dist/logging-BK_g0p3a.js
1333
1509
  const ROOT_LOG_CATEGORY = ["sentry", "mcp"];
1334
1510
  let loggingConfigured = false;
1335
1511
  function resolveLowestLevel() {
@@ -1346,12 +1522,12 @@ function resolveLowestLevel() {
1346
1522
  * (creating Issues), this sink uses Sentry.logger.* methods to send data to the
1347
1523
  * Logs product.
1348
1524
  *
1349
- * Note: This uses @sentry/node logger API. Cloudflare Workers will need a separate
1350
- * implementation using @sentry/cloudflare logger API.
1525
+ * This uses @sentry/core logger API which works across all platforms (Node.js,
1526
+ * Cloudflare Workers, etc.) as long as Sentry is initialized with the appropriate SDK.
1351
1527
  */
1352
1528
  function createSentryLogsSink() {
1353
1529
  return (record) => {
1354
- if (!__sentry_node.logger) return;
1530
+ if (!__sentry_core.logger) return;
1355
1531
  let message = "";
1356
1532
  for (let i = 0; i < record.message.length; i++) if (i % 2 === 0) message += record.message[i];
1357
1533
  else {
@@ -1361,24 +1537,24 @@ function createSentryLogsSink() {
1361
1537
  const attributes$73 = record.properties;
1362
1538
  switch (record.level) {
1363
1539
  case "trace":
1364
- __sentry_node.logger.trace(message, attributes$73);
1540
+ __sentry_core.logger.trace(message, attributes$73);
1365
1541
  break;
1366
1542
  case "debug":
1367
- __sentry_node.logger.debug(message, attributes$73);
1543
+ __sentry_core.logger.debug(message, attributes$73);
1368
1544
  break;
1369
1545
  case "info":
1370
- __sentry_node.logger.info(message, attributes$73);
1546
+ __sentry_core.logger.info(message, attributes$73);
1371
1547
  break;
1372
1548
  case "warning":
1373
- __sentry_node.logger.warn(message, attributes$73);
1549
+ __sentry_core.logger.warn(message, attributes$73);
1374
1550
  break;
1375
1551
  case "error":
1376
- __sentry_node.logger.error(message, attributes$73);
1552
+ __sentry_core.logger.error(message, attributes$73);
1377
1553
  break;
1378
1554
  case "fatal":
1379
- __sentry_node.logger.fatal(message, attributes$73);
1555
+ __sentry_core.logger.fatal(message, attributes$73);
1380
1556
  break;
1381
- default: __sentry_node.logger.info(message, attributes$73);
1557
+ default: __sentry_core.logger.info(message, attributes$73);
1382
1558
  }
1383
1559
  };
1384
1560
  }
@@ -1415,8 +1591,8 @@ function ensureLoggingConfigured() {
1415
1591
  function getLogger$1(scope, defaults) {
1416
1592
  ensureLoggingConfigured();
1417
1593
  const category = Array.isArray(scope) ? scope : [scope];
1418
- const logger$1 = getLogger([...ROOT_LOG_CATEGORY, ...category]);
1419
- return defaults ? logger$1.with(defaults) : logger$1;
1594
+ const logger$2 = getLogger([...ROOT_LOG_CATEGORY, ...category]);
1595
+ return defaults ? logger$2.with(defaults) : logger$2;
1420
1596
  }
1421
1597
  const ISSUE_LOGGER_SCOPE = ["runtime", "issues"];
1422
1598
  function isRecord(value) {
@@ -1494,7 +1670,7 @@ function serializeError(value, depth = 0) {
1494
1670
  }
1495
1671
  return { message: coerceMessage(value) };
1496
1672
  }
1497
- const logger = getLogger$1([]);
1673
+ const logger$1 = getLogger$1([]);
1498
1674
  const DEFAULT_LOGGER_SCOPE = [];
1499
1675
  function buildLogProperties(level, options, serializedError) {
1500
1676
  const properties = { severity: level };
@@ -1533,6 +1709,9 @@ function logWithLevel(level, value, contextsOrOptions) {
1533
1709
  default: scopedLogger.info(message, () => properties);
1534
1710
  }
1535
1711
  }
1712
+ function logInfo(value, contextsOrOptions) {
1713
+ logWithLevel("info", value, contextsOrOptions);
1714
+ }
1536
1715
  function logWarn(value, contextsOrOptions) {
1537
1716
  logWithLevel("warning", value, contextsOrOptions);
1538
1717
  }
@@ -1573,7 +1752,7 @@ function logIssue(error, contextsOrOptions, attachmentsArg) {
1573
1752
  }
1574
1753
 
1575
1754
  //#endregion
1576
- //#region ../mcp-core/dist/schema-COv2Mx9E.js
1755
+ //#region ../mcp-core/dist/schema-BO1YtJIJ.js
1577
1756
  /**
1578
1757
  * Schema for Sentry API error responses.
1579
1758
  *
@@ -2070,7 +2249,7 @@ const TraceIssueSchema = zod.z.object({
2070
2249
  const TraceSchema = zod.z.array(zod.z.union([TraceSpanSchema, TraceIssueSchema]));
2071
2250
 
2072
2251
  //#endregion
2073
- //#region ../mcp-core/dist/errors-h_Ebmo8b.js
2252
+ //#region ../mcp-core/dist/errors-ZBQnDL3L.js
2074
2253
  /**
2075
2254
  * API Error Class Hierarchy
2076
2255
  *
@@ -2285,7 +2464,7 @@ function createApiError(message, status, detail, responseBody) {
2285
2464
  }
2286
2465
 
2287
2466
  //#endregion
2288
- //#region ../mcp-core/dist/client-B9APZB0N.js
2467
+ //#region ../mcp-core/dist/client-DsM0pHqr.js
2289
2468
  /**
2290
2469
  * Mapping of common network error codes to user-friendly messages.
2291
2470
  * These help users understand and resolve connection issues.
@@ -3374,7 +3553,7 @@ var SentryApiService = class {
3374
3553
  };
3375
3554
 
3376
3555
  //#endregion
3377
- //#region ../mcp-core/dist/validate-region-url-DAFGgDb3.js
3556
+ //#region ../mcp-core/dist/validate-region-url-BL1kR9T7.js
3378
3557
  /**
3379
3558
  * Validates that a regionUrl is valid.
3380
3559
  * Prevents SSRF attacks by only allowing the base host itself or domains from an allowlist.
@@ -3401,12 +3580,12 @@ function validateRegionUrl(regionUrl, baseHost) {
3401
3580
  const regionHost = parsedUrl.host.toLowerCase();
3402
3581
  const baseLower = baseHost.toLowerCase();
3403
3582
  if (regionHost === baseLower) return regionHost;
3404
- if (!require_resolve.SENTRY_ALLOWED_REGION_DOMAINS.has(regionHost)) throw new UserInputError(`Invalid regionUrl: ${regionUrl}. The domain '${regionHost}' is not allowed. Allowed domains are: ${Array.from(require_resolve.SENTRY_ALLOWED_REGION_DOMAINS).join(", ")}`);
3583
+ if (!SENTRY_ALLOWED_REGION_DOMAINS.has(regionHost)) throw new UserInputError(`Invalid regionUrl: ${regionUrl}. The domain '${regionHost}' is not allowed. Allowed domains are: ${Array.from(SENTRY_ALLOWED_REGION_DOMAINS).join(", ")}`);
3405
3584
  return regionHost;
3406
3585
  }
3407
3586
 
3408
3587
  //#endregion
3409
- //#region ../mcp-core/dist/api-C49LlEqH.js
3588
+ //#region ../mcp-core/dist/api-DxBbW5xK.js
3410
3589
  /**
3411
3590
  * Create a Sentry API service from server context with optional region override
3412
3591
  * @param context - Server context containing host and access token
@@ -3427,7 +3606,7 @@ function apiServiceFromContext(context$1, opts = {}) {
3427
3606
  }
3428
3607
 
3429
3608
  //#endregion
3430
- //#region ../mcp-core/dist/whoami-BoraVlxR.js
3609
+ //#region ../mcp-core/dist/whoami-Ri2i43vR.js
3431
3610
  var whoami_default = defineTool({
3432
3611
  name: "whoami",
3433
3612
  description: [
@@ -3437,7 +3616,7 @@ var whoami_default = defineTool({
3437
3616
  "- Get the user's name and email address."
3438
3617
  ].join("\n"),
3439
3618
  inputSchema: {},
3440
- requiredSkills: require_resolve.ALL_SKILLS,
3619
+ skills: require_resolve.ALL_SKILLS,
3441
3620
  requiredScopes: [],
3442
3621
  annotations: {
3443
3622
  readOnlyHint: true,
@@ -3460,11 +3639,11 @@ var whoami_default = defineTool({
3460
3639
  });
3461
3640
 
3462
3641
  //#endregion
3463
- //#region ../mcp-core/dist/find-organizations-Df_7XcZh.js
3642
+ //#region ../mcp-core/dist/find-organizations-Cf2YI972.js
3464
3643
  const RESULT_LIMIT$2 = 25;
3465
3644
  var find_organizations_default = defineTool({
3466
3645
  name: "find_organizations",
3467
- requiredSkills: require_resolve.ALL_SKILLS,
3646
+ skills: require_resolve.ALL_SKILLS,
3468
3647
  requiredScopes: ["org:read"],
3469
3648
  description: [
3470
3649
  "Find organizations that the user has access to in Sentry.",
@@ -3512,11 +3691,11 @@ var find_organizations_default = defineTool({
3512
3691
  });
3513
3692
 
3514
3693
  //#endregion
3515
- //#region ../mcp-core/dist/find-teams-Ci9--JWk.js
3694
+ //#region ../mcp-core/dist/find-teams-C_HR4IHN.js
3516
3695
  const RESULT_LIMIT$1 = 25;
3517
3696
  var find_teams_default = defineTool({
3518
3697
  name: "find_teams",
3519
- requiredSkills: [
3698
+ skills: [
3520
3699
  "inspect",
3521
3700
  "triage",
3522
3701
  "project-management"
@@ -3560,11 +3739,11 @@ var find_teams_default = defineTool({
3560
3739
  });
3561
3740
 
3562
3741
  //#endregion
3563
- //#region ../mcp-core/dist/find-projects-_xE0VUHG.js
3742
+ //#region ../mcp-core/dist/find-projects-DLZN7tox.js
3564
3743
  const RESULT_LIMIT = 25;
3565
3744
  var find_projects_default = defineTool({
3566
3745
  name: "find_projects",
3567
- requiredSkills: require_resolve.ALL_SKILLS,
3746
+ skills: require_resolve.ALL_SKILLS,
3568
3747
  requiredScopes: ["project:read"],
3569
3748
  description: [
3570
3749
  "Find projects in Sentry.",
@@ -3604,10 +3783,10 @@ var find_projects_default = defineTool({
3604
3783
  });
3605
3784
 
3606
3785
  //#endregion
3607
- //#region ../mcp-core/dist/find-releases-B-2KNnj4.js
3786
+ //#region ../mcp-core/dist/find-releases-B5iKG6ZO.js
3608
3787
  var find_releases_default = defineTool({
3609
3788
  name: "find_releases",
3610
- requiredSkills: ["inspect"],
3789
+ skills: ["inspect"],
3611
3790
  requiredScopes: ["project:read"],
3612
3791
  description: [
3613
3792
  "Find releases in Sentry.",
@@ -3695,7 +3874,7 @@ var find_releases_default = defineTool({
3695
3874
  });
3696
3875
 
3697
3876
  //#endregion
3698
- //#region ../mcp-core/dist/issue-helpers-CW_FS0Jn.js
3877
+ //#region ../mcp-core/dist/issue-helpers-DtCbXiRZ.js
3699
3878
  /**
3700
3879
  * Extracts the Sentry issue ID and organization slug from a full URL
3701
3880
  *
@@ -3771,7 +3950,7 @@ function parseIssueParams({ issueUrl, issueId, organizationSlug }) {
3771
3950
  }
3772
3951
 
3773
3952
  //#endregion
3774
- //#region ../mcp-core/dist/seer-D6i7nmhd.js
3953
+ //#region ../mcp-core/dist/seer-CSFgx4AP.js
3775
3954
  const SEER_POLLING_INTERVAL = 5e3;
3776
3955
  const SEER_TIMEOUT = 5 * 60 * 1e3;
3777
3956
  const SEER_MAX_RETRIES = 3;
@@ -3852,7 +4031,7 @@ function getOutputForAutofixStep(step) {
3852
4031
  }
3853
4032
 
3854
4033
  //#endregion
3855
- //#region ../mcp-core/dist/formatting-CGRFosDy.js
4034
+ //#region ../mcp-core/dist/formatting-CbPBuuTP.js
3856
4035
  const LANGUAGE_EXTENSIONS = {
3857
4036
  ".java": "java",
3858
4037
  ".py": "python",
@@ -4820,7 +4999,7 @@ function formatIssueOutput({ organizationSlug, issue, event, apiService, autofix
4820
4999
  }
4821
5000
 
4822
5001
  //#endregion
4823
- //#region ../mcp-core/dist/enhance-error-oY19n4bn.js
5002
+ //#region ../mcp-core/dist/enhance-error-BzwoJ7V0.js
4824
5003
  /**
4825
5004
  * Enhances a 404 error with parameter context to help users understand what went wrong.
4826
5005
  * This is optional - tools can use this when they want to provide extra context.
@@ -4848,10 +5027,10 @@ function enhanceNotFoundError(error, params) {
4848
5027
  }
4849
5028
 
4850
5029
  //#endregion
4851
- //#region ../mcp-core/dist/get-issue-details-Dkx3WdXu.js
5030
+ //#region ../mcp-core/dist/get-issue-details-CzHzJZi2.js
4852
5031
  var get_issue_details_default = defineTool({
4853
5032
  name: "get_issue_details",
4854
- requiredSkills: [
5033
+ skills: [
4855
5034
  "inspect",
4856
5035
  "triage",
4857
5036
  "seer"
@@ -5029,14 +5208,14 @@ function shouldFetchTraceForEvent(event) {
5029
5208
  }
5030
5209
 
5031
5210
  //#endregion
5032
- //#region ../mcp-core/dist/get-trace-details-f5XoKmIu.js
5211
+ //#region ../mcp-core/dist/get-trace-details-DGzLP_Mo.js
5033
5212
  const MAX_DEPTH = 2;
5034
5213
  const MINIMUM_DURATION_THRESHOLD_MS = 10;
5035
5214
  const MIN_MEANINGFUL_CHILD_DURATION = 5;
5036
5215
  const MIN_AVG_DURATION_MS = 5;
5037
5216
  var get_trace_details_default = defineTool({
5038
5217
  name: "get_trace_details",
5039
- requiredSkills: ["inspect"],
5218
+ skills: ["inspect"],
5040
5219
  requiredScopes: ["event:read"],
5041
5220
  description: [
5042
5221
  "Get detailed information about a specific Sentry trace by ID.",
@@ -5328,10 +5507,10 @@ function formatTraceOutput({ organizationSlug, traceId, traceMeta, trace: trace$
5328
5507
  }
5329
5508
 
5330
5509
  //#endregion
5331
- //#region ../mcp-core/dist/get-event-attachment-B5GR2cWj.js
5510
+ //#region ../mcp-core/dist/get-event-attachment-4_XbtsrW.js
5332
5511
  var get_event_attachment_default = defineTool({
5333
5512
  name: "get_event_attachment",
5334
- requiredSkills: ["inspect"],
5513
+ skills: ["inspect"],
5335
5514
  requiredScopes: ["event:read"],
5336
5515
  description: [
5337
5516
  "Download attachments from a Sentry event.",
@@ -5464,7 +5643,7 @@ var get_event_attachment_default = defineTool({
5464
5643
  });
5465
5644
 
5466
5645
  //#endregion
5467
- //#region ../mcp-core/dist/formatting-CIwRyNGU.js
5646
+ //#region ../mcp-core/dist/formatting-DJFcfTJG.js
5468
5647
  /**
5469
5648
  * Helper function to format assignedTo field for display
5470
5649
  */
@@ -5476,10 +5655,10 @@ function formatAssignedTo(assignedTo) {
5476
5655
  }
5477
5656
 
5478
5657
  //#endregion
5479
- //#region ../mcp-core/dist/update-issue-BKnQHYYL.js
5658
+ //#region ../mcp-core/dist/update-issue-BSKY4Du1.js
5480
5659
  var update_issue_default = defineTool({
5481
5660
  name: "update_issue",
5482
- requiredSkills: ["triage"],
5661
+ skills: ["triage"],
5483
5662
  requiredScopes: ["event:write"],
5484
5663
  description: [
5485
5664
  "Update an issue's status or assignment in Sentry. This allows you to resolve, ignore, or reassign issues.",
@@ -8749,7 +8928,7 @@ function createOpenAI(options = {}) {
8749
8928
  var openai = createOpenAI({ compatibility: "strict" });
8750
8929
 
8751
8930
  //#endregion
8752
- //#region ../mcp-core/dist/openai-provider-C18ibzKZ.js
8931
+ //#region ../mcp-core/dist/openai-provider-BwPDNx0z.js
8753
8932
  const DEFAULT_OPENAI_MODEL = "gpt-5";
8754
8933
  const VALID_REASONING_EFFORTS = [
8755
8934
  "low",
@@ -10753,10 +10932,10 @@ var DiagComponentLogger = function() {
10753
10932
  return DiagComponentLogger$1;
10754
10933
  }();
10755
10934
  function logProxy(funcName, namespace$73, args) {
10756
- var logger$1 = getGlobal("diag");
10757
- if (!logger$1) return;
10935
+ var logger$2 = getGlobal("diag");
10936
+ if (!logger$2) return;
10758
10937
  args.unshift(namespace$73);
10759
- return logger$1[funcName].apply(logger$1, __spreadArray$3([], __read$3(args), false));
10938
+ return logger$2[funcName].apply(logger$2, __spreadArray$3([], __read$3(args), false));
10760
10939
  }
10761
10940
 
10762
10941
  //#endregion
@@ -10789,13 +10968,13 @@ var DiagLogLevel;
10789
10968
 
10790
10969
  //#endregion
10791
10970
  //#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js
10792
- function createLogLevelDiagLogger(maxLevel, logger$1) {
10971
+ function createLogLevelDiagLogger(maxLevel, logger$2) {
10793
10972
  if (maxLevel < DiagLogLevel.NONE) maxLevel = DiagLogLevel.NONE;
10794
10973
  else if (maxLevel > DiagLogLevel.ALL) maxLevel = DiagLogLevel.ALL;
10795
- logger$1 = logger$1 || {};
10974
+ logger$2 = logger$2 || {};
10796
10975
  function _filterFunc(funcName, theLevel) {
10797
- var theFunc = logger$1[funcName];
10798
- if (typeof theFunc === "function" && maxLevel >= theLevel) return theFunc.bind(logger$1);
10976
+ var theFunc = logger$2[funcName];
10977
+ if (typeof theFunc === "function" && maxLevel >= theLevel) return theFunc.bind(logger$2);
10799
10978
  return function() {};
10800
10979
  }
10801
10980
  return {
@@ -10850,23 +11029,23 @@ var DiagAPI = function() {
10850
11029
  return function() {
10851
11030
  var args = [];
10852
11031
  for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
10853
- var logger$1 = getGlobal("diag");
10854
- if (!logger$1) return;
10855
- return logger$1[funcName].apply(logger$1, __spreadArray$2([], __read$2(args), false));
11032
+ var logger$2 = getGlobal("diag");
11033
+ if (!logger$2) return;
11034
+ return logger$2[funcName].apply(logger$2, __spreadArray$2([], __read$2(args), false));
10856
11035
  };
10857
11036
  }
10858
11037
  var self = this;
10859
- var setLogger = function(logger$1, optionsOrLogLevel) {
11038
+ var setLogger = function(logger$2, optionsOrLogLevel) {
10860
11039
  var _a$2, _b, _c;
10861
11040
  if (optionsOrLogLevel === void 0) optionsOrLogLevel = { logLevel: DiagLogLevel.INFO };
10862
- if (logger$1 === self) {
11041
+ if (logger$2 === self) {
10863
11042
  var err = /* @__PURE__ */ new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
10864
11043
  self.error((_a$2 = err.stack) !== null && _a$2 !== void 0 ? _a$2 : err.message);
10865
11044
  return false;
10866
11045
  }
10867
11046
  if (typeof optionsOrLogLevel === "number") optionsOrLogLevel = { logLevel: optionsOrLogLevel };
10868
11047
  var oldLogger = getGlobal("diag");
10869
- var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger$1);
11048
+ var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger$2);
10870
11049
  if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
10871
11050
  var stack = (_c = (/* @__PURE__ */ new Error()).stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
10872
11051
  oldLogger.warn("Current logger will be overwritten from " + stack);
@@ -14067,7 +14246,7 @@ function trimStartOfStream() {
14067
14246
  var HANGING_STREAM_WARNING_TIME_MS = 15 * 1e3;
14068
14247
 
14069
14248
  //#endregion
14070
- //#region ../mcp-core/dist/callEmbeddedAgent-CX8bB_WX.js
14249
+ //#region ../mcp-core/dist/callEmbeddedAgent-C4iLIZ6C.js
14071
14250
  /**
14072
14251
  * Call an embedded agent with tool call capture
14073
14252
  * This is the standard way to call embedded AI agents within MCP tools
@@ -14086,6 +14265,10 @@ async function callEmbeddedAgent({ system, prompt, tools, schema }) {
14086
14265
  maxSteps: 5,
14087
14266
  temperature: 1,
14088
14267
  experimental_output: output_exports.object({ schema }),
14268
+ experimental_telemetry: {
14269
+ isEnabled: true,
14270
+ functionId: "callEmbeddedAgent"
14271
+ },
14089
14272
  providerOptions: { openai: {
14090
14273
  structuredOutputs: false,
14091
14274
  strictJsonSchema: false
@@ -14109,7 +14292,7 @@ async function callEmbeddedAgent({ system, prompt, tools, schema }) {
14109
14292
  }
14110
14293
 
14111
14294
  //#endregion
14112
- //#region ../mcp-core/dist/utils-Bq75Ba9Z.js
14295
+ //#region ../mcp-core/dist/utils-wepw5Cmn.js
14113
14296
  /**
14114
14297
  * Standard response schema for all embedded agent tools.
14115
14298
  * Tools return either an error message or the result data, never both.
@@ -14191,7 +14374,7 @@ function agentTool(config) {
14191
14374
  }
14192
14375
 
14193
14376
  //#endregion
14194
- //#region ../mcp-core/dist/otel-semantics-DEnkwUAq.js
14377
+ //#region ../mcp-core/dist/otel-semantics-ji8CZiqz.js
14195
14378
  var namespace$72 = "android";
14196
14379
  var description$72 = "The Android platform on which the Android application is running.\n";
14197
14380
  var attributes$72 = {
@@ -19037,7 +19220,7 @@ function createOtelLookupTool(options) {
19037
19220
  }
19038
19221
 
19039
19222
  //#endregion
19040
- //#region ../mcp-core/dist/whoami-BHrE9F4J.js
19223
+ //#region ../mcp-core/dist/whoami-B-N3_K3B.js
19041
19224
  /**
19042
19225
  * Get the current authenticated user's information from Sentry API
19043
19226
  */
@@ -19066,7 +19249,7 @@ function createWhoamiTool(options) {
19066
19249
  }
19067
19250
 
19068
19251
  //#endregion
19069
- //#region ../mcp-core/dist/utils-EGQqk2W7.js
19252
+ //#region ../mcp-core/dist/utils-Dehfm_qW.js
19070
19253
  function getStringValue(event, key, defaultValue = "") {
19071
19254
  const value = event[key];
19072
19255
  return typeof value === "string" ? value : defaultValue;
@@ -19119,7 +19302,7 @@ function createDatasetAttributesTool(options) {
19119
19302
  "logs"
19120
19303
  ]).describe("The dataset to query attributes for") }),
19121
19304
  execute: async ({ dataset }) => {
19122
- const { BASE_COMMON_FIELDS, DATASET_FIELDS, RECOMMENDED_FIELDS: RECOMMENDED_FIELDS$1, NUMERIC_FIELDS } = await Promise.resolve().then(() => require("./config-DFewJLVx.cjs"));
19305
+ const { BASE_COMMON_FIELDS, DATASET_FIELDS, RECOMMENDED_FIELDS: RECOMMENDED_FIELDS$1, NUMERIC_FIELDS, DATASET_EXAMPLES } = await Promise.resolve().then(() => require("./config-rZ982IEm.cjs"));
19123
19306
  const { attributes: customAttributes, fieldTypes } = await fetchCustomAttributes(apiService, organizationSlug, dataset, projectId);
19124
19307
  const allFields = {
19125
19308
  ...BASE_COMMON_FIELDS,
@@ -19145,13 +19328,16 @@ ${Object.keys(allFieldTypes).length > 30 ? `\n... and ${Object.keys(allFieldType
19145
19328
 
19146
19329
  IMPORTANT: Only use numeric aggregate functions (avg, sum, min, max, percentiles) with numeric fields. Use count() or count_unique() for non-numeric fields.
19147
19330
 
19148
- Use this information to construct appropriate queries for the ${dataset} dataset.`;
19331
+ EXAMPLE QUERIES FOR ${dataset.toUpperCase()}:
19332
+ ${DATASET_EXAMPLES[dataset].map((ex) => `- "${ex.description}" →\n ${JSON.stringify(ex.output)}`).join("\n\n")}
19333
+
19334
+ Use these examples as patterns for constructing your query.`;
19149
19335
  }
19150
19336
  });
19151
19337
  }
19152
19338
 
19153
19339
  //#endregion
19154
- //#region ../mcp-core/dist/agent-DUcsM6ug.js
19340
+ //#region ../mcp-core/dist/agent-B24BDcpH.js
19155
19341
  const searchEventsAgentOutputSchema = zod.z.object({
19156
19342
  dataset: zod.z.enum([
19157
19343
  "spans",
@@ -19193,7 +19379,7 @@ async function searchEventsAgent(options) {
19193
19379
  });
19194
19380
  const whoamiTool = createWhoamiTool({ apiService: options.apiService });
19195
19381
  return await callEmbeddedAgent({
19196
- system: require_config_DtimzxvV.systemPrompt,
19382
+ system: require_config_BoFBjXRq.systemPrompt,
19197
19383
  prompt: options.query,
19198
19384
  tools: {
19199
19385
  datasetAttributes: datasetAttributesTool,
@@ -19205,7 +19391,7 @@ async function searchEventsAgent(options) {
19205
19391
  }
19206
19392
 
19207
19393
  //#endregion
19208
- //#region ../mcp-core/dist/formatters-BDf0umPC.js
19394
+ //#region ../mcp-core/dist/formatters-CBiThZnb.js
19209
19395
  /**
19210
19396
  * Format an explanation for how a natural language query was translated
19211
19397
  */
@@ -19227,12 +19413,12 @@ function formatErrorResults(params) {
19227
19413
  output += `**View these results in Sentry**:\n${explorerUrl}\n`;
19228
19414
  output += `_Please share this link with the user to view the search results in their Sentry dashboard._\n\n`;
19229
19415
  if (eventData.length === 0) {
19230
- __sentry_node.logger.info(__sentry_node.logger.fmt`No error events found for query: ${naturalLanguageQuery}`, {
19416
+ logInfo(`No error events found for query: ${naturalLanguageQuery}`, { extra: {
19231
19417
  query: sentryQuery,
19232
19418
  fields,
19233
19419
  organizationSlug,
19234
19420
  dataset: "errors"
19235
- });
19421
+ } });
19236
19422
  output += `No results found.\n\n`;
19237
19423
  output += `Try being more specific or using different terms in your search.\n`;
19238
19424
  return output;
@@ -19291,12 +19477,12 @@ function formatLogResults(params) {
19291
19477
  output += `**View these results in Sentry**:\n${explorerUrl}\n`;
19292
19478
  output += `_Please share this link with the user to view the search results in their Sentry dashboard._\n\n`;
19293
19479
  if (eventData.length === 0) {
19294
- __sentry_node.logger.info(__sentry_node.logger.fmt`No log events found for query: ${naturalLanguageQuery}`, {
19480
+ logInfo(`No log events found for query: ${naturalLanguageQuery}`, { extra: {
19295
19481
  query: sentryQuery,
19296
19482
  fields,
19297
19483
  organizationSlug,
19298
19484
  dataset: "logs"
19299
- });
19485
+ } });
19300
19486
  output += `No results found.\n\n`;
19301
19487
  output += `Try being more specific or using different terms in your search.\n`;
19302
19488
  return output;
@@ -19372,12 +19558,12 @@ function formatSpanResults(params) {
19372
19558
  output += `**View these results in Sentry**:\n${explorerUrl}\n`;
19373
19559
  output += `_Please share this link with the user to view the search results in their Sentry dashboard._\n\n`;
19374
19560
  if (eventData.length === 0) {
19375
- __sentry_node.logger.info(__sentry_node.logger.fmt`No span events found for query: ${naturalLanguageQuery}`, {
19561
+ logInfo(`No span events found for query: ${naturalLanguageQuery}`, { extra: {
19376
19562
  query: sentryQuery,
19377
19563
  fields,
19378
19564
  organizationSlug,
19379
19565
  dataset: "spans"
19380
- });
19566
+ } });
19381
19567
  output += `No results found.\n\n`;
19382
19568
  output += `Try being more specific or using different terms in your search.\n`;
19383
19569
  return output;
@@ -19423,10 +19609,10 @@ function formatSpanResults(params) {
19423
19609
  }
19424
19610
 
19425
19611
  //#endregion
19426
- //#region ../mcp-core/dist/handler-DJ0HK96y.js
19612
+ //#region ../mcp-core/dist/handler-BV5deuNu.js
19427
19613
  var handler_default = defineTool({
19428
19614
  name: "search_events",
19429
- requiredSkills: [
19615
+ skills: [
19430
19616
  "inspect",
19431
19617
  "triage",
19432
19618
  "seer"
@@ -19503,7 +19689,7 @@ var handler_default = defineTool({
19503
19689
  });
19504
19690
  const parsed = agentResult.result;
19505
19691
  const dataset = parsed.dataset;
19506
- const recommendedFields = require_config_DtimzxvV.RECOMMENDED_FIELDS[dataset];
19692
+ const recommendedFields = require_config_BoFBjXRq.RECOMMENDED_FIELDS[dataset];
19507
19693
  if (!parsed.sort) throw new UserInputError(`Search Events Agent response missing required 'sort' parameter. Received: ${JSON.stringify(parsed, null, 2)}. The agent must specify how to sort results (e.g., '-timestamp' for newest first, '-count()' for highest count).`);
19508
19694
  const sentryQuery = parsed.query || "";
19509
19695
  const requestedFields = parsed.fields || [];
@@ -19564,10 +19750,10 @@ var handler_default = defineTool({
19564
19750
  });
19565
19751
 
19566
19752
  //#endregion
19567
- //#region ../mcp-core/dist/create-team-BAdl8A5-.js
19753
+ //#region ../mcp-core/dist/create-team-Dy96alMI.js
19568
19754
  var create_team_default = defineTool({
19569
19755
  name: "create_team",
19570
- requiredSkills: ["project-management"],
19756
+ skills: ["project-management"],
19571
19757
  requiredScopes: ["team:write"],
19572
19758
  description: [
19573
19759
  "Create a new team in Sentry.",
@@ -19619,10 +19805,10 @@ var create_team_default = defineTool({
19619
19805
  });
19620
19806
 
19621
19807
  //#endregion
19622
- //#region ../mcp-core/dist/create-project-OSqZHO31.js
19808
+ //#region ../mcp-core/dist/create-project-CgOCqPNP.js
19623
19809
  var create_project_default = defineTool({
19624
19810
  name: "create_project",
19625
- requiredSkills: ["project-management"],
19811
+ skills: ["project-management"],
19626
19812
  requiredScopes: ["project:write", "team:read"],
19627
19813
  description: [
19628
19814
  "Create a new project in Sentry (includes DSN automatically).",
@@ -19696,10 +19882,10 @@ var create_project_default = defineTool({
19696
19882
  });
19697
19883
 
19698
19884
  //#endregion
19699
- //#region ../mcp-core/dist/update-project-DUo5F94A.js
19885
+ //#region ../mcp-core/dist/update-project-CMtXKaXN.js
19700
19886
  var update_project_default = defineTool({
19701
19887
  name: "update_project",
19702
- requiredSkills: ["project-management"],
19888
+ skills: ["project-management"],
19703
19889
  requiredScopes: ["project:write"],
19704
19890
  description: [
19705
19891
  "Update project settings in Sentry, such as name, slug, platform, and team assignment.",
@@ -19814,10 +20000,10 @@ var update_project_default = defineTool({
19814
20000
  });
19815
20001
 
19816
20002
  //#endregion
19817
- //#region ../mcp-core/dist/create-dsn-cwJCYVxO.js
20003
+ //#region ../mcp-core/dist/create-dsn-C-zvRMtE.js
19818
20004
  var create_dsn_default = defineTool({
19819
20005
  name: "create_dsn",
19820
- requiredSkills: ["project-management"],
20006
+ skills: ["project-management"],
19821
20007
  requiredScopes: ["project:write"],
19822
20008
  description: [
19823
20009
  "Create an additional DSN for an EXISTING project.",
@@ -19874,10 +20060,10 @@ var create_dsn_default = defineTool({
19874
20060
  });
19875
20061
 
19876
20062
  //#endregion
19877
- //#region ../mcp-core/dist/find-dsns-op9qb46s.js
20063
+ //#region ../mcp-core/dist/find-dsns-sufkfAux.js
19878
20064
  var find_dsns_default = defineTool({
19879
20065
  name: "find_dsns",
19880
- requiredSkills: ["project-management"],
20066
+ skills: ["project-management"],
19881
20067
  requiredScopes: ["project:read"],
19882
20068
  description: [
19883
20069
  "List all Sentry DSNs for a specific project.",
@@ -19925,7 +20111,7 @@ var find_dsns_default = defineTool({
19925
20111
  });
19926
20112
 
19927
20113
  //#endregion
19928
- //#region ../mcp-core/dist/fetch-utils-BWMzxmEl.js
20114
+ //#region ../mcp-core/dist/fetch-utils-C6qSgZai.js
19929
20115
  /**
19930
20116
  * Fetch with timeout using AbortController
19931
20117
  * @param url - The URL to fetch
@@ -19975,10 +20161,10 @@ async function retryWithBackoff(fn, { maxRetries = 3, initialDelay = 1e3, should
19975
20161
  }
19976
20162
 
19977
20163
  //#endregion
19978
- //#region ../mcp-core/dist/analyze-issue-with-seer-Bn3h3z1Q.js
20164
+ //#region ../mcp-core/dist/analyze-issue-with-seer-jcYxRIL1.js
19979
20165
  var analyze_issue_with_seer_default = defineTool({
19980
20166
  name: "analyze_issue_with_seer",
19981
- requiredSkills: ["seer"],
20167
+ skills: ["seer"],
19982
20168
  requiredScopes: [],
19983
20169
  description: [
19984
20170
  "Use Seer to analyze production errors and get detailed root cause analysis with specific code fixes.",
@@ -20163,10 +20349,10 @@ var analyze_issue_with_seer_default = defineTool({
20163
20349
  });
20164
20350
 
20165
20351
  //#endregion
20166
- //#region ../mcp-core/dist/search-docs-BTxn8zJZ.js
20352
+ //#region ../mcp-core/dist/search-docs-BzvTE9Na.js
20167
20353
  var search_docs_default = defineTool({
20168
20354
  name: "search_docs",
20169
- requiredSkills: ["docs"],
20355
+ skills: ["docs"],
20170
20356
  requiredScopes: [],
20171
20357
  description: [
20172
20358
  "Search Sentry documentation for SDK setup, instrumentation, and configuration guidance.",
@@ -20246,10 +20432,10 @@ var search_docs_default = defineTool({
20246
20432
  });
20247
20433
 
20248
20434
  //#endregion
20249
- //#region ../mcp-core/dist/get-doc-CkdqvAbH.js
20435
+ //#region ../mcp-core/dist/get-doc-CImfwkht.js
20250
20436
  var get_doc_default = defineTool({
20251
20437
  name: "get_doc",
20252
- requiredSkills: ["docs"],
20438
+ skills: ["docs"],
20253
20439
  requiredScopes: [],
20254
20440
  description: [
20255
20441
  "Fetch the full markdown content of a Sentry documentation page.",
@@ -20323,7 +20509,7 @@ var get_doc_default = defineTool({
20323
20509
  });
20324
20510
 
20325
20511
  //#endregion
20326
- //#region ../mcp-core/dist/dataset-fields-DNUZW54W.js
20512
+ //#region ../mcp-core/dist/dataset-fields-nvbboMpe.js
20327
20513
  /**
20328
20514
  * Discover available fields for a dataset by querying Sentry's tags API
20329
20515
  */
@@ -20473,7 +20659,7 @@ function getCommonPatterns(dataset) {
20473
20659
  }
20474
20660
 
20475
20661
  //#endregion
20476
- //#region ../mcp-core/dist/config-48eLu9dt.js
20662
+ //#region ../mcp-core/dist/config-BFaJp4hW.js
20477
20663
  /**
20478
20664
  * Configuration for the search-issues agent
20479
20665
  */
@@ -20545,7 +20731,7 @@ Always use the issueFields tool to discover available fields when needed.
20545
20731
  Use the whoami tool when you need to resolve 'me' references.`;
20546
20732
 
20547
20733
  //#endregion
20548
- //#region ../mcp-core/dist/agent-BEGFNdJ3.js
20734
+ //#region ../mcp-core/dist/agent-4n2tvUk3.js
20549
20735
  const searchIssuesAgentOutputSchema = zod.z.object({
20550
20736
  query: zod.z.string().describe("The Sentry issue search query"),
20551
20737
  sort: zod.z.enum([
@@ -20579,7 +20765,7 @@ async function searchIssuesAgent(options) {
20579
20765
  }
20580
20766
 
20581
20767
  //#endregion
20582
- //#region ../mcp-core/dist/formatters-ddoifBDN.js
20768
+ //#region ../mcp-core/dist/formatters-W4LF85x9.js
20583
20769
  /**
20584
20770
  * Format an explanation for how a natural language query was translated
20585
20771
  */
@@ -20603,12 +20789,12 @@ function formatIssueResults(params) {
20603
20789
  output += `⚠️ **IMPORTANT**: Display these issues as highlighted cards with status indicators, assignee info, and clickable Issue IDs.\n\n`;
20604
20790
  }
20605
20791
  if (issues.length === 0) {
20606
- __sentry_node.logger.info(__sentry_node.logger.fmt`No issues found for query: ${naturalLanguageQuery || query}`, {
20792
+ logInfo(`No issues found for query: ${naturalLanguageQuery || query}`, { extra: {
20607
20793
  query,
20608
20794
  organizationSlug,
20609
20795
  projectSlug: projectSlugOrId,
20610
20796
  naturalLanguageQuery
20611
- });
20797
+ } });
20612
20798
  output += "No issues found matching your search criteria.\n\n";
20613
20799
  output += "Try adjusting your search criteria or time range.";
20614
20800
  return output;
@@ -20660,10 +20846,10 @@ function formatDate(dateString) {
20660
20846
  }
20661
20847
 
20662
20848
  //#endregion
20663
- //#region ../mcp-core/dist/handler-BEqYQTaW.js
20849
+ //#region ../mcp-core/dist/handler-DqBNjidz.js
20664
20850
  var handler_default$1 = defineTool({
20665
20851
  name: "search_issues",
20666
- requiredSkills: [
20852
+ skills: [
20667
20853
  "inspect",
20668
20854
  "triage",
20669
20855
  "seer"
@@ -20781,7 +20967,7 @@ var handler_default$1 = defineTool({
20781
20967
  });
20782
20968
 
20783
20969
  //#endregion
20784
- //#region ../mcp-core/dist/config-DkQjdsDV.js
20970
+ //#region ../mcp-core/dist/config-Dh25cVhL.js
20785
20971
  /**
20786
20972
  * Configuration for the use_sentry embedded agent.
20787
20973
  *
@@ -20800,7 +20986,7 @@ The user may include various parameters to pass to those tools in their prompt.
20800
20986
  You MUST return tool results directly without interpreting them.`;
20801
20987
 
20802
20988
  //#endregion
20803
- //#region ../mcp-core/dist/agent-BH2CU6gS.js
20989
+ //#region ../mcp-core/dist/agent-bVTgqfc0.js
20804
20990
  /**
20805
20991
  * Output schema for the embedded agent.
20806
20992
  * The agent returns the final result string directly from its tool calls.
@@ -20822,7 +21008,7 @@ async function useSentryAgent(options) {
20822
21008
  }
20823
21009
 
20824
21010
  //#endregion
20825
- //#region ../mcp-core/dist/error-handling-jSzAQs4J.js
21011
+ //#region ../mcp-core/dist/error-handling-BVlYIE1J.js
20826
21012
  /**
20827
21013
  * Type guard to identify user input validation errors.
20828
21014
  */
@@ -20913,7 +21099,7 @@ async function formatErrorForUser(error) {
20913
21099
  }
20914
21100
 
20915
21101
  //#endregion
20916
- //#region ../mcp-core/dist/constraint-helpers-CBddlAo8.js
21102
+ //#region ../mcp-core/dist/constraint-helpers-0jgp7p3K.js
20917
21103
  /**
20918
21104
  * Determines which tool parameter keys should be filtered out of the schema
20919
21105
  * because they will be injected from constraints.
@@ -20975,7 +21161,7 @@ function getConstraintParametersToInject(constraints, toolInputSchema) {
20975
21161
  }
20976
21162
 
20977
21163
  //#endregion
20978
- //#region ../mcp-core/dist/server-8ny70iLt.js
21164
+ //#region ../mcp-core/dist/server-DGF-NUWx.js
20979
21165
  /**
20980
21166
  * Format tool calls into a readable trace
20981
21167
  */
@@ -20996,7 +21182,7 @@ function formatToolCallTrace(toolCalls) {
20996
21182
  }
20997
21183
  var handler_default$2 = defineTool({
20998
21184
  name: "use_sentry",
20999
- requiredSkills: [],
21185
+ skills: [],
21000
21186
  requiredScopes: [],
21001
21187
  description: [
21002
21188
  "Natural language interface to Sentry via an embedded AI agent.",
@@ -21090,7 +21276,7 @@ var tools_default = {
21090
21276
  /**
21091
21277
  * Creates and configures a complete MCP server with Sentry instrumentation.
21092
21278
  *
21093
- * The server is built with tools filtered based on the granted scopes in the context.
21279
+ * The server is built with tools filtered based on the granted skills in the context.
21094
21280
  * Context is captured in tool handler closures and passed directly to handlers.
21095
21281
  *
21096
21282
  * @example Usage with stdio transport
@@ -21125,7 +21311,7 @@ var tools_default = {
21125
21311
  */
21126
21312
  function buildServer({ context: context$1, agentMode = false, tools: customTools }) {
21127
21313
  const server$1 = new __modelcontextprotocol_sdk_server_mcp_js.McpServer({
21128
- name: require_resolve.MCP_SERVER_NAME,
21314
+ name: MCP_SERVER_NAME,
21129
21315
  version: require_stdio.LIB_VERSION
21130
21316
  });
21131
21317
  configureServer({
@@ -21137,18 +21323,17 @@ function buildServer({ context: context$1, agentMode = false, tools: customTools
21137
21323
  return (0, __sentry_core.wrapMcpServerWithSentry)(server$1);
21138
21324
  }
21139
21325
  /**
21140
- * Configures an MCP server with tools filtered by granted skills or scopes.
21326
+ * Configures an MCP server with tools filtered by granted skills.
21141
21327
  *
21142
21328
  * Internal function used by buildServer(). Use buildServer() instead for most cases.
21143
- * Tools are filtered at registration time based on grantedSkills OR grantedScopes
21144
- * (either system can grant access), and context is captured in closures for tool handler execution.
21329
+ * Tools are filtered at registration time based on grantedSkills, and context is
21330
+ * captured in closures for tool handler execution.
21145
21331
  *
21146
21332
  * In agent mode, only the use_sentry tool is registered, bypassing authorization checks.
21147
21333
  */
21148
21334
  function configureServer({ server: server$1, context: context$1, agentMode = false, tools: customTools }) {
21149
21335
  const toolsToRegister = agentMode ? { use_sentry: tools_default.use_sentry } : customTools ?? tools_default;
21150
21336
  const grantedSkills = context$1.grantedSkills ? new Set(context$1.grantedSkills) : void 0;
21151
- const grantedScopes = context$1.grantedScopes ? new Set(context$1.grantedScopes) : void 0;
21152
21337
  server$1.server.onerror = (error) => {
21153
21338
  const transportLogOptions = {
21154
21339
  loggerScope: ["server", "transport"],
@@ -21158,47 +21343,32 @@ function configureServer({ server: server$1, context: context$1, agentMode = fal
21158
21343
  };
21159
21344
  for (const [toolKey, tool$1] of Object.entries(toolsToRegister)) {
21160
21345
  /**
21161
- * Authorization System Precedence
21162
- * ================================
21163
- *
21164
- * The server supports two authorization systems:
21165
- * 1. **Skills System (NEW)** - User-facing permission groups (inspect, triage, etc.)
21166
- * 2. **Scopes System (LEGACY)** - Low-level API permissions (event:read, project:write, etc.)
21167
- *
21168
- * IMPORTANT: These systems are **MUTUALLY EXCLUSIVE** - only one is active per session:
21346
+ * Skills-Based Authorization
21347
+ * ==========================
21169
21348
  *
21170
- * ## Skills Mode (when grantedSkills is set):
21171
- * - ONLY skills are checked (scopes are ignored)
21172
- * - Tool must have non-empty `requiredSkills` array to be exposed
21173
- * - Empty `requiredSkills: []` means intentionally excluded from skills system
21174
- * - Authorization: `allowed = hasRequiredSkills(grantedSkills, tool.requiredSkills)`
21349
+ * Tools are filtered at registration time based on grantedSkills.
21350
+ * Tool must have non-empty `skills` array to be exposed.
21351
+ * Empty `skills: []` means intentionally excluded from skills system.
21175
21352
  *
21176
- * ## Scopes Mode (when grantedSkills is NOT set, but grantedScopes is set):
21177
- * - Falls back to legacy scope checking
21178
- * - Empty `requiredScopes: []` means no scopes required (always allowed)
21179
- * - Authorization: `allowed = isToolAllowed(tool.requiredScopes, grantedScopes)`
21180
- *
21181
- * ## Tool Visibility:
21182
- * - If not allowed by active authorization system: tool is NOT registered
21183
- * - Only registered tools are visible to MCP clients
21353
+ * In agent mode, authorization is skipped - use_sentry handles it internally.
21184
21354
  *
21185
21355
  * ## Examples:
21186
21356
  * ```typescript
21187
- * // Tool available in "triage" skill only:
21188
- * { requiredSkills: ["triage"], requiredScopes: ["event:write"] }
21357
+ * // Tool belongs to "triage" skill only:
21358
+ * { skills: ["triage"] }
21189
21359
  *
21190
- * // Tool available to ALL skills (foundational tool like whoami):
21191
- * { requiredSkills: ALL_SKILLS, requiredScopes: [] }
21360
+ * // Tool belongs to ALL skills (foundational tool like whoami):
21361
+ * { skills: ALL_SKILLS }
21192
21362
  *
21193
21363
  * // Tool excluded from skills system (like use_sentry in agent mode):
21194
- * { requiredSkills: [], requiredScopes: [] }
21364
+ * { skills: [] }
21195
21365
  * ```
21196
21366
  */
21197
21367
  let allowed = false;
21198
21368
  if (agentMode) allowed = true;
21199
21369
  else if (grantedSkills) {
21200
- if (tool$1.requiredSkills && tool$1.requiredSkills.length > 0) allowed = require_resolve.hasRequiredSkills(grantedSkills, tool$1.requiredSkills);
21201
- } else if (grantedScopes) allowed = require_resolve.isToolAllowed(tool$1.requiredScopes, grantedScopes);
21370
+ if (tool$1.skills && tool$1.skills.length > 0) allowed = require_resolve.isEnabledBySkills(grantedSkills, tool$1.skills);
21371
+ }
21202
21372
  if (!allowed) continue;
21203
21373
  if (toolKey === "find_organizations" && context$1.constraints.organizationSlug || toolKey === "find_projects" && context$1.constraints.projectSlug) continue;
21204
21374
  const constraintKeysToFilter = new Set(getConstraintKeysToFilter(context$1.constraints, tool$1.inputSchema));
@@ -21243,7 +21413,7 @@ function configureServer({ server: server$1, context: context$1, agentMode = fal
21243
21413
  }
21244
21414
 
21245
21415
  //#endregion
21246
- //#region ../mcp-core/dist/sentry-Bz8KwQu9.js
21416
+ //#region ../mcp-core/dist/sentry-Cim_ihS6.js
21247
21417
  const SCRUB_PATTERNS = [
21248
21418
  {
21249
21419
  pattern: /\bsk-[a-zA-Z0-9]{48}\b/g,
@@ -21348,7 +21518,7 @@ function sentryBeforeSend(event, hint) {
21348
21518
  //#region src/index.ts
21349
21519
  const packageName = "@sentry/mcp-server";
21350
21520
  const allSkills = Object.keys(require_resolve.SKILLS);
21351
- const usageText = require_usage.buildUsage(packageName, require_resolve.DEFAULT_SCOPES, require_resolve.ALL_SCOPES, require_resolve.DEFAULT_SKILLS, allSkills);
21521
+ const usageText = require_usage.buildUsage(packageName, allSkills);
21352
21522
  function die(message) {
21353
21523
  console.error(message);
21354
21524
  console.error(usageText);
@@ -21417,7 +21587,6 @@ if (cli.agent) {
21417
21587
  const SENTRY_TIMEOUT = 5e3;
21418
21588
  const context = {
21419
21589
  accessToken: cfg.accessToken,
21420
- grantedScopes: cfg.finalScopes,
21421
21590
  grantedSkills: cfg.finalSkills,
21422
21591
  constraints: {
21423
21592
  organizationSlug: cfg.organizationSlug ?? null,