@sentry/mcp-server 0.4.0 → 0.6.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 (161) hide show
  1. package/dist/api-client/client.cjs +2 -2
  2. package/dist/api-client/client.d.cts +3 -3
  3. package/dist/api-client/client.d.ts +3 -3
  4. package/dist/api-client/client.js +2 -2
  5. package/dist/api-client/client.test.cjs +2 -2
  6. package/dist/api-client/client.test.js +2 -2
  7. package/dist/api-client/index.cjs +6 -3
  8. package/dist/api-client/index.d.cts +4 -4
  9. package/dist/api-client/index.d.ts +4 -4
  10. package/dist/api-client/index.js +3 -3
  11. package/dist/api-client/schema.cjs +5 -2
  12. package/dist/api-client/schema.d.cts +2 -2
  13. package/dist/api-client/schema.d.ts +2 -2
  14. package/dist/api-client/schema.js +2 -2
  15. package/dist/api-client/types.d.cts +2 -2
  16. package/dist/api-client/types.d.ts +2 -2
  17. package/dist/{client-C_XfRSu3.cjs → client-DQF6UreY.cjs} +41 -38
  18. package/dist/client-DQF6UreY.cjs.map +1 -0
  19. package/dist/{client-BKLE5Lkt.js → client-vqrS5E_N.js} +41 -38
  20. package/dist/client-vqrS5E_N.js.map +1 -0
  21. package/dist/{client.d-BizHDVuq.d.cts → client.d-JulFjrUM.d.cts} +25 -23
  22. package/dist/client.d-JulFjrUM.d.cts.map +1 -0
  23. package/dist/{client.d-CrWOcVIU.d.ts → client.d-eUhyVsN_.d.ts} +27 -25
  24. package/dist/client.d-eUhyVsN_.d.ts.map +1 -0
  25. package/dist/index.cjs +13 -13
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.js +13 -13
  28. package/dist/index.js.map +1 -1
  29. package/dist/internal/formatting.d.cts +3 -3
  30. package/dist/internal/formatting.d.ts +3 -3
  31. package/dist/internal/issue-helpers.cjs +4 -2
  32. package/dist/internal/issue-helpers.d.cts +30 -1
  33. package/dist/internal/issue-helpers.d.cts.map +1 -1
  34. package/dist/internal/issue-helpers.d.ts +30 -1
  35. package/dist/internal/issue-helpers.d.ts.map +1 -1
  36. package/dist/internal/issue-helpers.js +2 -2
  37. package/dist/internal/issue-helpers.test.cjs +41 -1
  38. package/dist/internal/issue-helpers.test.cjs.map +1 -1
  39. package/dist/internal/issue-helpers.test.js +41 -1
  40. package/dist/internal/issue-helpers.test.js.map +1 -1
  41. package/dist/issue-helpers-CdWMhVWJ.cjs +87 -0
  42. package/dist/issue-helpers-CdWMhVWJ.cjs.map +1 -0
  43. package/dist/{issue-helpers-C0kEdXOE.cjs → issue-helpers-Cx6bFCUv.js} +38 -9
  44. package/dist/issue-helpers-Cx6bFCUv.js.map +1 -0
  45. package/dist/{promptDefinitions-CaRMCDPI.js → promptDefinitions-C9aGYWZ6.js} +2 -2
  46. package/dist/{promptDefinitions-CaRMCDPI.js.map → promptDefinitions-C9aGYWZ6.js.map} +1 -1
  47. package/dist/{promptDefinitions-CVB4IyVf.cjs → promptDefinitions-OnJHLqrZ.cjs} +2 -2
  48. package/dist/{promptDefinitions-CVB4IyVf.cjs.map → promptDefinitions-OnJHLqrZ.cjs.map} +1 -1
  49. package/dist/promptDefinitions.cjs +2 -2
  50. package/dist/promptDefinitions.js +2 -2
  51. package/dist/{schema-Bc6_gUDA.cjs → schema-BnXdl41H.cjs} +71 -13
  52. package/dist/schema-BnXdl41H.cjs.map +1 -0
  53. package/dist/{schema-D1B8p0Ib.js → schema-BzPfPMq7.js} +54 -14
  54. package/dist/schema-BzPfPMq7.js.map +1 -0
  55. package/dist/{schema-BvloqMHW.cjs → schema-_xqdSRLo.cjs} +8 -1
  56. package/dist/{schema-BvloqMHW.cjs.map → schema-_xqdSRLo.cjs.map} +1 -1
  57. package/dist/{schema-k04PdSCK.js → schema-pZrPEvtp.js} +3 -2
  58. package/dist/{schema-k04PdSCK.js.map → schema-pZrPEvtp.js.map} +1 -1
  59. package/dist/schema.cjs +2 -1
  60. package/dist/{schema.d-DQ5YUr0Y.d.ts → schema.d-DwpHAZsi.d.ts} +2950 -184
  61. package/dist/schema.d-DwpHAZsi.d.ts.map +1 -0
  62. package/dist/{schema.d-cvHc3M20.d.cts → schema.d-vgLUM73w.d.cts} +3025 -259
  63. package/dist/schema.d-vgLUM73w.d.cts.map +1 -0
  64. package/dist/schema.d.cts +2 -1
  65. package/dist/schema.d.cts.map +1 -1
  66. package/dist/schema.d.ts +2 -1
  67. package/dist/schema.d.ts.map +1 -1
  68. package/dist/schema.js +2 -2
  69. package/dist/{server-DHbbEoa2.js → server-BLE3CwEp.js} +8 -9
  70. package/dist/server-BLE3CwEp.js.map +1 -0
  71. package/dist/{server-DQ_dBWQy.cjs → server-CqLaJq7P.cjs} +8 -9
  72. package/dist/server-CqLaJq7P.cjs.map +1 -0
  73. package/dist/server.cjs +8 -8
  74. package/dist/server.d.cts +2 -2
  75. package/dist/server.d.cts.map +1 -1
  76. package/dist/server.d.ts +2 -2
  77. package/dist/server.d.ts.map +1 -1
  78. package/dist/server.js +8 -8
  79. package/dist/{stdio-BHg5CaoN.js → stdio-BLheCcU0.js} +2 -2
  80. package/dist/{stdio-BHg5CaoN.js.map → stdio-BLheCcU0.js.map} +1 -1
  81. package/dist/{stdio-CRqulLZQ.cjs → stdio-DKNKrvTY.cjs} +2 -2
  82. package/dist/{stdio-CRqulLZQ.cjs.map → stdio-DKNKrvTY.cjs.map} +1 -1
  83. package/dist/test-setup.cjs +42 -42
  84. package/dist/test-setup.cjs.map +1 -1
  85. package/dist/test-setup.js +42 -42
  86. package/dist/test-setup.js.map +1 -1
  87. package/dist/{toolDefinitions-BJ0cyDce.cjs → toolDefinitions-C0t6Y5Su.cjs} +26 -5
  88. package/dist/toolDefinitions-C0t6Y5Su.cjs.map +1 -0
  89. package/dist/{toolDefinitions-L20Lv3AW.js → toolDefinitions-DB4pPvgy.js} +26 -5
  90. package/dist/toolDefinitions-DB4pPvgy.js.map +1 -0
  91. package/dist/toolDefinitions.cjs +2 -2
  92. package/dist/{toolDefinitions.d-C0zMvL9m.d.ts → toolDefinitions.d-C5JUBInb.d.ts} +16 -1
  93. package/dist/toolDefinitions.d-C5JUBInb.d.ts.map +1 -0
  94. package/dist/{toolDefinitions.d-Dx4q--0l.d.cts → toolDefinitions.d-CsT15_MF.d.cts} +16 -1
  95. package/dist/toolDefinitions.d-CsT15_MF.d.cts.map +1 -0
  96. package/dist/toolDefinitions.d.cts +1 -1
  97. package/dist/toolDefinitions.d.ts +1 -1
  98. package/dist/toolDefinitions.js +2 -2
  99. package/dist/toolDefinitions.test.cjs +2 -2
  100. package/dist/toolDefinitions.test.js +2 -2
  101. package/dist/{tools-B22b8Jjm.cjs → tools-BdAFXSMG.cjs} +118 -101
  102. package/dist/tools-BdAFXSMG.cjs.map +1 -0
  103. package/dist/{tools-CXgh-6Vh.js → tools-DZzt3LcX.js} +118 -101
  104. package/dist/tools-DZzt3LcX.js.map +1 -0
  105. package/dist/tools.cjs +4 -4
  106. package/dist/tools.d.cts +32 -75
  107. package/dist/tools.d.cts.map +1 -1
  108. package/dist/tools.d.ts +35 -78
  109. package/dist/tools.d.ts.map +1 -1
  110. package/dist/tools.js +4 -4
  111. package/dist/tools.test.cjs +94 -25
  112. package/dist/tools.test.cjs.map +1 -1
  113. package/dist/tools.test.js +94 -25
  114. package/dist/tools.test.js.map +1 -1
  115. package/dist/transports/stdio.cjs +9 -9
  116. package/dist/transports/stdio.d.cts +2 -2
  117. package/dist/transports/stdio.d.ts +2 -2
  118. package/dist/transports/stdio.js +9 -9
  119. package/dist/{types.d-DsrCjT7G.d.ts → types.d-B-acZthg.d.ts} +2 -2
  120. package/dist/{types.d-DsrCjT7G.d.ts.map → types.d-B-acZthg.d.ts.map} +1 -1
  121. package/dist/{types.d-DHI7S0mb.d.ts → types.d-BeKsSRmy.d.ts} +2 -2
  122. package/dist/{types.d-DHI7S0mb.d.ts.map → types.d-BeKsSRmy.d.ts.map} +1 -1
  123. package/dist/{types.d-DQGXrBBW.d.cts → types.d-BfhMPrt_.d.cts} +2 -2
  124. package/dist/{types.d-DQGXrBBW.d.cts.map → types.d-BfhMPrt_.d.cts.map} +1 -1
  125. package/dist/{types.d-r20cCyVI.d.cts → types.d-Bq-AxlK6.d.cts} +2 -2
  126. package/dist/{types.d-r20cCyVI.d.cts.map → types.d-Bq-AxlK6.d.cts.map} +1 -1
  127. package/dist/types.d.cts +2 -2
  128. package/dist/types.d.ts +2 -2
  129. package/dist/{version-D93Bj2gg.cjs → version-DkTBZdhM.cjs} +2 -2
  130. package/dist/version-DkTBZdhM.cjs.map +1 -0
  131. package/dist/version-S8A9iKsF.js +6 -0
  132. package/dist/version-S8A9iKsF.js.map +1 -0
  133. package/dist/version.cjs +1 -1
  134. package/dist/version.d.cts +1 -1
  135. package/dist/version.d.cts.map +1 -1
  136. package/dist/version.d.ts +1 -1
  137. package/dist/version.d.ts.map +1 -1
  138. package/dist/version.js +1 -1
  139. package/package.json +5 -6
  140. package/dist/client-BKLE5Lkt.js.map +0 -1
  141. package/dist/client-C_XfRSu3.cjs.map +0 -1
  142. package/dist/client.d-BizHDVuq.d.cts.map +0 -1
  143. package/dist/client.d-CrWOcVIU.d.ts.map +0 -1
  144. package/dist/issue-helpers-C0kEdXOE.cjs.map +0 -1
  145. package/dist/issue-helpers-DFde36Zu.js +0 -32
  146. package/dist/issue-helpers-DFde36Zu.js.map +0 -1
  147. package/dist/schema-Bc6_gUDA.cjs.map +0 -1
  148. package/dist/schema-D1B8p0Ib.js.map +0 -1
  149. package/dist/schema.d-DQ5YUr0Y.d.ts.map +0 -1
  150. package/dist/schema.d-cvHc3M20.d.cts.map +0 -1
  151. package/dist/server-DHbbEoa2.js.map +0 -1
  152. package/dist/server-DQ_dBWQy.cjs.map +0 -1
  153. package/dist/toolDefinitions-BJ0cyDce.cjs.map +0 -1
  154. package/dist/toolDefinitions-L20Lv3AW.js.map +0 -1
  155. package/dist/toolDefinitions.d-C0zMvL9m.d.ts.map +0 -1
  156. package/dist/toolDefinitions.d-Dx4q--0l.d.cts.map +0 -1
  157. package/dist/tools-B22b8Jjm.cjs.map +0 -1
  158. package/dist/tools-CXgh-6Vh.js.map +0 -1
  159. package/dist/version-D93Bj2gg.cjs.map +0 -1
  160. package/dist/version-DkmlRpxa.js +0 -6
  161. package/dist/version-DkmlRpxa.js.map +0 -1
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
- require('./schema-Bc6_gUDA.cjs');
3
- require('./client-C_XfRSu3.cjs');
2
+ require('./schema-BnXdl41H.cjs');
3
+ require('./client-DQF6UreY.cjs');
4
4
  require('./types-o3zWarRp.cjs');
5
5
  require('./api-client-CEBuz3Zu.cjs');
6
6
  require('./formatting-BTSvl7n7.cjs');
7
- require('./issue-helpers-C0kEdXOE.cjs');
7
+ require('./issue-helpers-CdWMhVWJ.cjs');
8
8
  require('./logging-BEMgC5SA.cjs');
9
- const require_tools = require('./tools-B22b8Jjm.cjs');
9
+ const require_tools = require('./tools-BdAFXSMG.cjs');
10
10
  const require_dist = require('./dist-3oa5SxPp.cjs');
11
11
  const require_vi_ClIskdbk = require('./vi.ClIskdbk-Bn6W0wTE.cjs');
12
12
 
@@ -22,7 +22,15 @@ require_dist.describe("list_organizations", () => {
22
22
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
23
23
  "# Organizations
24
24
 
25
- - sentry-mcp-evals
25
+ ## **sentry-mcp-evals**
26
+
27
+ **Web URL:** https://sentry.io/sentry-mcp-evals
28
+ **Region URL:** https://us.sentry.io
29
+
30
+ # Using this information
31
+
32
+ - The organization's name is the identifier for the organization, and is used in many tools for \`organizationSlug\`.
33
+ - If a tool supports passing in the \`regionUrl\`, you should also pass in the correct value there.
26
34
  "
27
35
  `);
28
36
  });
@@ -34,7 +42,10 @@ require_dist.describe("list_teams", () => {
34
42
  accessToken: "access-token",
35
43
  userId: "1",
36
44
  organizationSlug: null
37
- }, { organizationSlug: "sentry-mcp-evals" });
45
+ }, {
46
+ organizationSlug: "sentry-mcp-evals",
47
+ regionUrl: void 0
48
+ });
38
49
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
39
50
  "# Teams in **sentry-mcp-evals**
40
51
 
@@ -50,17 +61,20 @@ require_dist.describe("list_projects", () => {
50
61
  accessToken: "access-token",
51
62
  userId: "1",
52
63
  organizationSlug: null
53
- }, { organizationSlug: "sentry-mcp-evals" });
64
+ }, {
65
+ organizationSlug: "sentry-mcp-evals",
66
+ regionUrl: void 0
67
+ });
54
68
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
55
69
  "# Projects in **sentry-mcp-evals**
56
70
 
57
- - cloudflare-mcp
71
+ - **cloudflare-mcp**
58
72
  "
59
73
  `);
60
74
  });
61
75
  });
62
76
  require_dist.describe("list_issues", () => {
63
- require_dist.it("serializes", async () => {
77
+ require_dist.it("serializes with project", async () => {
64
78
  const tool = require_tools.TOOL_HANDLERS.list_issues;
65
79
  const result = await tool({
66
80
  accessToken: "access-token",
@@ -70,7 +84,8 @@ require_dist.describe("list_issues", () => {
70
84
  organizationSlug: "sentry-mcp-evals",
71
85
  projectSlug: "cloudflare-mcp",
72
86
  query: void 0,
73
- sortBy: "last_seen"
87
+ sortBy: "last_seen",
88
+ regionUrl: void 0
74
89
  });
75
90
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
76
91
  "# Issues in **sentry-mcp-evals/cloudflare-mcp**
@@ -93,6 +108,45 @@ require_dist.describe("list_issues", () => {
93
108
 
94
109
  # Using this information
95
110
 
111
+ - You can reference the Issue ID in commit messages (e.g. \`Fixes <issueID>\`) to automatically close the issue when the commit is merged.
112
+ - You can get more details about a specific issue by using the tool: \`get_issue_details(organizationSlug="sentry-mcp-evals", issueId=<issueID>)\`
113
+ "
114
+ `);
115
+ });
116
+ require_dist.it("serializes without project", async () => {
117
+ const tool = require_tools.TOOL_HANDLERS.list_issues;
118
+ const result = await tool({
119
+ accessToken: "access-token",
120
+ userId: "1",
121
+ organizationSlug: null
122
+ }, {
123
+ organizationSlug: "sentry-mcp-evals",
124
+ projectSlug: void 0,
125
+ query: void 0,
126
+ sortBy: "last_seen",
127
+ regionUrl: void 0
128
+ });
129
+ require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
130
+ "# Issues in **sentry-mcp-evals**
131
+
132
+ ## CLOUDFLARE-MCP-41
133
+
134
+ **Description**: Error: Tool list_organizations is already registered
135
+ **Culprit**: Object.fetch(index)
136
+ **First Seen**: 2025-04-03T22:51:19.403Z
137
+ **Last Seen**: 2025-04-12T11:34:11.000Z
138
+ **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41
139
+
140
+ ## CLOUDFLARE-MCP-42
141
+
142
+ **Description**: Error: Tool list_issues is already registered
143
+ **Culprit**: Object.fetch(index)
144
+ **First Seen**: 2025-04-11T22:51:19.403Z
145
+ **Last Seen**: 2025-04-12T11:34:11.000Z
146
+ **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-42
147
+
148
+ # Using this information
149
+
96
150
  - You can reference the Issue ID in commit messages (e.g. \`Fixes <issueID>\`) to automatically close the issue when the commit is merged.
97
151
  - You can get more details about a specific issue by using the tool: \`get_issue_details(organizationSlug="sentry-mcp-evals", issueId=<issueID>)\`
98
152
  "
@@ -108,7 +162,8 @@ require_dist.describe("list_releases", () => {
108
162
  organizationSlug: null
109
163
  }, {
110
164
  organizationSlug: "sentry-mcp-evals",
111
- projectSlug: void 0
165
+ projectSlug: void 0,
166
+ regionUrl: void 0
112
167
  });
113
168
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
114
169
  "# Releases in **sentry-mcp-evals**
@@ -136,7 +191,8 @@ require_dist.describe("list_releases", () => {
136
191
  organizationSlug: null
137
192
  }, {
138
193
  organizationSlug: "sentry-mcp-evals",
139
- projectSlug: "cloudflare-mcp"
194
+ projectSlug: "cloudflare-mcp",
195
+ regionUrl: void 0
140
196
  });
141
197
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
142
198
  "# Releases in **sentry-mcp-evals/cloudflare-mcp**
@@ -166,7 +222,8 @@ require_dist.describe("list_tags", () => {
166
222
  organizationSlug: null
167
223
  }, {
168
224
  organizationSlug: "sentry-mcp-evals",
169
- projectSlug: void 0
225
+ projectSlug: void 0,
226
+ regionUrl: void 0
170
227
  });
171
228
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
172
229
  "# Tags in **sentry-mcp-evals**
@@ -211,7 +268,8 @@ require_dist.describe("search_errors", () => {
211
268
  filename: void 0,
212
269
  transaction: void 0,
213
270
  query: void 0,
214
- sortBy: "count"
271
+ sortBy: "count",
272
+ regionUrl: void 0
215
273
  });
216
274
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
217
275
  "# Errors in **sentry-mcp-evals**
@@ -246,7 +304,8 @@ require_dist.describe("search_transactions", () => {
246
304
  projectSlug: void 0,
247
305
  transaction: void 0,
248
306
  query: void 0,
249
- sortBy: "duration"
307
+ sortBy: "duration",
308
+ regionUrl: void 0
250
309
  });
251
310
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
252
311
  "# Transactions in **sentry-mcp-evals**
@@ -288,7 +347,8 @@ require_dist.describe("get_issue_summary", () => {
288
347
  }, {
289
348
  organizationSlug: "sentry-mcp-evals",
290
349
  issueId: "CLOUDFLARE-MCP-41",
291
- issueUrl: void 0
350
+ issueUrl: void 0,
351
+ regionUrl: void 0
292
352
  });
293
353
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
294
354
  "# Issue CLOUDFLARE-MCP-41 in **sentry-mcp-evals**
@@ -315,7 +375,8 @@ require_dist.describe("get_issue_summary", () => {
315
375
  }, {
316
376
  organizationSlug: void 0,
317
377
  issueId: void 0,
318
- issueUrl: "https://sentry-mcp-evals.sentry.io/issues/6507376925"
378
+ issueUrl: "https://sentry-mcp-evals.sentry.io/issues/6507376925",
379
+ regionUrl: void 0
319
380
  });
320
381
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
321
382
  "# Issue CLOUDFLARE-MCP-41 in **sentry-mcp-evals**
@@ -344,7 +405,8 @@ require_dist.describe("get_issue_details", () => {
344
405
  }, {
345
406
  organizationSlug: "sentry-mcp-evals",
346
407
  issueId: "CLOUDFLARE-MCP-41",
347
- issueUrl: void 0
408
+ issueUrl: void 0,
409
+ regionUrl: void 0
348
410
  });
349
411
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
350
412
  "# Issue CLOUDFLARE-MCP-41 in **sentry-mcp-evals**
@@ -386,7 +448,8 @@ require_dist.describe("get_issue_details", () => {
386
448
  }, {
387
449
  organizationSlug: void 0,
388
450
  issueId: void 0,
389
- issueUrl: "https://sentry-mcp-evals.sentry.io/issues/6507376925"
451
+ issueUrl: "https://sentry-mcp-evals.sentry.io/issues/6507376925",
452
+ regionUrl: void 0
390
453
  });
391
454
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
392
455
  "# Issue CLOUDFLARE-MCP-41 in **sentry-mcp-evals**
@@ -429,7 +492,8 @@ require_dist.describe("create_team", () => {
429
492
  organizationSlug: null
430
493
  }, {
431
494
  organizationSlug: "sentry-mcp-evals",
432
- name: "the-goats"
495
+ name: "the-goats",
496
+ regionUrl: void 0
433
497
  });
434
498
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
435
499
  "# New Team in **sentry-mcp-evals**
@@ -455,7 +519,8 @@ require_dist.describe("create_project", () => {
455
519
  organizationSlug: "sentry-mcp-evals",
456
520
  teamSlug: "the-goats",
457
521
  name: "cloudflare-mcp",
458
- platform: "javascript"
522
+ platform: "javascript",
523
+ regionUrl: void 0
459
524
  });
460
525
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
461
526
  "# New Project in **sentry-mcp-evals**
@@ -483,7 +548,8 @@ require_dist.describe("create_dsn", () => {
483
548
  }, {
484
549
  organizationSlug: "sentry-mcp-evals",
485
550
  projectSlug: "cloudflare-mcp",
486
- name: "Default"
551
+ name: "Default",
552
+ regionUrl: void 0
487
553
  });
488
554
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
489
555
  "# New DSN in **sentry-mcp-evals/cloudflare-mcp**
@@ -507,7 +573,8 @@ require_dist.describe("list_dsn", () => {
507
573
  organizationSlug: null
508
574
  }, {
509
575
  organizationSlug: "sentry-mcp-evals",
510
- projectSlug: "cloudflare-mcp"
576
+ projectSlug: "cloudflare-mcp",
577
+ regionUrl: void 0
511
578
  });
512
579
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
513
580
  "# DSNs in **sentry-mcp-evals/cloudflare-mcp**
@@ -533,7 +600,8 @@ require_dist.describe("begin_autofix", () => {
533
600
  }, {
534
601
  organizationSlug: "sentry-mcp-evals",
535
602
  issueId: "PEATED-A8",
536
- issueUrl: void 0
603
+ issueUrl: void 0,
604
+ regionUrl: void 0
537
605
  });
538
606
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
539
607
  "# Autofix Started for Issue PEATED-A8
@@ -560,7 +628,8 @@ require_dist.describe("get_autofix_status", () => {
560
628
  }, {
561
629
  organizationSlug: "sentry-mcp-evals",
562
630
  issueId: "PEATED-A8",
563
- issueUrl: void 0
631
+ issueUrl: void 0,
632
+ regionUrl: void 0
564
633
  });
565
634
  require_vi_ClIskdbk.globalExpect(result).toMatchInlineSnapshot(`
566
635
  "# Autofix Status for Issue PEATED-A8
@@ -1 +1 @@
1
- {"version":3,"file":"tools.test.cjs","names":["TOOL_HANDLERS"],"sources":["../src/tools.test.ts"],"sourcesContent":["import { describe, it, expect } from \"vitest\";\nimport { TOOL_HANDLERS } from \"./tools\";\n\ndescribe(\"list_organizations\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.list_organizations;\n const result = await tool({\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n });\n expect(result).toMatchInlineSnapshot(`\n \"# Organizations\n\n - sentry-mcp-evals\n \"\n `);\n });\n});\n\ndescribe(\"list_teams\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.list_teams;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Teams in **sentry-mcp-evals**\n\n - the-goats\n \"\n `);\n });\n});\n\ndescribe(\"list_projects\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.list_projects;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Projects in **sentry-mcp-evals**\n\n - cloudflare-mcp\n \"\n `);\n });\n});\n\ndescribe(\"list_issues\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.list_issues;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n projectSlug: \"cloudflare-mcp\",\n query: undefined,\n sortBy: \"last_seen\",\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Issues in **sentry-mcp-evals/cloudflare-mcp**\n\n ## CLOUDFLARE-MCP-41\n\n **Description**: Error: Tool list_organizations is already registered\n **Culprit**: Object.fetch(index)\n **First Seen**: 2025-04-03T22:51:19.403Z\n **Last Seen**: 2025-04-12T11:34:11.000Z\n **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41\n\n ## CLOUDFLARE-MCP-42\n\n **Description**: Error: Tool list_issues is already registered\n **Culprit**: Object.fetch(index)\n **First Seen**: 2025-04-11T22:51:19.403Z\n **Last Seen**: 2025-04-12T11:34:11.000Z\n **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-42\n\n # Using this information\n\n - You can reference the Issue ID in commit messages (e.g. \\`Fixes <issueID>\\`) to automatically close the issue when the commit is merged.\n - You can get more details about a specific issue by using the tool: \\`get_issue_details(organizationSlug=\"sentry-mcp-evals\", issueId=<issueID>)\\`\n \"\n `);\n });\n});\n\ndescribe(\"list_releases\", () => {\n it(\"works without project\", async () => {\n const tool = TOOL_HANDLERS.list_releases;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n projectSlug: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Releases in **sentry-mcp-evals**\n\n ## 8ce89484-0fec-4913-a2cd-e8e2d41dee36\n\n **Created**: 2025-04-13T19:54:21.764Z\n **First Event**: 2025-04-13T19:54:21.000Z\n **Last Event**: 2025-04-13T20:28:23.000Z\n **New Issues**: 0\n **Projects**: cloudflare-mcp\n\n # Using this information\n\n - You can reference the Release version in commit messages or documentation.\n - You can search for issues in a specific release using the \\`search_errors()\\` tool with the query \\`release:8ce89484-0fec-4913-a2cd-e8e2d41dee36\\`.\n \"\n `);\n });\n it(\"works with project\", async () => {\n const tool = TOOL_HANDLERS.list_releases;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n projectSlug: \"cloudflare-mcp\",\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Releases in **sentry-mcp-evals/cloudflare-mcp**\n\n ## 8ce89484-0fec-4913-a2cd-e8e2d41dee36\n\n **Created**: 2025-04-13T19:54:21.764Z\n **First Event**: 2025-04-13T19:54:21.000Z\n **Last Event**: 2025-04-13T20:28:23.000Z\n **New Issues**: 0\n **Projects**: cloudflare-mcp\n\n # Using this information\n\n - You can reference the Release version in commit messages or documentation.\n - You can search for issues in a specific release using the \\`search_errors()\\` tool with the query \\`release:8ce89484-0fec-4913-a2cd-e8e2d41dee36\\`.\n \"\n `);\n });\n});\n\ndescribe(\"list_tags\", () => {\n it(\"works\", async () => {\n const tool = TOOL_HANDLERS.list_tags;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n projectSlug: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Tags in **sentry-mcp-evals**\n\n - transaction\n - runtime.name\n - level\n - device\n - os\n - user\n - runtime\n - release\n - url\n - uptime_rule\n - server_name\n - browser\n - os.name\n - device.family\n - replayId\n - client_os.name\n - environment\n - service\n - browser.name\n\n # Using this information\n\n - You can reference tags in the \\`query\\` parameter of various tools: \\`tagName:tagValue\\`.\n \"\n `);\n });\n});\n\ndescribe(\"search_errors\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.search_errors;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n projectSlug: undefined,\n filename: undefined,\n transaction: undefined,\n query: undefined,\n sortBy: \"count\",\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Errors in **sentry-mcp-evals**\n\n\n ## CLOUDFLARE-MCP-41\n\n **Description**: Error: Tool list_organizations is already registered\n **Issue ID**: CLOUDFLARE-MCP-41\n **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41\n **Project**: test-suite\n **Last Seen**: 2025-04-07T12:23:39+00:00\n **Occurrences**: 2\n\n # Using this information\n\n - You can reference the Issue ID in commit messages (e.g. \\`Fixes <issueID>\\`) to automatically close the issue when the commit is merged.\n - You can get more details about an error by using the tool: \\`get_issue_details(organizationSlug=\"sentry-mcp-evals\", issueId=<issueID>)\\`\n \"\n `);\n });\n});\n\ndescribe(\"search_transactions\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.search_transactions;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n projectSlug: undefined,\n transaction: undefined,\n query: undefined,\n sortBy: \"duration\",\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Transactions in **sentry-mcp-evals**\n\n\n ## GET /trpc/bottleList\n\n **Span ID**: 07752c6aeb027c8f\n **Trace ID**: 6a477f5b0f31ef7b6b9b5e1dea66c91d\n **Span Operation**: http.server\n **Span Description**: GET /trpc/bottleList\n **Duration**: 12\n **Timestamp**: 2025-04-13T14:19:18+00:00\n **Project**: peated\n **URL**: https://sentry-mcp-evals.sentry.io/explore/traces/trace/6a477f5b0f31ef7b6b9b5e1dea66c91d\n\n ## GET /trpc/bottleList\n\n **Span ID**: 7ab5edf5b3ba42c9\n **Trace ID**: 54177131c7b192a446124daba3136045\n **Span Operation**: http.server\n **Span Description**: GET /trpc/bottleList\n **Duration**: 18\n **Timestamp**: 2025-04-13T14:19:17+00:00\n **Project**: peated\n **URL**: https://sentry-mcp-evals.sentry.io/explore/traces/trace/54177131c7b192a446124daba3136045\n\n \"\n `);\n });\n});\n\ndescribe(\"get_issue_summary\", () => {\n it(\"serializes with issueId\", async () => {\n const tool = TOOL_HANDLERS.get_issue_summary;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n issueId: \"CLOUDFLARE-MCP-41\",\n issueUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Issue CLOUDFLARE-MCP-41 in **sentry-mcp-evals**\n\n **Description**: Error: Tool list_organizations is already registered\n **Culprit**: Object.fetch(index)\n **First Seen**: 2025-04-03T22:51:19.403Z\n **Last Seen**: 2025-04-12T11:34:11.000Z\n **Occurrences**: 25\n **Users Impacted**: 1\n **Status**: unresolved\n **Platform**: javascript\n **Project**: CLOUDFLARE-MCP\n **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41\n \"\n `);\n });\n\n it(\"serializes with issueUrl\", async () => {\n const tool = TOOL_HANDLERS.get_issue_summary;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: undefined,\n issueId: undefined,\n issueUrl: \"https://sentry-mcp-evals.sentry.io/issues/6507376925\",\n },\n );\n\n expect(result).toMatchInlineSnapshot(`\n \"# Issue CLOUDFLARE-MCP-41 in **sentry-mcp-evals**\n\n **Description**: Error: Tool list_organizations is already registered\n **Culprit**: Object.fetch(index)\n **First Seen**: 2025-04-03T22:51:19.403Z\n **Last Seen**: 2025-04-12T11:34:11.000Z\n **Occurrences**: 25\n **Users Impacted**: 1\n **Status**: unresolved\n **Platform**: javascript\n **Project**: CLOUDFLARE-MCP\n **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41\n \"\n `);\n });\n});\n\ndescribe(\"get_issue_details\", () => {\n it(\"serializes with issueId\", async () => {\n const tool = TOOL_HANDLERS.get_issue_details;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n issueId: \"CLOUDFLARE-MCP-41\",\n issueUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Issue CLOUDFLARE-MCP-41 in **sentry-mcp-evals**\n\n **Description**: Error: Tool list_organizations is already registered\n **Culprit**: Object.fetch(index)\n **First Seen**: 2025-04-03T22:51:19.403Z\n **Last Seen**: 2025-04-12T11:34:11.000Z\n **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41\n\n ## Event Specifics\n\n **Occurred At**: 2025-04-08T21:15:04.000Z\n **Error:**\n \\`\\`\\`\n Error: Tool list_organizations is already registered\n \\`\\`\\`\n\n **Stacktrace:**\n \\`\\`\\`\n index.js:7809:27\n index.js:8029:24 (OAuthProviderImpl.fetch)\n index.js:19631:28 (Object.fetch)\n \\`\\`\\`\n\n # Using this information\n\n - You can reference the IssueID in commit messages (e.g. \\`Fixes CLOUDFLARE-MCP-41\\`) to automatically close the issue when the commit is merged.\n - The stacktrace includes both first-party application code as well as third-party code, its important to triage to first-party code.\n \"\n `);\n });\n\n it(\"serializes with issueUrl\", async () => {\n const tool = TOOL_HANDLERS.get_issue_details;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: undefined,\n issueId: undefined,\n issueUrl: \"https://sentry-mcp-evals.sentry.io/issues/6507376925\",\n },\n );\n\n expect(result).toMatchInlineSnapshot(`\n \"# Issue CLOUDFLARE-MCP-41 in **sentry-mcp-evals**\n\n **Description**: Error: Tool list_organizations is already registered\n **Culprit**: Object.fetch(index)\n **First Seen**: 2025-04-03T22:51:19.403Z\n **Last Seen**: 2025-04-12T11:34:11.000Z\n **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41\n\n ## Event Specifics\n\n **Occurred At**: 2025-04-08T21:15:04.000Z\n **Error:**\n \\`\\`\\`\n Error: Tool list_organizations is already registered\n \\`\\`\\`\n\n **Stacktrace:**\n \\`\\`\\`\n index.js:7809:27\n index.js:8029:24 (OAuthProviderImpl.fetch)\n index.js:19631:28 (Object.fetch)\n \\`\\`\\`\n\n # Using this information\n\n - You can reference the IssueID in commit messages (e.g. \\`Fixes 6507376925\\`) to automatically close the issue when the commit is merged.\n - The stacktrace includes both first-party application code as well as third-party code, its important to triage to first-party code.\n \"\n `);\n });\n});\n\ndescribe(\"create_team\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.create_team;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n name: \"the-goats\",\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# New Team in **sentry-mcp-evals**\n\n **ID**: 4509109078196224\n **Slug**: the-goats\n **Name**: the-goats\n # Using this information\n\n - You should always inform the user of the Team Slug value.\n \"\n `);\n });\n});\n\ndescribe(\"create_project\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.create_project;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n teamSlug: \"the-goats\",\n name: \"cloudflare-mcp\",\n platform: \"javascript\",\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# New Project in **sentry-mcp-evals**\n\n **ID**: 4509109104082945\n **Slug**: cloudflare-mcp\n **Name**: cloudflare-mcp\n **SENTRY_DSN**: https://d20df0a1ab5031c7f3c7edca9c02814d@o4509106732793856.ingest.us.sentry.io/4509109104082945\n\n # Using this information\n\n - You can reference the **SENTRY_DSN** value to initialize Sentry's SDKs.\n - You should always inform the user of the **SENTRY_DSN** and Project Slug values.\n \"\n `);\n });\n});\n\ndescribe(\"create_dsn\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.create_dsn;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n projectSlug: \"cloudflare-mcp\",\n name: \"Default\",\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# New DSN in **sentry-mcp-evals/cloudflare-mcp**\n\n **DSN**: https://d20df0a1ab5031c7f3c7edca9c02814d@o4509106732793856.ingest.us.sentry.io/4509109104082945\n **Name**: Default\n\n # Using this information\n\n - The \\`SENTRY_DSN\\` value is a URL that you can use to initialize Sentry's SDKs.\n \"\n `);\n });\n});\n\ndescribe(\"list_dsn\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.list_dsns;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n projectSlug: \"cloudflare-mcp\",\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# DSNs in **sentry-mcp-evals/cloudflare-mcp**\n\n ## Default\n **ID**: d20df0a1ab5031c7f3c7edca9c02814d\n **DSN**: https://d20df0a1ab5031c7f3c7edca9c02814d@o4509106732793856.ingest.us.sentry.io/4509109104082945\n\n # Using this information\n\n - The \\`SENTRY_DSN\\` value is a URL that you can use to initialize Sentry's SDKs.\n \"\n `);\n });\n});\n\ndescribe(\"begin_autofix\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.begin_autofix;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n issueId: \"PEATED-A8\",\n issueUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Autofix Started for Issue PEATED-A8\n\n **Run ID:**: 123\n\n This operation may take some time, so you should call \\`get_autofix_status()\\` to check the status of the analysis, and repeat the process until its finished.\n\n You should also inform the user that the operation may take some time, and give them updates whenever you check the status of the operation..\n\n \\`\\`\\`\n get_autofix_status(organizationSlug=\"sentry-mcp-evals\", issueId=\"PEATED-A8\")\n \\`\\`\\`\"\n `);\n });\n});\n\ndescribe(\"get_autofix_status\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.get_autofix_status;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n issueId: \"PEATED-A8\",\n issueUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Autofix Status for Issue PEATED-A8\n\n ## Analyzing the Issue\n\n **The \\`bottleById\\` query fails because the input ID (3216) doesn't exist in the database.\n **\n The exception details show that the \\`input\\` value at the time of the \\`TRPCError\\` in \\`bottleById.ts\\` was 3216, and the query likely failed because a bottle with ID 3216 was not found in the database.\n\n \\`\\`\\`\n Variable values at the time of the exception::\n {\n \"input\": 3216\n }\n \\`\\`\\`\n\n\n **However, the request also includes a different ID (16720) for \\`bottlePriceList\\`.\n **\n The root cause is likely a mismatch of input IDs within the batched TRPC request, where \\`bottlePriceList\\` expects bottle ID 16720, but \\`bottleById\\` receives a different ID (3216) leading to the \"Bottle not found\" error.\n\n \\`\\`\\`\n GET http://api.peated.com/trpc/bottlePriceList,bottleById\n \\`\\`\\`\n\n \\`\\`\\`json\n {\n \"input\": 3216\n }\n \\`\\`\\`\n\n \\`\\`\\`\n TRPCError: Bottle not found. (occurred in: GET /trpc/bottlePriceList,bottleById)\n \\`\\`\\`\n\n\n **This suggests a data consistency issue or incorrect client-side request.\n **\n The \\`TRPCError\\` originates from \\`bottleById.ts\\` with the input value being \\`3216\\`, indicating the procedure failed to find a bottle with that specific ID in the database.\n\n \\`\\`\\`\n <anonymous> in file /app/apps/server/src/trpc/routes/bottleById.ts [Line 33, column 13] (In app)\n .select({\n ...getTableColumns(bottles),\n })\n .from(bottleTombstones)\n .innerJoin(bottles, eq(bottleTombstones.newBottleId, bottles.id))\n .where(eq(bottleTombstones.bottleId, input));\n if (!bottle) {\n throw new TRPCError({ <-- SUSPECT LINE\n message: \"Bottle not found.\",\n code: \"NOT_FOUND\",\n });\n }\n }\n\n const createdBy = await db.query.users.findFirst({\n ---\n Variable values at the time of the exception::\n {\n \"input\": 3216\n }\n \\`\\`\\`\n\n\n\n ## Root Cause Analysis\n\n **The client initiates a batched TRPC request to the \\`/trpc/bottlePriceList,bottleById\\` endpoint, intending to fetch both the price list and details for a specific bottle.**\n\n This is the entry point where the client requests data from two different procedures in a single HTTP request. The server needs to correctly route and process the parameters for each procedure.\n\n **The TRPC server receives the batched request and begins processing the \\`bottlePriceList\\` procedure, intending to fetch the price list for bottle ID 16720.**\n\n \\`\\`\\`typescript\n // apps/server/src/trpc/routes/bottlePriceList.ts\n .input(z.object({ bottle: z.number(), onlyValid: z.boolean().optional() }))\n .query(async function ({ input, ctx }) {\n const [bottle] = await db.select().from(bottles).where(eq(bottles.id, input.bottle));\n if (!bottle) { ... }\n \\`\\`\\`\n This procedure expects a 'bottle' parameter in the input, which is used to query the database.\n\n **The TRPC server also processes the \\`bottleById\\` procedure, but due to a parameter mapping issue or client-side error, it receives bottle ID 3216 as input instead of 16720.**\n\n \\`\\`\\`typescript\n // apps/server/src/trpc/routes/bottleById.ts\n export default publicProcedure.input(z.number()).query(async function ({ input, ctx }) {\n let [bottle] = await db.select().from(bottles).where(eq(bottles.id, input));\n if (!bottle) { ... }\n \\`\\`\\`\n This procedure expects a numerical ID as input to find the bottle.\n\n **The \\`bottleById\\` procedure queries the \\`bottles\\` table for a bottle with ID 3216, but no such bottle exists.**\n\n The database query returns no results because bottle ID 3216 is not present in the \\`bottles\\` table.\n\n **The \\`bottleById\\` procedure then checks the \\`bottleTombstones\\` table to see if bottle ID 3216 has been tombstoned (redirected to a new ID), but no such tombstone exists.**\n\n The query to \\`bottleTombstones\\` also returns no results, indicating that bottle ID 3216 has not been redirected.\n\n **Since the \\`bottleById\\` procedure cannot find a bottle with ID 3216 in either the \\`bottles\\` or \\`bottleTombstones\\` tables, it throws a \\`TRPCError\\` with the message \"Bottle not found.\"**\n\n \\`\\`\\`typescript\n // apps/server/src/trpc/routes/bottleById.ts\n if (!bottle) {\n throw new TRPCError({ message: \"Bottle not found.\", code: \"NOT_FOUND\" });\n }\n \\`\\`\\`\n This is where the error is thrown, indicating that the bottle could not be found.\n\n\n ## Planning Solution\n\n **The discrepancy between inputs suggests a potential issue with batch request handling.\n **\n The \\`TRPCError\\` occurred in \\`bottleById.ts\\` with an input of \\`3216\\`, while the request was initiated with a bottle ID of \\`16720\\`, indicating a mismatch in the bottle ID being processed.\n\n \\`\\`\\`\n Variable values at the time of the exception::\n {\n \"input\": 3216\n }\n \\`\\`\\`\n\n \\`\\`\\`\n GET http://api.peated.com/trpc/bottlePriceList,bottleById\n \\`\\`\\`\n\n\n **The client-side batch request construction is the most likely source of error.\n **\n The discrepancy between the bottle ID in the error message (16720) and the ID being processed (3216) strongly suggests a client-side parameter mapping issue in the batched TRPC request.\n\n To fix this, I propose the following steps:\n\n 1. **Inspect the Client-Side Code:** Identify the code responsible for constructing the TRPC batch request to \\`/trpc/bottlePriceList,bottleById\\`.\n\n 2. **Verify Parameter Mapping:** Ensure that both \\`bottlePriceList\\` and \\`bottleById\\` are receiving the correct bottle ID (which should be 16720 in this case).\n\n 3. **Correct Parameter Assignment:** If the parameters are being incorrectly assigned, modify the client-side code to ensure that both procedures receive the same, correct bottle ID.\n\n 4. **Add Logging (Client-Side):** Add temporary logging to the client-side code to confirm the parameters being sent to each procedure in the batch request. This will help verify the fix.\n\n \\`\\`\\`typescript\n // Example logging (add to the client-side code where the batch request is created)\n console.log(\"bottlePriceList input:\", { bottle: 16720 }); // Replace 16720 with the actual ID\n console.log(\"bottleById input:\", { bottle: 16720 }); // Replace 16720 with the actual ID\n \\`\\`\\`\n\n 5. **Test the Fix:** After applying the fix, test the affected functionality to ensure that the \"Bottle not found\" error is resolved and that both procedures are working correctly.\n\n 6. **Remove Logging:** Once the fix is verified, remove the temporary logging.\n\n This approach directly addresses the most likely cause of the issue and provides a clear path to resolution.\n\n\n **Ensuring consistent bottle IDs will likely resolve this inconsistency.\n **\n The error message references bottle ID 16720, but the exception details show the procedure was actually processing ID 3216, indicating a parameter mismatch in the batch request.\n\n To fix this, I recommend the following steps:\n\n 1. **Client-Side Investigation**:\n\n * Examine the client-side code where the TRPC batch request is constructed.\n * Verify that the same \\`bottleId\\` parameter is being passed to both \\`bottlePriceList\\` and \\`bottleById\\` procedures.\n * If the IDs are being passed correctly, inspect the network request payload to confirm the correct structure of the batched request.\n\n \\`\\`\\`typescript\n // Example (Hypothetical) Client-Side Code\n const bottleId = 16720; // Example bottle ID\n\n // Ensure both procedures receive the same bottleId\n const [priceList, bottleDetails] = await trpc.batch(() => [\n trpc.bottlePriceList.fetch({ bottle: bottleId }),\n trpc.bottleById.fetch(bottleId),\n ]);\n \\`\\`\\`\n\n 2. **Server-Side Logging (Temporary)**:\n\n * Add temporary logging to both \\`bottlePriceList\\` and \\`bottleById\\` procedures to log the received \\`input\\` value.\n * This will help confirm whether the server is receiving the correct IDs from the client.\n * **Important**: Remove these logs after debugging to avoid unnecessary overhead.\n\n \\`\\`\\`typescript\n // apps/server/src/trpc/routes/bottlePriceList.ts\n export default publicProcedure\n .input(\n z.object({\n bottle: z.number(),\n onlyValid: z.boolean().optional(),\n }),\n )\n .query(async function ({ input, ctx }) {\n console.log(\"bottlePriceList input:\", input); // Add this line\n // ... rest of the code\n });\n\n // apps/server/src/trpc/routes/bottleById.ts\n export default publicProcedure.input(z.number()).query(async function ({\n input,\n ctx,\n }) {\n console.log(\"bottleById input:\", input); // Add this line\n // ... rest of the code\n });\n \\`\\`\\`\n\n 3. **TRPC Batch Request Configuration**:\n\n * Review the TRPC batch link configuration on the client-side.\n * Ensure that the batching logic is correctly mapping parameters to the corresponding procedures.\n * If using a custom batching implementation, verify its correctness.\n\n 4. **Data Integrity Check**:\n\n * If the client-side code appears correct, investigate whether bottle ID 3216 should exist in the database.\n * Check the \\`bottles\\` table and \\`bottleTombstones\\` table for any entries related to bottle ID 3216.\n * If the bottle should exist but is missing, investigate potential data deletion or migration issues.\n\n 5. **Tombstone Logic**:\n\n * Double-check the logic for creating and using tombstones.\n * Ensure that when a bottle is deleted, a tombstone entry is created correctly, pointing to the new bottle (if any).\n\n 6. **Error Handling**:\n\n * While this isn't the primary fix, consider improving the error message in \\`bottleById.ts\\` to include more context.\n * Include the original requested bottle ID (if available) in the error message to aid debugging.\n\n 7. **Client-Side Retries**:\n\n * Implement a retry mechanism on the client-side for TRPC requests.\n * If a \"Bottle not found\" error occurs, retry the request a few times before giving up. This can help mitigate transient issues.\n\n By following these steps, you should be able to identify the root cause of the parameter mismatch and implement a fix that ensures consistent bottle IDs are passed to both TRPC procedures in the batch request.\n\n\n\n ## Solution\n\n Consolidate bottle and price data fetching into a single batched TRPC request using \\`Promise.all\\` to ensure ID consistency.\n\n **Create a shared utility function to fetch bottle details and price data together.**\n \\`\\`\\`typescript\n // In a shared utility function or component\n export async function getBottleWithPrices(bottleId: number) {\n const trpcClient = await getTrpcClient();\n \n // Use Promise.all to ensure both requests are part of the same batch\n // and receive the same parameters\n const [bottle, priceList] = await Promise.all([\n trpcClient.bottleById.fetch(bottleId),\n trpcClient.bottlePriceList.fetch({ bottle: bottleId }),\n ]);\n \n return { bottle, priceList };\n }\n \\`\\`\\`\n This code creates a function that uses \\`Promise.all\\` to fetch both bottle details and price data concurrently. This ensures that both TRPC procedures are part of the same batch and receive the same \\`bottleId\\`.\n\n **Modify the page components to use the shared utility function.**\n \\`\\`\\`typescript\n // Then in the page components:\n const { bottle, priceList } = await getBottleWithPrices(Number(bottleId));\n \\`\\`\\`\n This code replaces the separate calls to \\`bottleById\\` and \\`bottlePriceList\\` with a single call to the \\`getBottleWithPrices\\` function, ensuring that both components receive data for the same bottle.\n\n **Add a unit test that reproduces the issue.**\n null\n\n\n \"\n `);\n });\n});\n"],"mappings":";;;;;;;;;;;;;AAGA,sBAAS,sBAAsB,MAAM;AACnC,iBAAG,cAAc,YAAY;EAC3B,MAAM,OAAOA,4BAAc;EAC3B,MAAM,SAAS,MAAM,KAAK;GACxB,aAAa;GACb,QAAQ;GACR,kBAAkB;EACnB,EAAC;AACF,mCAAO,OAAO,CAAC,uBAAuB;;;;;MAKpC;CACH,EAAC;AACH,EAAC;AAEF,sBAAS,cAAc,MAAM;AAC3B,iBAAG,cAAc,YAAY;EAC3B,MAAM,OAAOA,4BAAc;EAC3B,MAAM,SAAS,MAAM,KACnB;GACE,aAAa;GACb,QAAQ;GACR,kBAAkB;EACnB,GACD,EACE,kBAAkB,mBACnB,EACF;AACD,mCAAO,OAAO,CAAC,uBAAuB;;;;;MAKpC;CACH,EAAC;AACH,EAAC;AAEF,sBAAS,iBAAiB,MAAM;AAC9B,iBAAG,cAAc,YAAY;EAC3B,MAAM,OAAOA,4BAAc;EAC3B,MAAM,SAAS,MAAM,KACnB;GACE,aAAa;GACb,QAAQ;GACR,kBAAkB;EACnB,GACD,EACE,kBAAkB,mBACnB,EACF;AACD,mCAAO,OAAO,CAAC,uBAAuB;;;;;MAKpC;CACH,EAAC;AACH,EAAC;AAEF,sBAAS,eAAe,MAAM;AAC5B,iBAAG,cAAc,YAAY;E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EACd,EACF;AACD,mCAAO,OAAO,CAAC,uBAAuB;;;;;;;;;;;MAWpC;CACH,EAAC;AACH,EAAC;AAEF,sBAAS,iBAAiB,MAAM;AAC9B,iBAAG,cAAc,YAAY;EAC3B,MAAM,OAAOA,4BAAc;EAC3B,MAAM,SAAS,MAAM,KACnB;GACE,aAAa;GACb,QAAQ;GACR,kBAAkB;EACnB,GACD;GACE,kBAAkB;GAClB,SAAS;GACT;EACD,EACF;AACD,mCAAO,OAAO,CAAC,uBAAuB;;;;;;;;;;;;MAYpC;CACH,EAAC;AACH,EAAC;AAEF,sBAAS,sBAAsB,MAAM;AACnC,iBAAG,cAAc,YAAY;EAC3B,MAAM,OAAOA,4BAAc;EAC3B,MAAM,SAAS,MAAM,KACnB;GACE,aAAa;GACb,QAAQ;GACR,kBAAkB;EACnB,GACD;GACE,kBAAkB;GAClB,SAAS;GACT;EACD,EACF;AACD,mCAAO,OAAO,CAAC,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAmRpC;CACH,EAAC;AACH,EAAC"}
1
+ {"version":3,"file":"tools.test.cjs","names":["TOOL_HANDLERS"],"sources":["../src/tools.test.ts"],"sourcesContent":["import { describe, it, expect } from \"vitest\";\nimport { TOOL_HANDLERS } from \"./tools\";\n\ndescribe(\"list_organizations\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.list_organizations;\n const result = await tool({\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n });\n expect(result).toMatchInlineSnapshot(`\n \"# Organizations\n\n ## **sentry-mcp-evals**\n\n **Web URL:** https://sentry.io/sentry-mcp-evals\n **Region URL:** https://us.sentry.io\n\n # Using this information\n\n - The organization's name is the identifier for the organization, and is used in many tools for \\`organizationSlug\\`.\n - If a tool supports passing in the \\`regionUrl\\`, you should also pass in the correct value there.\n \"\n `);\n });\n});\n\ndescribe(\"list_teams\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.list_teams;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n regionUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Teams in **sentry-mcp-evals**\n\n - the-goats\n \"\n `);\n });\n});\n\ndescribe(\"list_projects\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.list_projects;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n regionUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Projects in **sentry-mcp-evals**\n\n - **cloudflare-mcp**\n \"\n `);\n });\n});\n\ndescribe(\"list_issues\", () => {\n it(\"serializes with project\", async () => {\n const tool = TOOL_HANDLERS.list_issues;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n projectSlug: \"cloudflare-mcp\",\n query: undefined,\n sortBy: \"last_seen\",\n regionUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Issues in **sentry-mcp-evals/cloudflare-mcp**\n\n ## CLOUDFLARE-MCP-41\n\n **Description**: Error: Tool list_organizations is already registered\n **Culprit**: Object.fetch(index)\n **First Seen**: 2025-04-03T22:51:19.403Z\n **Last Seen**: 2025-04-12T11:34:11.000Z\n **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41\n\n ## CLOUDFLARE-MCP-42\n\n **Description**: Error: Tool list_issues is already registered\n **Culprit**: Object.fetch(index)\n **First Seen**: 2025-04-11T22:51:19.403Z\n **Last Seen**: 2025-04-12T11:34:11.000Z\n **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-42\n\n # Using this information\n\n - You can reference the Issue ID in commit messages (e.g. \\`Fixes <issueID>\\`) to automatically close the issue when the commit is merged.\n - You can get more details about a specific issue by using the tool: \\`get_issue_details(organizationSlug=\"sentry-mcp-evals\", issueId=<issueID>)\\`\n \"\n `);\n });\n\n it(\"serializes without project\", async () => {\n const tool = TOOL_HANDLERS.list_issues;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n projectSlug: undefined,\n query: undefined,\n sortBy: \"last_seen\",\n regionUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Issues in **sentry-mcp-evals**\n\n ## CLOUDFLARE-MCP-41\n\n **Description**: Error: Tool list_organizations is already registered\n **Culprit**: Object.fetch(index)\n **First Seen**: 2025-04-03T22:51:19.403Z\n **Last Seen**: 2025-04-12T11:34:11.000Z\n **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41\n\n ## CLOUDFLARE-MCP-42\n\n **Description**: Error: Tool list_issues is already registered\n **Culprit**: Object.fetch(index)\n **First Seen**: 2025-04-11T22:51:19.403Z\n **Last Seen**: 2025-04-12T11:34:11.000Z\n **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-42\n\n # Using this information\n\n - You can reference the Issue ID in commit messages (e.g. \\`Fixes <issueID>\\`) to automatically close the issue when the commit is merged.\n - You can get more details about a specific issue by using the tool: \\`get_issue_details(organizationSlug=\"sentry-mcp-evals\", issueId=<issueID>)\\`\n \"\n `);\n });\n});\n\ndescribe(\"list_releases\", () => {\n it(\"works without project\", async () => {\n const tool = TOOL_HANDLERS.list_releases;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n projectSlug: undefined,\n regionUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Releases in **sentry-mcp-evals**\n\n ## 8ce89484-0fec-4913-a2cd-e8e2d41dee36\n\n **Created**: 2025-04-13T19:54:21.764Z\n **First Event**: 2025-04-13T19:54:21.000Z\n **Last Event**: 2025-04-13T20:28:23.000Z\n **New Issues**: 0\n **Projects**: cloudflare-mcp\n\n # Using this information\n\n - You can reference the Release version in commit messages or documentation.\n - You can search for issues in a specific release using the \\`search_errors()\\` tool with the query \\`release:8ce89484-0fec-4913-a2cd-e8e2d41dee36\\`.\n \"\n `);\n });\n it(\"works with project\", async () => {\n const tool = TOOL_HANDLERS.list_releases;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n projectSlug: \"cloudflare-mcp\",\n regionUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Releases in **sentry-mcp-evals/cloudflare-mcp**\n\n ## 8ce89484-0fec-4913-a2cd-e8e2d41dee36\n\n **Created**: 2025-04-13T19:54:21.764Z\n **First Event**: 2025-04-13T19:54:21.000Z\n **Last Event**: 2025-04-13T20:28:23.000Z\n **New Issues**: 0\n **Projects**: cloudflare-mcp\n\n # Using this information\n\n - You can reference the Release version in commit messages or documentation.\n - You can search for issues in a specific release using the \\`search_errors()\\` tool with the query \\`release:8ce89484-0fec-4913-a2cd-e8e2d41dee36\\`.\n \"\n `);\n });\n});\n\ndescribe(\"list_tags\", () => {\n it(\"works\", async () => {\n const tool = TOOL_HANDLERS.list_tags;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n projectSlug: undefined,\n regionUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Tags in **sentry-mcp-evals**\n\n - transaction\n - runtime.name\n - level\n - device\n - os\n - user\n - runtime\n - release\n - url\n - uptime_rule\n - server_name\n - browser\n - os.name\n - device.family\n - replayId\n - client_os.name\n - environment\n - service\n - browser.name\n\n # Using this information\n\n - You can reference tags in the \\`query\\` parameter of various tools: \\`tagName:tagValue\\`.\n \"\n `);\n });\n});\n\ndescribe(\"search_errors\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.search_errors;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n projectSlug: undefined,\n filename: undefined,\n transaction: undefined,\n query: undefined,\n sortBy: \"count\",\n regionUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Errors in **sentry-mcp-evals**\n\n\n ## CLOUDFLARE-MCP-41\n\n **Description**: Error: Tool list_organizations is already registered\n **Issue ID**: CLOUDFLARE-MCP-41\n **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41\n **Project**: test-suite\n **Last Seen**: 2025-04-07T12:23:39+00:00\n **Occurrences**: 2\n\n # Using this information\n\n - You can reference the Issue ID in commit messages (e.g. \\`Fixes <issueID>\\`) to automatically close the issue when the commit is merged.\n - You can get more details about an error by using the tool: \\`get_issue_details(organizationSlug=\"sentry-mcp-evals\", issueId=<issueID>)\\`\n \"\n `);\n });\n});\n\ndescribe(\"search_transactions\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.search_transactions;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n projectSlug: undefined,\n transaction: undefined,\n query: undefined,\n sortBy: \"duration\",\n regionUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Transactions in **sentry-mcp-evals**\n\n\n ## GET /trpc/bottleList\n\n **Span ID**: 07752c6aeb027c8f\n **Trace ID**: 6a477f5b0f31ef7b6b9b5e1dea66c91d\n **Span Operation**: http.server\n **Span Description**: GET /trpc/bottleList\n **Duration**: 12\n **Timestamp**: 2025-04-13T14:19:18+00:00\n **Project**: peated\n **URL**: https://sentry-mcp-evals.sentry.io/explore/traces/trace/6a477f5b0f31ef7b6b9b5e1dea66c91d\n\n ## GET /trpc/bottleList\n\n **Span ID**: 7ab5edf5b3ba42c9\n **Trace ID**: 54177131c7b192a446124daba3136045\n **Span Operation**: http.server\n **Span Description**: GET /trpc/bottleList\n **Duration**: 18\n **Timestamp**: 2025-04-13T14:19:17+00:00\n **Project**: peated\n **URL**: https://sentry-mcp-evals.sentry.io/explore/traces/trace/54177131c7b192a446124daba3136045\n\n \"\n `);\n });\n});\n\ndescribe(\"get_issue_summary\", () => {\n it(\"serializes with issueId\", async () => {\n const tool = TOOL_HANDLERS.get_issue_summary;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n issueId: \"CLOUDFLARE-MCP-41\",\n issueUrl: undefined,\n regionUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Issue CLOUDFLARE-MCP-41 in **sentry-mcp-evals**\n\n **Description**: Error: Tool list_organizations is already registered\n **Culprit**: Object.fetch(index)\n **First Seen**: 2025-04-03T22:51:19.403Z\n **Last Seen**: 2025-04-12T11:34:11.000Z\n **Occurrences**: 25\n **Users Impacted**: 1\n **Status**: unresolved\n **Platform**: javascript\n **Project**: CLOUDFLARE-MCP\n **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41\n \"\n `);\n });\n\n it(\"serializes with issueUrl\", async () => {\n const tool = TOOL_HANDLERS.get_issue_summary;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: undefined,\n issueId: undefined,\n issueUrl: \"https://sentry-mcp-evals.sentry.io/issues/6507376925\",\n regionUrl: undefined,\n },\n );\n\n expect(result).toMatchInlineSnapshot(`\n \"# Issue CLOUDFLARE-MCP-41 in **sentry-mcp-evals**\n\n **Description**: Error: Tool list_organizations is already registered\n **Culprit**: Object.fetch(index)\n **First Seen**: 2025-04-03T22:51:19.403Z\n **Last Seen**: 2025-04-12T11:34:11.000Z\n **Occurrences**: 25\n **Users Impacted**: 1\n **Status**: unresolved\n **Platform**: javascript\n **Project**: CLOUDFLARE-MCP\n **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41\n \"\n `);\n });\n});\n\ndescribe(\"get_issue_details\", () => {\n it(\"serializes with issueId\", async () => {\n const tool = TOOL_HANDLERS.get_issue_details;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n issueId: \"CLOUDFLARE-MCP-41\",\n issueUrl: undefined,\n regionUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Issue CLOUDFLARE-MCP-41 in **sentry-mcp-evals**\n\n **Description**: Error: Tool list_organizations is already registered\n **Culprit**: Object.fetch(index)\n **First Seen**: 2025-04-03T22:51:19.403Z\n **Last Seen**: 2025-04-12T11:34:11.000Z\n **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41\n\n ## Event Specifics\n\n **Occurred At**: 2025-04-08T21:15:04.000Z\n **Error:**\n \\`\\`\\`\n Error: Tool list_organizations is already registered\n \\`\\`\\`\n\n **Stacktrace:**\n \\`\\`\\`\n index.js:7809:27\n index.js:8029:24 (OAuthProviderImpl.fetch)\n index.js:19631:28 (Object.fetch)\n \\`\\`\\`\n\n # Using this information\n\n - You can reference the IssueID in commit messages (e.g. \\`Fixes CLOUDFLARE-MCP-41\\`) to automatically close the issue when the commit is merged.\n - The stacktrace includes both first-party application code as well as third-party code, its important to triage to first-party code.\n \"\n `);\n });\n\n it(\"serializes with issueUrl\", async () => {\n const tool = TOOL_HANDLERS.get_issue_details;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: undefined,\n issueId: undefined,\n issueUrl: \"https://sentry-mcp-evals.sentry.io/issues/6507376925\",\n regionUrl: undefined,\n },\n );\n\n expect(result).toMatchInlineSnapshot(`\n \"# Issue CLOUDFLARE-MCP-41 in **sentry-mcp-evals**\n\n **Description**: Error: Tool list_organizations is already registered\n **Culprit**: Object.fetch(index)\n **First Seen**: 2025-04-03T22:51:19.403Z\n **Last Seen**: 2025-04-12T11:34:11.000Z\n **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41\n\n ## Event Specifics\n\n **Occurred At**: 2025-04-08T21:15:04.000Z\n **Error:**\n \\`\\`\\`\n Error: Tool list_organizations is already registered\n \\`\\`\\`\n\n **Stacktrace:**\n \\`\\`\\`\n index.js:7809:27\n index.js:8029:24 (OAuthProviderImpl.fetch)\n index.js:19631:28 (Object.fetch)\n \\`\\`\\`\n\n # Using this information\n\n - You can reference the IssueID in commit messages (e.g. \\`Fixes 6507376925\\`) to automatically close the issue when the commit is merged.\n - The stacktrace includes both first-party application code as well as third-party code, its important to triage to first-party code.\n \"\n `);\n });\n});\n\ndescribe(\"create_team\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.create_team;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n name: \"the-goats\",\n regionUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# New Team in **sentry-mcp-evals**\n\n **ID**: 4509109078196224\n **Slug**: the-goats\n **Name**: the-goats\n # Using this information\n\n - You should always inform the user of the Team Slug value.\n \"\n `);\n });\n});\n\ndescribe(\"create_project\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.create_project;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n teamSlug: \"the-goats\",\n name: \"cloudflare-mcp\",\n platform: \"javascript\",\n regionUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# New Project in **sentry-mcp-evals**\n\n **ID**: 4509109104082945\n **Slug**: cloudflare-mcp\n **Name**: cloudflare-mcp\n **SENTRY_DSN**: https://d20df0a1ab5031c7f3c7edca9c02814d@o4509106732793856.ingest.us.sentry.io/4509109104082945\n\n # Using this information\n\n - You can reference the **SENTRY_DSN** value to initialize Sentry's SDKs.\n - You should always inform the user of the **SENTRY_DSN** and Project Slug values.\n \"\n `);\n });\n});\n\ndescribe(\"create_dsn\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.create_dsn;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n projectSlug: \"cloudflare-mcp\",\n name: \"Default\",\n regionUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# New DSN in **sentry-mcp-evals/cloudflare-mcp**\n\n **DSN**: https://d20df0a1ab5031c7f3c7edca9c02814d@o4509106732793856.ingest.us.sentry.io/4509109104082945\n **Name**: Default\n\n # Using this information\n\n - The \\`SENTRY_DSN\\` value is a URL that you can use to initialize Sentry's SDKs.\n \"\n `);\n });\n});\n\ndescribe(\"list_dsn\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.list_dsns;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n projectSlug: \"cloudflare-mcp\",\n regionUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# DSNs in **sentry-mcp-evals/cloudflare-mcp**\n\n ## Default\n **ID**: d20df0a1ab5031c7f3c7edca9c02814d\n **DSN**: https://d20df0a1ab5031c7f3c7edca9c02814d@o4509106732793856.ingest.us.sentry.io/4509109104082945\n\n # Using this information\n\n - The \\`SENTRY_DSN\\` value is a URL that you can use to initialize Sentry's SDKs.\n \"\n `);\n });\n});\n\ndescribe(\"begin_autofix\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.begin_autofix;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n issueId: \"PEATED-A8\",\n issueUrl: undefined,\n regionUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Autofix Started for Issue PEATED-A8\n\n **Run ID:**: 123\n\n This operation may take some time, so you should call \\`get_autofix_status()\\` to check the status of the analysis, and repeat the process until its finished.\n\n You should also inform the user that the operation may take some time, and give them updates whenever you check the status of the operation..\n\n \\`\\`\\`\n get_autofix_status(organizationSlug=\"sentry-mcp-evals\", issueId=\"PEATED-A8\")\n \\`\\`\\`\"\n `);\n });\n});\n\ndescribe(\"get_autofix_status\", () => {\n it(\"serializes\", async () => {\n const tool = TOOL_HANDLERS.get_autofix_status;\n const result = await tool(\n {\n accessToken: \"access-token\",\n userId: \"1\",\n organizationSlug: null,\n },\n {\n organizationSlug: \"sentry-mcp-evals\",\n issueId: \"PEATED-A8\",\n issueUrl: undefined,\n regionUrl: undefined,\n },\n );\n expect(result).toMatchInlineSnapshot(`\n \"# Autofix Status for Issue PEATED-A8\n\n ## Analyzing the Issue\n\n **The \\`bottleById\\` query fails because the input ID (3216) doesn't exist in the database.\n **\n The exception details show that the \\`input\\` value at the time of the \\`TRPCError\\` in \\`bottleById.ts\\` was 3216, and the query likely failed because a bottle with ID 3216 was not found in the database.\n\n \\`\\`\\`\n Variable values at the time of the exception::\n {\n \"input\": 3216\n }\n \\`\\`\\`\n\n\n **However, the request also includes a different ID (16720) for \\`bottlePriceList\\`.\n **\n The root cause is likely a mismatch of input IDs within the batched TRPC request, where \\`bottlePriceList\\` expects bottle ID 16720, but \\`bottleById\\` receives a different ID (3216) leading to the \"Bottle not found\" error.\n\n \\`\\`\\`\n GET http://api.peated.com/trpc/bottlePriceList,bottleById\n \\`\\`\\`\n\n \\`\\`\\`json\n {\n \"input\": 3216\n }\n \\`\\`\\`\n\n \\`\\`\\`\n TRPCError: Bottle not found. (occurred in: GET /trpc/bottlePriceList,bottleById)\n \\`\\`\\`\n\n\n **This suggests a data consistency issue or incorrect client-side request.\n **\n The \\`TRPCError\\` originates from \\`bottleById.ts\\` with the input value being \\`3216\\`, indicating the procedure failed to find a bottle with that specific ID in the database.\n\n \\`\\`\\`\n <anonymous> in file /app/apps/server/src/trpc/routes/bottleById.ts [Line 33, column 13] (In app)\n .select({\n ...getTableColumns(bottles),\n })\n .from(bottleTombstones)\n .innerJoin(bottles, eq(bottleTombstones.newBottleId, bottles.id))\n .where(eq(bottleTombstones.bottleId, input));\n if (!bottle) {\n throw new TRPCError({ <-- SUSPECT LINE\n message: \"Bottle not found.\",\n code: \"NOT_FOUND\",\n });\n }\n }\n\n const createdBy = await db.query.users.findFirst({\n ---\n Variable values at the time of the exception::\n {\n \"input\": 3216\n }\n \\`\\`\\`\n\n\n\n ## Root Cause Analysis\n\n **The client initiates a batched TRPC request to the \\`/trpc/bottlePriceList,bottleById\\` endpoint, intending to fetch both the price list and details for a specific bottle.**\n\n This is the entry point where the client requests data from two different procedures in a single HTTP request. The server needs to correctly route and process the parameters for each procedure.\n\n **The TRPC server receives the batched request and begins processing the \\`bottlePriceList\\` procedure, intending to fetch the price list for bottle ID 16720.**\n\n \\`\\`\\`typescript\n // apps/server/src/trpc/routes/bottlePriceList.ts\n .input(z.object({ bottle: z.number(), onlyValid: z.boolean().optional() }))\n .query(async function ({ input, ctx }) {\n const [bottle] = await db.select().from(bottles).where(eq(bottles.id, input.bottle));\n if (!bottle) { ... }\n \\`\\`\\`\n This procedure expects a 'bottle' parameter in the input, which is used to query the database.\n\n **The TRPC server also processes the \\`bottleById\\` procedure, but due to a parameter mapping issue or client-side error, it receives bottle ID 3216 as input instead of 16720.**\n\n \\`\\`\\`typescript\n // apps/server/src/trpc/routes/bottleById.ts\n export default publicProcedure.input(z.number()).query(async function ({ input, ctx }) {\n let [bottle] = await db.select().from(bottles).where(eq(bottles.id, input));\n if (!bottle) { ... }\n \\`\\`\\`\n This procedure expects a numerical ID as input to find the bottle.\n\n **The \\`bottleById\\` procedure queries the \\`bottles\\` table for a bottle with ID 3216, but no such bottle exists.**\n\n The database query returns no results because bottle ID 3216 is not present in the \\`bottles\\` table.\n\n **The \\`bottleById\\` procedure then checks the \\`bottleTombstones\\` table to see if bottle ID 3216 has been tombstoned (redirected to a new ID), but no such tombstone exists.**\n\n The query to \\`bottleTombstones\\` also returns no results, indicating that bottle ID 3216 has not been redirected.\n\n **Since the \\`bottleById\\` procedure cannot find a bottle with ID 3216 in either the \\`bottles\\` or \\`bottleTombstones\\` tables, it throws a \\`TRPCError\\` with the message \"Bottle not found.\"**\n\n \\`\\`\\`typescript\n // apps/server/src/trpc/routes/bottleById.ts\n if (!bottle) {\n throw new TRPCError({ message: \"Bottle not found.\", code: \"NOT_FOUND\" });\n }\n \\`\\`\\`\n This is where the error is thrown, indicating that the bottle could not be found.\n\n\n ## Planning Solution\n\n **The discrepancy between inputs suggests a potential issue with batch request handling.\n **\n The \\`TRPCError\\` occurred in \\`bottleById.ts\\` with an input of \\`3216\\`, while the request was initiated with a bottle ID of \\`16720\\`, indicating a mismatch in the bottle ID being processed.\n\n \\`\\`\\`\n Variable values at the time of the exception::\n {\n \"input\": 3216\n }\n \\`\\`\\`\n\n \\`\\`\\`\n GET http://api.peated.com/trpc/bottlePriceList,bottleById\n \\`\\`\\`\n\n\n **The client-side batch request construction is the most likely source of error.\n **\n The discrepancy between the bottle ID in the error message (16720) and the ID being processed (3216) strongly suggests a client-side parameter mapping issue in the batched TRPC request.\n\n To fix this, I propose the following steps:\n\n 1. **Inspect the Client-Side Code:** Identify the code responsible for constructing the TRPC batch request to \\`/trpc/bottlePriceList,bottleById\\`.\n\n 2. **Verify Parameter Mapping:** Ensure that both \\`bottlePriceList\\` and \\`bottleById\\` are receiving the correct bottle ID (which should be 16720 in this case).\n\n 3. **Correct Parameter Assignment:** If the parameters are being incorrectly assigned, modify the client-side code to ensure that both procedures receive the same, correct bottle ID.\n\n 4. **Add Logging (Client-Side):** Add temporary logging to the client-side code to confirm the parameters being sent to each procedure in the batch request. This will help verify the fix.\n\n \\`\\`\\`typescript\n // Example logging (add to the client-side code where the batch request is created)\n console.log(\"bottlePriceList input:\", { bottle: 16720 }); // Replace 16720 with the actual ID\n console.log(\"bottleById input:\", { bottle: 16720 }); // Replace 16720 with the actual ID\n \\`\\`\\`\n\n 5. **Test the Fix:** After applying the fix, test the affected functionality to ensure that the \"Bottle not found\" error is resolved and that both procedures are working correctly.\n\n 6. **Remove Logging:** Once the fix is verified, remove the temporary logging.\n\n This approach directly addresses the most likely cause of the issue and provides a clear path to resolution.\n\n\n **Ensuring consistent bottle IDs will likely resolve this inconsistency.\n **\n The error message references bottle ID 16720, but the exception details show the procedure was actually processing ID 3216, indicating a parameter mismatch in the batch request.\n\n To fix this, I recommend the following steps:\n\n 1. **Client-Side Investigation**:\n\n * Examine the client-side code where the TRPC batch request is constructed.\n * Verify that the same \\`bottleId\\` parameter is being passed to both \\`bottlePriceList\\` and \\`bottleById\\` procedures.\n * If the IDs are being passed correctly, inspect the network request payload to confirm the correct structure of the batched request.\n\n \\`\\`\\`typescript\n // Example (Hypothetical) Client-Side Code\n const bottleId = 16720; // Example bottle ID\n\n // Ensure both procedures receive the same bottleId\n const [priceList, bottleDetails] = await trpc.batch(() => [\n trpc.bottlePriceList.fetch({ bottle: bottleId }),\n trpc.bottleById.fetch(bottleId),\n ]);\n \\`\\`\\`\n\n 2. **Server-Side Logging (Temporary)**:\n\n * Add temporary logging to both \\`bottlePriceList\\` and \\`bottleById\\` procedures to log the received \\`input\\` value.\n * This will help confirm whether the server is receiving the correct IDs from the client.\n * **Important**: Remove these logs after debugging to avoid unnecessary overhead.\n\n \\`\\`\\`typescript\n // apps/server/src/trpc/routes/bottlePriceList.ts\n export default publicProcedure\n .input(\n z.object({\n bottle: z.number(),\n onlyValid: z.boolean().optional(),\n }),\n )\n .query(async function ({ input, ctx }) {\n console.log(\"bottlePriceList input:\", input); // Add this line\n // ... rest of the code\n });\n\n // apps/server/src/trpc/routes/bottleById.ts\n export default publicProcedure.input(z.number()).query(async function ({\n input,\n ctx,\n }) {\n console.log(\"bottleById input:\", input); // Add this line\n // ... rest of the code\n });\n \\`\\`\\`\n\n 3. **TRPC Batch Request Configuration**:\n\n * Review the TRPC batch link configuration on the client-side.\n * Ensure that the batching logic is correctly mapping parameters to the corresponding procedures.\n * If using a custom batching implementation, verify its correctness.\n\n 4. **Data Integrity Check**:\n\n * If the client-side code appears correct, investigate whether bottle ID 3216 should exist in the database.\n * Check the \\`bottles\\` table and \\`bottleTombstones\\` table for any entries related to bottle ID 3216.\n * If the bottle should exist but is missing, investigate potential data deletion or migration issues.\n\n 5. **Tombstone Logic**:\n\n * Double-check the logic for creating and using tombstones.\n * Ensure that when a bottle is deleted, a tombstone entry is created correctly, pointing to the new bottle (if any).\n\n 6. **Error Handling**:\n\n * While this isn't the primary fix, consider improving the error message in \\`bottleById.ts\\` to include more context.\n * Include the original requested bottle ID (if available) in the error message to aid debugging.\n\n 7. **Client-Side Retries**:\n\n * Implement a retry mechanism on the client-side for TRPC requests.\n * If a \"Bottle not found\" error occurs, retry the request a few times before giving up. This can help mitigate transient issues.\n\n By following these steps, you should be able to identify the root cause of the parameter mismatch and implement a fix that ensures consistent bottle IDs are passed to both TRPC procedures in the batch request.\n\n\n\n ## Solution\n\n Consolidate bottle and price data fetching into a single batched TRPC request using \\`Promise.all\\` to ensure ID consistency.\n\n **Create a shared utility function to fetch bottle details and price data together.**\n \\`\\`\\`typescript\n // In a shared utility function or component\n export async function getBottleWithPrices(bottleId: number) {\n const trpcClient = await getTrpcClient();\n \n // Use Promise.all to ensure both requests are part of the same batch\n // and receive the same parameters\n const [bottle, priceList] = await Promise.all([\n trpcClient.bottleById.fetch(bottleId),\n trpcClient.bottlePriceList.fetch({ bottle: bottleId }),\n ]);\n \n return { bottle, priceList };\n }\n \\`\\`\\`\n This code creates a function that uses \\`Promise.all\\` to fetch both bottle details and price data concurrently. This ensures that both TRPC procedures are part of the same batch and receive the same \\`bottleId\\`.\n\n **Modify the page components to use the shared utility function.**\n \\`\\`\\`typescript\n // Then in the page components:\n const { bottle, priceList } = await getBottleWithPrices(Number(bottleId));\n \\`\\`\\`\n This code replaces the separate calls to \\`bottleById\\` and \\`bottlePriceList\\` with a single call to the \\`getBottleWithPrices\\` function, ensuring that both components receive data for the same bottle.\n\n **Add a unit test that reproduces the issue.**\n null\n\n\n \"\n `);\n });\n});\n"],"mappings":";;;;;;;;;;;;;AAGA,sBAAS,sBAAsB,MAAM;AACnC,iBAAG,cAAc,YAAY;EAC3B,MAAM,OAAOA,4BAAc;EAC3B,MAAM,SAAS,MAAM,KAAK;GACxB,aAAa;GACb,QAAQ;GACR,kBAAkB;EACnB,EAAC;AACF,mCAAO,OAAO,CAAC,uBAAuB;;;;;;;;;;;;;MAapC;CACH,EAAC;AACH,EAAC;AAEF,sBAAS,cAAc,MAAM;AAC3B,iBAAG,cAAc,YAAY;EAC3B,MAAM,OAAOA,4BAAc;EAC3B,MAAM,SAAS,MAAM,KACnB;GACE,aAAa;GACb,QAAQ;GACR,kBAAkB;EACnB,GACD;GACE,kBAAkB;GAClB;EACD,EACF;AACD,mCAAO,OAAO,CAAC,uBAAuB;;;;;MAKpC;CACH,EAAC;AACH,EAAC;AAEF,sBAAS,iBAAiB,MAAM;AAC9B,iBAAG,cAAc,YAAY;EAC3B,MAAM,OAAOA,4BAAc;EAC3B,MAAM,SAAS,MAAM,KACnB;GACE,aAAa;GACb,QAAQ;GACR,kBAAkB;EACnB,GACD;GACE,kBAAkB;GAClB;EACD,EACF;AACD,mCAAO,OAAO,C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