@sentry/mcp-server 0.17.0 → 0.17.1

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 (219) hide show
  1. package/README.md +4 -0
  2. package/dist/agent-tools/discover-dataset-fields.d.cts +3 -3
  3. package/dist/agent-tools/discover-dataset-fields.d.ts +6 -6
  4. package/dist/agent-tools/lookup-otel-semantics.d.cts +3 -3
  5. package/dist/agent-tools/lookup-otel-semantics.d.ts +6 -6
  6. package/dist/agent-tools/whoami.d.cts +3 -3
  7. package/dist/agent-tools/whoami.d.ts +6 -6
  8. package/dist/{analyze-issue-with-seer-Dw9iqvSk.cjs → analyze-issue-with-seer-ByoDTsq-.cjs} +2 -2
  9. package/dist/{analyze-issue-with-seer-Dw9iqvSk.cjs.map → analyze-issue-with-seer-ByoDTsq-.cjs.map} +1 -1
  10. package/dist/{analyze-issue-with-seer-DcSwrWrs.js → analyze-issue-with-seer-CpwtN4UA.js} +2 -2
  11. package/dist/{analyze-issue-with-seer-DcSwrWrs.js.map → analyze-issue-with-seer-CpwtN4UA.js.map} +1 -1
  12. package/dist/api-client/client.d.cts +3 -3
  13. package/dist/api-client/client.d.ts +3 -3
  14. package/dist/api-client/index.d.cts +3 -3
  15. package/dist/api-client/index.d.ts +3 -3
  16. package/dist/api-client/schema.d.cts +1 -1
  17. package/dist/api-client/schema.d.ts +1 -1
  18. package/dist/api-client/types.d.cts +2 -2
  19. package/dist/api-client/types.d.ts +2 -2
  20. package/dist/{client-C_dDreKj.d.ts → client-DLkUGS7r.d.ts} +4 -4
  21. package/dist/{client-C_dDreKj.d.ts.map → client-DLkUGS7r.d.ts.map} +1 -1
  22. package/dist/{client-CgS3tjJG.d.cts → client-DV68BdcS.d.cts} +2 -2
  23. package/dist/{client-CgS3tjJG.d.cts.map → client-DV68BdcS.d.cts.map} +1 -1
  24. package/dist/{constants-S7AU45oQ.js → constants-Fe-4NTUo.js} +6 -2
  25. package/dist/constants-Fe-4NTUo.js.map +1 -0
  26. package/dist/{constants-ClkMK29-.cjs → constants-wrEbre3j.cjs} +11 -1
  27. package/dist/constants-wrEbre3j.cjs.map +1 -0
  28. package/dist/constants.cjs +2 -1
  29. package/dist/constants.d.cts +5 -1
  30. package/dist/constants.d.cts.map +1 -1
  31. package/dist/constants.d.ts +5 -1
  32. package/dist/constants.d.ts.map +1 -1
  33. package/dist/constants.js +2 -2
  34. package/dist/{create-dsn-QDLdwhDO.js → create-dsn-BT3t-MDA.js} +2 -2
  35. package/dist/{create-dsn-QDLdwhDO.js.map → create-dsn-BT3t-MDA.js.map} +1 -1
  36. package/dist/{create-dsn-C6IPwoVO.cjs → create-dsn-Bgwi-Ygi.cjs} +2 -2
  37. package/dist/{create-dsn-C6IPwoVO.cjs.map → create-dsn-Bgwi-Ygi.cjs.map} +1 -1
  38. package/dist/{create-project-DdSF58TR.cjs → create-project-4R4aZMoc.cjs} +2 -2
  39. package/dist/{create-project-DdSF58TR.cjs.map → create-project-4R4aZMoc.cjs.map} +1 -1
  40. package/dist/{create-project-Cax3fWey.js → create-project-Ca1Sy1_F.js} +2 -2
  41. package/dist/{create-project-Cax3fWey.js.map → create-project-Ca1Sy1_F.js.map} +1 -1
  42. package/dist/{create-team-CXaLcylp.cjs → create-team-CSBXDcoD.cjs} +2 -2
  43. package/dist/{create-team-CXaLcylp.cjs.map → create-team-CSBXDcoD.cjs.map} +1 -1
  44. package/dist/{create-team-nm06goO5.js → create-team-D0dUl7Zo.js} +2 -2
  45. package/dist/{create-team-nm06goO5.js.map → create-team-D0dUl7Zo.js.map} +1 -1
  46. package/dist/{find-dsns-vQolGM7e.cjs → find-dsns-CkvahHwJ.cjs} +2 -2
  47. package/dist/{find-dsns-vQolGM7e.cjs.map → find-dsns-CkvahHwJ.cjs.map} +1 -1
  48. package/dist/{find-dsns-C3G5aBm1.js → find-dsns-DrNAfU_Q.js} +2 -2
  49. package/dist/{find-dsns-C3G5aBm1.js.map → find-dsns-DrNAfU_Q.js.map} +1 -1
  50. package/dist/{find-projects-B0NdOjBO.js → find-projects-CZCMck_0.js} +2 -2
  51. package/dist/{find-projects-B0NdOjBO.js.map → find-projects-CZCMck_0.js.map} +1 -1
  52. package/dist/{find-projects-xM2L0U1W.cjs → find-projects-Dh-1AK-m.cjs} +2 -2
  53. package/dist/{find-projects-xM2L0U1W.cjs.map → find-projects-Dh-1AK-m.cjs.map} +1 -1
  54. package/dist/{find-releases-BBTYr5Bx.cjs → find-releases-BsAkl--F.cjs} +2 -2
  55. package/dist/{find-releases-BBTYr5Bx.cjs.map → find-releases-BsAkl--F.cjs.map} +1 -1
  56. package/dist/{find-releases-BO2OF_uR.js → find-releases-Do_CywRr.js} +2 -2
  57. package/dist/{find-releases-BO2OF_uR.js.map → find-releases-Do_CywRr.js.map} +1 -1
  58. package/dist/{find-teams-CqUwp0EI.js → find-teams-BylQQ4FO.js} +2 -2
  59. package/dist/{find-teams-CqUwp0EI.js.map → find-teams-BylQQ4FO.js.map} +1 -1
  60. package/dist/{find-teams-B237Aq8U.cjs → find-teams-DXyzyQOy.cjs} +2 -2
  61. package/dist/{find-teams-B237Aq8U.cjs.map → find-teams-DXyzyQOy.cjs.map} +1 -1
  62. package/dist/{formatting-C80LN9iK.d.ts → formatting-C3qu84cm.d.ts} +4 -4
  63. package/dist/{formatting-C80LN9iK.d.ts.map → formatting-C3qu84cm.d.ts.map} +1 -1
  64. package/dist/{formatting-BxyhA4G3.d.cts → formatting-CmBYkI_e.d.cts} +4 -4
  65. package/dist/{formatting-BxyhA4G3.d.cts.map → formatting-CmBYkI_e.d.cts.map} +1 -1
  66. package/dist/{get-event-attachment-o0oH43Tv.cjs → get-event-attachment-BzhDeM6z.cjs} +2 -2
  67. package/dist/{get-event-attachment-o0oH43Tv.cjs.map → get-event-attachment-BzhDeM6z.cjs.map} +1 -1
  68. package/dist/{get-event-attachment-B-ElqztF.js → get-event-attachment-CVoMrETq.js} +2 -2
  69. package/dist/{get-event-attachment-B-ElqztF.js.map → get-event-attachment-CVoMrETq.js.map} +1 -1
  70. package/dist/{get-issue-details-CP_RyCpt.cjs → get-issue-details-C96fhps3.cjs} +2 -2
  71. package/dist/{get-issue-details-CP_RyCpt.cjs.map → get-issue-details-C96fhps3.cjs.map} +1 -1
  72. package/dist/{get-issue-details-CzroF7HR.js → get-issue-details-_uS_AZ_v.js} +2 -2
  73. package/dist/{get-issue-details-CzroF7HR.js.map → get-issue-details-_uS_AZ_v.js.map} +1 -1
  74. package/dist/{handler-BH_OLIbD.cjs → handler-7T1iMsQU.cjs} +2 -2
  75. package/dist/{handler-BH_OLIbD.cjs.map → handler-7T1iMsQU.cjs.map} +1 -1
  76. package/dist/{handler-aE_8mEm7.js → handler-B0bLvFFX.js} +2 -2
  77. package/dist/{handler-aE_8mEm7.js.map → handler-B0bLvFFX.js.map} +1 -1
  78. package/dist/{handler-O9fYgC9a.cjs → handler-DEjS3yks.cjs} +2 -2
  79. package/dist/{handler-O9fYgC9a.cjs.map → handler-DEjS3yks.cjs.map} +1 -1
  80. package/dist/{handler-ykkULTZ-.js → handler-DTN2HYXt.js} +2 -2
  81. package/dist/{handler-ykkULTZ-.js.map → handler-DTN2HYXt.js.map} +1 -1
  82. package/dist/index.cjs +33 -26
  83. package/dist/index.cjs.map +1 -1
  84. package/dist/index.js +33 -26
  85. package/dist/index.js.map +1 -1
  86. package/dist/internal/formatting.d.cts +4 -4
  87. package/dist/internal/formatting.d.ts +4 -4
  88. package/dist/internal/test-fixtures.d.cts +146 -146
  89. package/dist/internal/test-fixtures.d.cts.map +1 -1
  90. package/dist/internal/test-fixtures.d.ts +26 -26
  91. package/dist/internal/test-fixtures.d.ts.map +1 -1
  92. package/dist/{promptDefinitions-5V4-M69A.cjs → promptDefinitions-CWV8hsUX.cjs} +2 -2
  93. package/dist/{promptDefinitions-5V4-M69A.cjs.map → promptDefinitions-CWV8hsUX.cjs.map} +1 -1
  94. package/dist/{promptDefinitions-DyshsF51.js → promptDefinitions-DF8nuJVq.js} +2 -2
  95. package/dist/{promptDefinitions-DyshsF51.js.map → promptDefinitions-DF8nuJVq.js.map} +1 -1
  96. package/dist/promptDefinitions.cjs +3 -3
  97. package/dist/promptDefinitions.js +3 -3
  98. package/dist/{resources-TCvijqOA.cjs → resources-Dadvq5Fm.cjs} +2 -2
  99. package/dist/{resources-TCvijqOA.cjs.map → resources-Dadvq5Fm.cjs.map} +1 -1
  100. package/dist/{resources-CSxBC9gs.js → resources-jcFoc4JU.js} +2 -2
  101. package/dist/{resources-CSxBC9gs.js.map → resources-jcFoc4JU.js.map} +1 -1
  102. package/dist/resources.cjs +2 -2
  103. package/dist/resources.js +2 -2
  104. package/dist/{schema-DPL_hZXP.cjs → schema-BL3kwfOA.cjs} +2 -2
  105. package/dist/{schema-DPL_hZXP.cjs.map → schema-BL3kwfOA.cjs.map} +1 -1
  106. package/dist/{schema-Bv2fvxgy.js → schema-DMfkTR1l.js} +2 -2
  107. package/dist/{schema-Bv2fvxgy.js.map → schema-DMfkTR1l.js.map} +1 -1
  108. package/dist/{schema-BlkWypl3.d.ts → schema-DWmx8lgm.d.ts} +29 -29
  109. package/dist/{schema-BlkWypl3.d.ts.map → schema-DWmx8lgm.d.ts.map} +1 -1
  110. package/dist/{schema-CdDcpvrp.d.cts → schema-xbTf44Hn.d.cts} +227 -227
  111. package/dist/{schema-CdDcpvrp.d.cts.map → schema-xbTf44Hn.d.cts.map} +1 -1
  112. package/dist/schema.cjs +2 -2
  113. package/dist/schema.js +2 -2
  114. package/dist/{search-docs-ss09Dt0F.js → search-docs-DIm3ykOg.js} +2 -2
  115. package/dist/{search-docs-ss09Dt0F.js.map → search-docs-DIm3ykOg.js.map} +1 -1
  116. package/dist/{search-docs-CjIZDaD1.cjs → search-docs-EbjJuL9Q.cjs} +2 -2
  117. package/dist/{search-docs-CjIZDaD1.cjs.map → search-docs-EbjJuL9Q.cjs.map} +1 -1
  118. package/dist/{server-D78x_7Vz.js → server-CnJvaT0s.js} +10 -9
  119. package/dist/server-CnJvaT0s.js.map +1 -0
  120. package/dist/{server-DYFiTMLB.cjs → server-Dv9HxoRk.cjs} +10 -9
  121. package/dist/server-Dv9HxoRk.cjs.map +1 -0
  122. package/dist/server.cjs +22 -22
  123. package/dist/server.d.cts.map +1 -1
  124. package/dist/server.d.ts.map +1 -1
  125. package/dist/server.js +22 -22
  126. package/dist/{stdio-Be01KQkA.cjs → stdio-C6MAgHmA.cjs} +3 -3
  127. package/dist/{stdio-Be01KQkA.cjs.map → stdio-C6MAgHmA.cjs.map} +1 -1
  128. package/dist/{stdio-CDb2NHHD.js → stdio-DnAY4MSF.js} +3 -3
  129. package/dist/{stdio-CDb2NHHD.js.map → stdio-DnAY4MSF.js.map} +1 -1
  130. package/dist/tools/analyze-issue-with-seer.cjs +3 -3
  131. package/dist/tools/analyze-issue-with-seer.js +3 -3
  132. package/dist/tools/create-dsn.cjs +3 -3
  133. package/dist/tools/create-dsn.js +3 -3
  134. package/dist/tools/create-project.cjs +3 -3
  135. package/dist/tools/create-project.js +3 -3
  136. package/dist/tools/create-team.cjs +3 -3
  137. package/dist/tools/create-team.js +3 -3
  138. package/dist/tools/find-dsns.cjs +3 -3
  139. package/dist/tools/find-dsns.js +3 -3
  140. package/dist/tools/find-projects.cjs +3 -3
  141. package/dist/tools/find-projects.js +3 -3
  142. package/dist/tools/find-releases.cjs +3 -3
  143. package/dist/tools/find-releases.js +3 -3
  144. package/dist/tools/find-teams.cjs +3 -3
  145. package/dist/tools/find-teams.js +3 -3
  146. package/dist/tools/get-event-attachment.cjs +3 -3
  147. package/dist/tools/get-event-attachment.js +3 -3
  148. package/dist/tools/get-issue-details.cjs +3 -3
  149. package/dist/tools/get-issue-details.js +3 -3
  150. package/dist/tools/index.cjs +18 -18
  151. package/dist/tools/index.d.ts +68 -68
  152. package/dist/tools/index.js +18 -18
  153. package/dist/tools/search-docs.cjs +3 -3
  154. package/dist/tools/search-docs.js +3 -3
  155. package/dist/tools/search-events/agent.d.cts +3 -3
  156. package/dist/tools/search-events/agent.d.ts +3 -3
  157. package/dist/tools/search-events/formatters.d.cts +4 -4
  158. package/dist/tools/search-events/formatters.d.ts +4 -4
  159. package/dist/tools/search-events/handler.cjs +3 -3
  160. package/dist/tools/search-events/handler.js +3 -3
  161. package/dist/tools/search-events/index.cjs +3 -3
  162. package/dist/tools/search-events/index.js +3 -3
  163. package/dist/tools/search-events/utils.d.cts +4 -4
  164. package/dist/tools/search-events/utils.d.ts +4 -4
  165. package/dist/tools/search-issues/agent.d.cts +5 -5
  166. package/dist/tools/search-issues/agent.d.cts.map +1 -1
  167. package/dist/tools/search-issues/agent.d.ts +3 -3
  168. package/dist/tools/search-issues/formatters.d.cts +3 -3
  169. package/dist/tools/search-issues/formatters.d.ts +3 -3
  170. package/dist/tools/search-issues/handler.cjs +3 -3
  171. package/dist/tools/search-issues/handler.js +3 -3
  172. package/dist/tools/search-issues/index.cjs +3 -3
  173. package/dist/tools/search-issues/index.js +3 -3
  174. package/dist/tools/update-issue.cjs +3 -3
  175. package/dist/tools/update-issue.js +3 -3
  176. package/dist/tools/update-project.cjs +3 -3
  177. package/dist/tools/update-project.js +3 -3
  178. package/dist/tools/utils/api-utils.d.cts +3 -3
  179. package/dist/tools/utils/api-utils.d.ts +3 -3
  180. package/dist/tools/utils/formatting-utils.d.cts +3 -3
  181. package/dist/tools/utils/formatting-utils.d.ts +3 -3
  182. package/dist/tools/utils/issue-utils.d.cts +4 -4
  183. package/dist/tools/utils/issue-utils.d.ts +4 -4
  184. package/dist/tools/utils/seer-utils.d.cts +3 -3
  185. package/dist/tools/utils/seer-utils.d.ts +3 -3
  186. package/dist/{tools-DvKm5uMs.js → tools-B0wbxDty.js} +16 -16
  187. package/dist/{tools-DvKm5uMs.js.map → tools-B0wbxDty.js.map} +1 -1
  188. package/dist/{tools-sQ2wM3Pi.cjs → tools-qfk-QAo0.cjs} +16 -16
  189. package/dist/{tools-sQ2wM3Pi.cjs.map → tools-qfk-QAo0.cjs.map} +1 -1
  190. package/dist/transports/stdio.cjs +23 -23
  191. package/dist/transports/stdio.js +23 -23
  192. package/dist/{types-BYtO24VE.d.cts → types-DE-njuHe.d.cts} +2 -2
  193. package/dist/{types-BYtO24VE.d.cts.map → types-DE-njuHe.d.cts.map} +1 -1
  194. package/dist/{types-B-8S69No.d.ts → types-DRywojVB.d.ts} +2 -2
  195. package/dist/{types-B-8S69No.d.ts.map → types-DRywojVB.d.ts.map} +1 -1
  196. package/dist/{update-issue-ndy2PF5G.js → update-issue-DoQYEQjf.js} +2 -2
  197. package/dist/{update-issue-ndy2PF5G.js.map → update-issue-DoQYEQjf.js.map} +1 -1
  198. package/dist/{update-issue-D77PudUi.cjs → update-issue-DqUsAuTd.cjs} +2 -2
  199. package/dist/{update-issue-D77PudUi.cjs.map → update-issue-DqUsAuTd.cjs.map} +1 -1
  200. package/dist/{update-project-Bxsi-BG_.js → update-project-C9CLxNfF.js} +2 -2
  201. package/dist/{update-project-Bxsi-BG_.js.map → update-project-C9CLxNfF.js.map} +1 -1
  202. package/dist/{update-project-DqECtbDA.cjs → update-project-DQu5PnE3.cjs} +2 -2
  203. package/dist/{update-project-DqECtbDA.cjs.map → update-project-DQu5PnE3.cjs.map} +1 -1
  204. package/dist/{utils-BwXbSgEI.d.ts → utils-CzV_Tz2C.d.ts} +2 -2
  205. package/dist/{utils-BwXbSgEI.d.ts.map → utils-CzV_Tz2C.d.ts.map} +1 -1
  206. package/dist/{utils-CtBGHj_N.d.cts → utils-Fm-dODdb.d.cts} +2 -2
  207. package/dist/{utils-CtBGHj_N.d.cts.map → utils-Fm-dODdb.d.cts.map} +1 -1
  208. package/dist/{version-CMS1IOUV.cjs → version-Bu9nGzm5.cjs} +2 -2
  209. package/dist/{version-CMS1IOUV.cjs.map → version-Bu9nGzm5.cjs.map} +1 -1
  210. package/dist/version-DvjTvYJs.js +6 -0
  211. package/dist/{version-Bj68uyCt.js.map → version-DvjTvYJs.js.map} +1 -1
  212. package/dist/version.cjs +1 -1
  213. package/dist/version.js +1 -1
  214. package/package.json +3 -3
  215. package/dist/constants-ClkMK29-.cjs.map +0 -1
  216. package/dist/constants-S7AU45oQ.js.map +0 -1
  217. package/dist/server-D78x_7Vz.js.map +0 -1
  218. package/dist/server-DYFiTMLB.cjs.map +0 -1
  219. package/dist/version-Bj68uyCt.js +0 -6
@@ -1 +1 @@
1
- {"version":3,"file":"update-issue-D77PudUi.cjs","names":["context: ServerContext","UserInputError"],"sources":["../src/tools/update-issue.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext, withApiErrorHandling } from \"./utils/api-utils\";\nimport { parseIssueParams } from \"./utils/issue-utils\";\nimport { formatAssignedTo } from \"./utils/formatting-utils\";\nimport { UserInputError } from \"../errors\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamIssueShortId,\n ParamIssueUrl,\n ParamIssueStatus,\n ParamAssignedTo,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"update_issue\",\n description: [\n \"Update an issue's status or assignment in Sentry. This allows you to resolve, ignore, or reassign issues.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Resolve an issue that has been fixed\",\n \"- Assign an issue to a team member or team for investigation\",\n \"- Mark an issue as ignored to reduce noise\",\n \"- Reopen a resolved issue by setting status to 'unresolved'\",\n \"\",\n \"<examples>\",\n \"### Resolve an issue\",\n \"\",\n \"```\",\n \"update_issue(organizationSlug='my-organization', issueId='PROJECT-123', status='resolved')\",\n \"```\",\n \"\",\n \"### Assign an issue to a user (use whoami to get your user ID)\",\n \"\",\n \"```\",\n \"update_issue(organizationSlug='my-organization', issueId='PROJECT-123', assignedTo='user:123456')\",\n \"```\",\n \"\",\n \"### Assign an issue to a team\",\n \"\",\n \"```\",\n \"update_issue(organizationSlug='my-organization', issueId='PROJECT-123', assignedTo='team:789')\",\n \"```\",\n \"\",\n \"### Mark an issue as ignored\",\n \"\",\n \"```\",\n \"update_issue(organizationSlug='my-organization', issueId='PROJECT-123', status='ignored')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user provides the `issueUrl`, you can ignore the other required parameters and extract them from the URL.\",\n \"- At least one of `status` or `assignedTo` must be provided to update the issue.\",\n \"- assignedTo format: Use 'user:ID' for users (e.g., 'user:123456') or 'team:ID' for teams (e.g., 'team:789')\",\n \"- To find your user ID, first use the whoami tool which returns your numeric user ID\",\n \"- Valid status values are: 'resolved', 'resolvedInNextRelease', 'unresolved', 'ignored'.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n issueId: ParamIssueShortId.optional(),\n issueUrl: ParamIssueUrl.optional(),\n status: ParamIssueStatus.optional(),\n assignedTo: ParamAssignedTo.optional(),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n\n // Validate that we have the minimum required parameters\n if (!params.issueUrl && !params.issueId) {\n throw new UserInputError(\n \"Either `issueId` or `issueUrl` must be provided\",\n );\n }\n\n if (!params.issueUrl && !params.organizationSlug) {\n throw new UserInputError(\n \"`organizationSlug` is required when providing `issueId`\",\n );\n }\n\n // Validate that at least one update parameter is provided\n if (!params.status && !params.assignedTo) {\n throw new UserInputError(\n \"At least one of `status` or `assignedTo` must be provided to update the issue\",\n );\n }\n\n const { organizationSlug: orgSlug, issueId: parsedIssueId } =\n parseIssueParams({\n organizationSlug: params.organizationSlug,\n issueId: params.issueId,\n issueUrl: params.issueUrl,\n });\n\n setTag(\"organization.slug\", orgSlug);\n\n // Get current issue details first\n const currentIssue = await withApiErrorHandling(\n () =>\n apiService.getIssue({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n }),\n {\n organizationSlug: orgSlug,\n issueId: parsedIssueId,\n },\n );\n\n // Update the issue\n const updatedIssue = await withApiErrorHandling(\n () =>\n apiService.updateIssue({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n status: params.status,\n assignedTo: params.assignedTo,\n }),\n {\n organizationSlug: orgSlug,\n issueId: parsedIssueId,\n },\n );\n\n let output = `# Issue ${updatedIssue.shortId} Updated in **${orgSlug}**\\n\\n`;\n output += `**Issue**: ${updatedIssue.title}\\n`;\n output += `**URL**: ${apiService.getIssueUrl(orgSlug, updatedIssue.shortId)}\\n\\n`;\n\n // Show what changed\n output += \"## Changes Made\\n\\n\";\n\n if (params.status && currentIssue.status !== params.status) {\n output += `**Status**: ${currentIssue.status} → **${params.status}**\\n`;\n }\n\n if (params.assignedTo) {\n const oldAssignee = formatAssignedTo(currentIssue.assignedTo ?? null);\n const newAssignee =\n params.assignedTo === \"me\" ? \"You\" : params.assignedTo;\n output += `**Assigned To**: ${oldAssignee} → **${newAssignee}**\\n`;\n }\n\n output += \"\\n## Current Status\\n\\n\";\n output += `**Status**: ${updatedIssue.status}\\n`;\n const currentAssignee = formatAssignedTo(updatedIssue.assignedTo ?? null);\n output += `**Assigned To**: ${currentAssignee}\\n`;\n\n output += \"\\n# Using this information\\n\\n\";\n output += `- The issue has been successfully updated in Sentry\\n`;\n output += `- You can view the issue details using: \\`get_issue_details(organizationSlug=\"${orgSlug}\", issueId=\"${updatedIssue.shortId}\")\\`\\n`;\n\n if (params.status === \"resolved\") {\n output += `- The issue is now marked as resolved and will no longer generate alerts\\n`;\n } else if (params.status === \"ignored\") {\n output += `- The issue is now ignored and will not generate alerts until it escalates\\n`;\n }\n\n return output;\n },\n});\n"],"mappings":";;;;;;;;;;AAiBA,2BAAe,8BAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;C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e,OAAO,QAAQ,OAAO;AAC9C,cAAW,mBAAmB,YAAY,OAAO,YAAY;EAC9D;AAED,YAAU;AACV,aAAW,cAAc,aAAa,OAAO;EAC7C,MAAM,kBAAkB,0CAAiB,aAAa,cAAc,KAAK;AACzE,aAAW,mBAAmB,gBAAgB;AAE9C,YAAU;AACV,aAAW;AACX,aAAW,gFAAgF,QAAQ,cAAc,aAAa,QAAQ;AAEtI,MAAI,OAAO,WAAW,WACpB,YAAW;WACF,OAAO,WAAW,UAC3B,YAAW;AAGb,SAAO;CACR;AACF,EAAC"}
1
+ {"version":3,"file":"update-issue-DqUsAuTd.cjs","names":["context: ServerContext","UserInputError"],"sources":["../src/tools/update-issue.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext, withApiErrorHandling } from \"./utils/api-utils\";\nimport { parseIssueParams } from \"./utils/issue-utils\";\nimport { formatAssignedTo } from \"./utils/formatting-utils\";\nimport { UserInputError } from \"../errors\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamIssueShortId,\n ParamIssueUrl,\n ParamIssueStatus,\n ParamAssignedTo,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"update_issue\",\n description: [\n \"Update an issue's status or assignment in Sentry. This allows you to resolve, ignore, or reassign issues.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Resolve an issue that has been fixed\",\n \"- Assign an issue to a team member or team for investigation\",\n \"- Mark an issue as ignored to reduce noise\",\n \"- Reopen a resolved issue by setting status to 'unresolved'\",\n \"\",\n \"<examples>\",\n \"### Resolve an issue\",\n \"\",\n \"```\",\n \"update_issue(organizationSlug='my-organization', issueId='PROJECT-123', status='resolved')\",\n \"```\",\n \"\",\n \"### Assign an issue to a user (use whoami to get your user ID)\",\n \"\",\n \"```\",\n \"update_issue(organizationSlug='my-organization', issueId='PROJECT-123', assignedTo='user:123456')\",\n \"```\",\n \"\",\n \"### Assign an issue to a team\",\n \"\",\n \"```\",\n \"update_issue(organizationSlug='my-organization', issueId='PROJECT-123', assignedTo='team:789')\",\n \"```\",\n \"\",\n \"### Mark an issue as ignored\",\n \"\",\n \"```\",\n \"update_issue(organizationSlug='my-organization', issueId='PROJECT-123', status='ignored')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user provides the `issueUrl`, you can ignore the other required parameters and extract them from the URL.\",\n \"- At least one of `status` or `assignedTo` must be provided to update the issue.\",\n \"- assignedTo format: Use 'user:ID' for users (e.g., 'user:123456') or 'team:ID' for teams (e.g., 'team:789')\",\n \"- To find your user ID, first use the whoami tool which returns your numeric user ID\",\n \"- Valid status values are: 'resolved', 'resolvedInNextRelease', 'unresolved', 'ignored'.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n issueId: ParamIssueShortId.optional(),\n issueUrl: ParamIssueUrl.optional(),\n status: ParamIssueStatus.optional(),\n assignedTo: ParamAssignedTo.optional(),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n\n // Validate that we have the minimum required parameters\n if (!params.issueUrl && !params.issueId) {\n throw new UserInputError(\n \"Either `issueId` or `issueUrl` must be provided\",\n );\n }\n\n if (!params.issueUrl && !params.organizationSlug) {\n throw new UserInputError(\n \"`organizationSlug` is required when providing `issueId`\",\n );\n }\n\n // Validate that at least one update parameter is provided\n if (!params.status && !params.assignedTo) {\n throw new UserInputError(\n \"At least one of `status` or `assignedTo` must be provided to update the issue\",\n );\n }\n\n const { organizationSlug: orgSlug, issueId: parsedIssueId } =\n parseIssueParams({\n organizationSlug: params.organizationSlug,\n issueId: params.issueId,\n issueUrl: params.issueUrl,\n });\n\n setTag(\"organization.slug\", orgSlug);\n\n // Get current issue details first\n const currentIssue = await withApiErrorHandling(\n () =>\n apiService.getIssue({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n }),\n {\n organizationSlug: orgSlug,\n issueId: parsedIssueId,\n },\n );\n\n // Update the issue\n const updatedIssue = await withApiErrorHandling(\n () =>\n apiService.updateIssue({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n status: params.status,\n assignedTo: params.assignedTo,\n }),\n {\n organizationSlug: orgSlug,\n issueId: parsedIssueId,\n },\n );\n\n let output = `# Issue ${updatedIssue.shortId} Updated in **${orgSlug}**\\n\\n`;\n output += `**Issue**: ${updatedIssue.title}\\n`;\n output += `**URL**: ${apiService.getIssueUrl(orgSlug, updatedIssue.shortId)}\\n\\n`;\n\n // Show what changed\n output += \"## Changes Made\\n\\n\";\n\n if (params.status && currentIssue.status !== params.status) {\n output += `**Status**: ${currentIssue.status} → **${params.status}**\\n`;\n }\n\n if (params.assignedTo) {\n const oldAssignee = formatAssignedTo(currentIssue.assignedTo ?? null);\n const newAssignee =\n params.assignedTo === \"me\" ? \"You\" : params.assignedTo;\n output += `**Assigned To**: ${oldAssignee} → **${newAssignee}**\\n`;\n }\n\n output += \"\\n## Current Status\\n\\n\";\n output += `**Status**: ${updatedIssue.status}\\n`;\n const currentAssignee = formatAssignedTo(updatedIssue.assignedTo ?? null);\n output += `**Assigned To**: ${currentAssignee}\\n`;\n\n output += \"\\n# Using this information\\n\\n\";\n output += `- The issue has been successfully updated in Sentry\\n`;\n output += `- You can view the issue details using: \\`get_issue_details(organizationSlug=\"${orgSlug}\", issueId=\"${updatedIssue.shortId}\")\\`\\n`;\n\n if (params.status === \"resolved\") {\n output += `- The issue is now marked as resolved and will no longer generate alerts\\n`;\n } else if (params.status === \"ignored\") {\n output += `- The issue is now ignored and will not generate alerts until it escalates\\n`;\n }\n\n return output;\n },\n});\n"],"mappings":";;;;;;;;;;AAiBA,2BAAe,8BAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;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AAU,aAAa,WAAW,OAAO,OAClD,YAAW,cAAc,aAAa,OAAO,OAAO,OAAO,OAAO;AAGpE,MAAI,OAAO,YAAY;GACrB,MAAM,cAAc,0CAAiB,aAAa,cAAc,KAAK;GACrE,MAAM,cACJ,OAAO,eAAe,OAAO,QAAQ,OAAO;AAC9C,cAAW,mBAAmB,YAAY,OAAO,YAAY;EAC9D;AAED,YAAU;AACV,aAAW,cAAc,aAAa,OAAO;EAC7C,MAAM,kBAAkB,0CAAiB,aAAa,cAAc,KAAK;AACzE,aAAW,mBAAmB,gBAAgB;AAE9C,YAAU;AACV,aAAW;AACX,aAAW,gFAAgF,QAAQ,cAAc,aAAa,QAAQ;AAEtI,MAAI,OAAO,WAAW,WACpB,YAAW;WACF,OAAO,WAAW,UAC3B,YAAW;AAGb,SAAO;CACR;AACF,EAAC"}
@@ -1,7 +1,7 @@
1
1
  import { UserInputError } from "./errors-D_R568zP.js";
2
2
  import { defineTool } from "./defineTool-77H4nSna.js";
3
3
  import { apiServiceFromContext } from "./api-utils-BlUSO8xh.js";
4
- import { ParamOrganizationSlug, ParamPlatform, ParamProjectSlug, ParamRegionUrl, ParamTeamSlug } from "./schema-Bv2fvxgy.js";
4
+ import { ParamOrganizationSlug, ParamPlatform, ParamProjectSlug, ParamRegionUrl, ParamTeamSlug } from "./schema-DMfkTR1l.js";
5
5
  import { logError } from "./logging-tGU_SYcA.js";
6
6
  import { z } from "zod";
7
7
  import { setTag } from "@sentry/core";
@@ -117,4 +117,4 @@ var update_project_default = defineTool({
117
117
 
118
118
  //#endregion
119
119
  export { update_project_default };
120
- //# sourceMappingURL=update-project-Bxsi-BG_.js.map
120
+ //# sourceMappingURL=update-project-C9CLxNfF.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-project-Bxsi-BG_.js","names":["context: ServerContext","project: Project | undefined","updates: string[]"],"sources":["../src/tools/update-project.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport { logError } from \"../logging\";\nimport { UserInputError } from \"../errors\";\nimport type { ServerContext } from \"../types\";\nimport type { Project } from \"../api-client/index\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlug,\n ParamPlatform,\n ParamTeamSlug,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"update_project\",\n description: [\n \"Update project settings in Sentry, such as name, slug, platform, and team assignment.\",\n \"\",\n \"Be careful when using this tool!\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Update a project's name or slug to fix onboarding mistakes\",\n \"- Change the platform assigned to a project\",\n \"- Update team assignment for a project\",\n \"\",\n \"<examples>\",\n \"### Update a project's name and slug\",\n \"\",\n \"```\",\n \"update_project(organizationSlug='my-organization', projectSlug='old-project', name='New Project Name', slug='new-project-slug')\",\n \"```\",\n \"\",\n \"### Assign a project to a different team\",\n \"\",\n \"```\",\n \"update_project(organizationSlug='my-organization', projectSlug='my-project', teamSlug='backend-team')\",\n \"```\",\n \"\",\n \"### Update platform\",\n \"\",\n \"```\",\n \"update_project(organizationSlug='my-organization', projectSlug='my-project', platform='python')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, it's likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- Team assignment is handled separately from other project settings\",\n \"- If any parameter is ambiguous, you should clarify with the user what they meant.\",\n \"- When updating the slug, the project will be accessible at the new slug after the update\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug,\n name: z.string().trim().describe(\"The new name for the project\").optional(),\n slug: z\n .string()\n .toLowerCase()\n .trim()\n .describe(\"The new slug for the project (must be unique)\")\n .optional(),\n platform: ParamPlatform.optional(),\n teamSlug: ParamTeamSlug.optional().describe(\n \"The team to assign this project to. Note: this will replace the current team assignment.\",\n ),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n setTag(\"project.slug\", params.projectSlug);\n\n // Handle team assignment separately if provided\n if (params.teamSlug) {\n setTag(\"team.slug\", params.teamSlug);\n try {\n await apiService.addTeamToProject({\n organizationSlug,\n projectSlug: params.projectSlug,\n teamSlug: params.teamSlug,\n });\n } catch (err) {\n logError(err);\n throw new Error(\n `Failed to assign team ${params.teamSlug} to project ${params.projectSlug}: ${err instanceof Error ? err.message : \"Unknown error\"}`,\n );\n }\n }\n\n // Update project settings if any are provided\n const hasProjectUpdates = params.name || params.slug || params.platform;\n\n let project: Project | undefined;\n if (hasProjectUpdates) {\n try {\n project = await apiService.updateProject({\n organizationSlug,\n projectSlug: params.projectSlug,\n name: params.name,\n slug: params.slug,\n platform: params.platform,\n });\n } catch (err) {\n logError(err);\n throw new Error(\n `Failed to update project ${params.projectSlug}: ${err instanceof Error ? err.message : \"Unknown error\"}`,\n );\n }\n } else {\n // If only team assignment, fetch current project data for display\n const projects = await apiService.listProjects(organizationSlug);\n project = projects.find((p) => p.slug === params.projectSlug);\n if (!project) {\n throw new UserInputError(`Project ${params.projectSlug} not found`);\n }\n }\n\n let output = `# Updated Project in **${organizationSlug}**\\n\\n`;\n output += `**ID**: ${project.id}\\n`;\n output += `**Slug**: ${project.slug}\\n`;\n output += `**Name**: ${project.name}\\n`;\n if (project.platform) {\n output += `**Platform**: ${project.platform}\\n`;\n }\n\n // Display what was updated\n const updates: string[] = [];\n if (params.name) updates.push(`name to \"${params.name}\"`);\n if (params.slug) updates.push(`slug to \"${params.slug}\"`);\n if (params.platform) updates.push(`platform to \"${params.platform}\"`);\n if (params.teamSlug)\n updates.push(`team assignment to \"${params.teamSlug}\"`);\n\n if (updates.length > 0) {\n output += `\\n## Updates Applied\\n`;\n output += updates.map((update) => `- Updated ${update}`).join(\"\\n\");\n output += `\\n`;\n }\n\n output += \"\\n# Using this information\\n\\n\";\n output += `- The project is now accessible at slug: \\`${project.slug}\\`\\n`;\n if (params.teamSlug) {\n output += `- The project is now assigned to the \\`${params.teamSlug}\\` team\\n`;\n }\n return output;\n },\n});\n"],"mappings":";;;;;;;;;AAgBA,6BAAe,WAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB;EAClB,WAAW,eAAe,UAAU;EACpC,aAAa;EACb,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,+BAA+B,CAAC,UAAU;EAC3E,MAAM,EACH,QAAQ,CACR,aAAa,CACb,MAAM,CACN,SAAS,gDAAgD,CACzD,UAAU;EACb,UAAU,cAAc,UAAU;EAClC,UAAU,cAAc,UAAU,CAAC,SACjC,2FACD;CACF;CACD,MAAM,QAAQ,QAAQA,SAAwB;EAC5C,MAAM,aAAa,sBAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,SAAO,qBAAqB,iBAAiB;AAC7C,SAAO,gBAAgB,OAAO,YAAY;AAG1C,MAAI,OAAO,UAAU;AACnB,UAAO,aAAa,OAAO,SAAS;AACpC,OAAI;AACF,UAAM,WAAW,iBAAiB;KAChC;KACA,aAAa,OAAO;KACpB,UAAU,OAAO;IAClB,EAAC;GACH,SAAQ,KAAK;AACZ,aAAS,IAAI;AACb,UAAM,IAAI,OACP,wBAAwB,OAAO,SAAS,cAAc,OAAO,YAAY,IAAI,eAAe,QAAQ,IAAI,UAAU;GAEtH;EACF;EAGD,MAAM,oBAAoB,OAAO,QAAQ,OAAO,QAAQ,OAAO;EAE/D,IAAIC;AACJ,MAAI,kBACF,KAAI;AACF,aAAU,MAAM,WAAW,cAAc;IACvC;IACA,aAAa,OAAO;IACpB,MAAM,OAAO;IACb,MAAM,OAAO;IACb,UAAU,OAAO;GAClB,EAAC;EACH,SAAQ,KAAK;AACZ,YAAS,IAAI;AACb,SAAM,IAAI,OACP,2BAA2B,OAAO,YAAY,IAAI,eAAe,QAAQ,IAAI,UAAU;EAE3F;OACI;GAEL,MAAM,WAAW,MAAM,WAAW,aAAa,iBAAiB;AAChE,aAAU,SAAS,KAAK,CAAC,MAAM,EAAE,SAAS,OAAO,YAAY;AAC7D,QAAK,QACH,OAAM,IAAI,gBAAgB,UAAU,OAAO,YAAY;EAE1D;EAED,IAAI,UAAU,yBAAyB,iBAAiB;AACxD,aAAW,UAAU,QAAQ,GAAG;AAChC,aAAW,YAAY,QAAQ,KAAK;AACpC,aAAW,YAAY,QAAQ,KAAK;AACpC,MAAI,QAAQ,SACV,YAAW,gBAAgB,QAAQ,SAAS;EAI9C,MAAMC,UAAoB,CAAE;AAC5B,MAAI,OAAO,KAAM,SAAQ,MAAM,WAAW,OAAO,KAAK,GAAG;AACzD,MAAI,OAAO,KAAM,SAAQ,MAAM,WAAW,OAAO,KAAK,GAAG;AACzD,MAAI,OAAO,SAAU,SAAQ,MAAM,eAAe,OAAO,SAAS,GAAG;AACrE,MAAI,OAAO,SACT,SAAQ,MAAM,sBAAsB,OAAO,SAAS,GAAG;AAEzD,MAAI,QAAQ,SAAS,GAAG;AACtB,cAAW;AACX,aAAU,QAAQ,IAAI,CAAC,YAAY,YAAY,SAAS,CAAC,KAAK,KAAK;AACnE,cAAW;EACZ;AAED,YAAU;AACV,aAAW,6CAA6C,QAAQ,KAAK;AACrE,MAAI,OAAO,SACT,YAAW,yCAAyC,OAAO,SAAS;AAEtE,SAAO;CACR;AACF,EAAC"}
1
+ {"version":3,"file":"update-project-C9CLxNfF.js","names":["context: ServerContext","project: Project | undefined","updates: string[]"],"sources":["../src/tools/update-project.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport { logError } from \"../logging\";\nimport { UserInputError } from \"../errors\";\nimport type { ServerContext } from \"../types\";\nimport type { Project } from \"../api-client/index\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlug,\n ParamPlatform,\n ParamTeamSlug,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"update_project\",\n description: [\n \"Update project settings in Sentry, such as name, slug, platform, and team assignment.\",\n \"\",\n \"Be careful when using this tool!\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Update a project's name or slug to fix onboarding mistakes\",\n \"- Change the platform assigned to a project\",\n \"- Update team assignment for a project\",\n \"\",\n \"<examples>\",\n \"### Update a project's name and slug\",\n \"\",\n \"```\",\n \"update_project(organizationSlug='my-organization', projectSlug='old-project', name='New Project Name', slug='new-project-slug')\",\n \"```\",\n \"\",\n \"### Assign a project to a different team\",\n \"\",\n \"```\",\n \"update_project(organizationSlug='my-organization', projectSlug='my-project', teamSlug='backend-team')\",\n \"```\",\n \"\",\n \"### Update platform\",\n \"\",\n \"```\",\n \"update_project(organizationSlug='my-organization', projectSlug='my-project', platform='python')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, it's likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- Team assignment is handled separately from other project settings\",\n \"- If any parameter is ambiguous, you should clarify with the user what they meant.\",\n \"- When updating the slug, the project will be accessible at the new slug after the update\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug,\n name: z.string().trim().describe(\"The new name for the project\").optional(),\n slug: z\n .string()\n .toLowerCase()\n .trim()\n .describe(\"The new slug for the project (must be unique)\")\n .optional(),\n platform: ParamPlatform.optional(),\n teamSlug: ParamTeamSlug.optional().describe(\n \"The team to assign this project to. Note: this will replace the current team assignment.\",\n ),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n setTag(\"project.slug\", params.projectSlug);\n\n // Handle team assignment separately if provided\n if (params.teamSlug) {\n setTag(\"team.slug\", params.teamSlug);\n try {\n await apiService.addTeamToProject({\n organizationSlug,\n projectSlug: params.projectSlug,\n teamSlug: params.teamSlug,\n });\n } catch (err) {\n logError(err);\n throw new Error(\n `Failed to assign team ${params.teamSlug} to project ${params.projectSlug}: ${err instanceof Error ? err.message : \"Unknown error\"}`,\n );\n }\n }\n\n // Update project settings if any are provided\n const hasProjectUpdates = params.name || params.slug || params.platform;\n\n let project: Project | undefined;\n if (hasProjectUpdates) {\n try {\n project = await apiService.updateProject({\n organizationSlug,\n projectSlug: params.projectSlug,\n name: params.name,\n slug: params.slug,\n platform: params.platform,\n });\n } catch (err) {\n logError(err);\n throw new Error(\n `Failed to update project ${params.projectSlug}: ${err instanceof Error ? err.message : \"Unknown error\"}`,\n );\n }\n } else {\n // If only team assignment, fetch current project data for display\n const projects = await apiService.listProjects(organizationSlug);\n project = projects.find((p) => p.slug === params.projectSlug);\n if (!project) {\n throw new UserInputError(`Project ${params.projectSlug} not found`);\n }\n }\n\n let output = `# Updated Project in **${organizationSlug}**\\n\\n`;\n output += `**ID**: ${project.id}\\n`;\n output += `**Slug**: ${project.slug}\\n`;\n output += `**Name**: ${project.name}\\n`;\n if (project.platform) {\n output += `**Platform**: ${project.platform}\\n`;\n }\n\n // Display what was updated\n const updates: string[] = [];\n if (params.name) updates.push(`name to \"${params.name}\"`);\n if (params.slug) updates.push(`slug to \"${params.slug}\"`);\n if (params.platform) updates.push(`platform to \"${params.platform}\"`);\n if (params.teamSlug)\n updates.push(`team assignment to \"${params.teamSlug}\"`);\n\n if (updates.length > 0) {\n output += `\\n## Updates Applied\\n`;\n output += updates.map((update) => `- Updated ${update}`).join(\"\\n\");\n output += `\\n`;\n }\n\n output += \"\\n# Using this information\\n\\n\";\n output += `- The project is now accessible at slug: \\`${project.slug}\\`\\n`;\n if (params.teamSlug) {\n output += `- The project is now assigned to the \\`${params.teamSlug}\\` team\\n`;\n }\n return output;\n },\n});\n"],"mappings":";;;;;;;;;AAgBA,6BAAe,WAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB;EAClB,WAAW,eAAe,UAAU;EACpC,aAAa;EACb,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,+BAA+B,CAAC,UAAU;EAC3E,MAAM,EACH,QAAQ,CACR,aAAa,CACb,MAAM,CACN,SAAS,gDAAgD,CACzD,UAAU;EACb,UAAU,cAAc,UAAU;EAClC,UAAU,cAAc,UAAU,CAAC,SACjC,2FACD;CACF;CACD,MAAM,QAAQ,QAAQA,SAAwB;EAC5C,MAAM,aAAa,sBAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,SAAO,qBAAqB,iBAAiB;AAC7C,SAAO,gBAAgB,OAAO,YAAY;AAG1C,MAAI,OAAO,UAAU;AACnB,UAAO,aAAa,OAAO,SAAS;AACpC,OAAI;AACF,UAAM,WAAW,iBAAiB;KAChC;KACA,aAAa,OAAO;KACpB,UAAU,OAAO;IAClB,EAAC;GACH,SAAQ,KAAK;AACZ,aAAS,IAAI;AACb,UAAM,IAAI,OACP,wBAAwB,OAAO,SAAS,cAAc,OAAO,YAAY,IAAI,eAAe,QAAQ,IAAI,UAAU;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@@ const require_chunk = require('./chunk-DWy1uDak.cjs');
2
2
  const require_errors = require('./errors-BtJEw2Z-.cjs');
3
3
  const require_defineTool = require('./defineTool-lWNTzWl_.cjs');
4
4
  const require_api_utils = require('./api-utils-DFWUfQ83.cjs');
5
- const require_schema = require('./schema-DPL_hZXP.cjs');
5
+ const require_schema = require('./schema-BL3kwfOA.cjs');
6
6
  const require_logging = require('./logging-BpL53bY6.cjs');
7
7
  const zod = require_chunk.__toESM(require("zod"));
8
8
  const __sentry_core = require_chunk.__toESM(require("@sentry/core"));
@@ -123,4 +123,4 @@ Object.defineProperty(exports, 'update_project_default', {
123
123
  return update_project_default;
124
124
  }
125
125
  });
126
- //# sourceMappingURL=update-project-DqECtbDA.cjs.map
126
+ //# sourceMappingURL=update-project-DQu5PnE3.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-project-DqECtbDA.cjs","names":["ParamOrganizationSlug","ParamProjectSlug","context: ServerContext","project: Project | undefined","UserInputError","updates: string[]"],"sources":["../src/tools/update-project.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport { logError } from \"../logging\";\nimport { UserInputError } from \"../errors\";\nimport type { ServerContext } from \"../types\";\nimport type { Project } from \"../api-client/index\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlug,\n ParamPlatform,\n ParamTeamSlug,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"update_project\",\n description: [\n \"Update project settings in Sentry, such as name, slug, platform, and team assignment.\",\n \"\",\n \"Be careful when using this tool!\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Update a project's name or slug to fix onboarding mistakes\",\n \"- Change the platform assigned to a project\",\n \"- Update team assignment for a project\",\n \"\",\n \"<examples>\",\n \"### Update a project's name and slug\",\n \"\",\n \"```\",\n \"update_project(organizationSlug='my-organization', projectSlug='old-project', name='New Project Name', slug='new-project-slug')\",\n \"```\",\n \"\",\n \"### Assign a project to a different team\",\n \"\",\n \"```\",\n \"update_project(organizationSlug='my-organization', projectSlug='my-project', teamSlug='backend-team')\",\n \"```\",\n \"\",\n \"### Update platform\",\n \"\",\n \"```\",\n \"update_project(organizationSlug='my-organization', projectSlug='my-project', platform='python')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, it's likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- Team assignment is handled separately from other project settings\",\n \"- If any parameter is ambiguous, you should clarify with the user what they meant.\",\n \"- When updating the slug, the project will be accessible at the new slug after the update\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug,\n name: z.string().trim().describe(\"The new name for the project\").optional(),\n slug: z\n .string()\n .toLowerCase()\n .trim()\n .describe(\"The new slug for the project (must be unique)\")\n .optional(),\n platform: ParamPlatform.optional(),\n teamSlug: ParamTeamSlug.optional().describe(\n \"The team to assign this project to. Note: this will replace the current team assignment.\",\n ),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n setTag(\"project.slug\", params.projectSlug);\n\n // Handle team assignment separately if provided\n if (params.teamSlug) {\n setTag(\"team.slug\", params.teamSlug);\n try {\n await apiService.addTeamToProject({\n organizationSlug,\n projectSlug: params.projectSlug,\n teamSlug: params.teamSlug,\n });\n } catch (err) {\n logError(err);\n throw new Error(\n `Failed to assign team ${params.teamSlug} to project ${params.projectSlug}: ${err instanceof Error ? err.message : \"Unknown error\"}`,\n );\n }\n }\n\n // Update project settings if any are provided\n const hasProjectUpdates = params.name || params.slug || params.platform;\n\n let project: Project | undefined;\n if (hasProjectUpdates) {\n try {\n project = await apiService.updateProject({\n organizationSlug,\n projectSlug: params.projectSlug,\n name: params.name,\n slug: params.slug,\n platform: params.platform,\n });\n } catch (err) {\n logError(err);\n throw new Error(\n `Failed to update project ${params.projectSlug}: ${err instanceof Error ? err.message : \"Unknown error\"}`,\n );\n }\n } else {\n // If only team assignment, fetch current project data for display\n const projects = await apiService.listProjects(organizationSlug);\n project = projects.find((p) => p.slug === params.projectSlug);\n if (!project) {\n throw new UserInputError(`Project ${params.projectSlug} not found`);\n }\n }\n\n let output = `# Updated Project in **${organizationSlug}**\\n\\n`;\n output += `**ID**: ${project.id}\\n`;\n output += `**Slug**: ${project.slug}\\n`;\n output += `**Name**: ${project.name}\\n`;\n if (project.platform) {\n output += `**Platform**: ${project.platform}\\n`;\n }\n\n // Display what was updated\n const updates: string[] = [];\n if (params.name) updates.push(`name to \"${params.name}\"`);\n if (params.slug) updates.push(`slug to \"${params.slug}\"`);\n if (params.platform) updates.push(`platform to \"${params.platform}\"`);\n if (params.teamSlug)\n updates.push(`team assignment to \"${params.teamSlug}\"`);\n\n if (updates.length > 0) {\n output += `\\n## Updates Applied\\n`;\n output += updates.map((update) => `- Updated ${update}`).join(\"\\n\");\n output += `\\n`;\n }\n\n output += \"\\n# Using this information\\n\\n\";\n output += `- The project is now accessible at slug: \\`${project.slug}\\`\\n`;\n if (params.teamSlug) {\n output += `- The project is now assigned to the \\`${params.teamSlug}\\` team\\n`;\n }\n return output;\n },\n});\n"],"mappings":";;;;;;;;;;AAgBA,6BAAe,8BAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkBA;EAClB,WAAW,8BAAe,UAAU;EACpC,aAAaC;EACb,MAAM,MAAE,QAAQ,CAAC,MAAM,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W,YAAY,QAAQ,KAAK;AACpC,aAAW,YAAY,QAAQ,KAAK;AACpC,MAAI,QAAQ,SACV,YAAW,gBAAgB,QAAQ,SAAS;EAI9C,MAAMC,UAAoB,CAAE;AAC5B,MAAI,OAAO,KAAM,SAAQ,MAAM,WAAW,OAAO,KAAK,GAAG;AACzD,MAAI,OAAO,KAAM,SAAQ,MAAM,WAAW,OAAO,KAAK,GAAG;AACzD,MAAI,OAAO,SAAU,SAAQ,MAAM,eAAe,OAAO,SAAS,GAAG;AACrE,MAAI,OAAO,SACT,SAAQ,MAAM,sBAAsB,OAAO,SAAS,GAAG;AAEzD,MAAI,QAAQ,SAAS,GAAG;AACtB,cAAW;AACX,aAAU,QAAQ,IAAI,CAAC,YAAY,YAAY,SAAS,CAAC,KAAK,KAAK;AACnE,cAAW;EACZ;AAED,YAAU;AACV,aAAW,6CAA6C,QAAQ,KAAK;AACrE,MAAI,OAAO,SACT,YAAW,yCAAyC,OAAO,SAAS;AAEtE,SAAO;CACR;AACF,EAAC"}
1
+ {"version":3,"file":"update-project-DQu5PnE3.cjs","names":["ParamOrganizationSlug","ParamProjectSlug","context: ServerContext","project: Project | undefined","UserInputError","updates: string[]"],"sources":["../src/tools/update-project.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport { logError } from \"../logging\";\nimport { UserInputError } from \"../errors\";\nimport type { ServerContext } from \"../types\";\nimport type { Project } from \"../api-client/index\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlug,\n ParamPlatform,\n ParamTeamSlug,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"update_project\",\n description: [\n \"Update project settings in Sentry, such as name, slug, platform, and team assignment.\",\n \"\",\n \"Be careful when using this tool!\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Update a project's name or slug to fix onboarding mistakes\",\n \"- Change the platform assigned to a project\",\n \"- Update team assignment for a project\",\n \"\",\n \"<examples>\",\n \"### Update a project's name and slug\",\n \"\",\n \"```\",\n \"update_project(organizationSlug='my-organization', projectSlug='old-project', name='New Project Name', slug='new-project-slug')\",\n \"```\",\n \"\",\n \"### Assign a project to a different team\",\n \"\",\n \"```\",\n \"update_project(organizationSlug='my-organization', projectSlug='my-project', teamSlug='backend-team')\",\n \"```\",\n \"\",\n \"### Update platform\",\n \"\",\n \"```\",\n \"update_project(organizationSlug='my-organization', projectSlug='my-project', platform='python')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, it's likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- Team assignment is handled separately from other project settings\",\n \"- If any parameter is ambiguous, you should clarify with the user what they meant.\",\n \"- When updating the slug, the project will be accessible at the new slug after the update\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug,\n name: z.string().trim().describe(\"The new name for the project\").optional(),\n slug: z\n .string()\n .toLowerCase()\n .trim()\n .describe(\"The new slug for the project (must be unique)\")\n .optional(),\n platform: ParamPlatform.optional(),\n teamSlug: ParamTeamSlug.optional().describe(\n \"The team to assign this project to. Note: this will replace the current team assignment.\",\n ),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n setTag(\"project.slug\", params.projectSlug);\n\n // Handle team assignment separately if provided\n if (params.teamSlug) {\n setTag(\"team.slug\", params.teamSlug);\n try {\n await apiService.addTeamToProject({\n organizationSlug,\n projectSlug: params.projectSlug,\n teamSlug: params.teamSlug,\n });\n } catch (err) {\n logError(err);\n throw new Error(\n `Failed to assign team ${params.teamSlug} to project ${params.projectSlug}: ${err instanceof Error ? err.message : \"Unknown error\"}`,\n );\n }\n }\n\n // Update project settings if any are provided\n const hasProjectUpdates = params.name || params.slug || params.platform;\n\n let project: Project | undefined;\n if (hasProjectUpdates) {\n try {\n project = await apiService.updateProject({\n organizationSlug,\n projectSlug: params.projectSlug,\n name: params.name,\n slug: params.slug,\n platform: params.platform,\n });\n } catch (err) {\n logError(err);\n throw new Error(\n `Failed to update project ${params.projectSlug}: ${err instanceof Error ? err.message : \"Unknown error\"}`,\n );\n }\n } else {\n // If only team assignment, fetch current project data for display\n const projects = await apiService.listProjects(organizationSlug);\n project = projects.find((p) => p.slug === params.projectSlug);\n if (!project) {\n throw new UserInputError(`Project ${params.projectSlug} not found`);\n }\n }\n\n let output = `# Updated Project in **${organizationSlug}**\\n\\n`;\n output += `**ID**: ${project.id}\\n`;\n output += `**Slug**: ${project.slug}\\n`;\n output += `**Name**: ${project.name}\\n`;\n if (project.platform) {\n output += `**Platform**: ${project.platform}\\n`;\n }\n\n // Display what was updated\n const updates: string[] = [];\n if (params.name) updates.push(`name to \"${params.name}\"`);\n if (params.slug) updates.push(`slug to \"${params.slug}\"`);\n if (params.platform) updates.push(`platform to \"${params.platform}\"`);\n if (params.teamSlug)\n updates.push(`team assignment to \"${params.teamSlug}\"`);\n\n if (updates.length > 0) {\n output += `\\n## Updates Applied\\n`;\n output += updates.map((update) => `- Updated ${update}`).join(\"\\n\");\n output += `\\n`;\n }\n\n output += \"\\n# Using this information\\n\\n\";\n output += `- The project is now accessible at slug: \\`${project.slug}\\`\\n`;\n if (params.teamSlug) {\n output += `- The project is now assigned to the \\`${params.teamSlug}\\` team\\n`;\n }\n return output;\n },\n});\n"],"mappings":";;;;;;;;;;AAgBA,6BAAe,8BAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;C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,OAAM,IAAIC,+BAAgB,UAAU,OAAO,YAAY;EAE1D;EAED,IAAI,UAAU,yBAAyB,iBAAiB;AACxD,aAAW,UAAU,QAAQ,GAAG;AAChC,aAAW,YAAY,QAAQ,KAAK;AACpC,aAAW,YAAY,QAAQ,KAAK;AACpC,MAAI,QAAQ,SACV,YAAW,gBAAgB,QAAQ,SAAS;EAI9C,MAAMC,UAAoB,CAAE;AAC5B,MAAI,OAAO,KAAM,SAAQ,MAAM,WAAW,OAAO,KAAK,GAAG;AACzD,MAAI,OAAO,KAAM,SAAQ,MAAM,WAAW,OAAO,KAAK,GAAG;AACzD,MAAI,OAAO,SAAU,SAAQ,MAAM,eAAe,OAAO,SAAS,GAAG;AACrE,MAAI,OAAO,SACT,SAAQ,MAAM,sBAAsB,OAAO,SAAS,GAAG;AAEzD,MAAI,QAAQ,SAAS,GAAG;AACtB,cAAW;AACX,aAAU,QAAQ,IAAI,CAAC,YAAY,YAAY,SAAS,CAAC,KAAK,KAAK;AACnE,cAAW;EACZ;AAED,YAAU;AACV,aAAW,6CAA6C,QAAQ,KAAK;AACrE,MAAI,OAAO,SACT,YAAW,yCAAyC,OAAO,SAAS;AAEtE,SAAO;CACR;AACF,EAAC"}
@@ -1,4 +1,4 @@
1
- import { SentryApiService } from "./client-C_dDreKj.js";
1
+ import { SentryApiService } from "./client-DLkUGS7r.js";
2
2
  import { z } from "zod";
3
3
  import * as ai173 from "ai";
4
4
 
@@ -32,4 +32,4 @@ declare function createDatasetAttributesTool(apiService: SentryApiService, organ
32
32
  //# sourceMappingURL=utils.d.ts.map
33
33
  //#endregion
34
34
  export { FlexibleEventData, createDatasetAttributesTool, fetchCustomAttributes, getNumberValue, getStringValue, isAggregateQuery };
35
- //# sourceMappingURL=utils-BwXbSgEI.d.ts.map
35
+ //# sourceMappingURL=utils-CzV_Tz2C.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils-BwXbSgEI.d.ts","names":[],"sources":["../src/tools/search-events/utils.ts"],"sour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AGtB,iBAwBM,qBAAA,CAvBb,UAAiB,EAwBZ,gBAxBY,EAAA,gBAAA,EAAA,MAAA,EAAA,OAAA,EAAA,QAAA,GAAA,MAAA,GAAA,OAAA,EAAA,SAAA,CAAA,EAAA,MAAA,EAAA,UAuBiB,CAvBjB,EAAA;EASV,WAAA,CAAA,EAAA,MAAc;EASd,KAAA,CAAA,EAAA,MAAA;EAKM,GAAA,CAAA,EAAA,MAAA;CAAqB,CAAA,EAMxC,OANwC,CAAA;EAAA,UAC7B,EAMA,MANA,CAAA,MAAA,EAAA,MAAA,CAAA;EAAgB,UAMhB,EACA,MADA,CAAA,MAAA,EAAA,QAAA,GAAA,QAAA,CAAA;CAAM,CAAA;;AADV;AAkEV;AAA2C,iBAA3B,2BAAA,CAA2B,UAAA,EAC7B,gBAD6B,EAAA,gBAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EAAA,MAAA,CAAA,EAGvB,KAAA,CAAA,IAHuB,CAGvB,CAAA,CAAA,SAHuB,CAAA;EAAA,OAC7B,EAAgB,CAAA,CAAA,OAAhB,CAAA,CAAA,OAAA,EAAA,QAAA,EAAA,MAAA,CAAA,CAAA;CAAgB,EAAA,OAAA,cAAA,EAAA;;;EAEV,OAAA,EAAA,OAAA,GAAA,QAAA,GAAA,MAAA;CAAA,CAAA,EAAA,MAAA,CAAA,GAAA;;;cAAA,KAAA,CAAA"}
@@ -1,4 +1,4 @@
1
- import { SentryApiService } from "./client-CgS3tjJG.cjs";
1
+ import { SentryApiService } from "./client-DV68BdcS.cjs";
2
2
  import * as ai173 from "ai";
3
3
  import { z } from "zod";
4
4
 
@@ -32,4 +32,4 @@ declare function createDatasetAttributesTool(apiService: SentryApiService, organ
32
32
  //# sourceMappingURL=utils.d.ts.map
33
33
  //#endregion
34
34
  export { FlexibleEventData, createDatasetAttributesTool, fetchCustomAttributes, getNumberValue, getStringValue, isAggregateQuery };
35
- //# sourceMappingURL=utils-CtBGHj_N.d.cts.map
35
+ //# sourceMappingURL=utils-Fm-dODdb.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils-CtBGHj_N.d.cts","names":[],"sources":["../src/tools/search-events/utils.ts"],"sourcesContent":[],"mappings":";;;;;KAOY,iBAAA,GAAoB;iBAGhB,cAAA,QACP;iBASO,cAAA,QACP;AAdG,iBAsBI,gBAAA,CAtBgB,MAAM,EAAA,MAAA,EAAA,CAAA,EAAA,OAAA;AAGtB,iBAwBM,qBAAA,CAvBb,UAAiB,EAwBZ,gBAxBY,EAAA,gBAAA,EAAA,MAAA,EAAA,OAAA,EAAA,QAAA,GAAA,MAAA,GAAA,OAAA,EAAA,SAAA,CAAA,EAAA,MAAA,EAAA,UAuBiB,CAvBjB,EAAA;EASV,WAAA,CAAA,EAAA,MAAc;EASd,KAAA,CAAA,EAAA,MAAA;EAKM,GAAA,CAAA,EAAA,MAAA;CAAqB,CAAA,EAMxC,OANwC,CAAA;EAAA,UAC7B,EAMA,MANA,CAAA,MAAA,EAAA,MAAA,CAAA;EAAgB,UAMhB,EACA,MADA,CAAA,MAAA,EAAA,QAAA,GAAA,QAAA,CAAA;CAAM,CAAA;;AADV;AAkEV;AAA2C,iBAA3B,2BAAA,CAA2B,UAAA,EAC7B,gBAD6B,EAAA,gBAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EAAA,MAAA,CAAA,EAGvB,KAAA,CAAA,IAHuB,CAGvB,CAAA,CAAA,SAHuB,CAAA;EAAA,OAC7B,EAAgB,CAAA,CAAA,OAAhB,CAAA,CAAA,OAAA,EAAA,QAAA,EAAA,MAAA,CAAA,CAAA;CAAgB,EAAA,OAAA,cAAA,EAAA;;;EAEV,OAAA,EAAA,QAAA,GAAA,OAAA,GAAA,MAAA;CAAA,CAAA,EAAA,MAAA,CAAA,GAAA;;;cAAA,KAAA,CAAA"}
1
+ {"version":3,"file":"utils-Fm-dODdb.d.cts","names":[],"sources":["../src/tools/search-events/utils.ts"],"sourcesContent":[],"mappings":";;;;;KAOY,iBAAA,GAAoB;iBAGhB,cAAA,QACP;iBASO,cAAA,QACP;AAdG,iBAsBI,gBAAA,CAtBgB,MAAM,EAAA,MAAA,EAAA,CAAA,EAAA,OAAA;AAGtB,iBAwBM,qBAAA,CAvBb,UAAiB,EAwBZ,gBAxBY,EAAA,gBAAA,EAAA,MAAA,EAAA,OAAA,EAAA,QAAA,GAAA,MAAA,GAAA,OAAA,EAAA,SAAA,CAAA,EAAA,MAAA,EAAA,UAuBiB,CAvBjB,EAAA;EASV,WAAA,CAAA,EAAA,MAAc;EASd,KAAA,CAAA,EAAA,MAAA;EAKM,GAAA,CAAA,EAAA,MAAA;CAAqB,CAAA,EAMxC,OANwC,CAAA;EAAA,UAC7B,EAMA,MANA,CAAA,MAAA,EAAA,MAAA,CAAA;EAAgB,UAMhB,EACA,MADA,CAAA,MAAA,EAAA,QAAA,GAAA,QAAA,CAAA;CAAM,CAAA;;AADV;AAkEV;AAA2C,iBAA3B,2BAAA,CAA2B,UAAA,EAC7B,gBAD6B,EAAA,gBAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EAAA,MAAA,CAAA,EAGvB,KAAA,CAAA,IAHuB,CAGvB,CAAA,CAAA,SAHuB,CAAA;EAAA,OAC7B,EAAgB,CAAA,CAAA,OAAhB,CAAA,CAAA,OAAA,EAAA,QAAA,EAAA,MAAA,CAAA,CAAA;CAAgB,EAAA,OAAA,cAAA,EAAA;;;EAEV,OAAA,EAAA,QAAA,GAAA,OAAA,GAAA,MAAA;CAAA,CAAA,EAAA,MAAA,CAAA,GAAA;;;cAAA,KAAA,CAAA"}
@@ -1,6 +1,6 @@
1
1
 
2
2
  //#region src/version.ts
3
- const LIB_VERSION = typeof process !== "undefined" && "0.17.0" || "0.0.0";
3
+ const LIB_VERSION = typeof process !== "undefined" && "0.17.1" || "0.0.0";
4
4
 
5
5
  //#endregion
6
6
  Object.defineProperty(exports, 'LIB_VERSION', {
@@ -9,4 +9,4 @@ Object.defineProperty(exports, 'LIB_VERSION', {
9
9
  return LIB_VERSION;
10
10
  }
11
11
  });
12
- //# sourceMappingURL=version-CMS1IOUV.cjs.map
12
+ //# sourceMappingURL=version-Bu9nGzm5.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"version-CMS1IOUV.cjs","names":[],"sources":["../src/version.ts"],"sourcesContent":["export const LIB_VERSION =\n (typeof process !== \"undefined\" && process.env?.npm_package_version) ||\n \"0.0.0\";\n"],"mappings":";;AAAA,MAAa,qBACH,YAAY,2BACpB"}
1
+ {"version":3,"file":"version-Bu9nGzm5.cjs","names":[],"sources":["../src/version.ts"],"sourcesContent":["export const LIB_VERSION =\n (typeof process !== \"undefined\" && process.env?.npm_package_version) ||\n \"0.0.0\";\n"],"mappings":";;AAAA,MAAa,qBACH,YAAY,2BACpB"}
@@ -0,0 +1,6 @@
1
+ //#region src/version.ts
2
+ const LIB_VERSION = typeof process !== "undefined" && "0.17.1" || "0.0.0";
3
+
4
+ //#endregion
5
+ export { LIB_VERSION };
6
+ //# sourceMappingURL=version-DvjTvYJs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version-Bj68uyCt.js","names":[],"sources":["../src/version.ts"],"sourcesContent":["export const LIB_VERSION =\n (typeof process !== \"undefined\" && process.env?.npm_package_version) ||\n \"0.0.0\";\n"],"mappings":";AAAA,MAAa,qBACH,YAAY,2BACpB"}
1
+ {"version":3,"file":"version-DvjTvYJs.js","names":[],"sources":["../src/version.ts"],"sourcesContent":["export const LIB_VERSION =\n (typeof process !== \"undefined\" && process.env?.npm_package_version) ||\n \"0.0.0\";\n"],"mappings":";AAAA,MAAa,qBACH,YAAY,2BACpB"}
package/dist/version.cjs CHANGED
@@ -1,3 +1,3 @@
1
- const require_version = require('./version-CMS1IOUV.cjs');
1
+ const require_version = require('./version-Bu9nGzm5.cjs');
2
2
 
3
3
  exports.LIB_VERSION = require_version.LIB_VERSION;
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
- import { LIB_VERSION } from "./version-Bj68uyCt.js";
1
+ import { LIB_VERSION } from "./version-DvjTvYJs.js";
2
2
 
3
3
  export { LIB_VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/mcp-server",
3
- "version": "0.17.0",
3
+ "version": "0.17.1",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -82,8 +82,8 @@
82
82
  "msw": "^2.10.2",
83
83
  "yaml": "^2.6.1",
84
84
  "zod-to-json-schema": "^3.24.6",
85
- "@sentry/mcp-server-mocks": "0.17.0",
86
- "@sentry/mcp-server-tsconfig": "0.17.0"
85
+ "@sentry/mcp-server-mocks": "0.17.1",
86
+ "@sentry/mcp-server-tsconfig": "0.17.1"
87
87
  },
88
88
  "dependencies": {
89
89
  "@ai-sdk/openai": "^1.3.22",
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants-ClkMK29-.cjs","names":["SENTRY_FRAMEWORKS: Record<string, string[]>"],"sources":["../src/constants.ts"],"sourcesContent":["/**\n * Constants for Sentry MCP server.\n *\n * Defines platform and framework combinations available in Sentry documentation.\n */\n\n/**\n * Common Sentry platforms that have documentation available\n */\nexport const SENTRY_PLATFORMS_BASE = [\n \"javascript\",\n \"python\",\n \"java\",\n \"dotnet\",\n \"go\",\n \"php\",\n \"ruby\",\n \"android\",\n \"apple\",\n \"unity\",\n \"unreal\",\n \"rust\",\n \"elixir\",\n \"kotlin\",\n \"native\",\n \"dart\",\n \"godot\",\n \"nintendo-switch\",\n \"playstation\",\n \"powershell\",\n \"react-native\",\n \"xbox\",\n] as const;\n\n/**\n * Platform-specific frameworks that have Sentry guides\n */\nexport const SENTRY_FRAMEWORKS: Record<string, string[]> = {\n javascript: [\n \"nextjs\",\n \"react\",\n \"gatsby\",\n \"remix\",\n \"vue\",\n \"angular\",\n \"hono\",\n \"svelte\",\n \"express\",\n \"fastify\",\n \"astro\",\n \"bun\",\n \"capacitor\",\n \"cloudflare\",\n \"connect\",\n \"cordova\",\n \"deno\",\n \"electron\",\n \"ember\",\n \"nuxt\",\n \"solid\",\n \"solidstart\",\n \"sveltekit\",\n \"tanstack-react\",\n \"wasm\",\n \"node\",\n \"koa\",\n \"nestjs\",\n \"hapi\",\n ],\n python: [\n \"django\",\n \"flask\",\n \"fastapi\",\n \"celery\",\n \"tornado\",\n \"pyramid\",\n \"aiohttp\",\n \"anthropic\",\n \"airflow\",\n \"aws-lambda\",\n \"boto3\",\n \"bottle\",\n \"chalice\",\n \"dramatiq\",\n \"falcon\",\n \"langchain\",\n \"litestar\",\n \"logging\",\n \"loguru\",\n \"openai\",\n \"quart\",\n \"ray\",\n \"redis\",\n \"rq\",\n \"sanic\",\n \"sqlalchemy\",\n \"starlette\",\n ],\n dart: [\"flutter\"],\n dotnet: [\n \"aspnetcore\",\n \"maui\",\n \"wpf\",\n \"winforms\",\n \"aspnet\",\n \"aws-lambda\",\n \"azure-functions\",\n \"blazor-webassembly\",\n \"entityframework\",\n \"google-cloud-functions\",\n \"extensions-logging\",\n \"log4net\",\n \"nlog\",\n \"serilog\",\n \"uwp\",\n \"xamarin\",\n ],\n java: [\n \"spring\",\n \"spring-boot\",\n \"android\",\n \"jul\",\n \"log4j2\",\n \"logback\",\n \"servlet\",\n ],\n go: [\n \"echo\",\n \"fasthttp\",\n \"fiber\",\n \"gin\",\n \"http\",\n \"iris\",\n \"logrus\",\n \"negroni\",\n \"slog\",\n \"zerolog\",\n ],\n php: [\"laravel\", \"symfony\"],\n ruby: [\"delayed_job\", \"rack\", \"rails\", \"resque\", \"sidekiq\"],\n android: [\"kotlin\"],\n apple: [\"ios\", \"macos\", \"watchos\", \"tvos\", \"visionos\"],\n kotlin: [\"multiplatform\"],\n} as const;\n\n/**\n * All valid guides for Sentry docs search filtering.\n * A guide can be either a platform (e.g., 'javascript') or a platform/framework combination (e.g., 'javascript/nextjs').\n */\nexport const SENTRY_GUIDES = [\n // Base platforms\n ...SENTRY_PLATFORMS_BASE,\n // Platform/guide combinations\n ...Object.entries(SENTRY_FRAMEWORKS).flatMap(([platform, guides]) =>\n guides.map((guide) => `${platform}/${guide}`),\n ),\n] as const;\n"],"mappings":";;;;;;;;;;AASA,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;AAKD,MAAaA,oBAA8C;CACzD,YAAY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACD,MAAM,CAAC,SAAU;CACjB,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACD,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACD,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACD,KAAK,CAAC,WAAW,SAAU;CAC3B,MAAM;EAAC;EAAe;EAAQ;EAAS;EAAU;CAAU;CAC3D,SAAS,CAAC,QAAS;CACnB,OAAO;EAAC;EAAO;EAAS;EAAW;EAAQ;CAAW;CACtD,QAAQ,CAAC,eAAgB;AAC1B;;;;;AAMD,MAAa,gBAAgB,CAE3B,GAAG,uBAEH,GAAG,OAAO,QAAQ,kBAAkB,CAAC,QAAQ,CAAC,CAAC,UAAU,OAAO,KAC9D,OAAO,IAAI,CAAC,aAAa,SAAS,GAAG,QAAQ,CAC9C,AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants-S7AU45oQ.js","names":["SENTRY_FRAMEWORKS: Record<string, string[]>"],"sources":["../src/constants.ts"],"sourcesContent":["/**\n * Constants for Sentry MCP server.\n *\n * Defines platform and framework combinations available in Sentry documentation.\n */\n\n/**\n * Common Sentry platforms that have documentation available\n */\nexport const SENTRY_PLATFORMS_BASE = [\n \"javascript\",\n \"python\",\n \"java\",\n \"dotnet\",\n \"go\",\n \"php\",\n \"ruby\",\n \"android\",\n \"apple\",\n \"unity\",\n \"unreal\",\n \"rust\",\n \"elixir\",\n \"kotlin\",\n \"native\",\n \"dart\",\n \"godot\",\n \"nintendo-switch\",\n \"playstation\",\n \"powershell\",\n \"react-native\",\n \"xbox\",\n] as const;\n\n/**\n * Platform-specific frameworks that have Sentry guides\n */\nexport const SENTRY_FRAMEWORKS: Record<string, string[]> = {\n javascript: [\n \"nextjs\",\n \"react\",\n \"gatsby\",\n \"remix\",\n \"vue\",\n \"angular\",\n \"hono\",\n \"svelte\",\n \"express\",\n \"fastify\",\n \"astro\",\n \"bun\",\n \"capacitor\",\n \"cloudflare\",\n \"connect\",\n \"cordova\",\n \"deno\",\n \"electron\",\n \"ember\",\n \"nuxt\",\n \"solid\",\n \"solidstart\",\n \"sveltekit\",\n \"tanstack-react\",\n \"wasm\",\n \"node\",\n \"koa\",\n \"nestjs\",\n \"hapi\",\n ],\n python: [\n \"django\",\n \"flask\",\n \"fastapi\",\n \"celery\",\n \"tornado\",\n \"pyramid\",\n \"aiohttp\",\n \"anthropic\",\n \"airflow\",\n \"aws-lambda\",\n \"boto3\",\n \"bottle\",\n \"chalice\",\n \"dramatiq\",\n \"falcon\",\n \"langchain\",\n \"litestar\",\n \"logging\",\n \"loguru\",\n \"openai\",\n \"quart\",\n \"ray\",\n \"redis\",\n \"rq\",\n \"sanic\",\n \"sqlalchemy\",\n \"starlette\",\n ],\n dart: [\"flutter\"],\n dotnet: [\n \"aspnetcore\",\n \"maui\",\n \"wpf\",\n \"winforms\",\n \"aspnet\",\n \"aws-lambda\",\n \"azure-functions\",\n \"blazor-webassembly\",\n \"entityframework\",\n \"google-cloud-functions\",\n \"extensions-logging\",\n \"log4net\",\n \"nlog\",\n \"serilog\",\n \"uwp\",\n \"xamarin\",\n ],\n java: [\n \"spring\",\n \"spring-boot\",\n \"android\",\n \"jul\",\n \"log4j2\",\n \"logback\",\n \"servlet\",\n ],\n go: [\n \"echo\",\n \"fasthttp\",\n \"fiber\",\n \"gin\",\n \"http\",\n \"iris\",\n \"logrus\",\n \"negroni\",\n \"slog\",\n \"zerolog\",\n ],\n php: [\"laravel\", \"symfony\"],\n ruby: [\"delayed_job\", \"rack\", \"rails\", \"resque\", \"sidekiq\"],\n android: [\"kotlin\"],\n apple: [\"ios\", \"macos\", \"watchos\", \"tvos\", \"visionos\"],\n kotlin: [\"multiplatform\"],\n} as const;\n\n/**\n * All valid guides for Sentry docs search filtering.\n * A guide can be either a platform (e.g., 'javascript') or a platform/framework combination (e.g., 'javascript/nextjs').\n */\nexport const SENTRY_GUIDES = [\n // Base platforms\n ...SENTRY_PLATFORMS_BASE,\n // Platform/guide combinations\n ...Object.entries(SENTRY_FRAMEWORKS).flatMap(([platform, guides]) =>\n guides.map((guide) => `${platform}/${guide}`),\n ),\n] as const;\n"],"mappings":";;;;;;;;;AASA,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;AAKD,MAAaA,oBAA8C;CACzD,YAAY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACD,MAAM,CAAC,SAAU;CACjB,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACD,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACD,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACD,KAAK,CAAC,WAAW,SAAU;CAC3B,MAAM;EAAC;EAAe;EAAQ;EAAS;EAAU;CAAU;CAC3D,SAAS,CAAC,QAAS;CACnB,OAAO;EAAC;EAAO;EAAS;EAAW;EAAQ;CAAW;CACtD,QAAQ,CAAC,eAAgB;AAC1B;;;;;AAMD,MAAa,gBAAgB,CAE3B,GAAG,uBAEH,GAAG,OAAO,QAAQ,kBAAkB,CAAC,QAAQ,CAAC,CAAC,UAAU,OAAO,KAC9D,OAAO,IAAI,CAAC,aAAa,SAAS,GAAG,QAAQ,CAC9C,AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"server-D78x_7Vz.js","names":["error: unknown","eventId","args: Record<string, unknown>","resource: { name: string; handler: ReadResourceCallback }","context: ServerContext","uri: URL","extra: RequestHandlerExtra<any, any>","variables: Variables","tools","params: any","extra: RequestHandlerExtra<ServerRequest, ServerNotification>"],"sources":["../src/server.ts"],"sourcesContent":["/**\n * MCP Server Configuration and Request Handling Infrastructure.\n *\n * This module orchestrates tool execution, prompt handling, resource management,\n * and telemetry collection in a unified server interface for LLMs.\n *\n * **Configuration Example:**\n * ```typescript\n * const server = new McpServer();\n * const context: ServerContext = {\n * accessToken: \"your-sentry-token\",\n * host: \"sentry.io\",\n * userId: \"user-123\",\n * clientId: \"mcp-client\"\n * };\n *\n * await configureServer({ server, context });\n * ```\n */\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport type { RequestHandlerExtra } from \"@modelcontextprotocol/sdk/shared/protocol.js\";\nimport type {\n ServerRequest,\n ServerNotification,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport type {\n ReadResourceCallback,\n ReadResourceTemplateCallback,\n} from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport type { Variables } from \"@modelcontextprotocol/sdk/shared/uriTemplate.js\";\nimport tools from \"./tools/index\";\nimport type { ServerContext } from \"./types\";\nimport { setTag, setUser, startNewTrace, startSpan } from \"@sentry/core\";\nimport { logError } from \"./logging\";\nimport { RESOURCES, isTemplateResource } from \"./resources\";\nimport { PROMPT_DEFINITIONS } from \"./promptDefinitions\";\nimport { PROMPT_HANDLERS } from \"./prompts\";\nimport { ApiError } from \"./api-client\";\nimport { UserInputError, ConfigurationError } from \"./errors\";\nimport { LIB_VERSION } from \"./version\";\n\n/**\n * Type guard to identify Sentry API errors.\n */\nfunction isApiError(error: unknown): error is ApiError {\n return error instanceof ApiError;\n}\n\n/**\n * Type guard to identify user input validation errors.\n */\nfunction isUserInputError(error: unknown): error is UserInputError {\n return error instanceof UserInputError;\n}\n\n/**\n * Type guard to identify configuration errors.\n */\nfunction isConfigurationError(error: unknown): error is ConfigurationError {\n return error instanceof ConfigurationError;\n}\n\n/**\n * Formats errors for LLM consumption with appropriate telemetry handling.\n *\n * **Error Types:**\n * - User Input Errors: Clear guidance without telemetry\n * - Configuration Errors: Configuration guidance without telemetry\n * - API Errors: Enhanced messaging with HTTP status context\n * - System Errors: Full telemetry capture with event IDs\n *\n * @example User Input Error Response\n * ```markdown\n * **Input Error**\n *\n * It looks like there was a problem with the input you provided.\n * Organization slug is required. Please provide an organizationSlug parameter.\n * You may be able to resolve the issue by addressing the concern and trying again.\n * ```\n *\n * @example Configuration Error Response\n * ```markdown\n * **Configuration Error**\n *\n * There appears to be a configuration issue with your setup.\n * Unable to connect to sentry.invalid.com - Hostname not found. Verify the URL is correct.\n * Please check your environment configuration and try again.\n * ```\n */\nasync function logAndFormatError(error: unknown) {\n if (isUserInputError(error)) {\n return [\n \"**Input Error**\",\n \"It looks like there was a problem with the input you provided.\",\n error.message,\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n if (isConfigurationError(error)) {\n return [\n \"**Configuration Error**\",\n \"There appears to be a configuration issue with your setup.\",\n error.message,\n `Please check your environment configuration and try again.`,\n ].join(\"\\n\\n\");\n }\n\n if (isApiError(error)) {\n // Log 500+ errors to Sentry for debugging\n const eventId = error.status >= 500 ? logError(error) : undefined;\n\n return [\n \"**Error**\",\n `There was an HTTP ${error.status} error with your request to the Sentry API.`,\n `${error.message}`,\n eventId ? `**Event ID**: ${eventId}` : \"\",\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ]\n .filter(Boolean)\n .join(\"\\n\\n\");\n }\n\n const eventId = logError(error);\n\n return [\n \"**Error**\",\n \"It looks like there was a problem communicating with the Sentry API.\",\n \"Please report the following to the user for the Sentry team:\",\n `**Event ID**: ${eventId}`,\n process.env.NODE_ENV !== \"production\"\n ? error instanceof Error\n ? error.message\n : String(error)\n : \"\",\n ].join(\"\\n\\n\");\n}\n\n/**\n * Extracts MCP request parameters for OpenTelemetry attributes.\n *\n * @example Parameter Transformation\n * ```typescript\n * const input = { organizationSlug: \"my-org\", query: \"is:unresolved\" };\n * const output = extractMcpParameters(input);\n * // { \"mcp.request.argument.organizationSlug\": \"\\\"my-org\\\"\", \"mcp.request.argument.query\": \"\\\"is:unresolved\\\"\" }\n * ```\n */\nfunction extractMcpParameters(args: Record<string, unknown>) {\n return Object.fromEntries(\n Object.entries(args).map(([key, value]) => {\n return [`mcp.request.argument.${key}`, JSON.stringify(value)];\n }),\n );\n}\n\n/**\n * Creates a telemetry wrapper for regular URI resource handlers.\n * Captures URI access and user context for observability.\n */\nfunction createResourceHandler(\n resource: { name: string; handler: ReadResourceCallback },\n context: ServerContext,\n): ReadResourceCallback {\n return async (uri: URL, extra: RequestHandlerExtra<any, any>) => {\n return await startNewTrace(async () => {\n return await startSpan(\n {\n name: `resources/read ${resource.name}`,\n attributes: {\n \"mcp.resource.name\": resource.name,\n \"mcp.resource.uri\": uri.toString(),\n ...(context.mcpClientName && {\n \"mcp.client.name\": context.mcpClientName,\n }),\n ...(context.mcpClientVersion && {\n \"mcp.client.version\": context.mcpClientVersion,\n }),\n ...(context.mcpProtocolVersion && {\n \"mcp.protocol.version\": context.mcpProtocolVersion,\n }),\n \"mcp.server.name\": \"Sentry MCP\",\n \"mcp.server.version\": LIB_VERSION,\n },\n },\n async () => {\n if (context.userId) {\n setUser({\n id: context.userId,\n });\n }\n if (context.clientId) {\n setTag(\"client.id\", context.clientId);\n }\n\n return resource.handler(uri, extra);\n },\n );\n });\n };\n}\n\n/**\n * Creates a telemetry wrapper for URI template resource handlers.\n * Captures template parameters and user context for observability.\n */\nfunction createTemplateResourceHandler(\n resource: { name: string; handler: ReadResourceCallback },\n context: ServerContext,\n): ReadResourceTemplateCallback {\n return async (\n uri: URL,\n variables: Variables,\n extra: RequestHandlerExtra<any, any>,\n ) => {\n return await startNewTrace(async () => {\n return await startSpan(\n {\n name: `resources/read ${resource.name}`,\n attributes: {\n \"mcp.resource.name\": resource.name,\n \"mcp.resource.uri\": uri.toString(),\n ...(context.mcpClientName && {\n \"mcp.client.name\": context.mcpClientName,\n }),\n ...(context.mcpClientVersion && {\n \"mcp.client.version\": context.mcpClientVersion,\n }),\n ...(context.mcpProtocolVersion && {\n \"mcp.protocol.version\": context.mcpProtocolVersion,\n }),\n \"mcp.server.name\": \"Sentry MCP\",\n \"mcp.server.version\": LIB_VERSION,\n ...extractMcpParameters(variables),\n },\n },\n async () => {\n if (context.userId) {\n setUser({\n id: context.userId,\n });\n }\n if (context.clientId) {\n setTag(\"client.id\", context.clientId);\n }\n\n // The MCP SDK has already constructed the URI from the template and variables\n // We just need to call the handler with the constructed URI\n return resource.handler(uri, extra);\n },\n );\n });\n };\n}\n\n/**\n * Configures an MCP server with all tools, prompts, resources, and telemetry.\n *\n * Transforms a bare MCP server instance into a fully-featured Sentry integration\n * with comprehensive observability, error handling, and handler registration.\n *\n * @example Basic Configuration\n * ```typescript\n * const server = new McpServer();\n * const context = {\n * accessToken: process.env.SENTRY_TOKEN,\n * host: \"sentry.io\",\n * userId: \"user-123\",\n * clientId: \"cursor-ide\"\n * };\n *\n * await configureServer({ server, context });\n * ```\n */\nexport async function configureServer({\n server,\n context,\n onToolComplete,\n onInitialized,\n}: {\n server: McpServer;\n context: ServerContext;\n onToolComplete?: () => void;\n onInitialized?: () => void | Promise<void>;\n}) {\n server.server.onerror = (error) => {\n logError(error);\n };\n\n // Hook into the initialized notification to capture client information\n server.server.oninitialized = () => {\n const serverInstance = server.server as any;\n const clientInfo = serverInstance._clientVersion;\n const protocolVersion = serverInstance._protocolVersion;\n\n // Update the context object with client information\n if (clientInfo) {\n context.mcpClientName = clientInfo.name;\n context.mcpClientVersion = clientInfo.version;\n }\n\n if (protocolVersion) {\n context.mcpProtocolVersion = protocolVersion;\n }\n\n // Call the custom onInitialized handler if provided\n // Note: MCP SDK doesn't support async callbacks, so we handle promises\n // without awaiting to avoid blocking the initialization flow\n if (onInitialized) {\n const result = onInitialized();\n if (result instanceof Promise) {\n result.catch((error) => {\n console.error(\"Error in onInitialized callback:\", error);\n logError(error);\n });\n }\n }\n };\n\n for (const resource of RESOURCES) {\n if (isTemplateResource(resource)) {\n // Handle URI template resources\n server.registerResource(\n resource.name,\n resource.template,\n {\n description: resource.description,\n mimeType: resource.mimeType,\n },\n createTemplateResourceHandler(resource, context),\n );\n } else {\n // Handle regular URI resources\n server.registerResource(\n resource.name,\n resource.uri,\n {\n description: resource.description,\n mimeType: resource.mimeType,\n },\n createResourceHandler(resource, context),\n );\n }\n }\n\n for (const prompt of PROMPT_DEFINITIONS) {\n const handler = PROMPT_HANDLERS[prompt.name];\n\n server.prompt(\n prompt.name,\n prompt.description,\n prompt.paramsSchema ? prompt.paramsSchema : {},\n async (...args) => {\n try {\n return await startNewTrace(async () => {\n return await startSpan(\n {\n name: `prompts/get ${prompt.name}`,\n attributes: {\n \"mcp.prompt.name\": prompt.name,\n ...(context.mcpClientName && {\n \"mcp.client.name\": context.mcpClientName,\n }),\n ...(context.mcpClientVersion && {\n \"mcp.client.version\": context.mcpClientVersion,\n }),\n ...(context.mcpProtocolVersion && {\n \"mcp.protocol.version\": context.mcpProtocolVersion,\n }),\n ...(context.mcpServerName && {\n \"mcp.server.name\": context.mcpServerName,\n }),\n ...(context.mcpServerVersion && {\n \"mcp.server.version\": context.mcpServerVersion,\n }),\n ...extractMcpParameters(args[0] || {}),\n },\n },\n async (span) => {\n if (context.userId) {\n setUser({\n id: context.userId,\n });\n }\n if (context.clientId) {\n setTag(\"client.id\", context.clientId);\n }\n try {\n // TODO(dcramer): I'm too dumb to figure this out\n // @ts-ignore\n const output = await handler(context, ...args);\n span.setStatus({\n code: 1, // ok\n });\n return {\n messages: [\n {\n role: \"user\" as const,\n content: {\n type: \"text\" as const,\n text: output,\n },\n },\n ],\n };\n } catch (error) {\n span.setStatus({\n code: 2, // error\n });\n throw error;\n }\n },\n );\n });\n } finally {\n onToolComplete?.();\n }\n },\n );\n }\n\n for (const [toolKey, tool] of Object.entries(tools)) {\n server.tool(\n tool.name,\n tool.description,\n tool.inputSchema,\n async (\n params: any,\n extra: RequestHandlerExtra<ServerRequest, ServerNotification>,\n ) => {\n try {\n return await startNewTrace(async () => {\n return await startSpan(\n {\n name: `tools/call ${tool.name}`,\n attributes: {\n \"mcp.tool.name\": tool.name,\n ...(context.mcpClientName && {\n \"mcp.client.name\": context.mcpClientName,\n }),\n ...(context.mcpClientVersion && {\n \"mcp.client.version\": context.mcpClientVersion,\n }),\n ...(context.mcpProtocolVersion && {\n \"mcp.protocol.version\": context.mcpProtocolVersion,\n }),\n ...(context.mcpServerName && {\n \"mcp.server.name\": context.mcpServerName,\n }),\n ...(context.mcpServerVersion && {\n \"mcp.server.version\": context.mcpServerVersion,\n }),\n ...extractMcpParameters(params || {}),\n },\n },\n async (span) => {\n if (context.userId) {\n setUser({\n id: context.userId,\n });\n }\n if (context.clientId) {\n setTag(\"client.id\", context.clientId);\n }\n\n try {\n const output = await tool.handler(params, context);\n span.setStatus({\n code: 1, // ok\n });\n // if the tool returns a string, assume it's a message\n if (typeof output === \"string\") {\n return {\n content: [\n {\n type: \"text\" as const,\n text: output,\n },\n ],\n };\n }\n // if the tool returns a list, assume it's a content list\n if (Array.isArray(output)) {\n return {\n content: output,\n };\n }\n throw new Error(`Invalid tool output: ${output}`);\n } catch (error) {\n span.setStatus({\n code: 2, // error\n });\n\n // CRITICAL: Tool errors MUST be returned as formatted text responses,\n // NOT thrown as exceptions. This ensures consistent error handling\n // and prevents the MCP client from receiving raw error objects.\n //\n // The logAndFormatError function provides user-friendly error messages\n // with appropriate formatting for different error types:\n // - UserInputError: Clear guidance for fixing input problems\n // - ConfigurationError: Clear guidance for fixing configuration issues\n // - ApiError: HTTP status context with helpful messaging\n // - System errors: Sentry event IDs for debugging\n //\n // DO NOT change this to throw error - it breaks error handling!\n return {\n content: [\n {\n type: \"text\" as const,\n text: await logAndFormatError(error),\n },\n ],\n isError: true,\n };\n }\n },\n );\n });\n } finally {\n onToolComplete?.();\n }\n },\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AA4CA,SAAS,WAAWA,OAAmC;AACrD,QAAO,iBAAiB;AACzB;;;;AAKD,SAAS,iBAAiBA,OAAyC;AACjE,QAAO,iBAAiB;AACzB;;;;AAKD,SAAS,qBAAqBA,OAA6C;AACzE,QAAO,iBAAiB;AACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BD,eAAe,kBAAkBA,OAAgB;AAC/C,KAAI,iBAAiB,MAAM,CACzB,QAAO;EACL;EACA;EACA,MAAM;GACL;CACF,EAAC,KAAK,OAAO;AAGhB,KAAI,qBAAqB,MAAM,CAC7B,QAAO;EACL;EACA;EACA,MAAM;GACL;CACF,EAAC,KAAK,OAAO;AAGhB,KAAI,WAAW,MAAM,EAAE;EAErB,MAAMC,YAAU,MAAM,UAAU,MAAM,SAAS,MAAM;AAErD,SAAO;GACL;IACC,oBAAoB,MAAM,OAAO;MAC/B,MAAM;GACTA,aAAW,gBAAgBA,cAAY;IACtC;EACF,EACE,OAAO,QAAQ,CACf,KAAK,OA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UACX;KACE,OAAO,aAAa,KAAK;KACzB,YAAY;MACV,iBAAiB,KAAK;MACtB,GAAI,QAAQ,iBAAiB,EAC3B,mBAAmB,QAAQ,cAC5B;MACD,GAAI,QAAQ,oBAAoB,EAC9B,sBAAsB,QAAQ,iBAC/B;MACD,GAAI,QAAQ,sBAAsB,EAChC,wBAAwB,QAAQ,mBACjC;MACD,GAAI,QAAQ,iBAAiB,EAC3B,mBAAmB,QAAQ,cAC5B;MACD,GAAI,QAAQ,oBAAoB,EAC9B,sBAAsB,QAAQ,iBAC/B;MACD,GAAG,qBAAqB,UAAU,CAAE,EAAC;KACtC;IACF,GACD,OAAO,SAAS;AACd,SAAI,QAAQ,OACV,SAAQ,EACN,IAAI,QAAQ,OACb,EAAC;AAEJ,SAAI,QAAQ,SACV,QAAO,aAAa,QAAQ,SAAS;AAGvC,SAAI;MACF,MAAM,SAAS,MAAM,KAAK,QAAQ,QAAQ,QAAQ;AAClD,WAAK,UAAU,EACb,MAAM,EACP,EAAC;AAEF,iBAAW,WAAW,SACpB,QAAO,EACL,SAAS,CACP;OACE,MAAM;OACN,MAAM;MACP,CACF,EACF;AAGH,UAAI,MAAM,QAAQ,OAAO,CACvB,QAAO,EACL,SAAS,OACV;AAEH,YAAM,IAAI,OAAO,uBAAuB;KACzC,SAAQ,OAAO;AACd,WAAK,UAAU,EACb,MAAM,EACP,EAAC;AAcF,aAAO;OACL,SAAS,CACP;QACE,MAAM;QACN,MAAM,MAAM,kBAAkB,MAAM;OACrC,CACF;OACD,SAAS;MACV;KACF;IACF,EACF;GACF,EAAC;EACH,UAAS;AACR,qBAAkB;EACnB;CACF,EACF;AAEJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"server-DYFiTMLB.cjs","names":["error: unknown","ApiError","UserInputError","ConfigurationError","eventId","args: Record<string, unknown>","resource: { name: string; handler: ReadResourceCallback }","context: ServerContext","uri: URL","extra: RequestHandlerExtra<any, any>","LIB_VERSION","variables: Variables","RESOURCES","PROMPT_DEFINITIONS","PROMPT_HANDLERS","tools","params: any","extra: RequestHandlerExtra<ServerRequest, ServerNotification>"],"sources":["../src/server.ts"],"sourcesContent":["/**\n * MCP Server Configuration and Request Handling Infrastructure.\n *\n * This module orchestrates tool execution, prompt handling, resource management,\n * and telemetry collection in a unified server interface for LLMs.\n *\n * **Configuration Example:**\n * ```typescript\n * const server = new McpServer();\n * const context: ServerContext = {\n * accessToken: \"your-sentry-token\",\n * host: \"sentry.io\",\n * userId: \"user-123\",\n * clientId: \"mcp-client\"\n * };\n *\n * await configureServer({ server, context });\n * ```\n */\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport type { RequestHandlerExtra } from \"@modelcontextprotocol/sdk/shared/protocol.js\";\nimport type {\n ServerRequest,\n ServerNotification,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport type {\n ReadResourceCallback,\n ReadResourceTemplateCallback,\n} from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport type { Variables } from \"@modelcontextprotocol/sdk/shared/uriTemplate.js\";\nimport tools from \"./tools/index\";\nimport type { ServerContext } from \"./types\";\nimport { setTag, setUser, startNewTrace, startSpan } from \"@sentry/core\";\nimport { logError } from \"./logging\";\nimport { RESOURCES, isTemplateResource } from \"./resources\";\nimport { PROMPT_DEFINITIONS } from \"./promptDefinitions\";\nimport { PROMPT_HANDLERS } from \"./prompts\";\nimport { ApiError } from \"./api-client\";\nimport { UserInputError, ConfigurationError } from \"./errors\";\nimport { LIB_VERSION } from \"./version\";\n\n/**\n * Type guard to identify Sentry API errors.\n */\nfunction isApiError(error: unknown): error is ApiError {\n return error instanceof ApiError;\n}\n\n/**\n * Type guard to identify user input validation errors.\n */\nfunction isUserInputError(error: unknown): error is UserInputError {\n return error instanceof UserInputError;\n}\n\n/**\n * Type guard to identify configuration errors.\n */\nfunction isConfigurationError(error: unknown): error is ConfigurationError {\n return error instanceof ConfigurationError;\n}\n\n/**\n * Formats errors for LLM consumption with appropriate telemetry handling.\n *\n * **Error Types:**\n * - User Input Errors: Clear guidance without telemetry\n * - Configuration Errors: Configuration guidance without telemetry\n * - API Errors: Enhanced messaging with HTTP status context\n * - System Errors: Full telemetry capture with event IDs\n *\n * @example User Input Error Response\n * ```markdown\n * **Input Error**\n *\n * It looks like there was a problem with the input you provided.\n * Organization slug is required. Please provide an organizationSlug parameter.\n * You may be able to resolve the issue by addressing the concern and trying again.\n * ```\n *\n * @example Configuration Error Response\n * ```markdown\n * **Configuration Error**\n *\n * There appears to be a configuration issue with your setup.\n * Unable to connect to sentry.invalid.com - Hostname not found. Verify the URL is correct.\n * Please check your environment configuration and try again.\n * ```\n */\nasync function logAndFormatError(error: unknown) {\n if (isUserInputError(error)) {\n return [\n \"**Input Error**\",\n \"It looks like there was a problem with the input you provided.\",\n error.message,\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n if (isConfigurationError(error)) {\n return [\n \"**Configuration Error**\",\n \"There appears to be a configuration issue with your setup.\",\n error.message,\n `Please check your environment configuration and try again.`,\n ].join(\"\\n\\n\");\n }\n\n if (isApiError(error)) {\n // Log 500+ errors to Sentry for debugging\n const eventId = error.status >= 500 ? logError(error) : undefined;\n\n return [\n \"**Error**\",\n `There was an HTTP ${error.status} error with your request to the Sentry API.`,\n `${error.message}`,\n eventId ? `**Event ID**: ${eventId}` : \"\",\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ]\n .filter(Boolean)\n .join(\"\\n\\n\");\n }\n\n const eventId = logError(error);\n\n return [\n \"**Error**\",\n \"It looks like there was a problem communicating with the Sentry API.\",\n \"Please report the following to the user for the Sentry team:\",\n `**Event ID**: ${eventId}`,\n process.env.NODE_ENV !== \"production\"\n ? error instanceof Error\n ? error.message\n : String(error)\n : \"\",\n ].join(\"\\n\\n\");\n}\n\n/**\n * Extracts MCP request parameters for OpenTelemetry attributes.\n *\n * @example Parameter Transformation\n * ```typescript\n * const input = { organizationSlug: \"my-org\", query: \"is:unresolved\" };\n * const output = extractMcpParameters(input);\n * // { \"mcp.request.argument.organizationSlug\": \"\\\"my-org\\\"\", \"mcp.request.argument.query\": \"\\\"is:unresolved\\\"\" }\n * ```\n */\nfunction extractMcpParameters(args: Record<string, unknown>) {\n return Object.fromEntries(\n Object.entries(args).map(([key, value]) => {\n return [`mcp.request.argument.${key}`, JSON.stringify(value)];\n }),\n );\n}\n\n/**\n * Creates a telemetry wrapper for regular URI resource handlers.\n * Captures URI access and user context for observability.\n */\nfunction createResourceHandler(\n resource: { name: string; handler: ReadResourceCallback },\n context: ServerContext,\n): ReadResourceCallback {\n return async (uri: URL, extra: RequestHandlerExtra<any, any>) => {\n return await startNewTrace(async () => {\n return await startSpan(\n {\n name: `resources/read ${resource.name}`,\n attributes: {\n \"mcp.resource.name\": resource.name,\n \"mcp.resource.uri\": uri.toString(),\n ...(context.mcpClientName && {\n \"mcp.client.name\": context.mcpClientName,\n }),\n ...(context.mcpClientVersion && {\n \"mcp.client.version\": context.mcpClientVersion,\n }),\n ...(context.mcpProtocolVersion && {\n \"mcp.protocol.version\": context.mcpProtocolVersion,\n }),\n \"mcp.server.name\": \"Sentry MCP\",\n \"mcp.server.version\": LIB_VERSION,\n },\n },\n async () => {\n if (context.userId) {\n setUser({\n id: context.userId,\n });\n }\n if (context.clientId) {\n setTag(\"client.id\", context.clientId);\n }\n\n return resource.handler(uri, extra);\n },\n );\n });\n };\n}\n\n/**\n * Creates a telemetry wrapper for URI template resource handlers.\n * Captures template parameters and user context for observability.\n */\nfunction createTemplateResourceHandler(\n resource: { name: string; handler: ReadResourceCallback },\n context: ServerContext,\n): ReadResourceTemplateCallback {\n return async (\n uri: URL,\n variables: Variables,\n extra: RequestHandlerExtra<any, any>,\n ) => {\n return await startNewTrace(async () => {\n return await startSpan(\n {\n name: `resources/read ${resource.name}`,\n attributes: {\n \"mcp.resource.name\": resource.name,\n \"mcp.resource.uri\": uri.toString(),\n ...(context.mcpClientName && {\n \"mcp.client.name\": context.mcpClientName,\n }),\n ...(context.mcpClientVersion && {\n \"mcp.client.version\": context.mcpClientVersion,\n }),\n ...(context.mcpProtocolVersion && {\n \"mcp.protocol.version\": context.mcpProtocolVersion,\n }),\n \"mcp.server.name\": \"Sentry MCP\",\n \"mcp.server.version\": LIB_VERSION,\n ...extractMcpParameters(variables),\n },\n },\n async () => {\n if (context.userId) {\n setUser({\n id: context.userId,\n });\n }\n if (context.clientId) {\n setTag(\"client.id\", context.clientId);\n }\n\n // The MCP SDK has already constructed the URI from the template and variables\n // We just need to call the handler with the constructed URI\n return resource.handler(uri, extra);\n },\n );\n });\n };\n}\n\n/**\n * Configures an MCP server with all tools, prompts, resources, and telemetry.\n *\n * Transforms a bare MCP server instance into a fully-featured Sentry integration\n * with comprehensive observability, error handling, and handler registration.\n *\n * @example Basic Configuration\n * ```typescript\n * const server = new McpServer();\n * const context = {\n * accessToken: process.env.SENTRY_TOKEN,\n * host: \"sentry.io\",\n * userId: \"user-123\",\n * clientId: \"cursor-ide\"\n * };\n *\n * await configureServer({ server, context });\n * ```\n */\nexport async function configureServer({\n server,\n context,\n onToolComplete,\n onInitialized,\n}: {\n server: McpServer;\n context: ServerContext;\n onToolComplete?: () => void;\n onInitialized?: () => void | Promise<void>;\n}) {\n server.server.onerror = (error) => {\n logError(error);\n };\n\n // Hook into the initialized notification to capture client information\n server.server.oninitialized = () => {\n const serverInstance = server.server as any;\n const clientInfo = serverInstance._clientVersion;\n const protocolVersion = serverInstance._protocolVersion;\n\n // Update the context object with client information\n if (clientInfo) {\n context.mcpClientName = clientInfo.name;\n context.mcpClientVersion = clientInfo.version;\n }\n\n if (protocolVersion) {\n context.mcpProtocolVersion = protocolVersion;\n }\n\n // Call the custom onInitialized handler if provided\n // Note: MCP SDK doesn't support async callbacks, so we handle promises\n // without awaiting to avoid blocking the initialization flow\n if (onInitialized) {\n const result = onInitialized();\n if (result instanceof Promise) {\n result.catch((error) => {\n console.error(\"Error in onInitialized callback:\", error);\n logError(error);\n });\n }\n }\n };\n\n for (const resource of RESOURCES) {\n if (isTemplateResource(resource)) {\n // Handle URI template resources\n server.registerResource(\n resource.name,\n resource.template,\n {\n description: resource.description,\n mimeType: resource.mimeType,\n },\n createTemplateResourceHandler(resource, context),\n );\n } else {\n // Handle regular URI resources\n server.registerResource(\n resource.name,\n resource.uri,\n {\n description: resource.description,\n mimeType: resource.mimeType,\n },\n createResourceHandler(resource, context),\n );\n }\n }\n\n for (const prompt of PROMPT_DEFINITIONS) {\n const handler = PROMPT_HANDLERS[prompt.name];\n\n server.prompt(\n prompt.name,\n prompt.description,\n prompt.paramsSchema ? prompt.paramsSchema : {},\n async (...args) => {\n try {\n return await startNewTrace(async () => {\n return await startSpan(\n {\n name: `prompts/get ${prompt.name}`,\n attributes: {\n \"mcp.prompt.name\": prompt.name,\n ...(context.mcpClientName && {\n \"mcp.client.name\": context.mcpClientName,\n }),\n ...(context.mcpClientVersion && {\n \"mcp.client.version\": context.mcpClientVersion,\n }),\n ...(context.mcpProtocolVersion && {\n \"mcp.protocol.version\": context.mcpProtocolVersion,\n }),\n ...(context.mcpServerName && {\n \"mcp.server.name\": context.mcpServerName,\n }),\n ...(context.mcpServerVersion && {\n \"mcp.server.version\": context.mcpServerVersion,\n }),\n ...extractMcpParameters(args[0] || {}),\n },\n },\n async (span) => {\n if (context.userId) {\n setUser({\n id: context.userId,\n });\n }\n if (context.clientId) {\n setTag(\"client.id\", context.clientId);\n }\n try {\n // TODO(dcramer): I'm too dumb to figure this out\n // @ts-ignore\n const output = await handler(context, ...args);\n span.setStatus({\n code: 1, // ok\n });\n return {\n messages: [\n {\n role: \"user\" as const,\n content: {\n type: \"text\" as const,\n text: output,\n },\n },\n ],\n };\n } catch (error) {\n span.setStatus({\n code: 2, // error\n });\n throw error;\n }\n },\n );\n });\n } finally {\n onToolComplete?.();\n }\n },\n );\n }\n\n for (const [toolKey, tool] of Object.entries(tools)) {\n server.tool(\n tool.name,\n tool.description,\n tool.inputSchema,\n async (\n params: any,\n extra: RequestHandlerExtra<ServerRequest, ServerNotification>,\n ) => {\n try {\n return await startNewTrace(async () => {\n return await startSpan(\n {\n name: `tools/call ${tool.name}`,\n attributes: {\n \"mcp.tool.name\": tool.name,\n ...(context.mcpClientName && {\n \"mcp.client.name\": context.mcpClientName,\n }),\n ...(context.mcpClientVersion && {\n \"mcp.client.version\": context.mcpClientVersion,\n }),\n ...(context.mcpProtocolVersion && {\n \"mcp.protocol.version\": context.mcpProtocolVersion,\n }),\n ...(context.mcpServerName && {\n \"mcp.server.name\": context.mcpServerName,\n }),\n ...(context.mcpServerVersion && {\n \"mcp.server.version\": context.mcpServerVersion,\n }),\n ...extractMcpParameters(params || {}),\n },\n },\n async (span) => {\n if (context.userId) {\n setUser({\n id: context.userId,\n });\n }\n if (context.clientId) {\n setTag(\"client.id\", context.clientId);\n }\n\n try {\n const output = await tool.handler(params, context);\n span.setStatus({\n code: 1, // ok\n });\n // if the tool returns a string, assume it's a message\n if (typeof output === \"string\") {\n return {\n content: [\n {\n type: \"text\" as const,\n text: output,\n },\n ],\n };\n }\n // if the tool returns a list, assume it's a content list\n if (Array.isArray(output)) {\n return {\n content: output,\n };\n }\n throw new Error(`Invalid tool output: ${output}`);\n } catch (error) {\n span.setStatus({\n code: 2, // error\n });\n\n // CRITICAL: Tool errors MUST be returned as formatted text responses,\n // NOT thrown as exceptions. This ensures consistent error handling\n // and prevents the MCP client from receiving raw error objects.\n //\n // The logAndFormatError function provides user-friendly error messages\n // with appropriate formatting for different error types:\n // - UserInputError: Clear guidance for fixing input problems\n // - ConfigurationError: Clear guidance for fixing configuration issues\n // - ApiError: HTTP status context with helpful messaging\n // - System errors: Sentry event IDs for debugging\n //\n // DO NOT change this to throw error - it breaks error handling!\n return {\n content: [\n {\n type: \"text\" as const,\n text: await logAndFormatError(error),\n },\n ],\n isError: true,\n };\n }\n },\n );\n });\n } finally {\n onToolComplete?.();\n }\n },\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AA4CA,SAAS,WAAWA,OAAmC;AACrD,QA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P,EAAC;AAEF,iBAAW,WAAW,SACpB,QAAO,EACL,SAAS,CACP;OACE,MAAM;OACN,MAAM;MACP,CACF,EACF;AAGH,UAAI,MAAM,QAAQ,OAAO,CACvB,QAAO,EACL,SAAS,OACV;AAEH,YAAM,IAAI,OAAO,uBAAuB;KACzC,SAAQ,OAAO;AACd,WAAK,UAAU,EACb,MAAM,EACP,EAAC;AAcF,aAAO;OACL,SAAS,CACP;QACE,MAAM;QACN,MAAM,MAAM,kBAAkB,MAAM;OACrC,CACF;OACD,SAAS;MACV;KACF;IACF,EACF;GACF,EAAC;EACH,UAAS;AACR,qBAAkB;EACnB;CACF,EACF;AAEJ"}
@@ -1,6 +0,0 @@
1
- //#region src/version.ts
2
- const LIB_VERSION = typeof process !== "undefined" && "0.17.0" || "0.0.0";
3
-
4
- //#endregion
5
- export { LIB_VERSION };
6
- //# sourceMappingURL=version-Bj68uyCt.js.map