@sentry/mcp-server 0.31.0 → 0.32.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 (103) hide show
  1. package/dist/auth/constants.cjs +1 -1
  2. package/dist/auth/constants.js +1 -1
  3. package/dist/auth/device-code-flow.cjs +4 -4
  4. package/dist/auth/device-code-flow.d.cts +1 -1
  5. package/dist/auth/device-code-flow.d.cts.map +1 -1
  6. package/dist/auth/device-code-flow.d.ts +1 -1
  7. package/dist/auth/device-code-flow.d.ts.map +1 -1
  8. package/dist/auth/device-code-flow.js +4 -4
  9. package/dist/auth/resolve-token.cjs +5 -5
  10. package/dist/auth/resolve-token.d.cts +1 -1
  11. package/dist/auth/resolve-token.d.ts +1 -1
  12. package/dist/auth/resolve-token.js +5 -5
  13. package/dist/auth/token-cache.d.cts +1 -1
  14. package/dist/auth/token-cache.d.ts +1 -1
  15. package/dist/auth/types.cjs +2 -1
  16. package/dist/auth/types.d.cts +2 -2
  17. package/dist/auth/types.d.ts +2 -2
  18. package/dist/auth/types.js +2 -2
  19. package/dist/{auth-BK5LL8QY.cjs → auth-DamN9R04.cjs} +5 -5
  20. package/dist/{auth-BK5LL8QY.cjs.map → auth-DamN9R04.cjs.map} +1 -1
  21. package/dist/{auth-BIb4PBnL.js → auth-XNi9K4Nz.js} +5 -5
  22. package/dist/{auth-BIb4PBnL.js.map → auth-XNi9K4Nz.js.map} +1 -1
  23. package/dist/cli/commands/auth.cjs +6 -6
  24. package/dist/cli/commands/auth.js +6 -6
  25. package/dist/cli/parse.d.cts +1 -1
  26. package/dist/cli/parse.d.ts +1 -1
  27. package/dist/cli/resolve.cjs +2 -2
  28. package/dist/cli/resolve.d.cts +1 -1
  29. package/dist/cli/resolve.d.ts +1 -1
  30. package/dist/cli/resolve.js +2 -2
  31. package/dist/cli/types.d.cts +1 -1
  32. package/dist/cli/types.d.ts +1 -1
  33. package/dist/cli/usage.cjs +1 -1
  34. package/dist/cli/usage.js +1 -1
  35. package/dist/{config-BYPjNBPX-Bqwc8iZW.cjs → config-D1QOSX9W-BurxE_FB.cjs} +4 -4
  36. package/dist/{config-BYPjNBPX-Bqwc8iZW.cjs.map → config-D1QOSX9W-BurxE_FB.cjs.map} +1 -1
  37. package/dist/{config-BYPjNBPX-7d8TAxBc.js → config-D1QOSX9W-CtF1qegU.js} +4 -4
  38. package/dist/{config-BYPjNBPX-7d8TAxBc.js.map → config-D1QOSX9W-CtF1qegU.js.map} +1 -1
  39. package/dist/config-DvaRyDc4.cjs +7 -0
  40. package/dist/{config--FiEKpQR.js → config-UqbHNH-n.js} +1 -1
  41. package/dist/{constants-Ciwj7kb9.js → constants-CnQOQOfw.js} +15 -3
  42. package/dist/constants-CnQOQOfw.js.map +1 -0
  43. package/dist/{constants-DmV1Benp.cjs → constants-zXY4MUBL.cjs} +20 -2
  44. package/dist/constants-zXY4MUBL.cjs.map +1 -0
  45. package/dist/{device-code-flow-CpGZ3Eqv.cjs → device-code-flow-B-sYi7io.cjs} +5 -5
  46. package/dist/device-code-flow-B-sYi7io.cjs.map +1 -0
  47. package/dist/{device-code-flow-DmgeS5QN.js → device-code-flow-BCdcs8S7.js} +5 -5
  48. package/dist/device-code-flow-BCdcs8S7.js.map +1 -0
  49. package/dist/index.cjs +1093 -393
  50. package/dist/index.cjs.map +1 -1
  51. package/dist/index.js +1088 -388
  52. package/dist/index.js.map +1 -1
  53. package/dist/{resolve-D0W2gbu8.js → resolve-D19wc4BJ.js} +3 -3
  54. package/dist/resolve-D19wc4BJ.js.map +1 -0
  55. package/dist/{resolve-BfYJ9Cqy.cjs → resolve-DQS7cx8P.cjs} +3 -3
  56. package/dist/resolve-DQS7cx8P.cjs.map +1 -0
  57. package/dist/{resolve-token-pfPBO9EK.js → resolve-token-BeHiwgSY.js} +4 -4
  58. package/dist/{resolve-token-pfPBO9EK.js.map → resolve-token-BeHiwgSY.js.map} +1 -1
  59. package/dist/{resolve-token-C2eTEtoo.cjs → resolve-token-DKH-nkWs.cjs} +4 -4
  60. package/dist/{resolve-token-C2eTEtoo.cjs.map → resolve-token-DKH-nkWs.cjs.map} +1 -1
  61. package/dist/{stdio-CUhyR_jH.js → stdio-B6V73MMI.js} +2 -2
  62. package/dist/{stdio-CUhyR_jH.js.map → stdio-B6V73MMI.js.map} +1 -1
  63. package/dist/{stdio-B08zZS4X.cjs → stdio-CSjj4HGd.cjs} +2 -2
  64. package/dist/{stdio-B08zZS4X.cjs.map → stdio-CSjj4HGd.cjs.map} +1 -1
  65. package/dist/transports/stdio.cjs +2 -2
  66. package/dist/transports/stdio.js +2 -2
  67. package/dist/{types-ClEPUb_D.d.cts → types-BJpeKPWI.d.cts} +8 -7
  68. package/dist/types-BJpeKPWI.d.cts.map +1 -0
  69. package/dist/{types-C8FoyqMN.js → types-C336ZSwF.js} +7 -4
  70. package/dist/types-C336ZSwF.js.map +1 -0
  71. package/dist/{types-BN426G4g.d.ts → types-DDkgkRP9.d.ts} +8 -7
  72. package/dist/types-DDkgkRP9.d.ts.map +1 -0
  73. package/dist/{types-xUmfecYm.cjs → types-DViCeKUc.cjs} +12 -3
  74. package/dist/types-DViCeKUc.cjs.map +1 -0
  75. package/dist/{types-rlmLVpNO.d.cts → types-T07_vWhw.d.cts} +2 -2
  76. package/dist/{types-rlmLVpNO.d.cts.map → types-T07_vWhw.d.cts.map} +1 -1
  77. package/dist/{types-CX4uOY82.d.ts → types-uISvMJKw.d.ts} +2 -2
  78. package/dist/{types-CX4uOY82.d.ts.map → types-uISvMJKw.d.ts.map} +1 -1
  79. package/dist/{usage-DRK6TiDr.cjs → usage-DqxR1zdC.cjs} +4 -3
  80. package/dist/usage-DqxR1zdC.cjs.map +1 -0
  81. package/dist/{usage-DB-MGezA.js → usage-QnwsoeF4.js} +4 -3
  82. package/dist/usage-QnwsoeF4.js.map +1 -0
  83. package/dist/version-BBolBvwF.js +7 -0
  84. package/dist/version-BBolBvwF.js.map +1 -0
  85. package/dist/{version-Ca7qUBih.cjs → version-g6exOvkr.cjs} +3 -3
  86. package/dist/version-g6exOvkr.cjs.map +1 -0
  87. package/package.json +5 -5
  88. package/dist/config-DU03TDiU.cjs +0 -7
  89. package/dist/constants-Ciwj7kb9.js.map +0 -1
  90. package/dist/constants-DmV1Benp.cjs.map +0 -1
  91. package/dist/device-code-flow-CpGZ3Eqv.cjs.map +0 -1
  92. package/dist/device-code-flow-DmgeS5QN.js.map +0 -1
  93. package/dist/resolve-BfYJ9Cqy.cjs.map +0 -1
  94. package/dist/resolve-D0W2gbu8.js.map +0 -1
  95. package/dist/types-BN426G4g.d.ts.map +0 -1
  96. package/dist/types-C8FoyqMN.js.map +0 -1
  97. package/dist/types-ClEPUb_D.d.cts.map +0 -1
  98. package/dist/types-xUmfecYm.cjs.map +0 -1
  99. package/dist/usage-DB-MGezA.js.map +0 -1
  100. package/dist/usage-DRK6TiDr.cjs.map +0 -1
  101. package/dist/version-CYYpU4RZ.js +0 -7
  102. package/dist/version-CYYpU4RZ.js.map +0 -1
  103. package/dist/version-Ca7qUBih.cjs.map +0 -1
package/dist/index.js CHANGED
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import { __commonJS, __export, __toDynamicImportESM, __toESM, require_token_error } from "./token-error-Df8A7mgb.js";
3
- import { ALL_SKILLS, SKILLS, finalize, isEnabledBySkills } from "./resolve-D0W2gbu8.js";
4
- import { getIssueUrl, getIssuesSearchUrl, getTraceUrl, isSentryHost } from "./constants-Ciwj7kb9.js";
5
- import { LIB_VERSION, USER_AGENT } from "./version-CYYpU4RZ.js";
6
- import { RECOMMENDED_FIELDS, systemPrompt } from "./config-BYPjNBPX-7d8TAxBc.js";
7
- import { startStdio } from "./stdio-CUhyR_jH.js";
8
- import { buildUsage } from "./usage-DB-MGezA.js";
3
+ import { ALL_SKILLS, SKILLS, finalize, isEnabledBySkills } from "./resolve-D19wc4BJ.js";
4
+ import { getIssueUrl, getIssuesSearchUrl, getReplayUrl, getTraceUrl, isSentryHost } from "./constants-CnQOQOfw.js";
5
+ import { LIB_VERSION, USER_AGENT } from "./version-BBolBvwF.js";
6
+ import { RECOMMENDED_FIELDS, systemPrompt } from "./config-D1QOSX9W-CtF1qegU.js";
7
+ import { startStdio } from "./stdio-B6V73MMI.js";
8
+ import { buildUsage } from "./usage-QnwsoeF4.js";
9
9
  import { merge, parseArgv, parseEnv } from "./parse-BC0czE2L.js";
10
- import "./types-C8FoyqMN.js";
11
- import "./device-code-flow-DmgeS5QN.js";
10
+ import "./types-C336ZSwF.js";
11
+ import "./device-code-flow-BCdcs8S7.js";
12
12
  import "./token-cache-BTEUyVx2.js";
13
- import { resolveAccessToken } from "./resolve-token-pfPBO9EK.js";
14
- import { authCommand } from "./auth-BIb4PBnL.js";
13
+ import { resolveAccessToken } from "./resolve-token-BeHiwgSY.js";
14
+ import { authCommand } from "./auth-XNi9K4Nz.js";
15
15
  import { z } from "zod";
16
16
  import util from "node:util";
17
17
  import { captureException, captureMessage, getActiveSpan, logger, setTag, setUser, withScope, wrapMcpServerWithSentry } from "@sentry/core";
@@ -322,7 +322,7 @@ function validateSlugOrId(val, ctx) {
322
322
  }
323
323
 
324
324
  //#endregion
325
- //#region ../mcp-core/dist/schema-B2kce020.js
325
+ //#region ../mcp-core/dist/schema-D6EG4ADm.js
326
326
  const ParamOrganizationSlug = 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.");
327
327
  const ParamTeamSlug = 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.");
328
328
  const ParamProjectSlug = 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.");
@@ -330,6 +330,8 @@ const ParamProjectSlugOrAll = z.string().toLowerCase().trim().superRefine(valida
330
330
  const ParamSearchQuery = z.string().trim().describe("Search query to filter results by name or slug. Use this to narrow down results when there are many items.");
331
331
  const ParamIssueShortId = z.string().toUpperCase().trim().describe("The Issue ID. e.g. `PROJECT-1Z43`");
332
332
  const ParamIssueUrl = z.string().url().trim().describe("The URL of the issue. e.g. https://my-organization.sentry.io/issues/PROJECT-1Z43");
333
+ const ParamReplayId = z.string().trim().describe("The replay ID. e.g. `7e07485f-12f9-416b-8b14-26260799b51f`");
334
+ const ParamReplayUrl = z.string().url().trim().describe("The URL of the replay. e.g. https://my-organization.sentry.io/replays/7e07485f-12f9-416b-8b14-26260799b51f/");
333
335
  const ParamTraceId = z.string().trim().regex(/^[0-9a-fA-F]{32}$/, "Trace ID must be a 32-character hexadecimal string").describe("The trace ID. e.g. `a4d1aae7216b47ff8117cf4e09ce9d0a`");
334
336
  const ParamPlatform = z.string().toLowerCase().trim().describe("The platform for the project. e.g., python, javascript, react, etc.");
335
337
  const ParamTransaction = z.string().trim().describe("The transaction name. Also known as the endpoint, or route name.");
@@ -1615,15 +1617,15 @@ function getLogger$1(scope, defaults) {
1615
1617
  return defaults ? logger$2.with(defaults) : logger$2;
1616
1618
  }
1617
1619
  const ISSUE_LOGGER_SCOPE = ["runtime", "issues"];
1618
- function isRecord(value) {
1620
+ function isRecord$1(value) {
1619
1621
  return typeof value === "object" && value !== null;
1620
1622
  }
1621
1623
  function isSentryContexts(value) {
1622
- if (!isRecord(value)) return false;
1623
- return Object.values(value).every((entry) => isRecord(entry));
1624
+ if (!isRecord$1(value)) return false;
1625
+ return Object.values(value).every((entry) => isRecord$1(entry));
1624
1626
  }
1625
1627
  function isBaseLogOptionsCandidate(value) {
1626
- if (!isRecord(value)) return false;
1628
+ if (!isRecord$1(value)) return false;
1627
1629
  if ("extra" in value || "loggerScope" in value) return true;
1628
1630
  if ("contexts" in value) {
1629
1631
  const contexts = value.contexts;
@@ -1632,7 +1634,7 @@ function isBaseLogOptionsCandidate(value) {
1632
1634
  return false;
1633
1635
  }
1634
1636
  function isLogIssueOptionsCandidate(value) {
1635
- return isBaseLogOptionsCandidate(value) || isRecord(value) && "attachments" in value;
1637
+ return isBaseLogOptionsCandidate(value) || isRecord$1(value) && "attachments" in value;
1636
1638
  }
1637
1639
  function parseBaseOptions(contextsOrOptions) {
1638
1640
  if (isBaseLogOptionsCandidate(contextsOrOptions)) {
@@ -1781,7 +1783,7 @@ function logIssue(error, contextsOrOptions, attachmentsArg) {
1781
1783
  }
1782
1784
 
1783
1785
  //#endregion
1784
- //#region ../mcp-core/dist/schema-ClnBXSjS.js
1786
+ //#region ../mcp-core/dist/schema-Dp-Y371G.js
1785
1787
  /**
1786
1788
  * Schema for Sentry API error responses.
1787
1789
  *
@@ -1832,14 +1834,85 @@ const ProjectSchema = z.object({
1832
1834
  firstTransactionEvent: z.boolean().optional()
1833
1835
  }).passthrough();
1834
1836
  const ProjectListSchema = z.array(ProjectSchema);
1837
+ const ReplayTagsSchema = z.preprocess((value) => {
1838
+ if (value === void 0 || value === null || Array.isArray(value)) return {};
1839
+ return value;
1840
+ }, z.record(z.string(), z.array(z.string())));
1841
+ const ReplayDetailsSchema = z.object({
1842
+ activity: z.number().nullable().optional(),
1843
+ browser: z.object({
1844
+ name: z.string().nullable().optional(),
1845
+ version: z.string().nullable().optional()
1846
+ }).nullish().default({}),
1847
+ count_dead_clicks: z.number().nullable().optional(),
1848
+ count_errors: z.number().nullable().optional(),
1849
+ count_infos: z.number().nullable().optional(),
1850
+ count_rage_clicks: z.number().nullable().optional(),
1851
+ count_segments: z.number().nullable().optional(),
1852
+ count_urls: z.number().nullable().optional(),
1853
+ count_warnings: z.number().nullable().optional(),
1854
+ device: z.object({
1855
+ brand: z.string().nullable().optional(),
1856
+ family: z.string().nullable().optional(),
1857
+ model: z.string().nullable().optional(),
1858
+ model_id: z.string().nullable().optional(),
1859
+ name: z.string().nullable().optional()
1860
+ }).nullish().default({}),
1861
+ dist: z.string().nullable().optional(),
1862
+ duration: z.number().nullable().optional(),
1863
+ environment: z.string().nullable().optional(),
1864
+ error_ids: z.array(z.string()).optional().default([]),
1865
+ finished_at: z.string().nullable().optional(),
1866
+ has_viewed: z.boolean().nullable().optional(),
1867
+ id: z.string(),
1868
+ info_ids: z.array(z.string()).optional().default([]),
1869
+ is_archived: z.boolean().nullable().optional(),
1870
+ os: z.object({
1871
+ name: z.string().nullable().optional(),
1872
+ version: z.string().nullable().optional()
1873
+ }).nullish().default({}),
1874
+ platform: z.string().nullable().optional(),
1875
+ project_id: z.union([z.string(), z.number()]).nullable().optional(),
1876
+ releases: z.array(z.string()).nullable().optional(),
1877
+ replay_type: z.string().nullable().optional(),
1878
+ sdk: z.object({
1879
+ name: z.string().nullable().optional(),
1880
+ version: z.string().nullable().optional()
1881
+ }).nullish().default({}),
1882
+ started_at: z.string().nullable().optional(),
1883
+ tags: ReplayTagsSchema,
1884
+ trace_ids: z.array(z.string()).optional().default([]),
1885
+ urls: z.preprocess((value) => value ?? [], z.array(z.string())),
1886
+ user: z.object({
1887
+ display_name: z.string().nullable().optional(),
1888
+ email: z.string().nullable().optional(),
1889
+ id: z.string().nullable().optional(),
1890
+ ip: z.string().nullable().optional(),
1891
+ username: z.string().nullable().optional(),
1892
+ geo: z.record(z.string(), z.union([z.string(), z.null()])).optional()
1893
+ }).nullish().default({}),
1894
+ warning_ids: z.array(z.string()).optional().default([])
1895
+ }).passthrough();
1896
+ const ReplayRecordingSegmentsSchema = z.array(z.array(z.unknown()));
1897
+ const ReplayIdsByResourceSchema = z.record(z.string(), z.array(z.string()));
1835
1898
  const ClientKeySchema = z.object({
1836
1899
  id: z.union([z.string(), z.number()]),
1837
1900
  name: z.string(),
1838
1901
  dsn: z.object({ public: z.string() }),
1839
1902
  isActive: z.boolean(),
1840
- dateCreated: z.string().datetime()
1903
+ dateCreated: z.string().datetime().nullable()
1841
1904
  }).passthrough();
1842
1905
  const ClientKeyListSchema = z.array(ClientKeySchema);
1906
+ const ReleaseProjectSchema = z.object({
1907
+ id: z.union([z.string(), z.number()]),
1908
+ slug: z.string().nullable(),
1909
+ name: z.string(),
1910
+ platform: z.string().nullable().optional()
1911
+ }).passthrough();
1912
+ const ReleaseCommitAuthorSchema = z.object({
1913
+ name: z.string().nullable().optional(),
1914
+ email: z.string().nullable().optional()
1915
+ }).passthrough();
1843
1916
  const ReleaseSchema = z.object({
1844
1917
  id: z.union([z.string(), z.number()]),
1845
1918
  version: z.string(),
@@ -1851,20 +1924,17 @@ const ReleaseSchema = z.object({
1851
1924
  newGroups: z.number(),
1852
1925
  lastCommit: z.object({
1853
1926
  id: z.union([z.string(), z.number()]),
1854
- message: z.string(),
1927
+ message: z.string().nullable(),
1855
1928
  dateCreated: z.string().datetime(),
1856
- author: z.object({
1857
- name: z.string(),
1858
- email: z.string()
1859
- })
1860
- }).nullable(),
1929
+ author: ReleaseCommitAuthorSchema.optional()
1930
+ }).passthrough().nullable(),
1861
1931
  lastDeploy: z.object({
1862
1932
  id: z.union([z.string(), z.number()]),
1863
- environment: z.string(),
1933
+ environment: z.string().nullable(),
1864
1934
  dateStarted: z.string().datetime().nullable(),
1865
1935
  dateFinished: z.string().datetime().nullable()
1866
- }).nullable(),
1867
- projects: z.array(ProjectSchema)
1936
+ }).passthrough().nullable(),
1937
+ projects: z.array(ReleaseProjectSchema)
1868
1938
  });
1869
1939
  const ReleaseListSchema = z.array(ReleaseSchema);
1870
1940
  const TagSchema = z.object({
@@ -2024,6 +2094,16 @@ const BaseEventSchema = z.object({
2024
2094
  ]) }).passthrough()).optional(),
2025
2095
  context: z.record(z.string(), z.unknown()).optional(),
2026
2096
  tags: EventTagsSchema.optional(),
2097
+ user: z.object({
2098
+ display_name: z.string().nullable().optional(),
2099
+ email: z.string().nullable().optional(),
2100
+ id: z.string().nullable().optional(),
2101
+ ip: z.string().nullable().optional(),
2102
+ ip_address: z.string().nullable().optional(),
2103
+ name: z.string().nullable().optional(),
2104
+ username: z.string().nullable().optional(),
2105
+ geo: z.record(z.string(), z.union([z.string(), z.null()])).nullable().optional()
2106
+ }).passthrough().nullable().optional(),
2027
2107
  _meta: z.unknown().optional(),
2028
2108
  dateReceived: z.string().datetime().optional()
2029
2109
  });
@@ -2388,8 +2468,8 @@ const FlamegraphProfileSchema = z.object({
2388
2468
  type: z.string(),
2389
2469
  unit: z.string(),
2390
2470
  weights: z.array(z.number()),
2391
- sample_durations_ns: z.array(z.number()),
2392
- sample_counts: z.array(z.number())
2471
+ sample_durations_ns: z.preprocess((value) => value ?? [], z.array(z.number())),
2472
+ sample_counts: z.preprocess((value) => value ?? [], z.array(z.number()))
2393
2473
  }).passthrough();
2394
2474
  /**
2395
2475
  * Schema for flamegraph API response.
@@ -2403,15 +2483,15 @@ const FlamegraphProfileSchema = z.object({
2403
2483
  * already aggregated and includes percentile calculations.
2404
2484
  */
2405
2485
  const FlamegraphSchema = z.object({
2406
- activeProfileIndex: z.number(),
2486
+ activeProfileIndex: z.preprocess((value) => value ?? 0, z.number()),
2407
2487
  metadata: z.record(z.unknown()).optional(),
2408
2488
  platform: z.string(),
2409
2489
  profiles: z.array(FlamegraphProfileSchema),
2410
2490
  projectID: z.number(),
2411
2491
  shared: z.object({
2412
2492
  frames: z.array(FlamegraphFrameSchema),
2413
- frame_infos: z.array(FlamegraphFrameInfoSchema),
2414
- profiles: z.array(FlamegraphProfileMetadataSchema)
2493
+ frame_infos: z.preprocess((value) => value ?? [], z.array(FlamegraphFrameInfoSchema)),
2494
+ profiles: z.preprocess((value) => value ?? [], z.array(FlamegraphProfileMetadataSchema))
2415
2495
  }),
2416
2496
  transactionName: z.string().optional(),
2417
2497
  metrics: z.unknown().optional()
@@ -2703,7 +2783,7 @@ function createApiError(message, status, detail, responseBody) {
2703
2783
  }
2704
2784
 
2705
2785
  //#endregion
2706
- //#region ../mcp-core/dist/client-D5MPii9Y.js
2786
+ //#region ../mcp-core/dist/client-CdmweRhR.js
2707
2787
  /**
2708
2788
  * Mapping of common network error codes to user-friendly messages.
2709
2789
  * These help users understand and resolve connection issues.
@@ -2991,6 +3071,9 @@ var SentryApiService = class {
2991
3071
  getTraceUrl(organizationSlug, traceId) {
2992
3072
  return getTraceUrl(this.host, organizationSlug, traceId);
2993
3073
  }
3074
+ getReplayUrl(organizationSlug, replayId) {
3075
+ return getReplayUrl(this.host, organizationSlug, replayId);
3076
+ }
2994
3077
  /**
2995
3078
  * Builds a URL for the legacy Discover API (used by errors dataset).
2996
3079
  *
@@ -3629,6 +3712,26 @@ var SentryApiService = class {
3629
3712
  blob: await downloadResponse.blob()
3630
3713
  };
3631
3714
  }
3715
+ async getReplayDetails({ organizationSlug, replayId }, opts) {
3716
+ const body = await this.requestJSON(`/organizations/${organizationSlug}/replays/${replayId}/`, void 0, opts);
3717
+ return z.object({ data: ReplayDetailsSchema }).parse(body).data;
3718
+ }
3719
+ async listReplayIdsForIssue({ organizationSlug, issueId, dataSource }, opts) {
3720
+ const normalizedIssueId = String(issueId);
3721
+ const queryParams = new URLSearchParams();
3722
+ queryParams.set("returnIds", "true");
3723
+ queryParams.set("query", `issue.id:[${normalizedIssueId}]`);
3724
+ queryParams.set("data_source", dataSource);
3725
+ queryParams.set("statsPeriod", "90d");
3726
+ queryParams.append("project", "-1");
3727
+ const body = await this.requestJSON(`/organizations/${organizationSlug}/replay-count/?${queryParams.toString()}`, void 0, opts);
3728
+ const replayIdsByResource = ReplayIdsByResourceSchema.parse(body);
3729
+ return replayIdsByResource[normalizedIssueId] ?? [];
3730
+ }
3731
+ async getReplayRecordingSegments({ organizationSlug, projectSlugOrId, replayId }, opts) {
3732
+ const body = await this.requestJSON(`/projects/${organizationSlug}/${projectSlugOrId}/replays/${replayId}/recording-segments/?download=true`, void 0, opts);
3733
+ return ReplayRecordingSegmentsSchema.parse(body);
3734
+ }
3632
3735
  async updateIssue({ organizationSlug, issueId, status, assignedTo }, opts) {
3633
3736
  const updateData = {};
3634
3737
  if (status !== void 0) updateData.status = status;
@@ -3973,7 +4076,7 @@ function validateRegionUrl(regionUrl, baseHost) {
3973
4076
  }
3974
4077
 
3975
4078
  //#endregion
3976
- //#region ../mcp-core/dist/api-DPhKk745.js
4079
+ //#region ../mcp-core/dist/api-CUGzR3jb.js
3977
4080
  /**
3978
4081
  * Create a Sentry API service from server context with optional region override
3979
4082
  * @param context - Server context containing host and access token
@@ -3994,7 +4097,7 @@ function apiServiceFromContext(context$1, opts = {}) {
3994
4097
  }
3995
4098
 
3996
4099
  //#endregion
3997
- //#region ../mcp-core/dist/whoami-DjZKB__R.js
4100
+ //#region ../mcp-core/dist/whoami-BSKPp-Nn.js
3998
4101
  var whoami_default = defineTool({
3999
4102
  name: "whoami",
4000
4103
  description: [
@@ -4027,7 +4130,7 @@ var whoami_default = defineTool({
4027
4130
  });
4028
4131
 
4029
4132
  //#endregion
4030
- //#region ../mcp-core/dist/find-organizations-CAHgf7sF.js
4133
+ //#region ../mcp-core/dist/find-organizations-BaOaAx02.js
4031
4134
  const RESULT_LIMIT$2 = 25;
4032
4135
  var find_organizations_default = defineTool({
4033
4136
  name: "find_organizations",
@@ -4079,7 +4182,7 @@ var find_organizations_default = defineTool({
4079
4182
  });
4080
4183
 
4081
4184
  //#endregion
4082
- //#region ../mcp-core/dist/find-teams-DsvBfxS9.js
4185
+ //#region ../mcp-core/dist/find-teams-Df4xhGsp.js
4083
4186
  const RESULT_LIMIT$1 = 25;
4084
4187
  var find_teams_default = defineTool({
4085
4188
  name: "find_teams",
@@ -4127,7 +4230,7 @@ var find_teams_default = defineTool({
4127
4230
  });
4128
4231
 
4129
4232
  //#endregion
4130
- //#region ../mcp-core/dist/find-projects-jWQLrhiQ.js
4233
+ //#region ../mcp-core/dist/find-projects-D9oRDdXl.js
4131
4234
  const RESULT_LIMIT = 25;
4132
4235
  var find_projects_default = defineTool({
4133
4236
  name: "find_projects",
@@ -4171,7 +4274,7 @@ var find_projects_default = defineTool({
4171
4274
  });
4172
4275
 
4173
4276
  //#endregion
4174
- //#region ../mcp-core/dist/find-releases-UoICWW5P.js
4277
+ //#region ../mcp-core/dist/find-releases-Dy0bRn67.js
4175
4278
  var find_releases_default = defineTool({
4176
4279
  name: "find_releases",
4177
4280
  skills: ["inspect"],
@@ -4238,16 +4341,17 @@ var find_releases_default = defineTool({
4238
4341
  if (release.newGroups !== void 0) releaseInfo.push(`**New Issues**: ${release.newGroups}`);
4239
4342
  if (release.projects && release.projects.length > 0) releaseInfo.push(`**Projects**: ${release.projects.map((p) => p.name).join(", ")}`);
4240
4343
  if (release.lastCommit) {
4344
+ const commitAuthor = release.lastCommit.author?.name ?? release.lastCommit.author?.email ?? "Unknown";
4241
4345
  releaseInfo.push("", `### Last Commit`, "");
4242
4346
  releaseInfo.push(`**Commit ID**: ${release.lastCommit.id}`);
4243
- releaseInfo.push(`**Commit Message**: ${release.lastCommit.message}`);
4244
- releaseInfo.push(`**Commit Author**: ${release.lastCommit.author.name}`);
4347
+ releaseInfo.push(`**Commit Message**: ${release.lastCommit.message ?? "Unknown"}`);
4348
+ releaseInfo.push(`**Commit Author**: ${commitAuthor}`);
4245
4349
  releaseInfo.push(`**Commit Date**: ${new Date(release.lastCommit.dateCreated).toISOString()}`);
4246
4350
  }
4247
4351
  if (release.lastDeploy) {
4248
4352
  releaseInfo.push("", `### Last Deploy`, "");
4249
4353
  releaseInfo.push(`**Deploy ID**: ${release.lastDeploy.id}`);
4250
- releaseInfo.push(`**Environment**: ${release.lastDeploy.environment}`);
4354
+ releaseInfo.push(`**Environment**: ${release.lastDeploy.environment ?? "Unknown"}`);
4251
4355
  if (release.lastDeploy.dateStarted) releaseInfo.push(`**Deploy Started**: ${new Date(release.lastDeploy.dateStarted).toISOString()}`);
4252
4356
  if (release.lastDeploy.dateFinished) releaseInfo.push(`**Deploy Finished**: ${new Date(release.lastDeploy.dateFinished).toISOString()}`);
4253
4357
  }
@@ -4419,7 +4523,24 @@ function getOutputForAutofixStep(step) {
4419
4523
  }
4420
4524
 
4421
4525
  //#endregion
4422
- //#region ../mcp-core/dist/formatting-Dk4pZlwg.js
4526
+ //#region ../mcp-core/dist/user-formatting-R_sbOJfq.js
4527
+ function isPlainObject(value) {
4528
+ return typeof value === "object" && value !== null && !Array.isArray(value);
4529
+ }
4530
+ function formatUserGeoSummary(value) {
4531
+ if (!isPlainObject(value)) return null;
4532
+ const parts = [
4533
+ value.country_code,
4534
+ value.city,
4535
+ value.region,
4536
+ value.country_name
4537
+ ].filter((part) => typeof part === "string" && part.length > 0);
4538
+ if (parts.length === 0) return null;
4539
+ return Array.from(new Set(parts)).join(", ");
4540
+ }
4541
+
4542
+ //#endregion
4543
+ //#region ../mcp-core/dist/formatting-BUSBBQN0.js
4423
4544
  /**
4424
4545
  * Convert Seer fixability score to actionability label.
4425
4546
  * Thresholds match Sentry core: src/sentry/seer/autofix/constants.py
@@ -4522,28 +4643,39 @@ function formatFrameHeader(frame, frameIndex, platform) {
4522
4643
  */
4523
4644
  function formatEventOutput(event, options) {
4524
4645
  let output = "";
4525
- if (!event.entries || !Array.isArray(event.entries)) {
4526
- output += formatTags(event.tags);
4527
- output += formatContext(event.context);
4528
- output += formatContexts(event.contexts);
4646
+ const eventUser = event.user;
4647
+ const eventWithReplayMetadataStripped = options?.replaySummary ? stripReplayMetadata(event) : event;
4648
+ const eventToRender = eventWithReplayMetadataStripped;
4649
+ if (options?.replaySummary) output += formatIssueReplayOutput({
4650
+ apiService: options.replaySummary.apiService,
4651
+ organizationSlug: options.replaySummary.organizationSlug,
4652
+ event,
4653
+ relatedReplayIds: options.replaySummary.relatedReplayIds
4654
+ });
4655
+ if (!eventToRender.entries || !Array.isArray(eventToRender.entries)) {
4656
+ output += formatEventUser(eventUser);
4657
+ output += formatTags(eventToRender.tags);
4658
+ output += formatContext(eventToRender.context);
4659
+ output += formatContexts(eventToRender.contexts);
4529
4660
  return output;
4530
4661
  }
4531
- const messageEntry = event.entries.find((e) => e.type === "message");
4532
- const exceptionEntry = event.entries.find((e) => e.type === "exception");
4533
- const threadsEntry = event.entries.find((e) => e.type === "threads");
4534
- const requestEntry = event.entries.find((e) => e.type === "request");
4535
- const spansEntry = event.entries.find((e) => e.type === "spans");
4536
- const cspEntry = event.entries.find((e) => e.type === "csp");
4537
- if (messageEntry) output += formatMessageInterfaceOutput(event, messageEntry.data);
4538
- if (exceptionEntry) output += formatExceptionInterfaceOutput(event, exceptionEntry.data);
4539
- else if (threadsEntry) output += formatThreadsInterfaceOutput(event, threadsEntry.data);
4540
- if (requestEntry) output += formatRequestInterfaceOutput(event, requestEntry.data);
4541
- if (cspEntry) output += formatCspInterfaceOutput(event, cspEntry.data);
4542
- if (event.type === "transaction") output += formatPerformanceIssueOutput(event, spansEntry?.data, options);
4543
- if (event.type === "generic") output += formatGenericEventOutput(event);
4544
- output += formatTags(event.tags);
4545
- output += formatContext(event.context);
4546
- output += formatContexts(event.contexts);
4662
+ const messageEntry = eventToRender.entries.find((e) => e.type === "message");
4663
+ const exceptionEntry = eventToRender.entries.find((e) => e.type === "exception");
4664
+ const threadsEntry = eventToRender.entries.find((e) => e.type === "threads");
4665
+ const requestEntry = eventToRender.entries.find((e) => e.type === "request");
4666
+ const spansEntry = eventToRender.entries.find((e) => e.type === "spans");
4667
+ const cspEntry = eventToRender.entries.find((e) => e.type === "csp");
4668
+ if (messageEntry) output += formatMessageInterfaceOutput(eventToRender, messageEntry.data);
4669
+ if (exceptionEntry) output += formatExceptionInterfaceOutput(eventToRender, exceptionEntry.data);
4670
+ else if (threadsEntry) output += formatThreadsInterfaceOutput(eventToRender, threadsEntry.data);
4671
+ if (requestEntry) output += formatRequestInterfaceOutput(eventToRender, requestEntry.data);
4672
+ if (cspEntry) output += formatCspInterfaceOutput(eventToRender, cspEntry.data);
4673
+ if (eventToRender.type === "transaction") output += formatPerformanceIssueOutput(eventToRender, spansEntry?.data, options);
4674
+ if (eventToRender.type === "generic") output += formatGenericEventOutput(eventToRender);
4675
+ output += formatEventUser(eventUser);
4676
+ output += formatTags(eventToRender.tags);
4677
+ output += formatContext(eventToRender.context);
4678
+ output += formatContexts(eventToRender.contexts);
4547
4679
  return output;
4548
4680
  }
4549
4681
  /**
@@ -5243,6 +5375,23 @@ function formatTags(tags) {
5243
5375
  if (!tags || tags.length === 0) return "";
5244
5376
  return `### Tags\n\n${tags.map((tag) => `**${tag.key}**: ${tag.value}`).join("\n")}\n\n`;
5245
5377
  }
5378
+ function formatEventUser(user) {
5379
+ if (!user || Object.keys(user).length === 0) return "";
5380
+ const userFields = [
5381
+ ["id", user.id],
5382
+ ["email", user.email],
5383
+ ["username", user.username],
5384
+ ["ip", user.ip ?? user.ip_address],
5385
+ ["display_name", user.display_name ?? user.name]
5386
+ ].filter(([, value]) => typeof value === "string" && value.length > 0);
5387
+ const userSummary = userFields.map(([key, value]) => `${key}:${value}`).join(", ");
5388
+ const geoSummary = formatUserGeoSummary(user.geo);
5389
+ if (!userSummary && !geoSummary) return "";
5390
+ let output = "### User\n\n";
5391
+ if (userSummary) output += `**user**: ${userSummary}\n`;
5392
+ if (geoSummary) output += `**user.geo**: ${geoSummary}\n`;
5393
+ return `${output}\n`;
5394
+ }
5246
5395
  function formatContext(context$1) {
5247
5396
  if (!context$1 || Object.keys(context$1).length === 0) return "";
5248
5397
  return `### Extra Data\n\nAdditional data attached to this event.\n\n${Object.entries(context$1).map(([key, value]) => {
@@ -5326,7 +5475,7 @@ function formatSeerSummary(autofixState) {
5326
5475
  * @param params - Object containing organization slug, issue, event, and API service
5327
5476
  * @returns Formatted markdown string with complete issue information
5328
5477
  */
5329
- function formatIssueOutput({ organizationSlug, issue, event, apiService, autofixState, performanceTrace, externalIssues, experimentalMode }) {
5478
+ function formatIssueOutput({ organizationSlug, issue, event, apiService, autofixState, performanceTrace, externalIssues, relatedReplayIds, experimentalMode }) {
5330
5479
  let output = `# Issue ${issue.shortId} in **${organizationSlug}**\n\n`;
5331
5480
  const isPerformanceIssue = issue.issueType?.startsWith("performance_") || issue.issueCategory === "performance";
5332
5481
  if (isPerformanceIssue && issue.metadata) {
@@ -5386,7 +5535,14 @@ function formatIssueOutput({ organizationSlug, issue, event, apiService, autofix
5386
5535
  }
5387
5536
  if (event.message) output += `**Message**:\n${event.message}\n`;
5388
5537
  output += "\n";
5389
- output += formatEventOutput(event, { performanceTrace });
5538
+ output += formatEventOutput(event, {
5539
+ performanceTrace,
5540
+ replaySummary: {
5541
+ apiService,
5542
+ organizationSlug,
5543
+ relatedReplayIds
5544
+ }
5545
+ });
5390
5546
  if (autofixState) output += formatSeerSummary(autofixState);
5391
5547
  if (externalIssues && externalIssues.length > 0) {
5392
5548
  output += "## External Issue Links\n\n";
@@ -5400,9 +5556,76 @@ function formatIssueOutput({ organizationSlug, issue, event, apiService, autofix
5400
5556
  if (experimentalMode) output += `- To see the trail of events leading up to this error, use \`get_sentry_resource(url='${apiService.getIssueUrl(organizationSlug, issue.shortId)}', resourceType='breadcrumbs')\`\n`;
5401
5557
  return output;
5402
5558
  }
5559
+ const MAX_DISPLAY_REPLAYS = 5;
5560
+ function formatIssueReplayOutput({ apiService, organizationSlug, event, relatedReplayIds }) {
5561
+ const attachedReplayId = getReplayIdFromEvent(event);
5562
+ const normalizedRelatedReplayIds = dedupeReplayIds(relatedReplayIds ?? []);
5563
+ const additionalRelatedReplayIds = normalizedRelatedReplayIds.filter((replayId) => replayId !== attachedReplayId);
5564
+ if (!attachedReplayId && normalizedRelatedReplayIds.length === 0) return "";
5565
+ const lines = ["## Session Replay", ""];
5566
+ if (attachedReplayId) lines.push(`**Attached Replay**: ${apiService.getReplayUrl(organizationSlug, attachedReplayId)}`);
5567
+ if (normalizedRelatedReplayIds.length > 0) lines.push(`**Related Replay Count**: ${normalizedRelatedReplayIds.length}`);
5568
+ if (additionalRelatedReplayIds.length > 0) {
5569
+ const displayedReplayIds = additionalRelatedReplayIds.slice(0, MAX_DISPLAY_REPLAYS);
5570
+ lines.push("");
5571
+ lines.push(attachedReplayId ? "### Other Related Replays" : "### Related Replays");
5572
+ lines.push("");
5573
+ for (const replayId of displayedReplayIds) lines.push(`- ${apiService.getReplayUrl(organizationSlug, replayId)}`);
5574
+ const remainingReplayCount = additionalRelatedReplayIds.length - displayedReplayIds.length;
5575
+ if (remainingReplayCount > 0) lines.push(`- ... and ${remainingReplayCount} more replay${remainingReplayCount === 1 ? "" : "s"}`);
5576
+ }
5577
+ const exampleReplayId = attachedReplayId ?? normalizedRelatedReplayIds.at(0) ?? null;
5578
+ if (exampleReplayId) {
5579
+ lines.push("");
5580
+ lines.push(`Use \`get_replay_details(organizationSlug='${organizationSlug}', replayId='${exampleReplayId}')\` to inspect a replay in detail.`);
5581
+ }
5582
+ return `${lines.join("\n")}\n\n`;
5583
+ }
5584
+ function getReplayIdFromEvent(event) {
5585
+ const replayContext = event.contexts?.replay;
5586
+ const replayContextId = typeof replayContext?.replay_id === "string" ? replayContext.replay_id : null;
5587
+ const replayTagId = event.tags?.find((tag) => tag.key === "replayId" || tag.key === "replay.id")?.value ?? null;
5588
+ return normalizeReplayId(replayContextId ?? replayTagId);
5589
+ }
5590
+ function dedupeReplayIds(replayIds) {
5591
+ const normalizedReplayIds = [];
5592
+ const seenReplayIds = /* @__PURE__ */ new Set();
5593
+ for (const replayId of replayIds) {
5594
+ const normalizedReplayId = normalizeReplayId(replayId);
5595
+ if (!normalizedReplayId || seenReplayIds.has(normalizedReplayId)) continue;
5596
+ seenReplayIds.add(normalizedReplayId);
5597
+ normalizedReplayIds.push(normalizedReplayId);
5598
+ }
5599
+ return normalizedReplayIds;
5600
+ }
5601
+ function normalizeReplayId(replayId) {
5602
+ if (typeof replayId !== "string") return null;
5603
+ const trimmedReplayId = replayId.trim();
5604
+ if (!trimmedReplayId) return null;
5605
+ return trimmedReplayId.replace(/-/g, "");
5606
+ }
5607
+ function stripReplayMetadata(event) {
5608
+ const tags = event.tags?.filter((tag) => tag.key !== "replay.id" && tag.key !== "replayId");
5609
+ const replayContext = event.contexts?.replay;
5610
+ if (!replayContext) return {
5611
+ ...event,
5612
+ tags
5613
+ };
5614
+ const nextReplayContext = Object.fromEntries(Object.entries(replayContext).filter(([key]) => key !== "replay_id"));
5615
+ const nonTypeReplayKeys = Object.keys(nextReplayContext).filter((key) => key !== "type");
5616
+ const contexts = nonTypeReplayKeys.length === 0 ? Object.fromEntries(Object.entries(event.contexts ?? {}).filter(([key]) => key !== "replay")) : {
5617
+ ...event.contexts,
5618
+ replay: nextReplayContext
5619
+ };
5620
+ return {
5621
+ ...event,
5622
+ tags,
5623
+ contexts
5624
+ };
5625
+ }
5403
5626
 
5404
5627
  //#endregion
5405
- //#region ../mcp-core/dist/enhance-error-BzwoJ7V0.js
5628
+ //#region ../mcp-core/dist/enhance-error-Ci4C7QqF.js
5406
5629
  /**
5407
5630
  * Enhances a 404 error with parameter context to help users understand what went wrong.
5408
5631
  * This is optional - tools can use this when they want to provide extra context.
@@ -5430,7 +5653,7 @@ function enhanceNotFoundError(error, params) {
5430
5653
  }
5431
5654
 
5432
5655
  //#endregion
5433
- //#region ../mcp-core/dist/get-issue-details-B2vtmsfK.js
5656
+ //#region ../mcp-core/dist/get-issue-details-2uGxQtn4.js
5434
5657
  var get_issue_details_default = defineTool({
5435
5658
  name: "get_issue_details",
5436
5659
  skills: [
@@ -5511,7 +5734,7 @@ var get_issue_details_default = defineTool({
5511
5734
  if (!found) return `# Event Not Found\n\nNo issue found for Event ID: ${eventId}`;
5512
5735
  issue$1 = found;
5513
5736
  }
5514
- const [{ event: event$1, performanceTrace: performanceTrace$1 }, { autofixState: autofixState$1, externalIssues: externalIssues$1 }] = await Promise.all([apiService.getEventForIssue({
5737
+ const [{ event: event$1, performanceTrace: performanceTrace$1 }, { autofixState: autofixState$1, externalIssues: externalIssues$1, relatedReplayIds: relatedReplayIds$1 }] = await Promise.all([apiService.getEventForIssue({
5515
5738
  organizationSlug: orgSlug$1,
5516
5739
  issueId: issue$1.shortId,
5517
5740
  eventId
@@ -5532,7 +5755,7 @@ var get_issue_details_default = defineTool({
5532
5755
  })), fetchIssueEnrichmentData({
5533
5756
  apiService,
5534
5757
  organizationSlug: orgSlug$1,
5535
- issueId: issue$1.shortId
5758
+ issue: issue$1
5536
5759
  })]);
5537
5760
  return formatIssueOutput({
5538
5761
  organizationSlug: orgSlug$1,
@@ -5542,6 +5765,7 @@ var get_issue_details_default = defineTool({
5542
5765
  autofixState: autofixState$1,
5543
5766
  performanceTrace: performanceTrace$1,
5544
5767
  externalIssues: externalIssues$1,
5768
+ relatedReplayIds: relatedReplayIds$1,
5545
5769
  experimentalMode: context$1.experimentalMode
5546
5770
  });
5547
5771
  }
@@ -5566,7 +5790,7 @@ var get_issue_details_default = defineTool({
5566
5790
  });
5567
5791
  throw error;
5568
5792
  }
5569
- const [{ event, performanceTrace }, { autofixState, externalIssues }] = await Promise.all([apiService.getLatestEventForIssue({
5793
+ const [{ event, performanceTrace }, { autofixState, externalIssues, relatedReplayIds }] = await Promise.all([apiService.getLatestEventForIssue({
5570
5794
  organizationSlug: orgSlug,
5571
5795
  issueId: issue.shortId
5572
5796
  }).then(async (event$1) => ({
@@ -5579,7 +5803,7 @@ var get_issue_details_default = defineTool({
5579
5803
  })), fetchIssueEnrichmentData({
5580
5804
  apiService,
5581
5805
  organizationSlug: orgSlug,
5582
- issueId: issue.shortId
5806
+ issue
5583
5807
  })]);
5584
5808
  return formatIssueOutput({
5585
5809
  organizationSlug: orgSlug,
@@ -5589,6 +5813,7 @@ var get_issue_details_default = defineTool({
5589
5813
  autofixState,
5590
5814
  performanceTrace,
5591
5815
  externalIssues,
5816
+ relatedReplayIds,
5592
5817
  experimentalMode: context$1.experimentalMode
5593
5818
  });
5594
5819
  }
@@ -5598,17 +5823,27 @@ var get_issue_details_default = defineTool({
5598
5823
  * Both calls are non-blocking -- failures are silently caught so they never
5599
5824
  * prevent the primary issue details from being returned.
5600
5825
  */
5601
- async function fetchIssueEnrichmentData({ apiService, organizationSlug, issueId }) {
5602
- const [autofixState, externalIssues] = await Promise.all([apiService.getAutofixState({
5603
- organizationSlug,
5604
- issueId
5605
- }).catch(() => void 0), apiService.getIssueExternalLinks({
5606
- organizationSlug,
5607
- issueId
5608
- }).catch(() => void 0)]);
5826
+ async function fetchIssueEnrichmentData({ apiService, organizationSlug, issue }) {
5827
+ const issueId = String(issue.id);
5828
+ const [autofixState, externalIssues, relatedReplayIds] = await Promise.all([
5829
+ apiService.getAutofixState({
5830
+ organizationSlug,
5831
+ issueId: issue.shortId
5832
+ }).catch(() => void 0),
5833
+ apiService.getIssueExternalLinks({
5834
+ organizationSlug,
5835
+ issueId: issue.shortId
5836
+ }).catch(() => void 0),
5837
+ apiService.listReplayIdsForIssue({
5838
+ organizationSlug,
5839
+ issueId,
5840
+ dataSource: getReplayDataSource(issue)
5841
+ }).catch(() => void 0)
5842
+ ]);
5609
5843
  return {
5610
5844
  autofixState,
5611
- externalIssues
5845
+ externalIssues,
5846
+ relatedReplayIds
5612
5847
  };
5613
5848
  }
5614
5849
  async function maybeFetchPerformanceTrace({ apiService, organizationSlug, event }) {
@@ -5634,9 +5869,12 @@ function shouldFetchTraceForEvent(event) {
5634
5869
  if (typeof traceId !== "string" || traceId.length === 0) return null;
5635
5870
  return { traceId };
5636
5871
  }
5872
+ function getReplayDataSource(issue) {
5873
+ return issue.issueCategory === "error" || issue.type === "error" ? "discover" : "search_issues";
5874
+ }
5637
5875
 
5638
5876
  //#endregion
5639
- //#region ../mcp-core/dist/get-issue-tag-values-Cvuw-dND.js
5877
+ //#region ../mcp-core/dist/get-issue-tag-values-CurH5U6T.js
5640
5878
  var get_issue_tag_values_default = defineTool({
5641
5879
  name: "get_issue_tag_values",
5642
5880
  skills: ["inspect"],
@@ -5751,7 +5989,7 @@ var get_issue_tag_values_default = defineTool({
5751
5989
  });
5752
5990
 
5753
5991
  //#endregion
5754
- //#region ../mcp-core/dist/get-trace-details-COQwrZyO.js
5992
+ //#region ../mcp-core/dist/get-trace-details-C3hHVNzs.js
5755
5993
  const MAX_DEPTH = 2;
5756
5994
  const MINIMUM_DURATION_THRESHOLD_MS = 10;
5757
5995
  const MIN_MEANINGFUL_CHILD_DURATION = 5;
@@ -6052,7 +6290,544 @@ function formatTraceOutput({ organizationSlug, traceId, traceMeta, trace: trace$
6052
6290
  }
6053
6291
 
6054
6292
  //#endregion
6055
- //#region ../mcp-core/dist/get-event-attachment-CBWB88Xp.js
6293
+ //#region ../mcp-core/dist/url-helpers-DGhXHR0Z.js
6294
+ /**
6295
+ * Parses a Sentry URL and extracts resource type and identifiers.
6296
+ *
6297
+ * Supported URL patterns:
6298
+ * - Issue: `/issues/{issueId}` or `/organizations/{org}/issues/{issueId}`
6299
+ * - Event: `/issues/{issueId}/events/{eventId}`
6300
+ * - Trace: `/explore/traces/trace/{traceId}` or `/performance/trace/{traceId}`
6301
+ * - Profile: `/explore/profiling/profile/{project}/flamegraph/` with query params
6302
+ * - Replay: `/replays/{replayId}/`
6303
+ * - Monitor: `/crons/{monitorSlug}/` or `/monitors/{monitorSlug}/`
6304
+ * - Release: `/releases/{version}/`
6305
+ *
6306
+ * Organization slug is extracted from:
6307
+ * 1. Subdomain (e.g., `my-org.sentry.io`)
6308
+ * 2. Path (e.g., `/organizations/my-org/...` or `/my-org/issues/...`)
6309
+ *
6310
+ * @param url - A Sentry URL to parse
6311
+ * @returns Parsed URL with resource type and identifiers
6312
+ * @throws UserInputError if the URL is invalid or cannot be parsed
6313
+ *
6314
+ * @example
6315
+ * // Issue URL
6316
+ * parseSentryUrl("https://my-org.sentry.io/issues/PROJECT-123")
6317
+ * // { type: "issue", organizationSlug: "my-org", issueId: "PROJECT-123" }
6318
+ *
6319
+ * @example
6320
+ * // Replay URL
6321
+ * parseSentryUrl("https://my-org.sentry.io/replays/abc123def456/")
6322
+ * // { type: "replay", organizationSlug: "my-org", replayId: "abc123def456" }
6323
+ *
6324
+ * @example
6325
+ * // Monitor URL
6326
+ * parseSentryUrl("https://my-org.sentry.io/crons/my-cron-job/")
6327
+ * // { type: "monitor", organizationSlug: "my-org", monitorSlug: "my-cron-job" }
6328
+ */
6329
+ function parseSentryUrl(url) {
6330
+ if (!url || typeof url !== "string") throw new UserInputError("Invalid Sentry URL. URL must be a non-empty string.");
6331
+ if (!url.startsWith("http://") && !url.startsWith("https://")) throw new UserInputError("Invalid Sentry URL. Must start with http:// or https://");
6332
+ let parsedUrl;
6333
+ try {
6334
+ parsedUrl = new URL(url);
6335
+ } catch {
6336
+ throw new UserInputError(`Invalid Sentry URL. Unable to parse URL: ${url}`);
6337
+ }
6338
+ const pathParts = parsedUrl.pathname.split("/").filter(Boolean);
6339
+ const organizationSlug = extractOrganizationSlug(parsedUrl, pathParts);
6340
+ return identifyResource(parsedUrl, pathParts, organizationSlug);
6341
+ }
6342
+ /**
6343
+ * Extracts organization slug from URL.
6344
+ *
6345
+ * Checks in order:
6346
+ * 1. `/organizations/{org}/...` path format
6347
+ * 2. `/{org}/issues/...` path format (org before known segments)
6348
+ * 3. Subdomain (e.g., `my-org.sentry.io`) - excluding region prefixes
6349
+ */
6350
+ function extractOrganizationSlug(parsedUrl, pathParts) {
6351
+ if (pathParts.includes("organizations")) {
6352
+ const orgIndex = pathParts.indexOf("organizations");
6353
+ const slug = pathParts[orgIndex + 1];
6354
+ if (slug) return slug;
6355
+ }
6356
+ const knownSegments = [
6357
+ "issues",
6358
+ "explore",
6359
+ "performance",
6360
+ "projects",
6361
+ "settings",
6362
+ "replays",
6363
+ "releases",
6364
+ "crons",
6365
+ "monitors",
6366
+ "alerts",
6367
+ "feedback",
6368
+ "dashboards",
6369
+ "discover",
6370
+ "insights"
6371
+ ];
6372
+ if (pathParts.length > 1 && knownSegments.includes(pathParts[1])) return pathParts[0];
6373
+ const hostParts = parsedUrl.hostname.split(".");
6374
+ const regionPrefixes = [
6375
+ "us",
6376
+ "eu",
6377
+ "de",
6378
+ "www"
6379
+ ];
6380
+ if (hostParts.length >= 2 && !regionPrefixes.includes(hostParts[0])) return hostParts[0];
6381
+ throw new UserInputError("Invalid Sentry URL. Could not determine organization from URL.");
6382
+ }
6383
+ /**
6384
+ * Identifies the resource type and extracts relevant identifiers.
6385
+ */
6386
+ function identifyResource(parsedUrl, pathParts, organizationSlug) {
6387
+ const profilingIndex = pathParts.indexOf("profiling");
6388
+ if (profilingIndex !== -1 && pathParts[profilingIndex + 1] === "profile") {
6389
+ const projectSlug = pathParts[profilingIndex + 2];
6390
+ const profilerId = parsedUrl.searchParams.get("profilerId") || void 0;
6391
+ const start = parsedUrl.searchParams.get("start") || void 0;
6392
+ const end = parsedUrl.searchParams.get("end") || void 0;
6393
+ return {
6394
+ type: "profile",
6395
+ organizationSlug,
6396
+ projectSlug,
6397
+ profilerId,
6398
+ start,
6399
+ end
6400
+ };
6401
+ }
6402
+ const replaysIndex = pathParts.indexOf("replays");
6403
+ if (replaysIndex !== -1) {
6404
+ const replayId = pathParts[replaysIndex + 1];
6405
+ if (replayId && replayId !== "selectors") return {
6406
+ type: "replay",
6407
+ organizationSlug,
6408
+ replayId
6409
+ };
6410
+ }
6411
+ const cronsIndex = pathParts.indexOf("crons");
6412
+ const monitorsIndex = pathParts.indexOf("monitors");
6413
+ const monitorPathIndex = cronsIndex !== -1 ? cronsIndex : monitorsIndex;
6414
+ if (monitorPathIndex !== -1) {
6415
+ const nextPart = pathParts[monitorPathIndex + 1];
6416
+ if (nextPart && nextPart !== "new") {
6417
+ const afterNext = pathParts[monitorPathIndex + 2];
6418
+ if (afterNext && afterNext !== "details") return {
6419
+ type: "monitor",
6420
+ organizationSlug,
6421
+ projectSlug: nextPart,
6422
+ monitorSlug: afterNext
6423
+ };
6424
+ return {
6425
+ type: "monitor",
6426
+ organizationSlug,
6427
+ monitorSlug: nextPart
6428
+ };
6429
+ }
6430
+ }
6431
+ const releasesIndex = pathParts.indexOf("releases");
6432
+ if (releasesIndex !== -1) {
6433
+ const releaseVersion = pathParts[releasesIndex + 1];
6434
+ if (releaseVersion && releaseVersion !== "new-events" && releaseVersion !== "all-events") return {
6435
+ type: "release",
6436
+ organizationSlug,
6437
+ releaseVersion
6438
+ };
6439
+ }
6440
+ const traceIndex = pathParts.indexOf("trace");
6441
+ if (traceIndex !== -1) {
6442
+ const traceId = pathParts[traceIndex + 1];
6443
+ if (traceId) {
6444
+ const nodeParam = parsedUrl.searchParams.get("node");
6445
+ let spanId;
6446
+ if (nodeParam?.startsWith("span-")) spanId = nodeParam.slice(5);
6447
+ return {
6448
+ type: "trace",
6449
+ organizationSlug,
6450
+ traceId,
6451
+ spanId
6452
+ };
6453
+ }
6454
+ }
6455
+ if (pathParts.includes("performance") && pathParts.includes("summary")) {
6456
+ const transaction = parsedUrl.searchParams.get("transaction") || void 0;
6457
+ if (transaction) return {
6458
+ type: "unknown",
6459
+ organizationSlug,
6460
+ transaction
6461
+ };
6462
+ }
6463
+ const issuesIndex = pathParts.indexOf("issues");
6464
+ if (issuesIndex !== -1) {
6465
+ const issueId = pathParts[issuesIndex + 1];
6466
+ if (issueId) {
6467
+ const eventsIndex = pathParts.indexOf("events", issuesIndex);
6468
+ if (eventsIndex !== -1) {
6469
+ const eventId = pathParts[eventsIndex + 1];
6470
+ if (eventId) return {
6471
+ type: "event",
6472
+ organizationSlug,
6473
+ issueId,
6474
+ eventId
6475
+ };
6476
+ }
6477
+ return {
6478
+ type: "issue",
6479
+ organizationSlug,
6480
+ issueId
6481
+ };
6482
+ }
6483
+ }
6484
+ return {
6485
+ type: "unknown",
6486
+ organizationSlug
6487
+ };
6488
+ }
6489
+ /**
6490
+ * Checks if a URL appears to be a Sentry profile URL.
6491
+ *
6492
+ * @param url - URL to check
6493
+ * @returns True if the URL looks like a profile URL
6494
+ */
6495
+ function isProfileUrl(url) {
6496
+ try {
6497
+ const parsed = parseSentryUrl(url);
6498
+ return parsed.type === "profile";
6499
+ } catch {
6500
+ return false;
6501
+ }
6502
+ }
6503
+
6504
+ //#endregion
6505
+ //#region ../mcp-core/dist/get-replay-details-Chw0wCJg.js
6506
+ const MAX_ACTIVITY_EVENTS = 6;
6507
+ const MAX_RELATED_ERRORS = 3;
6508
+ const MAX_RELATED_TRACES = 2;
6509
+ var get_replay_details_default = defineTool({
6510
+ name: "get_replay_details",
6511
+ skills: ["inspect"],
6512
+ requiredScopes: [
6513
+ "org:read",
6514
+ "project:read",
6515
+ "event:read"
6516
+ ],
6517
+ requiredCapabilities: ["replays"],
6518
+ description: [
6519
+ "Get high-level information about a specific Sentry replay by URL or replay ID.",
6520
+ "",
6521
+ "USE THIS TOOL WHEN USERS:",
6522
+ "- Share a replay URL",
6523
+ "- Ask what happened in a specific replay",
6524
+ "- Want a concise replay summary plus the next issue or trace lookups to run",
6525
+ "",
6526
+ "<examples>",
6527
+ "### With replay URL",
6528
+ "```",
6529
+ "get_replay_details(replayUrl='https://my-organization.sentry.io/replays/7e07485f-12f9-416b-8b14-26260799b51f/')",
6530
+ "```",
6531
+ "",
6532
+ "### With organization and replay ID",
6533
+ "```",
6534
+ "get_replay_details(organizationSlug='my-organization', replayId='7e07485f-12f9-416b-8b14-26260799b51f')",
6535
+ "```",
6536
+ "</examples>"
6537
+ ].join("\n"),
6538
+ inputSchema: {
6539
+ replayUrl: ParamReplayUrl.optional(),
6540
+ organizationSlug: ParamOrganizationSlug.optional(),
6541
+ replayId: ParamReplayId.optional(),
6542
+ regionUrl: ParamRegionUrl.nullable().optional()
6543
+ },
6544
+ annotations: {
6545
+ readOnlyHint: true,
6546
+ openWorldHint: true
6547
+ },
6548
+ async handler(params, context$1) {
6549
+ const resolved = resolveReplayParams(params);
6550
+ const regionUrl = await resolveReplayRegionUrl({
6551
+ context: context$1,
6552
+ organizationSlug: resolved.organizationSlug,
6553
+ regionUrl: params.regionUrl ?? context$1.constraints.regionUrl
6554
+ });
6555
+ const apiService = apiServiceFromContext(context$1, { regionUrl: regionUrl ?? void 0 });
6556
+ setTag("organization.slug", resolved.organizationSlug);
6557
+ setTag("replay.id", resolved.replayId);
6558
+ const replay = await apiService.getReplayDetails({
6559
+ organizationSlug: resolved.organizationSlug,
6560
+ replayId: resolved.replayId
6561
+ });
6562
+ const isArchived = replay.is_archived === true;
6563
+ const projectId = replay.project_id != null ? String(replay.project_id) : null;
6564
+ const hasSegments = (replay.count_segments ?? 0) > 0;
6565
+ const [{ segments }, relatedIssues, relatedTraces] = await Promise.all([
6566
+ fetchReplaySegments({
6567
+ apiService,
6568
+ organizationSlug: resolved.organizationSlug,
6569
+ replayId: resolved.replayId,
6570
+ projectId,
6571
+ isArchived,
6572
+ hasSegments
6573
+ }),
6574
+ fetchReplayIssues({
6575
+ apiService,
6576
+ organizationSlug: resolved.organizationSlug,
6577
+ errorIds: replay.error_ids
6578
+ }),
6579
+ fetchReplayTraces({
6580
+ apiService,
6581
+ organizationSlug: resolved.organizationSlug,
6582
+ traceIds: replay.trace_ids
6583
+ })
6584
+ ]);
6585
+ return formatReplayOutput({
6586
+ replay,
6587
+ organizationSlug: resolved.organizationSlug,
6588
+ replayUrl: params.replayUrl ?? apiService.getReplayUrl(resolved.organizationSlug, replay.id),
6589
+ segments,
6590
+ isArchived,
6591
+ relatedIssues,
6592
+ relatedTraces
6593
+ });
6594
+ }
6595
+ });
6596
+ function resolveReplayParams(params) {
6597
+ if (params.replayUrl) {
6598
+ const parsed = parseSentryUrl(params.replayUrl);
6599
+ if (parsed.type !== "replay" || !parsed.replayId) throw new UserInputError("Invalid replay URL. URL must point to a Sentry replay resource.");
6600
+ return {
6601
+ organizationSlug: params.organizationSlug ?? parsed.organizationSlug,
6602
+ replayId: parsed.replayId
6603
+ };
6604
+ }
6605
+ if (!params.organizationSlug || !params.replayId) throw new UserInputError("Provide either `replayUrl` or both `organizationSlug` and `replayId`.");
6606
+ return {
6607
+ organizationSlug: params.organizationSlug,
6608
+ replayId: params.replayId
6609
+ };
6610
+ }
6611
+ async function resolveReplayRegionUrl({ context: context$1, organizationSlug, regionUrl }) {
6612
+ if (regionUrl != null) {
6613
+ const trimmedRegionUrl = regionUrl.trim();
6614
+ return trimmedRegionUrl || null;
6615
+ }
6616
+ try {
6617
+ const organization = await apiServiceFromContext(context$1).getOrganization(organizationSlug);
6618
+ const resolvedRegionUrl = organization.links?.regionUrl?.trim();
6619
+ return resolvedRegionUrl || null;
6620
+ } catch {
6621
+ return null;
6622
+ }
6623
+ }
6624
+ function formatReplayOutput({ replay, organizationSlug, replayUrl, segments, isArchived, relatedIssues, relatedTraces }) {
6625
+ const lines = [];
6626
+ const user = replay.user?.display_name ?? replay.user?.email ?? replay.user?.username ?? replay.user?.id ?? "Anonymous User";
6627
+ const device = replay.device?.name ?? replay.device?.model ?? replay.device?.family ?? null;
6628
+ const activityEvents = extractReplayActivityEvents(segments);
6629
+ lines.push(`# Replay ${replay.id} in **${organizationSlug}**`);
6630
+ lines.push("");
6631
+ lines.push("## Summary");
6632
+ lines.push("");
6633
+ lines.push(`- **Replay URL**: ${replayUrl}`);
6634
+ lines.push(`- **Duration**: ${replay.duration != null ? formatDurationSeconds(replay.duration) : "Unknown"}`);
6635
+ lines.push(`- **Environment**: ${replay.environment ?? "Unknown"}`);
6636
+ lines.push(`- **Browser**: ${formatNameVersion(replay.browser?.name, replay.browser?.version)}`);
6637
+ lines.push(`- **OS**: ${formatNameVersion(replay.os?.name, replay.os?.version)}`);
6638
+ lines.push(`- **User**: ${user}`);
6639
+ if (replay.urls.length > 0) lines.push(`- **URLs**: ${replay.urls.slice(0, 3).join(", ")}`);
6640
+ if (device) lines.push(`- **Device**: ${device}`);
6641
+ if (replay.releases && replay.releases.length > 0) lines.push(`- **Release**: ${replay.releases[0]}`);
6642
+ lines.push("");
6643
+ lines.push("## Activity");
6644
+ lines.push("");
6645
+ if (isArchived) lines.push("Recording is archived and not available for playback.");
6646
+ else if (activityEvents.length > 0) {
6647
+ const startTime = activityEvents[0]?.timestampMs ?? null;
6648
+ for (const event of activityEvents) {
6649
+ const prefix = event.timestampMs !== null && startTime !== null ? `${formatRelativeTime(event.timestampMs - startTime)} · ` : "";
6650
+ const details = event.details.length > 0 ? ` · ${event.details.join(" · ")}` : "";
6651
+ lines.push(`- ${prefix}\`${event.label}\`${details}`);
6652
+ }
6653
+ } else lines.push("No activity events recorded.");
6654
+ const hasRelated = relatedIssues.length > 0 || relatedTraces.length > 0;
6655
+ if (hasRelated) {
6656
+ lines.push("");
6657
+ lines.push("## Related");
6658
+ lines.push("");
6659
+ for (const ri of relatedIssues) if (ri.issue) lines.push(`- **${ri.issue.shortId}**: ${ri.issue.title}`);
6660
+ else lines.push(`- Event \`${ri.eventId}\``);
6661
+ for (const rt of relatedTraces) {
6662
+ const spanInfo = rt.traceMeta ? ` (${rt.traceMeta.span_count} spans)` : "";
6663
+ lines.push(`- Trace \`${rt.traceId}\`${spanInfo}`);
6664
+ }
6665
+ lines.push("");
6666
+ lines.push("Use `get_sentry_resource` to inspect any issue or trace listed above.");
6667
+ }
6668
+ return lines.join("\n");
6669
+ }
6670
+ function formatDurationSeconds(durationSeconds) {
6671
+ if (durationSeconds < 60) return `${durationSeconds}s`;
6672
+ const minutes = Math.floor(durationSeconds / 60);
6673
+ const seconds = durationSeconds % 60;
6674
+ return seconds > 0 ? `${minutes}m ${seconds}s` : `${minutes}m`;
6675
+ }
6676
+ async function fetchReplaySegments({ apiService, organizationSlug, replayId, projectId, isArchived, hasSegments }) {
6677
+ if (isArchived || !projectId || !hasSegments) return { segments: null };
6678
+ try {
6679
+ const segments = await apiService.getReplayRecordingSegments({
6680
+ organizationSlug,
6681
+ projectSlugOrId: projectId,
6682
+ replayId
6683
+ });
6684
+ return { segments };
6685
+ } catch {
6686
+ return { segments: null };
6687
+ }
6688
+ }
6689
+ async function fetchReplayIssues({ apiService, organizationSlug, errorIds }) {
6690
+ const ids = errorIds.slice(0, MAX_RELATED_ERRORS);
6691
+ return Promise.all(ids.map(async (eventId) => {
6692
+ try {
6693
+ const [issue] = await apiService.listIssues({
6694
+ organizationSlug,
6695
+ query: eventId,
6696
+ limit: 1
6697
+ });
6698
+ return {
6699
+ eventId,
6700
+ issue: issue ?? null
6701
+ };
6702
+ } catch {
6703
+ return {
6704
+ eventId,
6705
+ issue: null
6706
+ };
6707
+ }
6708
+ }));
6709
+ }
6710
+ async function fetchReplayTraces({ apiService, organizationSlug, traceIds }) {
6711
+ const ids = traceIds.slice(0, MAX_RELATED_TRACES);
6712
+ return Promise.all(ids.map(async (traceId) => {
6713
+ try {
6714
+ const traceMeta = await apiService.getTraceMeta({
6715
+ organizationSlug,
6716
+ traceId
6717
+ });
6718
+ return {
6719
+ traceId,
6720
+ traceMeta
6721
+ };
6722
+ } catch {
6723
+ return {
6724
+ traceId,
6725
+ traceMeta: null
6726
+ };
6727
+ }
6728
+ }));
6729
+ }
6730
+ function formatNameVersion(name$5, version) {
6731
+ if (name$5 && version) return `${name$5} ${version}`;
6732
+ return name$5 ?? version ?? "Unknown";
6733
+ }
6734
+ function extractReplayActivityEvents(segments) {
6735
+ if (!segments) return [];
6736
+ const events = [];
6737
+ for (const segment of segments) for (const event of segment) {
6738
+ const replayEvent = summarizeReplayEvent(event);
6739
+ if (replayEvent) events.push(replayEvent);
6740
+ if (events.length >= MAX_ACTIVITY_EVENTS) return events;
6741
+ }
6742
+ return events;
6743
+ }
6744
+ function summarizeReplayEvent(event) {
6745
+ if (!isRecord(event)) return null;
6746
+ const timestampMs = getEventTimestampMillis(event.timestamp);
6747
+ const data = isRecord(event.data) ? event.data : null;
6748
+ const tag = typeof data?.tag === "string" ? data.tag : "";
6749
+ const payload = isRecord(data?.payload) ? data.payload : null;
6750
+ if (tag) {
6751
+ const replayEvent = summarizeTaggedReplayEvent(tag, payload);
6752
+ if (replayEvent) return {
6753
+ timestampMs,
6754
+ ...replayEvent
6755
+ };
6756
+ }
6757
+ if (typeof event.type === "number" && data) {
6758
+ const href = typeof data.href === "string" ? data.href : null;
6759
+ if (href) return {
6760
+ timestampMs,
6761
+ label: "page.view",
6762
+ details: [`href=${href}`]
6763
+ };
6764
+ }
6765
+ return null;
6766
+ }
6767
+ function summarizeTaggedReplayEvent(tag, payload) {
6768
+ if (tag === "performanceSpan") {
6769
+ const op = firstString(payload?.op);
6770
+ const description$73 = firstString(payload?.description);
6771
+ const durationMs = isRecord(payload?.data) && typeof payload.data.duration === "number" ? payload.data.duration : null;
6772
+ if (description$73 || op) return {
6773
+ label: op ?? "performanceSpan",
6774
+ details: [description$73 ? `description=${description$73}` : null, durationMs !== null ? `duration_ms=${durationMs}` : null].filter((value) => value !== null)
6775
+ };
6776
+ }
6777
+ if (tag === "ui.click") {
6778
+ const message = firstString(payload?.message, payload?.description);
6779
+ if (message) return {
6780
+ label: tag,
6781
+ details: [`message=${quoteDetail(message)}`]
6782
+ };
6783
+ }
6784
+ const knownKeys = [
6785
+ "message",
6786
+ "description",
6787
+ "category",
6788
+ "type"
6789
+ ];
6790
+ const details = [];
6791
+ for (const key of knownKeys) {
6792
+ const value = firstString(payload?.[key]);
6793
+ if (value) details.push(`${key}=${quoteDetail(value)}`);
6794
+ }
6795
+ const extra = summarizeObject(payload, new Set(knownKeys));
6796
+ if (extra) details.push(extra);
6797
+ return details.length > 0 ? {
6798
+ label: tag,
6799
+ details
6800
+ } : null;
6801
+ }
6802
+ function getEventTimestampMillis(value) {
6803
+ if (typeof value !== "number") return null;
6804
+ return value > 1e12 ? value : value * 1e3;
6805
+ }
6806
+ function formatRelativeTime(offsetMs) {
6807
+ const offsetSeconds = Math.max(0, Math.round(offsetMs / 1e3));
6808
+ if (offsetSeconds < 60) return `T+${offsetSeconds}s`;
6809
+ const minutes = Math.floor(offsetSeconds / 60);
6810
+ const seconds = offsetSeconds % 60;
6811
+ return seconds > 0 ? `T+${minutes}m ${seconds}s` : `T+${minutes}m`;
6812
+ }
6813
+ function summarizeObject(value, excludedKeys = /* @__PURE__ */ new Set()) {
6814
+ if (!isRecord(value)) return null;
6815
+ const entries = Object.entries(value).filter(([key, nested]) => !excludedKeys.has(key) && (typeof nested === "string" || typeof nested === "number")).slice(0, 3).map(([key, nested]) => `${key}=${nested}`);
6816
+ return entries.length > 0 ? `payload=${quoteDetail(entries.join(", "))}` : null;
6817
+ }
6818
+ function firstString(...values) {
6819
+ for (const value of values) if (typeof value === "string" && value.trim()) return value.trim();
6820
+ return null;
6821
+ }
6822
+ function isRecord(value) {
6823
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6824
+ }
6825
+ function quoteDetail(value) {
6826
+ return JSON.stringify(value.trim());
6827
+ }
6828
+
6829
+ //#endregion
6830
+ //#region ../mcp-core/dist/get-event-attachment-C52Cyavz.js
6056
6831
  var get_event_attachment_default = defineTool({
6057
6832
  name: "get_event_attachment",
6058
6833
  skills: ["inspect"],
@@ -6188,7 +6963,7 @@ var get_event_attachment_default = defineTool({
6188
6963
  });
6189
6964
 
6190
6965
  //#endregion
6191
- //#region ../mcp-core/dist/formatting-CIwRyNGU.js
6966
+ //#region ../mcp-core/dist/formatting-BMQ1BB0J.js
6192
6967
  /**
6193
6968
  * Helper function to format assignedTo field for display
6194
6969
  */
@@ -6200,7 +6975,7 @@ function formatAssignedTo(assignedTo) {
6200
6975
  }
6201
6976
 
6202
6977
  //#endregion
6203
- //#region ../mcp-core/dist/update-issue-CTU4EyEW.js
6978
+ //#region ../mcp-core/dist/update-issue-CA2a7r1b.js
6204
6979
  var update_issue_default = defineTool({
6205
6980
  name: "update_issue",
6206
6981
  skills: ["triage"],
@@ -13045,7 +13820,65 @@ function createOpenAI(options = {}) {
13045
13820
  var openai = createOpenAI();
13046
13821
 
13047
13822
  //#endregion
13048
- //#region ../mcp-core/dist/openai-provider-BT4fAGlz.js
13823
+ //#region ../mcp-core/dist/azure-openai-provider-CL8cBegk.js
13824
+ const DEFAULT_OPENAI_MODEL$1 = "gpt-5";
13825
+ let configuredBaseUrl$2;
13826
+ function setAzureOpenAIBaseUrl(baseUrl) {
13827
+ configuredBaseUrl$2 = baseUrl;
13828
+ }
13829
+ function hasAzureDeploymentPath(baseUrl) {
13830
+ const pathname = new URL(baseUrl).pathname.replace(/\/+$/, "");
13831
+ return /\/openai\/deployments\/[^/]+$/i.test(pathname);
13832
+ }
13833
+ function hasAzureV1Path(baseUrl) {
13834
+ const pathname = new URL(baseUrl).pathname.replace(/\/+$/, "");
13835
+ return /\/openai\/v1$/i.test(pathname);
13836
+ }
13837
+ function getAzureOpenAIApiSurface() {
13838
+ if (!configuredBaseUrl$2) throw new ConfigurationError("Provider \"azure-openai\" requires --openai-base-url to target an Azure OpenAI endpoint.");
13839
+ if (hasAzureV1Path(configuredBaseUrl$2)) return "responses";
13840
+ if (hasAzureDeploymentPath(configuredBaseUrl$2)) return "chat-completions";
13841
+ throw new ConfigurationError("Provider \"azure-openai\" requires an Azure v1 base URL ending in /openai/v1 or a deployment URL ending in /openai/deployments/<deployment>.");
13842
+ }
13843
+ function getAzureOpenAIApiVersion() {
13844
+ const apiVersion = process.env.OPENAI_API_VERSION?.trim();
13845
+ return apiVersion && apiVersion.length > 0 ? apiVersion : void 0;
13846
+ }
13847
+ function createAzureOpenAIFetch(baseUrl) {
13848
+ const apiVersion = getAzureOpenAIApiVersion();
13849
+ const shouldAppendApiVersion = apiVersion !== void 0 && hasAzureDeploymentPath(baseUrl);
13850
+ return async (input, init) => {
13851
+ const requestUrl = input instanceof Request ? new URL(input.url) : new URL(input instanceof URL ? input.href : input.toString());
13852
+ if (shouldAppendApiVersion) requestUrl.searchParams.set("api-version", apiVersion);
13853
+ const headers = new Headers(input instanceof Request ? input.headers : void 0);
13854
+ if (init?.headers) for (const [key, value] of new Headers(init.headers).entries()) headers.set(key, value);
13855
+ if (process.env.OPENAI_API_KEY) headers.set("api-key", process.env.OPENAI_API_KEY);
13856
+ if (input instanceof Request) return fetch(new Request(requestUrl.toString(), input), {
13857
+ ...init,
13858
+ headers
13859
+ });
13860
+ return fetch(requestUrl.toString(), {
13861
+ ...init,
13862
+ headers
13863
+ });
13864
+ };
13865
+ }
13866
+ function getAzureOpenAIModel(model) {
13867
+ if (!configuredBaseUrl$2) throw new ConfigurationError("Provider \"azure-openai\" requires --openai-base-url to target an Azure OpenAI endpoint.");
13868
+ const apiSurface = getAzureOpenAIApiSurface();
13869
+ const modelId = model ?? (process.env.OPENAI_MODEL || DEFAULT_OPENAI_MODEL$1);
13870
+ const factory$1 = createOpenAI({
13871
+ baseURL: configuredBaseUrl$2,
13872
+ headers: { "User-Agent": USER_AGENT },
13873
+ name: "azure-openai",
13874
+ fetch: createAzureOpenAIFetch(configuredBaseUrl$2)
13875
+ });
13876
+ if (apiSurface === "chat-completions") return factory$1.chat(modelId);
13877
+ return factory$1(modelId);
13878
+ }
13879
+
13880
+ //#endregion
13881
+ //#region ../mcp-core/dist/openai-provider-Dgg1ZY8a.js
13049
13882
  const DEFAULT_OPENAI_MODEL = "gpt-5";
13050
13883
  let configuredBaseUrl$1;
13051
13884
  /**
@@ -13060,7 +13893,7 @@ function setOpenAIBaseUrl(baseUrl) {
13060
13893
  *
13061
13894
  * Works with:
13062
13895
  * - OpenAI API directly (default)
13063
- * - Any OpenAI-compatible API via custom base URL (Vercel AI Gateway, Azure OpenAI, etc.)
13896
+ * - Generic OpenAI-compatible APIs via custom base URL (Vercel AI Gateway, proxies, etc.)
13064
13897
  *
13065
13898
  * Configuration:
13066
13899
  * - OPENAI_API_KEY: API key for authentication (required)
@@ -13071,6 +13904,9 @@ function setOpenAIBaseUrl(baseUrl) {
13071
13904
  * - Direct OpenAI: "gpt-4o", "gpt-4-turbo", etc.
13072
13905
  * - Vercel AI Gateway: "openai/gpt-4o", "anthropic/claude-sonnet-4.5", etc.
13073
13906
  * - Other providers: Check their documentation
13907
+ *
13908
+ * Azure-specific endpoint routing lives in the dedicated `azure-openai`
13909
+ * provider so generic OpenAI-compatible endpoints keep predictable behavior.
13074
13910
  */
13075
13911
  function getOpenAIModel(model) {
13076
13912
  const defaultModel = process.env.OPENAI_MODEL || DEFAULT_OPENAI_MODEL;
@@ -16592,7 +17428,7 @@ function createAnthropic(options = {}) {
16592
17428
  var anthropic = createAnthropic();
16593
17429
 
16594
17430
  //#endregion
16595
- //#region ../mcp-core/dist/anthropic-provider-DKboDOaj.js
17431
+ //#region ../mcp-core/dist/anthropic-provider-ThWzRpbo.js
16596
17432
  const DEFAULT_ANTHROPIC_MODEL = "claude-sonnet-4-5";
16597
17433
  let configuredBaseUrl;
16598
17434
  /**
@@ -16620,7 +17456,7 @@ function getAnthropicModel(model) {
16620
17456
  }
16621
17457
 
16622
17458
  //#endregion
16623
- //#region ../mcp-core/dist/provider-factory-qe51AMLu.js
17459
+ //#region ../mcp-core/dist/provider-factory-CTzV6hDZ.js
16624
17460
  let configuredProvider;
16625
17461
  /**
16626
17462
  * Configure the embedded agent provider explicitly.
@@ -16633,8 +17469,9 @@ function setAgentProvider(provider) {
16633
17469
  * Configure base URLs for providers (called from CLI).
16634
17470
  */
16635
17471
  function setProviderBaseUrls(config) {
16636
- if (config.openaiBaseUrl) setOpenAIBaseUrl(config.openaiBaseUrl);
16637
- if (config.anthropicBaseUrl) setAnthropicBaseUrl(config.anthropicBaseUrl);
17472
+ setOpenAIBaseUrl(config.openaiBaseUrl);
17473
+ setAzureOpenAIBaseUrl(config.openaiBaseUrl);
17474
+ setAnthropicBaseUrl(config.anthropicBaseUrl);
16638
17475
  }
16639
17476
  /**
16640
17477
  * Check if both API keys are present, indicating a conflict.
@@ -16648,7 +17485,8 @@ function detectProviderConflict() {
16648
17485
  function hasApiKeyForProvider(type) {
16649
17486
  switch (type) {
16650
17487
  case "anthropic": return Boolean(process.env.ANTHROPIC_API_KEY);
16651
- case "openai": return Boolean(process.env.OPENAI_API_KEY);
17488
+ case "openai":
17489
+ case "azure-openai": return Boolean(process.env.OPENAI_API_KEY);
16652
17490
  }
16653
17491
  }
16654
17492
  /**
@@ -16657,7 +17495,8 @@ function hasApiKeyForProvider(type) {
16657
17495
  function getApiKeyName(type) {
16658
17496
  switch (type) {
16659
17497
  case "anthropic": return "ANTHROPIC_API_KEY";
16660
- case "openai": return "OPENAI_API_KEY";
17498
+ case "openai":
17499
+ case "azure-openai": return "OPENAI_API_KEY";
16661
17500
  }
16662
17501
  }
16663
17502
  /**
@@ -16667,17 +17506,31 @@ function buildProvider(type) {
16667
17506
  switch (type) {
16668
17507
  case "anthropic": return {
16669
17508
  type: "anthropic",
17509
+ label: "anthropic",
16670
17510
  getModel: getAnthropicModel,
16671
17511
  getProviderOptions: () => ({})
16672
17512
  };
16673
17513
  case "openai": return {
16674
17514
  type: "openai",
17515
+ label: "openai responses API",
16675
17516
  getModel: getOpenAIModel,
16676
17517
  getProviderOptions: () => ({ openai: {
16677
17518
  structuredOutputs: false,
16678
17519
  strictJsonSchema: false
16679
17520
  } })
16680
17521
  };
17522
+ case "azure-openai": {
17523
+ const apiSurface = getAzureOpenAIApiSurface();
17524
+ return {
17525
+ type: "azure-openai",
17526
+ label: `azure-openai ${apiSurface === "chat-completions" ? "chat completions" : "responses"} API`,
17527
+ getModel: getAzureOpenAIModel,
17528
+ getProviderOptions: () => ({ openai: {
17529
+ structuredOutputs: false,
17530
+ strictJsonSchema: false
17531
+ } })
17532
+ };
17533
+ }
16681
17534
  }
16682
17535
  }
16683
17536
  /**
@@ -16687,7 +17540,7 @@ function buildProvider(type) {
16687
17540
  function resolveProviderType() {
16688
17541
  if (configuredProvider) return configuredProvider;
16689
17542
  const envProvider = process.env.EMBEDDED_AGENT_PROVIDER?.toLowerCase();
16690
- if (envProvider === "openai" || envProvider === "anthropic") return envProvider;
17543
+ if (envProvider === "openai" || envProvider === "azure-openai" || envProvider === "anthropic") return envProvider;
16691
17544
  if (detectProviderConflict()) return void 0;
16692
17545
  if (process.env.ANTHROPIC_API_KEY) return "anthropic";
16693
17546
  if (process.env.OPENAI_API_KEY) return "openai";
@@ -16706,7 +17559,7 @@ function resolveProviderType() {
16706
17559
  function getAgentProvider() {
16707
17560
  const providerType = resolveProviderType();
16708
17561
  if (providerType && !hasApiKeyForProvider(providerType)) throw new ConfigurationError(`Provider "${providerType}" is configured but ${getApiKeyName(providerType)} is not set. Please set the API key environment variable.`);
16709
- if (!providerType && detectProviderConflict()) throw new ConfigurationError("Both ANTHROPIC_API_KEY and OPENAI_API_KEY are set. Please specify which provider to use by setting the EMBEDDED_AGENT_PROVIDER environment variable to 'openai' or 'anthropic'.");
17562
+ if (!providerType && detectProviderConflict()) throw new ConfigurationError("Both ANTHROPIC_API_KEY and OPENAI_API_KEY are set. Please specify which provider to use by setting the EMBEDDED_AGENT_PROVIDER environment variable to 'openai', 'azure-openai', or 'anthropic'.");
16710
17563
  if (!providerType) throw new ConfigurationError("No embedded agent provider configured. Set OPENAI_API_KEY or ANTHROPIC_API_KEY environment variable, or use --agent-provider flag to specify a provider.");
16711
17564
  return buildProvider(providerType);
16712
17565
  }
@@ -16727,8 +17580,11 @@ function hasAgentProvider() {
16727
17580
  * Returns undefined if no provider is available, API key is missing, or both API keys are present without explicit selection.
16728
17581
  */
16729
17582
  function getResolvedProviderType() {
16730
- const providerType = resolveProviderType();
16731
- return providerType && hasApiKeyForProvider(providerType) ? providerType : void 0;
17583
+ try {
17584
+ return getAgentProvider().type;
17585
+ } catch {
17586
+ return void 0;
17587
+ }
16732
17588
  }
16733
17589
 
16734
17590
  //#endregion
@@ -22103,7 +22959,7 @@ var _a19;
22103
22959
  _a19 = symbol19;
22104
22960
 
22105
22961
  //#endregion
22106
- //#region ../mcp-core/dist/callEmbeddedAgent-OjlsNjfN.js
22962
+ //#region ../mcp-core/dist/callEmbeddedAgent-CafFXCBs.js
22107
22963
  /**
22108
22964
  * Call an embedded agent with tool call capture
22109
22965
  * This is the standard way to call embedded AI agents within MCP tools
@@ -22254,7 +23110,7 @@ function rescueFromText(text$1, schema) {
22254
23110
  }
22255
23111
 
22256
23112
  //#endregion
22257
- //#region ../mcp-core/dist/utils-CzQHxOri.js
23113
+ //#region ../mcp-core/dist/utils-BJ0gOJGl.js
22258
23114
  /**
22259
23115
  * Standard response schema for all embedded agent tools.
22260
23116
  * Tools return either an error message or the result data, never both.
@@ -22361,7 +23217,7 @@ function agentTool(config) {
22361
23217
  }
22362
23218
 
22363
23219
  //#endregion
22364
- //#region ../mcp-core/dist/otel-semantics-ByiF2y64.js
23220
+ //#region ../mcp-core/dist/otel-semantics-B6fKuCUl.js
22365
23221
  var namespace$72 = "android";
22366
23222
  var description$72 = "The Android platform on which the Android application is running.\n";
22367
23223
  var attributes$72 = {
@@ -27207,7 +28063,7 @@ function createOtelLookupTool(options) {
27207
28063
  }
27208
28064
 
27209
28065
  //#endregion
27210
- //#region ../mcp-core/dist/whoami-wTxZKtZC.js
28066
+ //#region ../mcp-core/dist/whoami-LUGpoeMT.js
27211
28067
  /**
27212
28068
  * Get the current authenticated user's information from Sentry API
27213
28069
  */
@@ -27236,7 +28092,7 @@ function createWhoamiTool(options) {
27236
28092
  }
27237
28093
 
27238
28094
  //#endregion
27239
- //#region ../mcp-core/dist/utils-x09ynXqv.js
28095
+ //#region ../mcp-core/dist/utils-D2prWzmQ.js
27240
28096
  const DEFAULT_MAX_VALUE_LENGTH = 200;
27241
28097
  const DEFAULT_MAX_ARRAY_ITEMS = 20;
27242
28098
  function getStringValue(event, key, defaultValue = "") {
@@ -27246,9 +28102,6 @@ function getStringValue(event, key, defaultValue = "") {
27246
28102
  function isAggregateQuery(fields) {
27247
28103
  return fields.some((field) => field.includes("(") && field.includes(")"));
27248
28104
  }
27249
- function isPlainObject(value) {
27250
- return typeof value === "object" && value !== null && !Array.isArray(value);
27251
- }
27252
28105
  function isPrimitive(value) {
27253
28106
  return value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
27254
28107
  }
@@ -27260,20 +28113,38 @@ const USER_FIELDS = [
27260
28113
  "email",
27261
28114
  "username",
27262
28115
  "ip_address",
27263
- "name"
28116
+ "name",
28117
+ "display_name"
27264
28118
  ];
27265
28119
  const USER_IDENTITY_FIELDS = new Set([
27266
28120
  "email",
27267
28121
  "username",
27268
28122
  "ip_address",
27269
- "name"
28123
+ "name",
28124
+ "display_name"
27270
28125
  ]);
27271
- function formatUserSummary(value) {
27272
- const hasIdentityField = USER_FIELDS.some((f) => USER_IDENTITY_FIELDS.has(f) && value[f] != null);
27273
- if (!hasIdentityField) return null;
28126
+ function hasUserIdentityFields(value) {
28127
+ return USER_FIELDS.some((f) => USER_IDENTITY_FIELDS.has(f) && value[f] != null);
28128
+ }
28129
+ function hasUserSummaryFields(value, options = {}) {
28130
+ return hasUserIdentityFields(value) || options.allowId === true && value.id != null;
28131
+ }
28132
+ function formatUserSummary(value, options = {}) {
28133
+ const includeGeo = options.includeGeo ?? true;
28134
+ const allowIdOnly = options.allowIdOnly ?? false;
28135
+ const hasSummaryField = hasUserSummaryFields(value, { allowId: allowIdOnly });
28136
+ if (!hasSummaryField) return null;
27274
28137
  const parts = USER_FIELDS.filter((f) => value[f] != null).map((f) => `${f}=${formatSimpleValue(value[f])}`);
28138
+ const geoSummary = formatUserGeoSummary(value.geo);
28139
+ if (includeGeo && geoSummary) parts.push(`geo=${geoSummary}`);
27275
28140
  return parts.length > 0 ? parts.join(", ") : null;
27276
28141
  }
28142
+ function formatKnownUserValue(value, options = {}) {
28143
+ return formatUserSummary(value, {
28144
+ includeGeo: options.includeGeo,
28145
+ allowIdOnly: true
28146
+ });
28147
+ }
27277
28148
  function sanitizeWhitespace(value) {
27278
28149
  return value.replace(/\s+/g, " ").trim();
27279
28150
  }
@@ -27375,7 +28246,7 @@ function createDatasetAttributesTool(options) {
27375
28246
  "logs"
27376
28247
  ]).describe("The dataset to query attributes for") }),
27377
28248
  execute: async ({ dataset }) => {
27378
- const { BASE_COMMON_FIELDS, DATASET_FIELDS, RECOMMENDED_FIELDS: RECOMMENDED_FIELDS$2, NUMERIC_FIELDS, DATASET_EXAMPLES } = await import("./config--FiEKpQR.js");
28249
+ const { BASE_COMMON_FIELDS, DATASET_FIELDS, RECOMMENDED_FIELDS: RECOMMENDED_FIELDS$2, NUMERIC_FIELDS, DATASET_EXAMPLES } = await import("./config-UqbHNH-n.js");
27379
28250
  const { attributes: customAttributes, fieldTypes } = await fetchCustomAttributes(apiService, organizationSlug, dataset, projectId);
27380
28251
  const allFields = {
27381
28252
  ...BASE_COMMON_FIELDS,
@@ -27410,7 +28281,7 @@ Use these examples as patterns for constructing your query.`;
27410
28281
  }
27411
28282
 
27412
28283
  //#endregion
27413
- //#region ../mcp-core/dist/agent-wsx2QONb.js
28284
+ //#region ../mcp-core/dist/agent-4NHLFRHJ.js
27414
28285
  const searchEventsAgentOutputSchema = z.object({
27415
28286
  dataset: z.enum([
27416
28287
  "spans",
@@ -27463,13 +28334,23 @@ async function searchEventsAgent(options) {
27463
28334
  }
27464
28335
 
27465
28336
  //#endregion
27466
- //#region ../mcp-core/dist/formatters-BNBcNMHO.js
28337
+ //#region ../mcp-core/dist/formatters-CiXu948b.js
27467
28338
  /**
27468
28339
  * Format an explanation for how a natural language query was translated
27469
28340
  */
27470
28341
  function formatExplanation$1(explanation) {
27471
28342
  return `## How I interpreted your query\n\n${explanation}`;
27472
28343
  }
28344
+ function formatUserFieldLines(value, options = {}) {
28345
+ const prefix = options.prefix ?? "";
28346
+ const geoSummary = formatUserGeoSummary(value.geo);
28347
+ const userSummary = formatKnownUserValue(value, { includeGeo: false });
28348
+ const lines = [];
28349
+ if (userSummary) lines.push(`${prefix}**user**: ${userSummary}`);
28350
+ else if (!geoSummary) lines.push(`${prefix}**user**: ${formatEventValue(value)}`);
28351
+ if (geoSummary) lines.push(`${prefix}**user.geo**: ${geoSummary}`);
28352
+ return lines;
28353
+ }
27473
28354
  /**
27474
28355
  * Format error event results for display
27475
28356
  */
@@ -27525,7 +28406,13 @@ function formatErrorResults(params) {
27525
28406
  else output += `**${field}**: ${formatEventValue(value)}\n`;
27526
28407
  }
27527
28408
  const displayedFields = new Set([...priorityFields, "id"]);
27528
- for (const [key, value] of Object.entries(event)) if (!displayedFields.has(key) && value !== null && value !== void 0) output += `**${key}**: ${formatEventValue(value)}\n`;
28409
+ for (const [key, value] of Object.entries(event)) if (!displayedFields.has(key) && value !== null && value !== void 0) {
28410
+ if (key === "user" && typeof value === "object" && value !== null) {
28411
+ for (const line of formatUserFieldLines(value)) output += `${line}\n`;
28412
+ continue;
28413
+ }
28414
+ output += `**${key}**: ${formatEventValue(value)}\n`;
28415
+ }
27529
28416
  output += "\n";
27530
28417
  }
27531
28418
  }
@@ -27606,7 +28493,13 @@ function formatLogResults(params) {
27606
28493
  } else output += `- **${field}**: ${formatEventValue(value)}\n`;
27607
28494
  }
27608
28495
  const displayedFields = new Set([...priorityFields, "id"]);
27609
- for (const [key, value] of Object.entries(event)) if (!displayedFields.has(key) && value !== null && value !== void 0) output += `- **${key}**: ${formatEventValue(value)}\n`;
28496
+ for (const [key, value] of Object.entries(event)) if (!displayedFields.has(key) && value !== null && value !== void 0) {
28497
+ if (key === "user" && typeof value === "object" && value !== null) {
28498
+ for (const line of formatUserFieldLines(value, { prefix: "- " })) output += `${line}\n`;
28499
+ continue;
28500
+ }
28501
+ output += `- **${key}**: ${formatEventValue(value)}\n`;
28502
+ }
27610
28503
  output += "\n";
27611
28504
  }
27612
28505
  }
@@ -27670,7 +28563,13 @@ function formatSpanResults(params) {
27670
28563
  else output += `**${field}**: ${formatEventValue(value)}\n`;
27671
28564
  }
27672
28565
  const displayedFields = new Set([...priorityFields, "id"]);
27673
- for (const [key, value] of Object.entries(event)) if (!displayedFields.has(key) && value !== null && value !== void 0) output += `**${key}**: ${formatEventValue(value)}\n`;
28566
+ for (const [key, value] of Object.entries(event)) if (!displayedFields.has(key) && value !== null && value !== void 0) {
28567
+ if (key === "user" && typeof value === "object" && value !== null) {
28568
+ for (const line of formatUserFieldLines(value)) output += `${line}\n`;
28569
+ continue;
28570
+ }
28571
+ output += `**${key}**: ${formatEventValue(value)}\n`;
28572
+ }
27674
28573
  output += "\n";
27675
28574
  }
27676
28575
  }
@@ -27682,7 +28581,7 @@ function formatSpanResults(params) {
27682
28581
  }
27683
28582
 
27684
28583
  //#endregion
27685
- //#region ../mcp-core/dist/handler-DNnyzfbW.js
28584
+ //#region ../mcp-core/dist/handler-D_U0I33Y.js
27686
28585
  var handler_default = defineTool({
27687
28586
  name: "search_events",
27688
28587
  skills: [
@@ -27823,7 +28722,7 @@ var handler_default = defineTool({
27823
28722
  });
27824
28723
 
27825
28724
  //#endregion
27826
- //#region ../mcp-core/dist/create-team-CIgYB9Qa.js
28725
+ //#region ../mcp-core/dist/create-team-ffsb-XSI.js
27827
28726
  var create_team_default = defineTool({
27828
28727
  name: "create_team",
27829
28728
  skills: ["project-management"],
@@ -27878,7 +28777,7 @@ var create_team_default = defineTool({
27878
28777
  });
27879
28778
 
27880
28779
  //#endregion
27881
- //#region ../mcp-core/dist/create-project-B-ud4_Gj.js
28780
+ //#region ../mcp-core/dist/create-project-B2VvJ14B.js
27882
28781
  var create_project_default = defineTool({
27883
28782
  name: "create_project",
27884
28783
  skills: ["project-management"],
@@ -27955,7 +28854,7 @@ var create_project_default = defineTool({
27955
28854
  });
27956
28855
 
27957
28856
  //#endregion
27958
- //#region ../mcp-core/dist/update-project-DTNa3ZSG.js
28857
+ //#region ../mcp-core/dist/update-project-1XC16fxk.js
27959
28858
  var update_project_default = defineTool({
27960
28859
  name: "update_project",
27961
28860
  skills: ["project-management"],
@@ -28073,7 +28972,7 @@ var update_project_default = defineTool({
28073
28972
  });
28074
28973
 
28075
28974
  //#endregion
28076
- //#region ../mcp-core/dist/create-dsn-BMy0VEvv.js
28975
+ //#region ../mcp-core/dist/create-dsn-CHweFOtw.js
28077
28976
  var create_dsn_default = defineTool({
28078
28977
  name: "create_dsn",
28079
28978
  skills: ["project-management"],
@@ -28133,7 +29032,7 @@ var create_dsn_default = defineTool({
28133
29032
  });
28134
29033
 
28135
29034
  //#endregion
28136
- //#region ../mcp-core/dist/find-dsns-BNs_f7T4.js
29035
+ //#region ../mcp-core/dist/find-dsns-Bed9HEVp.js
28137
29036
  var find_dsns_default = defineTool({
28138
29037
  name: "find_dsns",
28139
29038
  skills: ["project-management"],
@@ -28184,7 +29083,7 @@ var find_dsns_default = defineTool({
28184
29083
  });
28185
29084
 
28186
29085
  //#endregion
28187
- //#region ../mcp-core/dist/fetch-utils-LjUGSOvJ.js
29086
+ //#region ../mcp-core/dist/fetch-utils-BFE0P13H.js
28188
29087
  /**
28189
29088
  * Fetch with timeout using AbortController
28190
29089
  * @param url - The URL to fetch
@@ -28234,7 +29133,7 @@ async function retryWithBackoff(fn, { maxRetries = 3, initialDelay = 1e3, should
28234
29133
  }
28235
29134
 
28236
29135
  //#endregion
28237
- //#region ../mcp-core/dist/analyze-issue-with-seer-B9kgNzVB.js
29136
+ //#region ../mcp-core/dist/analyze-issue-with-seer-Dm-MPYES.js
28238
29137
  var analyze_issue_with_seer_default = defineTool({
28239
29138
  name: "analyze_issue_with_seer",
28240
29139
  skills: ["seer"],
@@ -28422,7 +29321,7 @@ var analyze_issue_with_seer_default = defineTool({
28422
29321
  });
28423
29322
 
28424
29323
  //#endregion
28425
- //#region ../mcp-core/dist/search-docs-BSAFG7hT.js
29324
+ //#region ../mcp-core/dist/search-docs-BZ-uFOdh.js
28426
29325
  var search_docs_default = defineTool({
28427
29326
  name: "search_docs",
28428
29327
  skills: ["docs"],
@@ -28505,7 +29404,7 @@ var search_docs_default = defineTool({
28505
29404
  });
28506
29405
 
28507
29406
  //#endregion
28508
- //#region ../mcp-core/dist/get-doc-B-dMSM8_.js
29407
+ //#region ../mcp-core/dist/get-doc-DybqY2qB.js
28509
29408
  var get_doc_default = defineTool({
28510
29409
  name: "get_doc",
28511
29410
  skills: ["docs"],
@@ -28582,7 +29481,7 @@ var get_doc_default = defineTool({
28582
29481
  });
28583
29482
 
28584
29483
  //#endregion
28585
- //#region ../mcp-core/dist/dataset-fields-33xy_jvb.js
29484
+ //#region ../mcp-core/dist/dataset-fields-CGkReqkR.js
28586
29485
  /**
28587
29486
  * Discover available fields for a dataset by querying Sentry's tags API
28588
29487
  */
@@ -28732,7 +29631,7 @@ function getCommonPatterns(dataset) {
28732
29631
  }
28733
29632
 
28734
29633
  //#endregion
28735
- //#region ../mcp-core/dist/config-DUCtK3n7.js
29634
+ //#region ../mcp-core/dist/config-CL2ib45U.js
28736
29635
  /**
28737
29636
  * Configuration for the search-issues agent
28738
29637
  */
@@ -28824,7 +29723,7 @@ Always use the issueFields tool to discover available fields when needed.
28824
29723
  Use the whoami tool when you need to resolve 'me' references.`;
28825
29724
 
28826
29725
  //#endregion
28827
- //#region ../mcp-core/dist/agent-BveVnjqw.js
29726
+ //#region ../mcp-core/dist/agent-BhpZL6Iz.js
28828
29727
  const searchIssuesAgentOutputSchema = z.object({
28829
29728
  query: z.string().describe("The Sentry issue search query"),
28830
29729
  sort: z.enum([
@@ -28857,7 +29756,7 @@ async function searchIssuesAgent(options) {
28857
29756
  }
28858
29757
 
28859
29758
  //#endregion
28860
- //#region ../mcp-core/dist/formatters-CgnSVeQb.js
29759
+ //#region ../mcp-core/dist/formatters-CfxrALIQ.js
28861
29760
  /**
28862
29761
  * Format an explanation for how a natural language query was translated
28863
29762
  */
@@ -28942,7 +29841,7 @@ function formatDate(dateString) {
28942
29841
  }
28943
29842
 
28944
29843
  //#endregion
28945
- //#region ../mcp-core/dist/handler-CzB1ic7R.js
29844
+ //#region ../mcp-core/dist/handler-zYxvmdYX.js
28946
29845
  var handler_default$1 = defineTool({
28947
29846
  name: "search_issues",
28948
29847
  skills: [
@@ -29065,7 +29964,7 @@ var handler_default$1 = defineTool({
29065
29964
  });
29066
29965
 
29067
29966
  //#endregion
29068
- //#region ../mcp-core/dist/config-mlP4H0sA.js
29967
+ //#region ../mcp-core/dist/config-A7NGLEjd.js
29069
29968
  const systemPrompt$2 = `You are a Sentry issue event filter translator. Your job is to:
29070
29969
  1. Translate natural language queries into Sentry tag filters for events within a SPECIFIC issue
29071
29970
  2. Select appropriate fields to return in the results
@@ -29400,7 +30299,7 @@ const EXAMPLE_QUERIES = [
29400
30299
  ];
29401
30300
 
29402
30301
  //#endregion
29403
- //#region ../mcp-core/dist/utils-b4MMh_Zk.js
30302
+ //#region ../mcp-core/dist/utils-BrIMdG-f.js
29404
30303
  /**
29405
30304
  * Create a tool for the agent to query available tags and fields for issue events
29406
30305
  * The tool is pre-bound with the API service and organization configured for the appropriate region
@@ -29477,7 +30376,7 @@ Received: ${params.issueUrl}`);
29477
30376
  }
29478
30377
 
29479
30378
  //#endregion
29480
- //#region ../mcp-core/dist/agent-CsDcSXOE.js
30379
+ //#region ../mcp-core/dist/agent-BPV2Ep4z.js
29481
30380
  const searchIssueEventsAgentOutputSchema = z.object({
29482
30381
  query: z.string().describe("Sentry query filters for tags/fields (NOT including issue: prefix - handler adds that)"),
29483
30382
  fields: z.array(z.string()).describe("Array of field names to return in results"),
@@ -29519,7 +30418,7 @@ async function searchIssueEventsAgent(options) {
29519
30418
  }
29520
30419
 
29521
30420
  //#endregion
29522
- //#region ../mcp-core/dist/handler-BVjqQBxm.js
30421
+ //#region ../mcp-core/dist/handler-DBc1nTD9.js
29523
30422
  var handler_default$2 = defineTool({
29524
30423
  name: "search_issue_events",
29525
30424
  skills: ["inspect", "triage"],
@@ -29621,7 +30520,7 @@ var handler_default$2 = defineTool({
29621
30520
  });
29622
30521
 
29623
30522
  //#endregion
29624
- //#region ../mcp-core/dist/config-BJzhfINu.js
30523
+ //#region ../mcp-core/dist/config-BTux0Mwm.js
29625
30524
  /**
29626
30525
  * Configuration for the use_sentry embedded agent.
29627
30526
  *
@@ -29640,7 +30539,7 @@ The user may include various parameters to pass to those tools in their prompt.
29640
30539
  You MUST return tool results directly without interpreting them.`;
29641
30540
 
29642
30541
  //#endregion
29643
- //#region ../mcp-core/dist/agent-BAhhoVHO.js
30542
+ //#region ../mcp-core/dist/agent-Cv4_4vN0.js
29644
30543
  /**
29645
30544
  * Output schema for the embedded agent.
29646
30545
  * The agent returns the final result string directly from its tool calls.
@@ -29661,7 +30560,7 @@ async function useSentryAgent(options) {
29661
30560
  }
29662
30561
 
29663
30562
  //#endregion
29664
- //#region ../mcp-core/dist/types-bWxCxxir.js
30563
+ //#region ../mcp-core/dist/types-BuGvc9q3.js
29665
30564
  /**
29666
30565
  * Resolves a tool description to a string.
29667
30566
  * Handles both static strings and dynamic description functions.
@@ -29683,7 +30582,7 @@ function isToolVisibleInMode(tool$1, experimentalMode) {
29683
30582
  }
29684
30583
 
29685
30584
  //#endregion
29686
- //#region ../mcp-core/dist/list-issues-BNpP7kp_.js
30585
+ //#region ../mcp-core/dist/list-issues-BRBWYo9f.js
29687
30586
  var list_issues_default = defineTool({
29688
30587
  name: "list_issues",
29689
30588
  skills: [
@@ -29766,7 +30665,7 @@ var list_issues_default = defineTool({
29766
30665
  });
29767
30666
 
29768
30667
  //#endregion
29769
- //#region ../mcp-core/dist/list-events-Bb6MjTx5.js
30668
+ //#region ../mcp-core/dist/list-events-DV_Gcoys.js
29770
30669
  const DEFAULT_FIELDS = {
29771
30670
  errors: RECOMMENDED_FIELDS.errors.basic,
29772
30671
  logs: RECOMMENDED_FIELDS.logs.basic,
@@ -29888,7 +30787,7 @@ var list_events_default = defineTool({
29888
30787
  });
29889
30788
 
29890
30789
  //#endregion
29891
- //#region ../mcp-core/dist/list-issue-events-BsxAzkCh.js
30790
+ //#region ../mcp-core/dist/list-issue-events-BJUU5dDl.js
29892
30791
  var list_issue_events_default = defineTool({
29893
30792
  name: "list_issue_events",
29894
30793
  skills: ["inspect", "triage"],
@@ -29972,7 +30871,7 @@ var list_issue_events_default = defineTool({
29972
30871
  });
29973
30872
 
29974
30873
  //#endregion
29975
- //#region ../mcp-core/dist/analyzer-DtlTbDTS.js
30874
+ //#region ../mcp-core/dist/analyzer-C9y4AiMa.js
29976
30875
  /**
29977
30876
  * Analyzes flamegraph data to extract hot paths (most CPU-intensive call stacks).
29978
30877
  *
@@ -30231,7 +31130,7 @@ function hasProfileData(flamegraph) {
30231
31130
  }
30232
31131
 
30233
31132
  //#endregion
30234
- //#region ../mcp-core/dist/formatter-C6FOnwJc.js
31133
+ //#region ../mcp-core/dist/formatter-CNWrD7yi.js
30235
31134
  /**
30236
31135
  * Maps a change type to its corresponding status icon.
30237
31136
  */
@@ -30280,11 +31179,15 @@ function formatFlamegraphAnalysis(flamegraph, options) {
30280
31179
  sections.push(formatActionableSteps(hotPaths, options));
30281
31180
  return sections.join("\n\n");
30282
31181
  }
31182
+ function getFlamegraphProfileCount(flamegraph) {
31183
+ return flamegraph.shared.profiles.length || flamegraph.profiles.length;
31184
+ }
30283
31185
  /**
30284
31186
  * Formats transaction information section.
30285
31187
  */
30286
31188
  function formatTransactionInfo(flamegraph) {
30287
31189
  const profile = flamegraph.profiles[0];
31190
+ const profileCount = getFlamegraphProfileCount(flamegraph);
30288
31191
  const totalSamples = profile?.sample_counts.reduce((a, b) => a + b, 0) || 0;
30289
31192
  const totalDuration = profile?.sample_durations_ns.reduce((a, b) => a + b, 0) || 0;
30290
31193
  return [
@@ -30294,7 +31197,7 @@ function formatTransactionInfo(flamegraph) {
30294
31197
  `- **Transaction**: ${flamegraph.transactionName || "Unknown"}`,
30295
31198
  `- **Project ID**: ${flamegraph.projectID}`,
30296
31199
  `- **Platform**: ${flamegraph.platform || "Unknown"}`,
30297
- `- **Total Profiles**: ${flamegraph.shared.profiles.length}`,
31200
+ `- **Total Profiles**: ${profileCount}`,
30298
31201
  `- **Total Samples**: ${totalSamples.toLocaleString()}`,
30299
31202
  `- **Estimated Total Time**: ${formatDuration(totalDuration)}`
30300
31203
  ].join("\n");
@@ -30339,11 +31242,12 @@ function formatPerformanceSummary(flamegraph, options) {
30339
31242
  function formatHotPaths(hotPaths, flamegraph, options) {
30340
31243
  if (hotPaths.length === 0) return "## Hot Paths\n\nNo significant hot paths found.";
30341
31244
  const sections = ["## Top Hot Paths", ""];
31245
+ const profileCount = getFlamegraphProfileCount(flamegraph);
30342
31246
  hotPaths.forEach((path, idx) => {
30343
31247
  if (idx > 0) sections.push("---", "");
30344
31248
  sections.push(`### Path #${idx + 1}: ${formatPercentage(path.percentOfTotal)} of execution time`);
30345
31249
  sections.push("");
30346
- sections.push(`**${path.sampleCount.toLocaleString()} samples** across ${flamegraph.shared.profiles.length} profiles`);
31250
+ sections.push(`**${path.sampleCount.toLocaleString()} samples** across ${profileCount} profiles`);
30347
31251
  sections.push("");
30348
31252
  const framesToShow = options.focusOnUserCode ? path.userCodeFrames : path.callStack;
30349
31253
  if (framesToShow.length > 0) {
@@ -30505,7 +31409,7 @@ function formatProfileChunkAnalysis(chunk, options) {
30505
31409
  }
30506
31410
 
30507
31411
  //#endregion
30508
- //#region ../mcp-core/dist/get-profile-details-C1Lo7ikm.js
31412
+ //#region ../mcp-core/dist/get-profile-details-37grNlzY.js
30509
31413
  var get_profile_details_default = defineTool({
30510
31414
  name: "get_profile_details",
30511
31415
  skills: ["inspect"],
@@ -30590,219 +31494,7 @@ var get_profile_details_default = defineTool({
30590
31494
  });
30591
31495
 
30592
31496
  //#endregion
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
31497
+ //#region ../mcp-core/dist/breadcrumbs-BFIJah2q.js
30806
31498
  /**
30807
31499
  * Fetches breadcrumbs from the latest event for an issue and formats them.
30808
31500
  */
@@ -30864,7 +31556,7 @@ function cleanAndTruncate(str, maxLen) {
30864
31556
  }
30865
31557
 
30866
31558
  //#endregion
30867
- //#region ../mcp-core/dist/get-profile-CZ7avA74.js
31559
+ //#region ../mcp-core/dist/get-profile-V33H4N5o.js
30868
31560
  /**
30869
31561
  * Resolves profile parameters from URL or explicit params.
30870
31562
  * URL takes precedence if provided and valid.
@@ -31073,13 +31765,14 @@ var get_profile_default = defineTool({
31073
31765
  });
31074
31766
 
31075
31767
  //#endregion
31076
- //#region ../mcp-core/dist/get-sentry-resource-Duc5U8N-.js
31768
+ //#region ../mcp-core/dist/get-sentry-resource-B-80mk-4.js
31077
31769
  /** Types with full API integration. */
31078
31770
  const FULLY_SUPPORTED_TYPES = [
31079
31771
  "issue",
31080
31772
  "event",
31081
31773
  "trace",
31082
- "breadcrumbs"
31774
+ "breadcrumbs",
31775
+ "replay"
31083
31776
  ];
31084
31777
  function resolveResourceParams(params) {
31085
31778
  if (params.url) {
@@ -31114,6 +31807,11 @@ function resolveResourceParams(params) {
31114
31807
  organizationSlug,
31115
31808
  issueId: resourceId.toUpperCase()
31116
31809
  };
31810
+ case "replay": return {
31811
+ type: "replay",
31812
+ organizationSlug,
31813
+ replayId: resourceId
31814
+ };
31117
31815
  }
31118
31816
  }
31119
31817
  /**
@@ -31194,21 +31892,6 @@ function resolveFromParsedUrl(parsed, params) {
31194
31892
  function generateUnsupportedResourceMessage(resolved) {
31195
31893
  const { type, organizationSlug } = resolved;
31196
31894
  switch (type) {
31197
- case "replay": {
31198
- const replayUrl = `https://${organizationSlug}.sentry.io/replays/${resolved.replayId}/`;
31199
- return [
31200
- "# Replay Detected",
31201
- "",
31202
- `**Organization**: ${organizationSlug}`,
31203
- `**Replay ID**: ${resolved.replayId}`,
31204
- "",
31205
- "Session replay support is coming soon. In the meantime:",
31206
- "",
31207
- `- **View in Sentry**: [Open Replay](${replayUrl})`,
31208
- "- **Find related issues**: Use `search_issues` with the replay's time range",
31209
- `- **Search events**: Use \`search_events\` with query \`replay_id:${resolved.replayId}\` to find events associated with this replay`
31210
- ].join("\n");
31211
- }
31212
31895
  case "monitor": {
31213
31896
  const monitorPath = resolved.projectSlug ? `${resolved.projectSlug}/${resolved.monitorSlug}` : resolved.monitorSlug;
31214
31897
  const monitorUrl = `https://${organizationSlug}.sentry.io/crons/${monitorPath}/`;
@@ -31271,7 +31954,8 @@ var get_sentry_resource_default = defineTool({
31271
31954
  "issue",
31272
31955
  "event",
31273
31956
  "trace",
31274
- "breadcrumbs"
31957
+ "breadcrumbs",
31958
+ "replay"
31275
31959
  ]).optional().describe("Resource type. With a URL, overrides the auto-detected type (e.g., 'breadcrumbs' on an issue URL)."),
31276
31960
  resourceId: z.string().trim().optional().describe("Resource identifier: issue shortId (e.g., 'PROJECT-123'), event ID, or trace ID. Required when not using a URL."),
31277
31961
  organizationSlug: ParamOrganizationSlug.optional()
@@ -31289,7 +31973,7 @@ var get_sentry_resource_default = defineTool({
31289
31973
  });
31290
31974
  setTag("resource.type", resolved.type);
31291
31975
  setTag("organization.slug", resolved.organizationSlug);
31292
- if (resolved.type === "replay" || resolved.type === "monitor" || resolved.type === "release") return generateUnsupportedResourceMessage(resolved);
31976
+ if (resolved.type === "monitor" || resolved.type === "release") return generateUnsupportedResourceMessage(resolved);
31293
31977
  switch (resolved.type) {
31294
31978
  case "issue": return get_issue_details_default.handler({
31295
31979
  organizationSlug: resolved.organizationSlug,
@@ -31319,6 +32003,11 @@ var get_sentry_resource_default = defineTool({
31319
32003
  throw error;
31320
32004
  }
31321
32005
  }
32006
+ case "replay": return get_replay_details_default.handler({
32007
+ replayUrl: params.url,
32008
+ organizationSlug: resolved.organizationSlug,
32009
+ replayId: resolved.replayId
32010
+ }, context$1);
31322
32011
  case "profile": return get_profile_default.handler({
31323
32012
  organizationSlug: resolved.organizationSlug,
31324
32013
  projectSlugOrId: resolved.projectSlug,
@@ -31337,7 +32026,7 @@ var get_sentry_resource_default = defineTool({
31337
32026
  });
31338
32027
 
31339
32028
  //#endregion
31340
- //#region ../mcp-core/dist/error-handling-C2zknUda.js
32029
+ //#region ../mcp-core/dist/error-handling-BKuqJ6YS.js
31341
32030
  /**
31342
32031
  * Type guard to identify user input validation errors.
31343
32032
  */
@@ -31495,7 +32184,7 @@ async function formatErrorForUser(error, options) {
31495
32184
  }
31496
32185
 
31497
32186
  //#endregion
31498
- //#region ../mcp-core/dist/constraint-helpers-C2JDBPW9.js
32187
+ //#region ../mcp-core/dist/constraint-helpers-DwbuhHth.js
31499
32188
  /**
31500
32189
  * Determines which tool parameter keys should be filtered out of the schema
31501
32190
  * because they will be injected from constraints.
@@ -33171,7 +33860,7 @@ var DefaultMCPClient = class {
33171
33860
  };
33172
33861
 
33173
33862
  //#endregion
33174
- //#region ../mcp-core/dist/server-C17cuymn.js
33863
+ //#region ../mcp-core/dist/server-D0-2RtQT.js
33175
33864
  /**
33176
33865
  * Format tool calls into a readable trace
33177
33866
  */
@@ -33291,6 +33980,7 @@ var tools_default = {
33291
33980
  get_issue_details: get_issue_details_default,
33292
33981
  get_issue_tag_values: get_issue_tag_values_default,
33293
33982
  get_trace_details: get_trace_details_default,
33983
+ get_replay_details: get_replay_details_default,
33294
33984
  get_event_attachment: get_event_attachment_default,
33295
33985
  update_issue: update_issue_default,
33296
33986
  search_events: handler_default,
@@ -33471,7 +34161,7 @@ function configureServer({ server, context: context$1, agentMode = false, experi
33471
34161
  }
33472
34162
 
33473
34163
  //#endregion
33474
- //#region ../mcp-core/dist/sentry-KBnLkfrV.js
34164
+ //#region ../mcp-core/dist/sentry-DtgK-Kwi.js
33475
34165
  const SCRUB_PATTERNS = [
33476
34166
  {
33477
34167
  pattern: /\bsk-[a-zA-Z0-9]{48}\b/g,
@@ -33637,9 +34327,9 @@ async function main() {
33637
34327
  if (!configured) return { mismatch: false };
33638
34328
  const hasAnthropic = Boolean(process.env.ANTHROPIC_API_KEY);
33639
34329
  const hasOpenAI = Boolean(process.env.OPENAI_API_KEY);
33640
- if (configured === "openai" && !hasOpenAI && hasAnthropic) return {
34330
+ if ((configured === "openai" || configured === "azure-openai") && !hasOpenAI && hasAnthropic) return {
33641
34331
  mismatch: true,
33642
- configured: "openai",
34332
+ configured,
33643
34333
  availableKey: "ANTHROPIC_API_KEY"
33644
34334
  };
33645
34335
  if (configured === "anthropic" && !hasAnthropic && hasOpenAI) return {
@@ -33657,12 +34347,18 @@ async function main() {
33657
34347
  const resolvedProvider = getResolvedProviderType();
33658
34348
  if (!resolvedProvider) {
33659
34349
  const mismatchInfo = hasProviderMismatch();
34350
+ let providerConfigError;
34351
+ try {
34352
+ getAgentProvider();
34353
+ } catch (error) {
34354
+ providerConfigError = error instanceof Error ? error.message : String(error);
34355
+ }
33660
34356
  if (hasProviderConflict()) {
33661
34357
  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.");
34358
+ console.warn("Please set EMBEDDED_AGENT_PROVIDER='openai', 'azure-openai', or 'anthropic' to specify which provider to use.");
33663
34359
  console.warn("AI-powered search tools will be unavailable until a provider is selected.");
33664
34360
  } else if (mismatchInfo.mismatch) {
33665
- const expectedKey = mismatchInfo.configured === "openai" ? "OPENAI_API_KEY" : "ANTHROPIC_API_KEY";
34361
+ const expectedKey = mismatchInfo.configured === "openai" || mismatchInfo.configured === "azure-openai" ? "OPENAI_API_KEY" : "ANTHROPIC_API_KEY";
33666
34362
  const configuredViaCliFlag = Boolean(cli.agentProvider);
33667
34363
  const providerSetting = configuredViaCliFlag ? `--agent-provider=${mismatchInfo.configured}` : `EMBEDDED_AGENT_PROVIDER='${mismatchInfo.configured}'`;
33668
34364
  const changeProviderHint = configuredViaCliFlag ? "Change --agent-provider to match your available API key" : "Change EMBEDDED_AGENT_PROVIDER to match your available API key";
@@ -33671,6 +34367,9 @@ async function main() {
33671
34367
  console.warn(` - Set ${expectedKey} to use the ${mismatchInfo.configured} provider, or`);
33672
34368
  console.warn(` - ${changeProviderHint}`);
33673
34369
  console.warn("AI-powered search tools will be unavailable until this is resolved.");
34370
+ } else if (providerConfigError && !providerConfigError.startsWith("No embedded agent provider configured")) {
34371
+ console.warn(`Warning: ${providerConfigError}`);
34372
+ console.warn("AI-powered search tools will be unavailable until this is resolved.");
33674
34373
  } else {
33675
34374
  console.warn("Warning: No LLM API key found (OPENAI_API_KEY or ANTHROPIC_API_KEY).");
33676
34375
  console.warn("The following AI-powered search tools will be unavailable:");
@@ -33680,7 +34379,8 @@ async function main() {
33680
34379
  console.warn("");
33681
34380
  } else {
33682
34381
  const providerSource = getProviderSource();
33683
- console.warn(`Using ${resolvedProvider} for AI-powered search tools (${providerSource}).`);
34382
+ const providerLabel = getAgentProvider().label;
34383
+ console.warn(`Using ${providerLabel} for AI-powered search tools (${providerSource}).`);
33684
34384
  if (providerSource === "auto-detected") {
33685
34385
  console.warn("Deprecation warning: Auto-detection of LLM provider is deprecated.");
33686
34386
  console.warn(`Please set EMBEDDED_AGENT_PROVIDER='${resolvedProvider}' explicitly.`);