@sentry/mcp-server 0.2.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 (201) hide show
  1. package/LICENSE.md +105 -0
  2. package/dist/api-client/client.cjs +5 -0
  3. package/dist/api-client/client.d.cts +5 -0
  4. package/dist/api-client/client.d.ts +5 -0
  5. package/dist/api-client/client.js +4 -0
  6. package/dist/api-client/client.test.cjs +34 -0
  7. package/dist/api-client/client.test.cjs.map +1 -0
  8. package/dist/api-client/client.test.d.cts +1 -0
  9. package/dist/api-client/client.test.d.ts +1 -0
  10. package/dist/api-client/client.test.js +33 -0
  11. package/dist/api-client/client.test.js.map +1 -0
  12. package/dist/api-client/index.cjs +35 -0
  13. package/dist/api-client/index.d.cts +6 -0
  14. package/dist/api-client/index.d.ts +6 -0
  15. package/dist/api-client/index.js +6 -0
  16. package/dist/api-client/schema.cjs +30 -0
  17. package/dist/api-client/schema.d.cts +3 -0
  18. package/dist/api-client/schema.d.ts +3 -0
  19. package/dist/api-client/schema.js +3 -0
  20. package/dist/api-client/types.cjs +1 -0
  21. package/dist/api-client/types.d.cts +4 -0
  22. package/dist/api-client/types.d.ts +4 -0
  23. package/dist/api-client/types.js +1 -0
  24. package/dist/api-client-9mzrj2HY.js +0 -0
  25. package/dist/api-client-CEBuz3Zu.cjs +0 -0
  26. package/dist/chunk-BtT13l48.cjs +40 -0
  27. package/dist/chunk-CsIcISPO.js +30 -0
  28. package/dist/client-BlG0jPGS.cjs +206 -0
  29. package/dist/client-BlG0jPGS.cjs.map +1 -0
  30. package/dist/client-D1XjYhij.js +194 -0
  31. package/dist/client-D1XjYhij.js.map +1 -0
  32. package/dist/client.d-B8RB2Poz.d.ts +108 -0
  33. package/dist/client.d-B8RB2Poz.d.ts.map +1 -0
  34. package/dist/client.d-CXQCEkJz.d.cts +108 -0
  35. package/dist/dist-B914BQU9.cjs +8043 -0
  36. package/dist/dist-B914BQU9.cjs.map +1 -0
  37. package/dist/dist-DJoL0rVQ.js +7899 -0
  38. package/dist/dist-DJoL0rVQ.js.map +1 -0
  39. package/dist/formatting-BTSvl7n7.cjs +41 -0
  40. package/dist/formatting-BTSvl7n7.cjs.map +1 -0
  41. package/dist/formatting-Bacfde0I.js +28 -0
  42. package/dist/formatting-Bacfde0I.js.map +1 -0
  43. package/dist/index.cjs +52 -0
  44. package/dist/index.cjs.map +1 -0
  45. package/dist/index.d-Cb-lHGvn.d.cts +1 -0
  46. package/dist/index.d-Db2MND9s.d.ts +1 -0
  47. package/dist/index.d.cts +1 -0
  48. package/dist/index.d.ts +1 -0
  49. package/dist/index.js +50 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/internal/formatting.cjs +4 -0
  52. package/dist/internal/formatting.d.cts +13 -0
  53. package/dist/internal/formatting.d.ts +13 -0
  54. package/dist/internal/formatting.d.ts.map +1 -0
  55. package/dist/internal/formatting.js +3 -0
  56. package/dist/internal/issue-helpers.cjs +3 -0
  57. package/dist/internal/issue-helpers.d.cts +16 -0
  58. package/dist/internal/issue-helpers.d.ts +16 -0
  59. package/dist/internal/issue-helpers.d.ts.map +1 -0
  60. package/dist/internal/issue-helpers.js +3 -0
  61. package/dist/internal/issue-helpers.test.cjs +74 -0
  62. package/dist/internal/issue-helpers.test.cjs.map +1 -0
  63. package/dist/internal/issue-helpers.test.d.cts +1 -0
  64. package/dist/internal/issue-helpers.test.d.ts +1 -0
  65. package/dist/internal/issue-helpers.test.js +73 -0
  66. package/dist/internal/issue-helpers.test.js.map +1 -0
  67. package/dist/issue-helpers-C0kEdXOE.cjs +39 -0
  68. package/dist/issue-helpers-C0kEdXOE.cjs.map +1 -0
  69. package/dist/issue-helpers-DFde36Zu.js +32 -0
  70. package/dist/issue-helpers-DFde36Zu.js.map +1 -0
  71. package/dist/logging-BEMgC5SA.cjs +32 -0
  72. package/dist/logging-BEMgC5SA.cjs.map +1 -0
  73. package/dist/logging-Cxm8lQvg.js +25 -0
  74. package/dist/logging-Cxm8lQvg.js.map +1 -0
  75. package/dist/logging.cjs +3 -0
  76. package/dist/logging.d.cts +7 -0
  77. package/dist/logging.d.ts +7 -0
  78. package/dist/logging.d.ts.map +1 -0
  79. package/dist/logging.js +3 -0
  80. package/dist/magic-string.es-COkPNEcb.cjs +1017 -0
  81. package/dist/magic-string.es-COkPNEcb.cjs.map +1 -0
  82. package/dist/magic-string.es-qySpjS4V.js +1015 -0
  83. package/dist/magic-string.es-qySpjS4V.js.map +1 -0
  84. package/dist/promptDefinitions-CVB4IyVf.cjs +23 -0
  85. package/dist/promptDefinitions-CVB4IyVf.cjs.map +1 -0
  86. package/dist/promptDefinitions-CaRMCDPI.js +16 -0
  87. package/dist/promptDefinitions-CaRMCDPI.js.map +1 -0
  88. package/dist/promptDefinitions.cjs +4 -0
  89. package/dist/promptDefinitions.d-X_QALSRc.d.cts +15 -0
  90. package/dist/promptDefinitions.d-qzT7TH_Z.d.ts +15 -0
  91. package/dist/promptDefinitions.d-qzT7TH_Z.d.ts.map +1 -0
  92. package/dist/promptDefinitions.d.cts +3 -0
  93. package/dist/promptDefinitions.d.ts +3 -0
  94. package/dist/promptDefinitions.js +4 -0
  95. package/dist/prompts--QCiXmR2.cjs +26 -0
  96. package/dist/prompts--QCiXmR2.cjs.map +1 -0
  97. package/dist/prompts-Tz-qECa0.js +19 -0
  98. package/dist/prompts-Tz-qECa0.js.map +1 -0
  99. package/dist/prompts.cjs +3 -0
  100. package/dist/prompts.d.cts +19 -0
  101. package/dist/prompts.d.ts +19 -0
  102. package/dist/prompts.d.ts.map +1 -0
  103. package/dist/prompts.js +3 -0
  104. package/dist/resources-BAE7VVZZ.cjs +33 -0
  105. package/dist/resources-BAE7VVZZ.cjs.map +1 -0
  106. package/dist/resources-OM3EAnnj.js +26 -0
  107. package/dist/resources-OM3EAnnj.js.map +1 -0
  108. package/dist/resources.cjs +3 -0
  109. package/dist/resources.d.cts +15 -0
  110. package/dist/resources.d.ts +15 -0
  111. package/dist/resources.d.ts.map +1 -0
  112. package/dist/resources.js +3 -0
  113. package/dist/schema-BvloqMHW.cjs +57 -0
  114. package/dist/schema-BvloqMHW.cjs.map +1 -0
  115. package/dist/schema-Bvva80Pn.js +223 -0
  116. package/dist/schema-Bvva80Pn.js.map +1 -0
  117. package/dist/schema-CyHM0GZH.cjs +392 -0
  118. package/dist/schema-CyHM0GZH.cjs.map +1 -0
  119. package/dist/schema-k04PdSCK.js +14 -0
  120. package/dist/schema-k04PdSCK.js.map +1 -0
  121. package/dist/schema.cjs +9 -0
  122. package/dist/schema.d-BDStOeMD.d.cts +4978 -0
  123. package/dist/schema.d-Oa2HQQCX.d.ts +4978 -0
  124. package/dist/schema.d-Oa2HQQCX.d.ts.map +1 -0
  125. package/dist/schema.d.cts +14 -0
  126. package/dist/schema.d.ts +14 -0
  127. package/dist/schema.d.ts.map +1 -0
  128. package/dist/schema.js +3 -0
  129. package/dist/server-DY8wjV9H.cjs +110 -0
  130. package/dist/server-DY8wjV9H.cjs.map +1 -0
  131. package/dist/server-DuRPgdH4.js +103 -0
  132. package/dist/server-DuRPgdH4.js.map +1 -0
  133. package/dist/server.cjs +16 -0
  134. package/dist/server.d.cts +15 -0
  135. package/dist/server.d.ts +15 -0
  136. package/dist/server.d.ts.map +1 -0
  137. package/dist/server.js +16 -0
  138. package/dist/stdio-CSJMThag.cjs +23 -0
  139. package/dist/stdio-CSJMThag.cjs.map +1 -0
  140. package/dist/stdio-Ce5DHKZ4.js +16 -0
  141. package/dist/stdio-Ce5DHKZ4.js.map +1 -0
  142. package/dist/test-setup.cjs +18648 -0
  143. package/dist/test-setup.cjs.map +1 -0
  144. package/dist/test-setup.d.cts +1 -0
  145. package/dist/test-setup.d.ts +1 -0
  146. package/dist/test-setup.js +18647 -0
  147. package/dist/test-setup.js.map +1 -0
  148. package/dist/toolDefinitions-CMNKyt4H.js +400 -0
  149. package/dist/toolDefinitions-CMNKyt4H.js.map +1 -0
  150. package/dist/toolDefinitions-DS7wXdsP.cjs +407 -0
  151. package/dist/toolDefinitions-DS7wXdsP.cjs.map +1 -0
  152. package/dist/toolDefinitions.cjs +4 -0
  153. package/dist/toolDefinitions.d-CIXKiX81.d.cts +252 -0
  154. package/dist/toolDefinitions.d-DkYVHG7Y.d.ts +252 -0
  155. package/dist/toolDefinitions.d-DkYVHG7Y.d.ts.map +1 -0
  156. package/dist/toolDefinitions.d.cts +3 -0
  157. package/dist/toolDefinitions.d.ts +3 -0
  158. package/dist/toolDefinitions.js +4 -0
  159. package/dist/toolDefinitions.test.cjs +16 -0
  160. package/dist/toolDefinitions.test.cjs.map +1 -0
  161. package/dist/toolDefinitions.test.d.cts +1 -0
  162. package/dist/toolDefinitions.test.d.ts +1 -0
  163. package/dist/toolDefinitions.test.js +15 -0
  164. package/dist/toolDefinitions.test.js.map +1 -0
  165. package/dist/tools-BfTTqLNG.cjs +461 -0
  166. package/dist/tools-BfTTqLNG.cjs.map +1 -0
  167. package/dist/tools-qkapmf3p.js +455 -0
  168. package/dist/tools-qkapmf3p.js.map +1 -0
  169. package/dist/tools.cjs +10 -0
  170. package/dist/tools.d.cts +207 -0
  171. package/dist/tools.d.ts +207 -0
  172. package/dist/tools.d.ts.map +1 -0
  173. package/dist/tools.js +10 -0
  174. package/dist/tools.test.cjs +845 -0
  175. package/dist/tools.test.cjs.map +1 -0
  176. package/dist/tools.test.d.cts +1 -0
  177. package/dist/tools.test.d.ts +1 -0
  178. package/dist/tools.test.js +844 -0
  179. package/dist/tools.test.js.map +1 -0
  180. package/dist/transports/stdio.cjs +17 -0
  181. package/dist/transports/stdio.d.cts +11 -0
  182. package/dist/transports/stdio.d.ts +11 -0
  183. package/dist/transports/stdio.d.ts.map +1 -0
  184. package/dist/transports/stdio.js +17 -0
  185. package/dist/types-H-TSmRpm.js +0 -0
  186. package/dist/types-o3zWarRp.cjs +0 -0
  187. package/dist/types.cjs +0 -0
  188. package/dist/types.d-B8gSnrcY.d.cts +43 -0
  189. package/dist/types.d-BDS-6_Sj.d.cts +25 -0
  190. package/dist/types.d-Bfi1CpIf.d.ts +25 -0
  191. package/dist/types.d-Bfi1CpIf.d.ts.map +1 -0
  192. package/dist/types.d-Bj1fPi3b.d.ts +43 -0
  193. package/dist/types.d-Bj1fPi3b.d.ts.map +1 -0
  194. package/dist/types.d.cts +5 -0
  195. package/dist/types.d.ts +5 -0
  196. package/dist/types.js +0 -0
  197. package/dist/vi.ClIskdbk-BhK8y4UO.cjs +6294 -0
  198. package/dist/vi.ClIskdbk-BhK8y4UO.cjs.map +1 -0
  199. package/dist/vi.ClIskdbk-CiLaali_.js +6279 -0
  200. package/dist/vi.ClIskdbk-CiLaali_.js.map +1 -0
  201. package/package.json +77 -0
@@ -0,0 +1,844 @@
1
+ import "./schema-Bvva80Pn.js";
2
+ import "./client-D1XjYhij.js";
3
+ import "./types-H-TSmRpm.js";
4
+ import "./api-client-9mzrj2HY.js";
5
+ import "./formatting-Bacfde0I.js";
6
+ import "./issue-helpers-DFde36Zu.js";
7
+ import "./logging-Cxm8lQvg.js";
8
+ import { TOOL_HANDLERS } from "./tools-qkapmf3p.js";
9
+ import { describe, it } from "./dist-DJoL0rVQ.js";
10
+ import { globalExpect } from "./vi.ClIskdbk-CiLaali_.js";
11
+
12
+ //#region src/tools.test.ts
13
+ describe("list_organizations", () => {
14
+ it("serializes", async () => {
15
+ const tool = TOOL_HANDLERS.list_organizations;
16
+ const result = await tool({
17
+ accessToken: "access-token",
18
+ userId: "1",
19
+ organizationSlug: null
20
+ });
21
+ globalExpect(result).toMatchInlineSnapshot(`
22
+ "# Organizations
23
+
24
+ - sentry-mcp-evals
25
+ "
26
+ `);
27
+ });
28
+ });
29
+ describe("list_teams", () => {
30
+ it("serializes", async () => {
31
+ const tool = TOOL_HANDLERS.list_teams;
32
+ const result = await tool({
33
+ accessToken: "access-token",
34
+ userId: "1",
35
+ organizationSlug: null
36
+ }, { organizationSlug: "sentry-mcp-evals" });
37
+ globalExpect(result).toMatchInlineSnapshot(`
38
+ "# Teams in **sentry-mcp-evals**
39
+
40
+ - the-goats
41
+ "
42
+ `);
43
+ });
44
+ });
45
+ describe("list_projects", () => {
46
+ it("serializes", async () => {
47
+ const tool = TOOL_HANDLERS.list_projects;
48
+ const result = await tool({
49
+ accessToken: "access-token",
50
+ userId: "1",
51
+ organizationSlug: null
52
+ }, { organizationSlug: "sentry-mcp-evals" });
53
+ globalExpect(result).toMatchInlineSnapshot(`
54
+ "# Projects in **sentry-mcp-evals**
55
+
56
+ - cloudflare-mcp
57
+ "
58
+ `);
59
+ });
60
+ });
61
+ describe("list_issues", () => {
62
+ it("serializes", async () => {
63
+ const tool = TOOL_HANDLERS.list_issues;
64
+ const result = await tool({
65
+ accessToken: "access-token",
66
+ userId: "1",
67
+ organizationSlug: null
68
+ }, {
69
+ organizationSlug: "sentry-mcp-evals",
70
+ projectSlug: "cloudflare-mcp",
71
+ query: void 0,
72
+ sortBy: "last_seen"
73
+ });
74
+ globalExpect(result).toMatchInlineSnapshot(`
75
+ "# Issues in **sentry-mcp-evals/cloudflare-mcp**
76
+
77
+ ## CLOUDFLARE-MCP-41
78
+
79
+ **Description**: Error: Tool list_organizations is already registered
80
+ **Culprit**: Object.fetch(index)
81
+ **First Seen**: 2025-04-03T22:51:19.403Z
82
+ **Last Seen**: 2025-04-12T11:34:11.000Z
83
+ **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41
84
+
85
+ ## CLOUDFLARE-MCP-42
86
+
87
+ **Description**: Error: Tool list_issues is already registered
88
+ **Culprit**: Object.fetch(index)
89
+ **First Seen**: 2025-04-11T22:51:19.403Z
90
+ **Last Seen**: 2025-04-12T11:34:11.000Z
91
+ **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-42
92
+
93
+ # Using this information
94
+
95
+ - You can reference the Issue ID in commit messages (e.g. \`Fixes <issueID>\`) to automatically close the issue when the commit is merged.
96
+ - You can get more details about a specific issue by using the tool: \`get_issue_details(organizationSlug="sentry-mcp-evals", issueId=<issueID>)\`
97
+ "
98
+ `);
99
+ });
100
+ });
101
+ describe("list_releases", () => {
102
+ it("works without project", async () => {
103
+ const tool = TOOL_HANDLERS.list_releases;
104
+ const result = await tool({
105
+ accessToken: "access-token",
106
+ userId: "1",
107
+ organizationSlug: null
108
+ }, {
109
+ organizationSlug: "sentry-mcp-evals",
110
+ projectSlug: void 0
111
+ });
112
+ globalExpect(result).toMatchInlineSnapshot(`
113
+ "# Releases in **sentry-mcp-evals**
114
+
115
+ ## 8ce89484-0fec-4913-a2cd-e8e2d41dee36
116
+
117
+ **Created**: 2025-04-13T19:54:21.764Z
118
+ **First Event**: 2025-04-13T19:54:21.000Z
119
+ **Last Event**: 2025-04-13T20:28:23.000Z
120
+ **New Issues**: 0
121
+ **Projects**: cloudflare-mcp
122
+
123
+ # Using this information
124
+
125
+ - You can reference the Release version in commit messages or documentation.
126
+ - You can search for issues in a specific release using the \`search_errors()\` tool with the query \`release:8ce89484-0fec-4913-a2cd-e8e2d41dee36\`.
127
+ "
128
+ `);
129
+ });
130
+ it("works with project", async () => {
131
+ const tool = TOOL_HANDLERS.list_releases;
132
+ const result = await tool({
133
+ accessToken: "access-token",
134
+ userId: "1",
135
+ organizationSlug: null
136
+ }, {
137
+ organizationSlug: "sentry-mcp-evals",
138
+ projectSlug: "cloudflare-mcp"
139
+ });
140
+ globalExpect(result).toMatchInlineSnapshot(`
141
+ "# Releases in **sentry-mcp-evals/cloudflare-mcp**
142
+
143
+ ## 8ce89484-0fec-4913-a2cd-e8e2d41dee36
144
+
145
+ **Created**: 2025-04-13T19:54:21.764Z
146
+ **First Event**: 2025-04-13T19:54:21.000Z
147
+ **Last Event**: 2025-04-13T20:28:23.000Z
148
+ **New Issues**: 0
149
+ **Projects**: cloudflare-mcp
150
+
151
+ # Using this information
152
+
153
+ - You can reference the Release version in commit messages or documentation.
154
+ - You can search for issues in a specific release using the \`search_errors()\` tool with the query \`release:8ce89484-0fec-4913-a2cd-e8e2d41dee36\`.
155
+ "
156
+ `);
157
+ });
158
+ });
159
+ describe("list_tags", () => {
160
+ it("works", async () => {
161
+ const tool = TOOL_HANDLERS.list_tags;
162
+ const result = await tool({
163
+ accessToken: "access-token",
164
+ userId: "1",
165
+ organizationSlug: null
166
+ }, {
167
+ organizationSlug: "sentry-mcp-evals",
168
+ projectSlug: void 0
169
+ });
170
+ globalExpect(result).toMatchInlineSnapshot(`
171
+ "# Tags in **sentry-mcp-evals**
172
+
173
+ - transaction
174
+ - runtime.name
175
+ - level
176
+ - device
177
+ - os
178
+ - user
179
+ - runtime
180
+ - release
181
+ - url
182
+ - uptime_rule
183
+ - server_name
184
+ - browser
185
+ - os.name
186
+ - device.family
187
+ - replayId
188
+ - client_os.name
189
+ - environment
190
+ - service
191
+ - browser.name
192
+
193
+ # Using this information
194
+
195
+ - You can reference tags in the \`query\` parameter of various tools: \`tagName:tagValue\`.
196
+ "
197
+ `);
198
+ });
199
+ });
200
+ describe("search_errors", () => {
201
+ it("serializes", async () => {
202
+ const tool = TOOL_HANDLERS.search_errors;
203
+ const result = await tool({
204
+ accessToken: "access-token",
205
+ userId: "1",
206
+ organizationSlug: null
207
+ }, {
208
+ organizationSlug: "sentry-mcp-evals",
209
+ projectSlug: void 0,
210
+ filename: void 0,
211
+ transaction: void 0,
212
+ query: void 0,
213
+ sortBy: "count"
214
+ });
215
+ globalExpect(result).toMatchInlineSnapshot(`
216
+ "# Errors in **sentry-mcp-evals**
217
+
218
+
219
+ ## CLOUDFLARE-MCP-41
220
+
221
+ **Description**: Error: Tool list_organizations is already registered
222
+ **Issue ID**: CLOUDFLARE-MCP-41
223
+ **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41
224
+ **Project**: test-suite
225
+ **Last Seen**: 2025-04-07T12:23:39+00:00
226
+ **Occurrences**: 2
227
+
228
+ # Using this information
229
+
230
+ - You can reference the Issue ID in commit messages (e.g. \`Fixes <issueID>\`) to automatically close the issue when the commit is merged.
231
+ - You can get more details about an error by using the tool: \`get_issue_details(organizationSlug="sentry-mcp-evals", issueId=<issueID>)\`
232
+ "
233
+ `);
234
+ });
235
+ });
236
+ describe("search_transactions", () => {
237
+ it("serializes", async () => {
238
+ const tool = TOOL_HANDLERS.search_transactions;
239
+ const result = await tool({
240
+ accessToken: "access-token",
241
+ userId: "1",
242
+ organizationSlug: null
243
+ }, {
244
+ organizationSlug: "sentry-mcp-evals",
245
+ projectSlug: void 0,
246
+ transaction: void 0,
247
+ query: void 0,
248
+ sortBy: "duration"
249
+ });
250
+ globalExpect(result).toMatchInlineSnapshot(`
251
+ "# Transactions in **sentry-mcp-evals**
252
+
253
+
254
+ ## GET /trpc/bottleList
255
+
256
+ **Span ID**: 07752c6aeb027c8f
257
+ **Trace ID**: 6a477f5b0f31ef7b6b9b5e1dea66c91d
258
+ **Span Operation**: http.server
259
+ **Span Description**: GET /trpc/bottleList
260
+ **Duration**: 12
261
+ **Timestamp**: 2025-04-13T14:19:18+00:00
262
+ **Project**: peated
263
+ **URL**: https://sentry-mcp-evals.sentry.io/explore/traces/trace/6a477f5b0f31ef7b6b9b5e1dea66c91d
264
+
265
+ ## GET /trpc/bottleList
266
+
267
+ **Span ID**: 7ab5edf5b3ba42c9
268
+ **Trace ID**: 54177131c7b192a446124daba3136045
269
+ **Span Operation**: http.server
270
+ **Span Description**: GET /trpc/bottleList
271
+ **Duration**: 18
272
+ **Timestamp**: 2025-04-13T14:19:17+00:00
273
+ **Project**: peated
274
+ **URL**: https://sentry-mcp-evals.sentry.io/explore/traces/trace/54177131c7b192a446124daba3136045
275
+
276
+ "
277
+ `);
278
+ });
279
+ });
280
+ describe("get_issue_summary", () => {
281
+ it("serializes with issueId", async () => {
282
+ const tool = TOOL_HANDLERS.get_issue_summary;
283
+ const result = await tool({
284
+ accessToken: "access-token",
285
+ userId: "1",
286
+ organizationSlug: null
287
+ }, {
288
+ organizationSlug: "sentry-mcp-evals",
289
+ issueId: "CLOUDFLARE-MCP-41",
290
+ issueUrl: void 0
291
+ });
292
+ globalExpect(result).toMatchInlineSnapshot(`
293
+ "# Issue CLOUDFLARE-MCP-41 in **sentry-mcp-evals**
294
+
295
+ **Description**: Error: Tool list_organizations is already registered
296
+ **Culprit**: Object.fetch(index)
297
+ **First Seen**: 2025-04-03T22:51:19.403Z
298
+ **Last Seen**: 2025-04-12T11:34:11.000Z
299
+ **Occurrences**: 25
300
+ **Users Impacted**: 1
301
+ **Status**: unresolved
302
+ **Platform**: javascript
303
+ **Project**: CLOUDFLARE-MCP
304
+ **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41
305
+ "
306
+ `);
307
+ });
308
+ it("serializes with issueUrl", async () => {
309
+ const tool = TOOL_HANDLERS.get_issue_summary;
310
+ const result = await tool({
311
+ accessToken: "access-token",
312
+ userId: "1",
313
+ organizationSlug: null
314
+ }, {
315
+ organizationSlug: void 0,
316
+ issueId: void 0,
317
+ issueUrl: "https://sentry-mcp-evals.sentry.io/issues/6507376925"
318
+ });
319
+ globalExpect(result).toMatchInlineSnapshot(`
320
+ "# Issue CLOUDFLARE-MCP-41 in **sentry-mcp-evals**
321
+
322
+ **Description**: Error: Tool list_organizations is already registered
323
+ **Culprit**: Object.fetch(index)
324
+ **First Seen**: 2025-04-03T22:51:19.403Z
325
+ **Last Seen**: 2025-04-12T11:34:11.000Z
326
+ **Occurrences**: 25
327
+ **Users Impacted**: 1
328
+ **Status**: unresolved
329
+ **Platform**: javascript
330
+ **Project**: CLOUDFLARE-MCP
331
+ **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41
332
+ "
333
+ `);
334
+ });
335
+ });
336
+ describe("get_issue_details", () => {
337
+ it("serializes with issueId", async () => {
338
+ const tool = TOOL_HANDLERS.get_issue_details;
339
+ const result = await tool({
340
+ accessToken: "access-token",
341
+ userId: "1",
342
+ organizationSlug: null
343
+ }, {
344
+ organizationSlug: "sentry-mcp-evals",
345
+ issueId: "CLOUDFLARE-MCP-41",
346
+ issueUrl: void 0
347
+ });
348
+ globalExpect(result).toMatchInlineSnapshot(`
349
+ "# Issue CLOUDFLARE-MCP-41 in **sentry-mcp-evals**
350
+
351
+ **Description**: Error: Tool list_organizations is already registered
352
+ **Culprit**: Object.fetch(index)
353
+ **First Seen**: 2025-04-03T22:51:19.403Z
354
+ **Last Seen**: 2025-04-12T11:34:11.000Z
355
+ **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41
356
+
357
+ ## Event Specifics
358
+
359
+ **Occurred At**: 2025-04-08T21:15:04.000Z
360
+ **Error:**
361
+ \`\`\`
362
+ Error: Tool list_organizations is already registered
363
+ \`\`\`
364
+
365
+ **Stacktrace:**
366
+ \`\`\`
367
+ index.js:7809:27
368
+ index.js:8029:24 (OAuthProviderImpl.fetch)
369
+ index.js:19631:28 (Object.fetch)
370
+ \`\`\`
371
+
372
+ # Using this information
373
+
374
+ - You can reference the IssueID in commit messages (e.g. \`Fixes CLOUDFLARE-MCP-41\`) to automatically close the issue when the commit is merged.
375
+ - The stacktrace includes both first-party application code as well as third-party code, its important to triage to first-party code.
376
+ "
377
+ `);
378
+ });
379
+ it("serializes with issueUrl", async () => {
380
+ const tool = TOOL_HANDLERS.get_issue_details;
381
+ const result = await tool({
382
+ accessToken: "access-token",
383
+ userId: "1",
384
+ organizationSlug: null
385
+ }, {
386
+ organizationSlug: void 0,
387
+ issueId: void 0,
388
+ issueUrl: "https://sentry-mcp-evals.sentry.io/issues/6507376925"
389
+ });
390
+ globalExpect(result).toMatchInlineSnapshot(`
391
+ "# Issue CLOUDFLARE-MCP-41 in **sentry-mcp-evals**
392
+
393
+ **Description**: Error: Tool list_organizations is already registered
394
+ **Culprit**: Object.fetch(index)
395
+ **First Seen**: 2025-04-03T22:51:19.403Z
396
+ **Last Seen**: 2025-04-12T11:34:11.000Z
397
+ **URL**: https://sentry-mcp-evals.sentry.io/issues/CLOUDFLARE-MCP-41
398
+
399
+ ## Event Specifics
400
+
401
+ **Occurred At**: 2025-04-08T21:15:04.000Z
402
+ **Error:**
403
+ \`\`\`
404
+ Error: Tool list_organizations is already registered
405
+ \`\`\`
406
+
407
+ **Stacktrace:**
408
+ \`\`\`
409
+ index.js:7809:27
410
+ index.js:8029:24 (OAuthProviderImpl.fetch)
411
+ index.js:19631:28 (Object.fetch)
412
+ \`\`\`
413
+
414
+ # Using this information
415
+
416
+ - You can reference the IssueID in commit messages (e.g. \`Fixes 6507376925\`) to automatically close the issue when the commit is merged.
417
+ - The stacktrace includes both first-party application code as well as third-party code, its important to triage to first-party code.
418
+ "
419
+ `);
420
+ });
421
+ });
422
+ describe("create_team", () => {
423
+ it("serializes", async () => {
424
+ const tool = TOOL_HANDLERS.create_team;
425
+ const result = await tool({
426
+ accessToken: "access-token",
427
+ userId: "1",
428
+ organizationSlug: null
429
+ }, {
430
+ organizationSlug: "sentry-mcp-evals",
431
+ name: "the-goats"
432
+ });
433
+ globalExpect(result).toMatchInlineSnapshot(`
434
+ "# New Team in **sentry-mcp-evals**
435
+
436
+ **ID**: 4509109078196224
437
+ **Slug**: the-goats
438
+ **Name**: the-goats
439
+ # Using this information
440
+
441
+ - You should always inform the user of the Team Slug value.
442
+ "
443
+ `);
444
+ });
445
+ });
446
+ describe("create_project", () => {
447
+ it("serializes", async () => {
448
+ const tool = TOOL_HANDLERS.create_project;
449
+ const result = await tool({
450
+ accessToken: "access-token",
451
+ userId: "1",
452
+ organizationSlug: null
453
+ }, {
454
+ organizationSlug: "sentry-mcp-evals",
455
+ teamSlug: "the-goats",
456
+ name: "cloudflare-mcp",
457
+ platform: "javascript"
458
+ });
459
+ globalExpect(result).toMatchInlineSnapshot(`
460
+ "# New Project in **sentry-mcp-evals**
461
+
462
+ **ID**: 4509109104082945
463
+ **Slug**: cloudflare-mcp
464
+ **Name**: cloudflare-mcp
465
+ **SENTRY_DSN**: https://d20df0a1ab5031c7f3c7edca9c02814d@o4509106732793856.ingest.us.sentry.io/4509109104082945
466
+
467
+ # Using this information
468
+
469
+ - You can reference the **SENTRY_DSN** value to initialize Sentry's SDKs.
470
+ - You should always inform the user of the **SENTRY_DSN** and Project Slug values.
471
+ "
472
+ `);
473
+ });
474
+ });
475
+ describe("create_dsn", () => {
476
+ it("serializes", async () => {
477
+ const tool = TOOL_HANDLERS.create_dsn;
478
+ const result = await tool({
479
+ accessToken: "access-token",
480
+ userId: "1",
481
+ organizationSlug: null
482
+ }, {
483
+ organizationSlug: "sentry-mcp-evals",
484
+ projectSlug: "cloudflare-mcp",
485
+ name: "Default"
486
+ });
487
+ globalExpect(result).toMatchInlineSnapshot(`
488
+ "# New DSN in **sentry-mcp-evals/cloudflare-mcp**
489
+
490
+ **DSN**: https://d20df0a1ab5031c7f3c7edca9c02814d@o4509106732793856.ingest.us.sentry.io/4509109104082945
491
+ **Name**: Default
492
+
493
+ # Using this information
494
+
495
+ - The \`SENTRY_DSN\` value is a URL that you can use to initialize Sentry's SDKs.
496
+ "
497
+ `);
498
+ });
499
+ });
500
+ describe("list_dsn", () => {
501
+ it("serializes", async () => {
502
+ const tool = TOOL_HANDLERS.list_dsns;
503
+ const result = await tool({
504
+ accessToken: "access-token",
505
+ userId: "1",
506
+ organizationSlug: null
507
+ }, {
508
+ organizationSlug: "sentry-mcp-evals",
509
+ projectSlug: "cloudflare-mcp"
510
+ });
511
+ globalExpect(result).toMatchInlineSnapshot(`
512
+ "# DSNs in **sentry-mcp-evals/cloudflare-mcp**
513
+
514
+ ## Default
515
+ **ID**: d20df0a1ab5031c7f3c7edca9c02814d
516
+ **DSN**: https://d20df0a1ab5031c7f3c7edca9c02814d@o4509106732793856.ingest.us.sentry.io/4509109104082945
517
+
518
+ # Using this information
519
+
520
+ - The \`SENTRY_DSN\` value is a URL that you can use to initialize Sentry's SDKs.
521
+ "
522
+ `);
523
+ });
524
+ });
525
+ describe("begin_autofix", () => {
526
+ it("serializes", async () => {
527
+ const tool = TOOL_HANDLERS.begin_autofix;
528
+ const result = await tool({
529
+ accessToken: "access-token",
530
+ userId: "1",
531
+ organizationSlug: null
532
+ }, {
533
+ organizationSlug: "sentry-mcp-evals",
534
+ issueId: "PEATED-A8",
535
+ issueUrl: void 0
536
+ });
537
+ globalExpect(result).toMatchInlineSnapshot(`
538
+ "# Autofix Started for Issue PEATED-A8
539
+
540
+ **Run ID:**: 123
541
+
542
+ 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.
543
+
544
+ 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..
545
+
546
+ \`\`\`
547
+ get_autofix_status(organizationSlug="sentry-mcp-evals", issueId="PEATED-A8")
548
+ \`\`\`"
549
+ `);
550
+ });
551
+ });
552
+ describe("get_autofix_status", () => {
553
+ it("serializes", async () => {
554
+ const tool = TOOL_HANDLERS.get_autofix_status;
555
+ const result = await tool({
556
+ accessToken: "access-token",
557
+ userId: "1",
558
+ organizationSlug: null
559
+ }, {
560
+ organizationSlug: "sentry-mcp-evals",
561
+ issueId: "PEATED-A8",
562
+ issueUrl: void 0
563
+ });
564
+ globalExpect(result).toMatchInlineSnapshot(`
565
+ "# Autofix Status for Issue PEATED-A8
566
+
567
+ ## Analyzing the Issue
568
+
569
+ **The \`bottleById\` query fails because the input ID (3216) doesn't exist in the database.
570
+ **
571
+ 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.
572
+
573
+ \`\`\`
574
+ Variable values at the time of the exception::
575
+ {
576
+ "input": 3216
577
+ }
578
+ \`\`\`
579
+
580
+
581
+ **However, the request also includes a different ID (16720) for \`bottlePriceList\`.
582
+ **
583
+ 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.
584
+
585
+ \`\`\`
586
+ GET http://api.peated.com/trpc/bottlePriceList,bottleById
587
+ \`\`\`
588
+
589
+ \`\`\`json
590
+ {
591
+ "input": 3216
592
+ }
593
+ \`\`\`
594
+
595
+ \`\`\`
596
+ TRPCError: Bottle not found. (occurred in: GET /trpc/bottlePriceList,bottleById)
597
+ \`\`\`
598
+
599
+
600
+ **This suggests a data consistency issue or incorrect client-side request.
601
+ **
602
+ 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.
603
+
604
+ \`\`\`
605
+ <anonymous> in file /app/apps/server/src/trpc/routes/bottleById.ts [Line 33, column 13] (In app)
606
+ .select({
607
+ ...getTableColumns(bottles),
608
+ })
609
+ .from(bottleTombstones)
610
+ .innerJoin(bottles, eq(bottleTombstones.newBottleId, bottles.id))
611
+ .where(eq(bottleTombstones.bottleId, input));
612
+ if (!bottle) {
613
+ throw new TRPCError({ <-- SUSPECT LINE
614
+ message: "Bottle not found.",
615
+ code: "NOT_FOUND",
616
+ });
617
+ }
618
+ }
619
+
620
+ const createdBy = await db.query.users.findFirst({
621
+ ---
622
+ Variable values at the time of the exception::
623
+ {
624
+ "input": 3216
625
+ }
626
+ \`\`\`
627
+
628
+
629
+
630
+ ## Root Cause Analysis
631
+
632
+ **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.**
633
+
634
+ 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.
635
+
636
+ **The TRPC server receives the batched request and begins processing the \`bottlePriceList\` procedure, intending to fetch the price list for bottle ID 16720.**
637
+
638
+ \`\`\`typescript
639
+ // apps/server/src/trpc/routes/bottlePriceList.ts
640
+ .input(z.object({ bottle: z.number(), onlyValid: z.boolean().optional() }))
641
+ .query(async function ({ input, ctx }) {
642
+ const [bottle] = await db.select().from(bottles).where(eq(bottles.id, input.bottle));
643
+ if (!bottle) { ... }
644
+ \`\`\`
645
+ This procedure expects a 'bottle' parameter in the input, which is used to query the database.
646
+
647
+ **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.**
648
+
649
+ \`\`\`typescript
650
+ // apps/server/src/trpc/routes/bottleById.ts
651
+ export default publicProcedure.input(z.number()).query(async function ({ input, ctx }) {
652
+ let [bottle] = await db.select().from(bottles).where(eq(bottles.id, input));
653
+ if (!bottle) { ... }
654
+ \`\`\`
655
+ This procedure expects a numerical ID as input to find the bottle.
656
+
657
+ **The \`bottleById\` procedure queries the \`bottles\` table for a bottle with ID 3216, but no such bottle exists.**
658
+
659
+ The database query returns no results because bottle ID 3216 is not present in the \`bottles\` table.
660
+
661
+ **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.**
662
+
663
+ The query to \`bottleTombstones\` also returns no results, indicating that bottle ID 3216 has not been redirected.
664
+
665
+ **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."**
666
+
667
+ \`\`\`typescript
668
+ // apps/server/src/trpc/routes/bottleById.ts
669
+ if (!bottle) {
670
+ throw new TRPCError({ message: "Bottle not found.", code: "NOT_FOUND" });
671
+ }
672
+ \`\`\`
673
+ This is where the error is thrown, indicating that the bottle could not be found.
674
+
675
+
676
+ ## Planning Solution
677
+
678
+ **The discrepancy between inputs suggests a potential issue with batch request handling.
679
+ **
680
+ 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.
681
+
682
+ \`\`\`
683
+ Variable values at the time of the exception::
684
+ {
685
+ "input": 3216
686
+ }
687
+ \`\`\`
688
+
689
+ \`\`\`
690
+ GET http://api.peated.com/trpc/bottlePriceList,bottleById
691
+ \`\`\`
692
+
693
+
694
+ **The client-side batch request construction is the most likely source of error.
695
+ **
696
+ 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.
697
+
698
+ To fix this, I propose the following steps:
699
+
700
+ 1. **Inspect the Client-Side Code:** Identify the code responsible for constructing the TRPC batch request to \`/trpc/bottlePriceList,bottleById\`.
701
+
702
+ 2. **Verify Parameter Mapping:** Ensure that both \`bottlePriceList\` and \`bottleById\` are receiving the correct bottle ID (which should be 16720 in this case).
703
+
704
+ 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.
705
+
706
+ 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.
707
+
708
+ \`\`\`typescript
709
+ // Example logging (add to the client-side code where the batch request is created)
710
+ console.log("bottlePriceList input:", { bottle: 16720 }); // Replace 16720 with the actual ID
711
+ console.log("bottleById input:", { bottle: 16720 }); // Replace 16720 with the actual ID
712
+ \`\`\`
713
+
714
+ 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.
715
+
716
+ 6. **Remove Logging:** Once the fix is verified, remove the temporary logging.
717
+
718
+ This approach directly addresses the most likely cause of the issue and provides a clear path to resolution.
719
+
720
+
721
+ **Ensuring consistent bottle IDs will likely resolve this inconsistency.
722
+ **
723
+ 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.
724
+
725
+ To fix this, I recommend the following steps:
726
+
727
+ 1. **Client-Side Investigation**:
728
+
729
+ * Examine the client-side code where the TRPC batch request is constructed.
730
+ * Verify that the same \`bottleId\` parameter is being passed to both \`bottlePriceList\` and \`bottleById\` procedures.
731
+ * If the IDs are being passed correctly, inspect the network request payload to confirm the correct structure of the batched request.
732
+
733
+ \`\`\`typescript
734
+ // Example (Hypothetical) Client-Side Code
735
+ const bottleId = 16720; // Example bottle ID
736
+
737
+ // Ensure both procedures receive the same bottleId
738
+ const [priceList, bottleDetails] = await trpc.batch(() => [
739
+ trpc.bottlePriceList.fetch({ bottle: bottleId }),
740
+ trpc.bottleById.fetch(bottleId),
741
+ ]);
742
+ \`\`\`
743
+
744
+ 2. **Server-Side Logging (Temporary)**:
745
+
746
+ * Add temporary logging to both \`bottlePriceList\` and \`bottleById\` procedures to log the received \`input\` value.
747
+ * This will help confirm whether the server is receiving the correct IDs from the client.
748
+ * **Important**: Remove these logs after debugging to avoid unnecessary overhead.
749
+
750
+ \`\`\`typescript
751
+ // apps/server/src/trpc/routes/bottlePriceList.ts
752
+ export default publicProcedure
753
+ .input(
754
+ z.object({
755
+ bottle: z.number(),
756
+ onlyValid: z.boolean().optional(),
757
+ }),
758
+ )
759
+ .query(async function ({ input, ctx }) {
760
+ console.log("bottlePriceList input:", input); // Add this line
761
+ // ... rest of the code
762
+ });
763
+
764
+ // apps/server/src/trpc/routes/bottleById.ts
765
+ export default publicProcedure.input(z.number()).query(async function ({
766
+ input,
767
+ ctx,
768
+ }) {
769
+ console.log("bottleById input:", input); // Add this line
770
+ // ... rest of the code
771
+ });
772
+ \`\`\`
773
+
774
+ 3. **TRPC Batch Request Configuration**:
775
+
776
+ * Review the TRPC batch link configuration on the client-side.
777
+ * Ensure that the batching logic is correctly mapping parameters to the corresponding procedures.
778
+ * If using a custom batching implementation, verify its correctness.
779
+
780
+ 4. **Data Integrity Check**:
781
+
782
+ * If the client-side code appears correct, investigate whether bottle ID 3216 should exist in the database.
783
+ * Check the \`bottles\` table and \`bottleTombstones\` table for any entries related to bottle ID 3216.
784
+ * If the bottle should exist but is missing, investigate potential data deletion or migration issues.
785
+
786
+ 5. **Tombstone Logic**:
787
+
788
+ * Double-check the logic for creating and using tombstones.
789
+ * Ensure that when a bottle is deleted, a tombstone entry is created correctly, pointing to the new bottle (if any).
790
+
791
+ 6. **Error Handling**:
792
+
793
+ * While this isn't the primary fix, consider improving the error message in \`bottleById.ts\` to include more context.
794
+ * Include the original requested bottle ID (if available) in the error message to aid debugging.
795
+
796
+ 7. **Client-Side Retries**:
797
+
798
+ * Implement a retry mechanism on the client-side for TRPC requests.
799
+ * If a "Bottle not found" error occurs, retry the request a few times before giving up. This can help mitigate transient issues.
800
+
801
+ 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.
802
+
803
+
804
+
805
+ ## Solution
806
+
807
+ Consolidate bottle and price data fetching into a single batched TRPC request using \`Promise.all\` to ensure ID consistency.
808
+
809
+ **Create a shared utility function to fetch bottle details and price data together.**
810
+ \`\`\`typescript
811
+ // In a shared utility function or component
812
+ export async function getBottleWithPrices(bottleId: number) {
813
+ const trpcClient = await getTrpcClient();
814
+
815
+ // Use Promise.all to ensure both requests are part of the same batch
816
+ // and receive the same parameters
817
+ const [bottle, priceList] = await Promise.all([
818
+ trpcClient.bottleById.fetch(bottleId),
819
+ trpcClient.bottlePriceList.fetch({ bottle: bottleId }),
820
+ ]);
821
+
822
+ return { bottle, priceList };
823
+ }
824
+ \`\`\`
825
+ 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\`.
826
+
827
+ **Modify the page components to use the shared utility function.**
828
+ \`\`\`typescript
829
+ // Then in the page components:
830
+ const { bottle, priceList } = await getBottleWithPrices(Number(bottleId));
831
+ \`\`\`
832
+ 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.
833
+
834
+ **Add a unit test that reproduces the issue.**
835
+ null
836
+
837
+
838
+ "
839
+ `);
840
+ });
841
+ });
842
+
843
+ //#endregion
844
+ //# sourceMappingURL=tools.test.js.map