@sentry/mcp-server 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -2
- package/dist/{analyze-issue-with-seer-Bq3kefOr.cjs → analyze-issue-with-seer-BkVrrh28.cjs} +10 -17
- package/dist/analyze-issue-with-seer-BkVrrh28.cjs.map +1 -0
- package/dist/{analyze-issue-with-seer-Dk0ZFwN8.js → analyze-issue-with-seer-CoqsTklL.js} +10 -17
- package/dist/analyze-issue-with-seer-CoqsTklL.js.map +1 -0
- package/dist/api-client/client.cjs +1 -1
- package/dist/api-client/client.d.cts +3 -3
- package/dist/api-client/client.d.ts +3 -3
- package/dist/api-client/client.js +1 -1
- package/dist/api-client/index.cjs +1 -1
- package/dist/api-client/index.d.cts +3 -3
- package/dist/api-client/index.d.ts +4 -4
- package/dist/api-client/index.js +1 -1
- package/dist/api-client/schema.d.cts +1 -1
- package/dist/api-client/schema.d.ts +1 -1
- package/dist/api-client/types.d.cts +2 -2
- package/dist/api-client/types.d.ts +2 -2
- package/dist/{api-utils-BcB1cMXS.js → api-utils-C6QJAzFL.js} +4 -4
- package/dist/api-utils-C6QJAzFL.js.map +1 -0
- package/dist/{api-utils-BJS0CChW.cjs → api-utils-d36iteNO.cjs} +4 -4
- package/dist/api-utils-d36iteNO.cjs.map +1 -0
- package/dist/{client-Dae1ZwWb.d.cts → client-CQ9Xe1aN.d.cts} +17 -19
- package/dist/client-CQ9Xe1aN.d.cts.map +1 -0
- package/dist/{client-BbamPqV4.js → client-DOYWNvVM.js} +21 -12
- package/dist/client-DOYWNvVM.js.map +1 -0
- package/dist/{client-BNTsOycD.cjs → client-Dkw5iYu3.cjs} +21 -12
- package/dist/client-Dkw5iYu3.cjs.map +1 -0
- package/dist/{client-qyEu8fvj.d.ts → client-VCJp6Kcu.d.ts} +19 -21
- package/dist/client-VCJp6Kcu.d.ts.map +1 -0
- package/dist/{create-dsn-B3L8iWno.js → create-dsn-D530I7Lr.js} +2 -2
- package/dist/{create-dsn-B3L8iWno.js.map → create-dsn-D530I7Lr.js.map} +1 -1
- package/dist/{create-dsn-CVPtt_Es.cjs → create-dsn-Dz8nyTFw.cjs} +2 -2
- package/dist/{create-dsn-CVPtt_Es.cjs.map → create-dsn-Dz8nyTFw.cjs.map} +1 -1
- package/dist/{create-project-B_6a6okf.cjs → create-project-BxzRiryg.cjs} +3 -3
- package/dist/{create-project-B_6a6okf.cjs.map → create-project-BxzRiryg.cjs.map} +1 -1
- package/dist/{create-project-DdIXMvWI.js → create-project-K1od5Rhx.js} +3 -3
- package/dist/{create-project-DdIXMvWI.js.map → create-project-K1od5Rhx.js.map} +1 -1
- package/dist/{create-team-C1DP5Z1r.cjs → create-team-CJhrccc1.cjs} +2 -2
- package/dist/{create-team-C1DP5Z1r.cjs.map → create-team-CJhrccc1.cjs.map} +1 -1
- package/dist/{create-team-BarRdaZK.js → create-team-zHz00C6Q.js} +2 -2
- package/dist/{create-team-BarRdaZK.js.map → create-team-zHz00C6Q.js.map} +1 -1
- package/dist/{fetch-utils-B-a92ObC.d.ts → fetch-utils-Bv9WjUp0.d.ts} +1 -1
- package/dist/fetch-utils-Bv9WjUp0.d.ts.map +1 -0
- package/dist/{find-dsns-BPbblgrn.js → find-dsns-BoEP0N7B.js} +2 -2
- package/dist/{find-dsns-BPbblgrn.js.map → find-dsns-BoEP0N7B.js.map} +1 -1
- package/dist/{find-dsns-BDJWY6nZ.cjs → find-dsns-CK59RaUJ.cjs} +2 -2
- package/dist/{find-dsns-BDJWY6nZ.cjs.map → find-dsns-CK59RaUJ.cjs.map} +1 -1
- package/dist/{find-errors-B9wLxXA0.js → find-errors-C3oUMeRi.js} +2 -2
- package/dist/{find-errors-B9wLxXA0.js.map → find-errors-C3oUMeRi.js.map} +1 -1
- package/dist/{find-errors-DnFs3PaH.cjs → find-errors-CB9NpSxG.cjs} +2 -2
- package/dist/{find-errors-DnFs3PaH.cjs.map → find-errors-CB9NpSxG.cjs.map} +1 -1
- package/dist/{find-issues-CwPbwRXK.cjs → find-issues-C3uk59rn.cjs} +2 -2
- package/dist/{find-issues-CwPbwRXK.cjs.map → find-issues-C3uk59rn.cjs.map} +1 -1
- package/dist/{find-issues-BI1tI3cJ.js → find-issues-CAtNGBly.js} +2 -2
- package/dist/{find-issues-BI1tI3cJ.js.map → find-issues-CAtNGBly.js.map} +1 -1
- package/dist/{find-organizations-DqS6zoTK.cjs → find-organizations-BrdMfZRO.cjs} +2 -2
- package/dist/{find-organizations-DqS6zoTK.cjs.map → find-organizations-BrdMfZRO.cjs.map} +1 -1
- package/dist/{find-organizations-CdiouW48.js → find-organizations-ojXwWWzk.js} +2 -2
- package/dist/{find-organizations-CdiouW48.js.map → find-organizations-ojXwWWzk.js.map} +1 -1
- package/dist/{find-projects-Ba6cdX7n.cjs → find-projects-BZWhlYJh.cjs} +2 -2
- package/dist/{find-projects-Ba6cdX7n.cjs.map → find-projects-BZWhlYJh.cjs.map} +1 -1
- package/dist/{find-projects-Ccfxv47h.js → find-projects-fcLG4KpT.js} +2 -2
- package/dist/{find-projects-Ccfxv47h.js.map → find-projects-fcLG4KpT.js.map} +1 -1
- package/dist/{find-releases-CFoGytN-.js → find-releases-BUozr0Z-.js} +2 -2
- package/dist/{find-releases-CFoGytN-.js.map → find-releases-BUozr0Z-.js.map} +1 -1
- package/dist/{find-releases-CFl86XMT.cjs → find-releases-CZCVEOHZ.cjs} +2 -2
- package/dist/{find-releases-CFl86XMT.cjs.map → find-releases-CZCVEOHZ.cjs.map} +1 -1
- package/dist/{find-tags-h2o0BKWO.cjs → find-tags-Byk4d3oZ.cjs} +2 -2
- package/dist/{find-tags-h2o0BKWO.cjs.map → find-tags-Byk4d3oZ.cjs.map} +1 -1
- package/dist/{find-tags-ORtYLH5b.js → find-tags-d-wF1Se8.js} +2 -2
- package/dist/{find-tags-ORtYLH5b.js.map → find-tags-d-wF1Se8.js.map} +1 -1
- package/dist/{find-teams-hreVp1nw.js → find-teams-BZ118EIK.js} +2 -2
- package/dist/{find-teams-hreVp1nw.js.map → find-teams-BZ118EIK.js.map} +1 -1
- package/dist/{find-teams-DUcDfSOl.cjs → find-teams-CnU5x9rQ.cjs} +2 -2
- package/dist/{find-teams-DUcDfSOl.cjs.map → find-teams-CnU5x9rQ.cjs.map} +1 -1
- package/dist/{find-transactions-BehUqQYs.js → find-transactions-BiBgg-AE.js} +2 -2
- package/dist/{find-transactions-BehUqQYs.js.map → find-transactions-BiBgg-AE.js.map} +1 -1
- package/dist/{find-transactions-BkPscam3.cjs → find-transactions-DuZyqjhF.cjs} +2 -2
- package/dist/{find-transactions-BkPscam3.cjs.map → find-transactions-DuZyqjhF.cjs.map} +1 -1
- package/dist/{formatting-pUm38KOj.js → formatting-Bvyded57.js} +34 -2
- package/dist/formatting-Bvyded57.js.map +1 -0
- package/dist/{formatting-Di1X9Jn3.d.cts → formatting-CcTK2X8V.d.cts} +7 -5
- package/dist/formatting-CcTK2X8V.d.cts.map +1 -0
- package/dist/{formatting-BlMiQa9i.cjs → formatting-D0Aki7rK.cjs} +33 -2
- package/dist/formatting-D0Aki7rK.cjs.map +1 -0
- package/dist/{formatting-utils-C3sej5ER.js → formatting-utils-DgOyTl-m.js} +1 -1
- package/dist/{formatting-utils-C3sej5ER.js.map → formatting-utils-DgOyTl-m.js.map} +1 -1
- package/dist/{formatting-utils-DDz14xeB.cjs → formatting-utils-m9R5bsRU.cjs} +1 -1
- package/dist/{formatting-utils-DDz14xeB.cjs.map → formatting-utils-m9R5bsRU.cjs.map} +1 -1
- package/dist/{formatting-B-u5CbYn.d.ts → formatting-vtXxusbn.d.ts} +7 -5
- package/dist/formatting-vtXxusbn.d.ts.map +1 -0
- package/dist/{get-doc-AuAW_qr9.cjs → get-doc-DaTCenOE.cjs} +2 -2
- package/dist/{get-doc-AuAW_qr9.cjs.map → get-doc-DaTCenOE.cjs.map} +1 -1
- package/dist/{get-doc-BtxZOy7y.js → get-doc-YTiQznr1.js} +2 -2
- package/dist/{get-doc-BtxZOy7y.js.map → get-doc-YTiQznr1.js.map} +1 -1
- package/dist/{get-event-attachment-Bq5lkaKV.cjs → get-event-attachment-C-ig2-3F.cjs} +2 -2
- package/dist/{get-event-attachment-Bq5lkaKV.cjs.map → get-event-attachment-C-ig2-3F.cjs.map} +1 -1
- package/dist/{get-event-attachment-DwAl54zv.js → get-event-attachment-DVCPpUMj.js} +2 -2
- package/dist/{get-event-attachment-DwAl54zv.js.map → get-event-attachment-DVCPpUMj.js.map} +1 -1
- package/dist/{get-issue-details-DrpD5LlK.js → get-issue-details-Dcmzxknx.js} +24 -11
- package/dist/get-issue-details-Dcmzxknx.js.map +1 -0
- package/dist/{get-issue-details-qGwu18JX.cjs → get-issue-details-lBrYR9yx.cjs} +24 -11
- package/dist/get-issue-details-lBrYR9yx.cjs.map +1 -0
- package/dist/index.cjs +53 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +53 -42
- package/dist/index.js.map +1 -1
- package/dist/internal/fetch-utils.d.ts +1 -1
- package/dist/internal/formatting.cjs +2 -1
- package/dist/internal/formatting.d.cts +4 -4
- package/dist/internal/formatting.d.ts +5 -5
- package/dist/internal/formatting.js +2 -1
- package/dist/internal/issue-helpers.d.ts +1 -1
- package/dist/internal/test-fixtures.d.cts +20 -20
- package/dist/internal/test-fixtures.d.ts +62 -62
- package/dist/internal/test-fixtures.d.ts.map +1 -1
- package/dist/{issue-helpers-BOn4g7rx.d.ts → issue-helpers-BJffpNoO.d.ts} +1 -1
- package/dist/{issue-helpers-BOn4g7rx.d.ts.map → issue-helpers-BJffpNoO.d.ts.map} +1 -1
- package/dist/{logging-oIouXrcb.cjs → logging-CX2buXiG.cjs} +1 -1
- package/dist/{logging-oIouXrcb.cjs.map → logging-CX2buXiG.cjs.map} +1 -1
- package/dist/{logging-LnQMFw-_.js → logging-DzxYBMrn.js} +1 -1
- package/dist/{logging-LnQMFw-_.js.map → logging-DzxYBMrn.js.map} +1 -1
- package/dist/logging.cjs +1 -1
- package/dist/logging.js +1 -1
- package/dist/{promptDefinitions-6xelipaz.d.ts → promptDefinitions-D3GTBGLr.d.ts} +1 -1
- package/dist/promptDefinitions-D3GTBGLr.d.ts.map +1 -0
- package/dist/promptDefinitions.d.ts +1 -1
- package/dist/prompts.d.cts +1 -1
- package/dist/prompts.d.ts +2 -2
- package/dist/{schema-B5BpplNK.d.ts → schema-3NeMWRAm.d.cts} +273 -273
- package/dist/{schema-Dt-HKnd_.d.cts.map → schema-3NeMWRAm.d.cts.map} +1 -1
- package/dist/{schema-Dt-HKnd_.d.cts → schema-B3CzDGJk.d.ts} +303 -303
- package/dist/{schema-B5BpplNK.d.ts.map → schema-B3CzDGJk.d.ts.map} +1 -1
- package/dist/{search-docs-CrMdRDJy.js → search-docs-BLbB_GV2.js} +3 -3
- package/dist/search-docs-BLbB_GV2.js.map +1 -0
- package/dist/{search-docs-VhefTOOH.cjs → search-docs-D5Foht_0.cjs} +3 -3
- package/dist/search-docs-D5Foht_0.cjs.map +1 -0
- package/dist/{seer-utils-CzYEEZb2.cjs → seer-utils-CDm5J8ur.cjs} +2 -2
- package/dist/{seer-utils-CzYEEZb2.cjs.map → seer-utils-CDm5J8ur.cjs.map} +1 -1
- package/dist/{seer-utils-Ckr8nYlz.js → seer-utils-Cj9DXrow.js} +2 -2
- package/dist/{seer-utils-Ckr8nYlz.js.map → seer-utils-Cj9DXrow.js.map} +1 -1
- package/dist/{server-DeuBftc5.js → server-BSRxzYFd.js} +4 -4
- package/dist/{server-DeuBftc5.js.map → server-BSRxzYFd.js.map} +1 -1
- package/dist/{server-CHG27fcn.cjs → server-Dgkqz8bA.cjs} +4 -4
- package/dist/{server-CHG27fcn.cjs.map → server-Dgkqz8bA.cjs.map} +1 -1
- package/dist/server.cjs +29 -29
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.js +29 -29
- package/dist/{stdio-BtVdTwx-.cjs → stdio-BQAm0Liz.cjs} +3 -3
- package/dist/{stdio-BtVdTwx-.cjs.map → stdio-BQAm0Liz.cjs.map} +1 -1
- package/dist/{stdio-DIuLW5EE.js → stdio-BcihaDjO.js} +3 -3
- package/dist/{stdio-DIuLW5EE.js.map → stdio-BcihaDjO.js.map} +1 -1
- package/dist/test-setup.cjs +1 -16
- package/dist/test-setup.cjs.map +1 -1
- package/dist/test-setup.js +1 -16
- package/dist/test-setup.js.map +1 -1
- package/dist/toolDefinitions.js +2 -2
- package/dist/tools/analyze-issue-with-seer.cjs +6 -6
- package/dist/tools/analyze-issue-with-seer.d.cts +2 -2
- package/dist/tools/analyze-issue-with-seer.d.ts +3 -3
- package/dist/tools/analyze-issue-with-seer.js +6 -6
- package/dist/tools/create-dsn.cjs +3 -3
- package/dist/tools/create-dsn.d.cts +2 -2
- package/dist/tools/create-dsn.d.ts +3 -3
- package/dist/tools/create-dsn.js +3 -3
- package/dist/tools/create-project.cjs +4 -4
- package/dist/tools/create-project.d.cts +2 -2
- package/dist/tools/create-project.d.ts +3 -3
- package/dist/tools/create-project.js +4 -4
- package/dist/tools/create-team.cjs +3 -3
- package/dist/tools/create-team.d.cts +2 -2
- package/dist/tools/create-team.d.ts +3 -3
- package/dist/tools/create-team.js +3 -3
- package/dist/tools/find-dsns.cjs +3 -3
- package/dist/tools/find-dsns.d.cts +2 -2
- package/dist/tools/find-dsns.d.ts +3 -3
- package/dist/tools/find-dsns.js +3 -3
- package/dist/tools/find-errors.cjs +3 -3
- package/dist/tools/find-errors.d.cts +2 -2
- package/dist/tools/find-errors.d.ts +3 -3
- package/dist/tools/find-errors.js +3 -3
- package/dist/tools/find-issues.cjs +3 -3
- package/dist/tools/find-issues.d.cts +2 -2
- package/dist/tools/find-issues.d.ts +3 -3
- package/dist/tools/find-issues.js +3 -3
- package/dist/tools/find-organizations.cjs +3 -3
- package/dist/tools/find-organizations.d.cts +2 -2
- package/dist/tools/find-organizations.d.ts +3 -3
- package/dist/tools/find-organizations.js +3 -3
- package/dist/tools/find-projects.cjs +3 -3
- package/dist/tools/find-projects.d.cts +2 -2
- package/dist/tools/find-projects.d.ts +3 -3
- package/dist/tools/find-projects.js +3 -3
- package/dist/tools/find-releases.cjs +3 -3
- package/dist/tools/find-releases.d.cts +2 -2
- package/dist/tools/find-releases.d.ts +3 -3
- package/dist/tools/find-releases.js +3 -3
- package/dist/tools/find-tags.cjs +3 -3
- package/dist/tools/find-tags.d.cts +2 -2
- package/dist/tools/find-tags.d.ts +3 -3
- package/dist/tools/find-tags.js +3 -3
- package/dist/tools/find-teams.cjs +3 -3
- package/dist/tools/find-teams.d.cts +2 -2
- package/dist/tools/find-teams.d.ts +3 -3
- package/dist/tools/find-teams.js +3 -3
- package/dist/tools/find-transactions.cjs +3 -3
- package/dist/tools/find-transactions.d.cts +2 -2
- package/dist/tools/find-transactions.d.ts +3 -3
- package/dist/tools/find-transactions.js +3 -3
- package/dist/tools/get-doc.cjs +2 -2
- package/dist/tools/get-doc.d.cts +2 -2
- package/dist/tools/get-doc.d.ts +3 -3
- package/dist/tools/get-doc.js +2 -2
- package/dist/tools/get-event-attachment.cjs +3 -3
- package/dist/tools/get-event-attachment.d.cts +2 -2
- package/dist/tools/get-event-attachment.d.ts +3 -3
- package/dist/tools/get-event-attachment.js +3 -3
- package/dist/tools/get-issue-details.cjs +6 -5
- package/dist/tools/get-issue-details.d.cts +2 -2
- package/dist/tools/get-issue-details.d.ts +3 -3
- package/dist/tools/get-issue-details.js +6 -5
- package/dist/tools/index.cjs +28 -28
- package/dist/tools/index.d.cts +2 -2
- package/dist/tools/index.d.ts +79 -79
- package/dist/tools/index.js +28 -28
- package/dist/tools/search-docs.cjs +2 -2
- package/dist/tools/search-docs.d.cts +2 -2
- package/dist/tools/search-docs.d.ts +3 -3
- package/dist/tools/search-docs.js +2 -2
- package/dist/tools/types.d.cts +2 -2
- package/dist/tools/types.d.ts +3 -3
- package/dist/tools/update-issue.cjs +7 -6
- package/dist/tools/update-issue.d.cts +2 -2
- package/dist/tools/update-issue.d.ts +3 -3
- package/dist/tools/update-issue.js +7 -6
- package/dist/tools/update-project.cjs +4 -4
- package/dist/tools/update-project.d.cts +2 -2
- package/dist/tools/update-project.d.ts +3 -3
- package/dist/tools/update-project.js +4 -4
- package/dist/tools/utils/api-utils.cjs +2 -2
- package/dist/tools/utils/api-utils.d.cts +5 -5
- package/dist/tools/utils/api-utils.d.ts +7 -7
- package/dist/tools/utils/api-utils.js +2 -2
- package/dist/tools/utils/defineTool.d.cts +2 -2
- package/dist/tools/utils/defineTool.d.ts +3 -3
- package/dist/tools/utils/fetch-utils.d.ts +1 -1
- package/dist/tools/utils/formatting-utils.cjs +1 -1
- package/dist/tools/utils/formatting-utils.d.cts +3 -3
- package/dist/tools/utils/formatting-utils.d.ts +4 -4
- package/dist/tools/utils/formatting-utils.js +1 -1
- package/dist/tools/utils/issue-utils.cjs +3 -2
- package/dist/tools/utils/issue-utils.d.cts +4 -4
- package/dist/tools/utils/issue-utils.d.ts +6 -6
- package/dist/tools/utils/issue-utils.js +3 -2
- package/dist/tools/utils/seer-utils.cjs +1 -1
- package/dist/tools/utils/seer-utils.d.cts +3 -3
- package/dist/tools/utils/seer-utils.d.ts +4 -4
- package/dist/tools/utils/seer-utils.js +1 -1
- package/dist/tools/whoami.cjs +3 -3
- package/dist/tools/whoami.d.cts +2 -2
- package/dist/tools/whoami.d.ts +3 -3
- package/dist/tools/whoami.js +3 -3
- package/dist/{tools-BiZ7ZDKf.cjs → tools-CHnZvVEN.cjs} +21 -21
- package/dist/{tools-BiZ7ZDKf.cjs.map → tools-CHnZvVEN.cjs.map} +1 -1
- package/dist/{tools-DGF9GhbP.js → tools-CdXGgq1W.js} +21 -21
- package/dist/{tools-DGF9GhbP.js.map → tools-CdXGgq1W.js.map} +1 -1
- package/dist/transports/stdio.cjs +31 -31
- package/dist/transports/stdio.d.cts +1 -1
- package/dist/transports/stdio.d.ts +2 -2
- package/dist/transports/stdio.js +31 -31
- package/dist/{types-C3pRFQyA.d.cts → types-BoMP-Ro6.d.cts} +2 -2
- package/dist/{types-C3pRFQyA.d.cts.map → types-BoMP-Ro6.d.cts.map} +1 -1
- package/dist/{types-CYjev2Ep.d.cts → types-CUN-2OSS.d.cts} +3 -3
- package/dist/{types-CYjev2Ep.d.cts.map → types-CUN-2OSS.d.cts.map} +1 -1
- package/dist/{types-CZaMk5Yg.d.cts → types-D_mx318Q.d.cts} +2 -2
- package/dist/{types-CZaMk5Yg.d.cts.map → types-D_mx318Q.d.cts.map} +1 -1
- package/dist/{types-B2qOfefC.d.ts → types-DkJtNDXU.d.ts} +4 -4
- package/dist/{types-B2qOfefC.d.ts.map → types-DkJtNDXU.d.ts.map} +1 -1
- package/dist/{types-Br0saqtE.d.ts → types-DpV1JAZj.d.ts} +2 -2
- package/dist/{types-Br0saqtE.d.ts.map → types-DpV1JAZj.d.ts.map} +1 -1
- package/dist/{types-D5KkaSjc.d.ts → types-qB8a4WQT.d.ts} +2 -2
- package/dist/{types-D5KkaSjc.d.ts.map → types-qB8a4WQT.d.ts.map} +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/{update-issue-DN80uuKU.js → update-issue-DRTQvy6p.js} +3 -3
- package/dist/{update-issue-DN80uuKU.js.map → update-issue-DRTQvy6p.js.map} +1 -1
- package/dist/{update-issue-Bz-u_Yaa.cjs → update-issue-DpkxxiNk.cjs} +3 -3
- package/dist/{update-issue-Bz-u_Yaa.cjs.map → update-issue-DpkxxiNk.cjs.map} +1 -1
- package/dist/{update-project-C7Xbmhqg.cjs → update-project-DLDDbcGY.cjs} +3 -3
- package/dist/{update-project-C7Xbmhqg.cjs.map → update-project-DLDDbcGY.cjs.map} +1 -1
- package/dist/{update-project-5j-SOHWU.js → update-project-YLxt2ry2.js} +3 -3
- package/dist/{update-project-5j-SOHWU.js.map → update-project-YLxt2ry2.js.map} +1 -1
- package/dist/url-utils-C9hykWmk.cjs +106 -0
- package/dist/url-utils-C9hykWmk.cjs.map +1 -0
- package/dist/url-utils-DvZYfzPM.js +82 -0
- package/dist/url-utils-DvZYfzPM.js.map +1 -0
- package/dist/utils/url-utils.cjs +6 -0
- package/dist/utils/url-utils.d.cts +37 -0
- package/dist/utils/url-utils.d.cts.map +1 -0
- package/dist/utils/url-utils.d.ts +37 -0
- package/dist/utils/url-utils.d.ts.map +1 -0
- package/dist/utils/url-utils.js +3 -0
- package/dist/version-CcTnFB56.js +6 -0
- package/dist/{version-DvMKCu-i.js.map → version-CcTnFB56.js.map} +1 -1
- package/dist/{version-Dyz6_b54.cjs → version-rDjaSkPw.cjs} +2 -2
- package/dist/{version-Dyz6_b54.cjs.map → version-rDjaSkPw.cjs.map} +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/dist/{whoami-qIbcECMA.cjs → whoami-CEgbTUqt.cjs} +2 -2
- package/dist/{whoami-qIbcECMA.cjs.map → whoami-CEgbTUqt.cjs.map} +1 -1
- package/dist/{whoami-raA70UBD.js → whoami-DesNZnaQ.js} +2 -2
- package/dist/{whoami-raA70UBD.js.map → whoami-DesNZnaQ.js.map} +1 -1
- package/package.json +3 -3
- package/dist/analyze-issue-with-seer-Bq3kefOr.cjs.map +0 -1
- package/dist/analyze-issue-with-seer-Dk0ZFwN8.js.map +0 -1
- package/dist/api-utils-BJS0CChW.cjs.map +0 -1
- package/dist/api-utils-BcB1cMXS.js.map +0 -1
- package/dist/client-BNTsOycD.cjs.map +0 -1
- package/dist/client-BbamPqV4.js.map +0 -1
- package/dist/client-Dae1ZwWb.d.cts.map +0 -1
- package/dist/client-qyEu8fvj.d.ts.map +0 -1
- package/dist/fetch-utils-B-a92ObC.d.ts.map +0 -1
- package/dist/formatting-B-u5CbYn.d.ts.map +0 -1
- package/dist/formatting-BlMiQa9i.cjs.map +0 -1
- package/dist/formatting-Di1X9Jn3.d.cts.map +0 -1
- package/dist/formatting-pUm38KOj.js.map +0 -1
- package/dist/get-issue-details-DrpD5LlK.js.map +0 -1
- package/dist/get-issue-details-qGwu18JX.cjs.map +0 -1
- package/dist/promptDefinitions-6xelipaz.d.ts.map +0 -1
- package/dist/search-docs-CrMdRDJy.js.map +0 -1
- package/dist/search-docs-VhefTOOH.cjs.map +0 -1
- package/dist/version-DvMKCu-i.js +0 -6
- /package/dist/{index-BrojxuhJ.d.ts → index-DVGDAddE.d.ts} +0 -0
- /package/dist/{issue-utils-BVAB6I-Z.js → issue-utils-BbCfbiY8.js} +0 -0
- /package/dist/{issue-utils-pdbo-5LW.cjs → issue-utils-DMKiif6C.cjs} +0 -0
|
@@ -50,6 +50,7 @@ var ApiError = class extends Error {
|
|
|
50
50
|
* - Enhanced error handling with LLM-friendly messages
|
|
51
51
|
* - URL generation for Sentry resources (issues, traces)
|
|
52
52
|
* - Bearer token authentication
|
|
53
|
+
* - Always uses HTTPS for secure connections
|
|
53
54
|
*
|
|
54
55
|
* @example Basic Usage
|
|
55
56
|
* ```typescript
|
|
@@ -67,7 +68,7 @@ var ApiError = class extends Error {
|
|
|
67
68
|
*
|
|
68
69
|
* @example Multi-Region Support
|
|
69
70
|
* ```typescript
|
|
70
|
-
* // Self-hosted instance
|
|
71
|
+
* // Self-hosted instance with hostname
|
|
71
72
|
* const selfHosted = new SentryApiService({
|
|
72
73
|
* accessToken: "token",
|
|
73
74
|
* host: "sentry.company.com"
|
|
@@ -87,25 +88,28 @@ var SentryApiService = class {
|
|
|
87
88
|
/**
|
|
88
89
|
* Creates a new Sentry API service instance.
|
|
89
90
|
*
|
|
91
|
+
* Always uses HTTPS for secure connections.
|
|
92
|
+
*
|
|
90
93
|
* @param config Configuration object
|
|
91
94
|
* @param config.accessToken OAuth access token for authentication (optional for some endpoints)
|
|
92
|
-
* @param config.host Sentry
|
|
95
|
+
* @param config.host Sentry hostname (e.g. "sentry.io", "sentry.example.com")
|
|
93
96
|
*/
|
|
94
|
-
constructor({ accessToken = null, host =
|
|
97
|
+
constructor({ accessToken = null, host = "sentry.io" }) {
|
|
95
98
|
this.accessToken = accessToken;
|
|
96
|
-
this.host = host
|
|
97
|
-
this.apiPrefix =
|
|
99
|
+
this.host = host;
|
|
100
|
+
this.apiPrefix = `https://${host}/api/0`;
|
|
98
101
|
}
|
|
99
102
|
/**
|
|
100
103
|
* Updates the host for API requests.
|
|
101
104
|
*
|
|
102
105
|
* Used for multi-region support or switching between Sentry instances.
|
|
106
|
+
* Always uses HTTPS protocol.
|
|
103
107
|
*
|
|
104
|
-
* @param host New
|
|
108
|
+
* @param host New hostname to use for API requests
|
|
105
109
|
*/
|
|
106
110
|
setHost(host) {
|
|
107
111
|
this.host = host;
|
|
108
|
-
this.apiPrefix =
|
|
112
|
+
this.apiPrefix = `https://${this.host}/api/0`;
|
|
109
113
|
}
|
|
110
114
|
/**
|
|
111
115
|
* Internal method for making authenticated requests to Sentry API.
|
|
@@ -124,7 +128,7 @@ var SentryApiService = class {
|
|
|
124
128
|
* @throws {Error} Network or parsing errors
|
|
125
129
|
*/
|
|
126
130
|
async request(path, options = {}, { host } = {}) {
|
|
127
|
-
const url = host ?
|
|
131
|
+
const url = host ? `https://${host}/api/0${path}` : `${this.apiPrefix}${path}`;
|
|
128
132
|
const headers = {
|
|
129
133
|
"Content-Type": "application/json",
|
|
130
134
|
"User-Agent": "Sentry MCP Server"
|
|
@@ -168,10 +172,11 @@ var SentryApiService = class {
|
|
|
168
172
|
* Generates a Sentry issue URL for browser navigation.
|
|
169
173
|
*
|
|
170
174
|
* Handles both SaaS (subdomain-based) and self-hosted URL formats.
|
|
175
|
+
* Always uses HTTPS protocol.
|
|
171
176
|
*
|
|
172
177
|
* @param organizationSlug Organization identifier
|
|
173
178
|
* @param issueId Issue identifier (short ID or numeric ID)
|
|
174
|
-
* @returns Full
|
|
179
|
+
* @returns Full URL to the issue in Sentry UI
|
|
175
180
|
*
|
|
176
181
|
* @example
|
|
177
182
|
* ```typescript
|
|
@@ -183,11 +188,14 @@ var SentryApiService = class {
|
|
|
183
188
|
* ```
|
|
184
189
|
*/
|
|
185
190
|
getIssueUrl(organizationSlug, issueId) {
|
|
186
|
-
|
|
191
|
+
const isSaas = this.host === "sentry.io";
|
|
192
|
+
return isSaas ? `https://${organizationSlug}.${this.host}/issues/${issueId}` : `https://${this.host}/organizations/${organizationSlug}/issues/${issueId}`;
|
|
187
193
|
}
|
|
188
194
|
/**
|
|
189
195
|
* Generates a Sentry trace URL for performance investigation.
|
|
190
196
|
*
|
|
197
|
+
* Always uses HTTPS protocol.
|
|
198
|
+
*
|
|
191
199
|
* @param organizationSlug Organization identifier
|
|
192
200
|
* @param traceId Trace identifier (hex string)
|
|
193
201
|
* @returns Full HTTPS URL to the trace in Sentry UI
|
|
@@ -199,7 +207,8 @@ var SentryApiService = class {
|
|
|
199
207
|
* ```
|
|
200
208
|
*/
|
|
201
209
|
getTraceUrl(organizationSlug, traceId) {
|
|
202
|
-
|
|
210
|
+
const isSaas = this.host === "sentry.io";
|
|
211
|
+
return isSaas ? `https://${organizationSlug}.${this.host}/explore/traces/trace/${traceId}` : `https://${this.host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;
|
|
203
212
|
}
|
|
204
213
|
/**
|
|
205
214
|
* Retrieves the authenticated user's profile information.
|
|
@@ -606,4 +615,4 @@ var SentryApiService = class {
|
|
|
606
615
|
|
|
607
616
|
//#endregion
|
|
608
617
|
export { ApiError, SentryApiService };
|
|
609
|
-
//# sourceMappingURL=client-
|
|
618
|
+
//# sourceMappingURL=client-DOYWNvVM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-DOYWNvVM.js","names":["NETWORK_ERROR_MESSAGES: Record<string, string>","message: string","status: number","host: string","path: string","options: RequestInit","headers: Record<string, string>","response: Response","parsed: unknown | undefined","organizationSlug: string","issueId: string","traceId: string","opts?: RequestOptions","updateData: Record<string, any>","sentryQuery: string[]"],"sources":["../src/api-client/client.ts"],"sourcesContent":["import {\n OrganizationListSchema,\n ClientKeySchema,\n TeamListSchema,\n TeamSchema,\n ProjectListSchema,\n ProjectSchema,\n ReleaseListSchema,\n IssueListSchema,\n IssueSchema,\n EventSchema,\n EventAttachmentListSchema,\n ErrorsSearchResponseSchema,\n SpansSearchResponseSchema,\n TagListSchema,\n ApiErrorSchema,\n ClientKeyListSchema,\n AutofixRunSchema,\n AutofixRunStateSchema,\n UserSchema,\n UserRegionsSchema,\n} from \"./schema\";\nimport type {\n AutofixRun,\n AutofixRunState,\n ClientKey,\n ClientKeyList,\n Event,\n EventAttachment,\n EventAttachmentList,\n Issue,\n IssueList,\n OrganizationList,\n Project,\n ProjectList,\n ReleaseList,\n TagList,\n Team,\n TeamList,\n User,\n} from \"./types\";\n// TODO: this is shared - so ideally, for safety, it uses @sentry/core, but currently\n// logger isnt exposed (or rather, it is, but its not the right logger)\n// import { logger } from \"@sentry/node\";\n\n/**\n * Mapping of common network error codes to user-friendly messages.\n * These help users understand and resolve connection issues.\n */\nconst NETWORK_ERROR_MESSAGES: Record<string, string> = {\n EAI_AGAIN: \"DNS temporarily unavailable. Check your internet connection.\",\n ENOTFOUND: \"Hostname not found. Verify the URL is correct.\",\n ECONNREFUSED: \"Connection refused. Ensure the service is accessible.\",\n ETIMEDOUT: \"Connection timed out. Check network connectivity.\",\n ECONNRESET: \"Connection reset. Try again in a moment.\",\n};\n\n/**\n * Custom error class for Sentry API responses.\n *\n * Provides enhanced error messages for LLM consumption and handles\n * common API error scenarios with user-friendly messaging.\n *\n * @example\n * ```typescript\n * try {\n * await apiService.listIssues({ organizationSlug: \"invalid\" });\n * } catch (error) {\n * if (error instanceof ApiError) {\n * console.log(`API Error ${error.status}: ${error.message}`);\n * }\n * }\n * ```\n */\nexport class ApiError extends Error {\n constructor(\n message: string,\n public status: number,\n ) {\n // HACK: improving this error message for the LLMs\n let finalMessage = message;\n if (\n message.includes(\n \"You do not have the multi project stream feature enabled\",\n ) ||\n message.includes(\"You cannot view events from multiple projects\")\n ) {\n finalMessage =\n \"You do not have access to query across multiple projects. Please select a project for your query.\";\n }\n super(finalMessage);\n }\n}\n\ntype RequestOptions = {\n host?: string;\n};\n\n/**\n * Sentry API client service for interacting with Sentry's REST API.\n *\n * This service provides a comprehensive interface to Sentry's API endpoints,\n * handling authentication, error processing, multi-region support, and\n * response validation through Zod schemas.\n *\n * Key Features:\n * - Multi-region support for Sentry SaaS and self-hosted instances\n * - Automatic schema validation with Zod\n * - Enhanced error handling with LLM-friendly messages\n * - URL generation for Sentry resources (issues, traces)\n * - Bearer token authentication\n * - Always uses HTTPS for secure connections\n *\n * @example Basic Usage\n * ```typescript\n * const apiService = new SentryApiService({\n * accessToken: \"your-token\",\n * host: \"sentry.io\"\n * });\n *\n * const orgs = await apiService.listOrganizations();\n * const issues = await apiService.listIssues({\n * organizationSlug: \"my-org\",\n * query: \"is:unresolved\"\n * });\n * ```\n *\n * @example Multi-Region Support\n * ```typescript\n * // Self-hosted instance with hostname\n * const selfHosted = new SentryApiService({\n * accessToken: \"token\",\n * host: \"sentry.company.com\"\n * });\n *\n * // Regional endpoint override\n * const issues = await apiService.listIssues(\n * { organizationSlug: \"org\" },\n * { host: \"eu.sentry.io\" }\n * );\n * ```\n */\nexport class SentryApiService {\n private accessToken: string | null;\n protected host: string;\n protected apiPrefix: string;\n\n /**\n * Creates a new Sentry API service instance.\n *\n * Always uses HTTPS for secure connections.\n *\n * @param config Configuration object\n * @param config.accessToken OAuth access token for authentication (optional for some endpoints)\n * @param config.host Sentry hostname (e.g. \"sentry.io\", \"sentry.example.com\")\n */\n constructor({\n accessToken = null,\n host = \"sentry.io\",\n }: {\n accessToken?: string | null;\n host?: string;\n }) {\n this.accessToken = accessToken;\n this.host = host;\n this.apiPrefix = `https://${host}/api/0`;\n }\n\n /**\n * Updates the host for API requests.\n *\n * Used for multi-region support or switching between Sentry instances.\n * Always uses HTTPS protocol.\n *\n * @param host New hostname to use for API requests\n */\n setHost(host: string) {\n this.host = host;\n this.apiPrefix = `https://${this.host}/api/0`;\n }\n\n /**\n * Internal method for making authenticated requests to Sentry API.\n *\n * Handles:\n * - Bearer token authentication\n * - Error response parsing and enhancement\n * - Multi-region host overrides\n * - Fetch availability validation\n *\n * @param path API endpoint path (without /api/0 prefix)\n * @param options Fetch options\n * @param requestOptions Additional request configuration\n * @returns Promise resolving to Response object\n * @throws {ApiError} Enhanced API errors with user-friendly messages\n * @throws {Error} Network or parsing errors\n */\n private async request(\n path: string,\n options: RequestInit = {},\n { host }: { host?: string } = {},\n ): Promise<Response> {\n const url = host\n ? `https://${host}/api/0${path}`\n : `${this.apiPrefix}${path}`;\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n \"User-Agent\": \"Sentry MCP Server\",\n };\n if (this.accessToken) {\n headers.Authorization = `Bearer ${this.accessToken}`;\n }\n\n // Check if fetch is available, otherwise provide a helpful error message\n if (typeof globalThis.fetch === \"undefined\") {\n throw new Error(\n \"fetch is not available. Please use Node.js >= 18 or ensure fetch is available in your environment.\",\n );\n }\n\n // logger.info(logger.fmt`[sentryApi] ${options.method || \"GET\"} ${url}`);\n let response: Response;\n try {\n response = await fetch(url, {\n ...options,\n headers,\n });\n } catch (error) {\n // Extract the root cause from the error chain\n let rootCause = error;\n while (rootCause instanceof Error && rootCause.cause) {\n rootCause = rootCause.cause;\n }\n\n const errorMessage =\n rootCause instanceof Error ? rootCause.message : String(rootCause);\n\n let friendlyMessage = `Unable to connect to ${url}`;\n\n // Check if we have a specific message for this error\n const errorCode = Object.keys(NETWORK_ERROR_MESSAGES).find((code) =>\n errorMessage.includes(code),\n );\n\n if (errorCode) {\n friendlyMessage += ` - ${NETWORK_ERROR_MESSAGES[errorCode]}`;\n } else {\n friendlyMessage += ` - ${errorMessage}`;\n }\n\n throw new Error(friendlyMessage, { cause: error });\n }\n\n if (!response.ok) {\n const errorText = await response.text();\n let parsed: unknown | undefined;\n try {\n parsed = JSON.parse(errorText);\n } catch (error) {\n console.error(\n `[sentryApi] Failed to parse error response: ${errorText}`,\n error,\n );\n }\n\n if (parsed) {\n const { data, success, error } = ApiErrorSchema.safeParse(parsed);\n\n if (success) {\n throw new ApiError(data.detail, response.status);\n }\n\n console.error(\n `[sentryApi] Failed to parse error response: ${errorText}`,\n error,\n );\n }\n\n throw new Error(\n `API request failed: ${response.status} ${response.statusText}\\n${errorText}`,\n );\n }\n\n return response;\n }\n\n /**\n * Generates a Sentry issue URL for browser navigation.\n *\n * Handles both SaaS (subdomain-based) and self-hosted URL formats.\n * Always uses HTTPS protocol.\n *\n * @param organizationSlug Organization identifier\n * @param issueId Issue identifier (short ID or numeric ID)\n * @returns Full URL to the issue in Sentry UI\n *\n * @example\n * ```typescript\n * // SaaS: https://my-org.sentry.io/issues/PROJ-123\n * apiService.getIssueUrl(\"my-org\", \"PROJ-123\")\n *\n * // Self-hosted: https://sentry.company.com/organizations/my-org/issues/PROJ-123\n * apiService.getIssueUrl(\"my-org\", \"PROJ-123\")\n * ```\n */\n getIssueUrl(organizationSlug: string, issueId: string): string {\n const isSaas = this.host === \"sentry.io\";\n\n return isSaas\n ? `https://${organizationSlug}.${this.host}/issues/${issueId}`\n : `https://${this.host}/organizations/${organizationSlug}/issues/${issueId}`;\n }\n\n /**\n * Generates a Sentry trace URL for performance investigation.\n *\n * Always uses HTTPS protocol.\n *\n * @param organizationSlug Organization identifier\n * @param traceId Trace identifier (hex string)\n * @returns Full HTTPS URL to the trace in Sentry UI\n *\n * @example\n * ```typescript\n * const traceUrl = apiService.getTraceUrl(\"my-org\", \"6a477f5b0f31ef7b6b9b5e1dea66c91d\");\n * // https://my-org.sentry.io/explore/traces/trace/6a477f5b0f31ef7b6b9b5e1dea66c91d\n * ```\n */\n getTraceUrl(organizationSlug: string, traceId: string): string {\n const isSaas = this.host === \"sentry.io\";\n\n return isSaas\n ? `https://${organizationSlug}.${this.host}/explore/traces/trace/${traceId}`\n : `https://${this.host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;\n }\n\n /**\n * Retrieves the authenticated user's profile information.\n *\n * @param opts Request options including host override\n * @returns User profile data\n * @throws {ApiError} If authentication fails or user not found\n */\n async getAuthenticatedUser(opts?: RequestOptions): Promise<User> {\n const response = await this.request(\"/auth/\", undefined, opts);\n const body = await response.json();\n return UserSchema.parse(body);\n }\n\n /**\n * Lists all organizations accessible to the authenticated user.\n *\n * Automatically handles multi-region queries by fetching from all\n * available regions and combining results.\n *\n * @param opts Request options\n * @returns Array of organizations across all accessible regions\n *\n * @example\n * ```typescript\n * const orgs = await apiService.listOrganizations();\n * orgs.forEach(org => {\n * // regionUrl present for Cloud Service, empty for self-hosted\n * console.log(`${org.name} (${org.slug}) - ${org.links?.regionUrl || 'No region URL'}`);\n * });\n * ```\n */\n async listOrganizations(opts?: RequestOptions): Promise<OrganizationList> {\n // TODO: Sentry is currently not returning all orgs without hitting region endpoints\n const regionResponse = await this.request(\n \"/users/me/regions/\",\n undefined,\n opts,\n );\n const regionData = UserRegionsSchema.parse(await regionResponse.json());\n\n return (\n await Promise.all(\n regionData.regions.map(async (region) =>\n this.request(`/organizations/`, undefined, {\n ...opts,\n host: new URL(region.url).host,\n }).then((response) => response.json()),\n ),\n )\n )\n .map((data) => OrganizationListSchema.parse(data))\n .reduce((acc, curr) => acc.concat(curr), []);\n }\n\n /**\n * Lists teams within an organization.\n *\n * @param organizationSlug Organization identifier\n * @param opts Request options including host override\n * @returns Array of teams in the organization\n */\n async listTeams(\n organizationSlug: string,\n opts?: RequestOptions,\n ): Promise<TeamList> {\n const response = await this.request(\n `/organizations/${organizationSlug}/teams/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return TeamListSchema.parse(body);\n }\n\n /**\n * Creates a new team within an organization.\n *\n * @param params Team creation parameters\n * @param params.organizationSlug Organization identifier\n * @param params.name Team name\n * @param opts Request options\n * @returns Created team data\n * @throws {ApiError} If team creation fails (e.g., name conflicts)\n */\n async createTeam(\n {\n organizationSlug,\n name,\n }: {\n organizationSlug: string;\n name: string;\n },\n opts?: RequestOptions,\n ): Promise<Team> {\n const response = await this.request(\n `/organizations/${organizationSlug}/teams/`,\n {\n method: \"POST\",\n body: JSON.stringify({ name }),\n },\n opts,\n );\n\n return TeamSchema.parse(await response.json());\n }\n\n /**\n * Lists projects within an organization.\n *\n * @param organizationSlug Organization identifier\n * @param opts Request options\n * @returns Array of projects in the organization\n */\n async listProjects(\n organizationSlug: string,\n opts?: RequestOptions,\n ): Promise<ProjectList> {\n const response = await this.request(\n `/organizations/${organizationSlug}/projects/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return ProjectListSchema.parse(body);\n }\n\n /**\n * Creates a new project within a team.\n *\n * @param params Project creation parameters\n * @param params.organizationSlug Organization identifier\n * @param params.teamSlug Team identifier\n * @param params.name Project name\n * @param params.platform Platform identifier (e.g., \"javascript\", \"python\")\n * @param opts Request options\n * @returns Created project data\n */\n async createProject(\n {\n organizationSlug,\n teamSlug,\n name,\n platform,\n }: {\n organizationSlug: string;\n teamSlug: string;\n name: string;\n platform?: string;\n },\n opts?: RequestOptions,\n ): Promise<Project> {\n const response = await this.request(\n `/teams/${organizationSlug}/${teamSlug}/projects/`,\n {\n method: \"POST\",\n body: JSON.stringify({\n name,\n platform,\n }),\n },\n opts,\n );\n return ProjectSchema.parse(await response.json());\n }\n\n /**\n * Updates an existing project's configuration.\n *\n * @param params Project update parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Current project identifier\n * @param params.name New project name (optional)\n * @param params.slug New project slug (optional)\n * @param params.platform New platform identifier (optional)\n * @param opts Request options\n * @returns Updated project data\n */\n async updateProject(\n {\n organizationSlug,\n projectSlug,\n name,\n slug,\n platform,\n }: {\n organizationSlug: string;\n projectSlug: string;\n name?: string;\n slug?: string;\n platform?: string;\n },\n opts?: RequestOptions,\n ): Promise<Project> {\n const updateData: Record<string, any> = {};\n if (name !== undefined) updateData.name = name;\n if (slug !== undefined) updateData.slug = slug;\n if (platform !== undefined) updateData.platform = platform;\n\n const response = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/`,\n {\n method: \"PUT\",\n body: JSON.stringify(updateData),\n },\n opts,\n );\n return ProjectSchema.parse(await response.json());\n }\n\n /**\n * Assigns a team to a project.\n *\n * @param params Assignment parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier\n * @param params.teamSlug Team identifier to assign\n * @param opts Request options\n */\n async addTeamToProject(\n {\n organizationSlug,\n projectSlug,\n teamSlug,\n }: {\n organizationSlug: string;\n projectSlug: string;\n teamSlug: string;\n },\n opts?: RequestOptions,\n ): Promise<void> {\n await this.request(\n `/projects/${organizationSlug}/${projectSlug}/teams/${teamSlug}/`,\n {\n method: \"POST\",\n body: JSON.stringify({}),\n },\n opts,\n );\n }\n\n /**\n * Creates a new client key (DSN) for a project.\n *\n * Client keys are used to identify and authenticate SDK requests to Sentry.\n *\n * @param params Key creation parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier\n * @param params.name Human-readable name for the key (optional)\n * @param opts Request options\n * @returns Created client key with DSN information\n *\n * @example\n * ```typescript\n * const key = await apiService.createClientKey({\n * organizationSlug: \"my-org\",\n * projectSlug: \"my-project\",\n * name: \"Production\"\n * });\n * console.log(`DSN: ${key.dsn.public}`);\n * ```\n */\n async createClientKey(\n {\n organizationSlug,\n projectSlug,\n name,\n }: {\n organizationSlug: string;\n projectSlug: string;\n name?: string;\n },\n opts?: RequestOptions,\n ): Promise<ClientKey> {\n const response = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/keys/`,\n {\n method: \"POST\",\n body: JSON.stringify({\n name,\n }),\n },\n opts,\n );\n return ClientKeySchema.parse(await response.json());\n }\n\n /**\n * Lists all client keys (DSNs) for a project.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier\n * @param opts Request options\n * @returns Array of client keys with DSN information\n */\n async listClientKeys(\n {\n organizationSlug,\n projectSlug,\n }: {\n organizationSlug: string;\n projectSlug: string;\n },\n opts?: RequestOptions,\n ): Promise<ClientKeyList> {\n const response = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/keys/`,\n undefined,\n opts,\n );\n return ClientKeyListSchema.parse(await response.json());\n }\n\n /**\n * Lists releases for an organization or specific project.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier (optional, scopes to specific project)\n * @param params.query Search query for filtering releases\n * @param opts Request options\n * @returns Array of releases with deployment and commit information\n *\n * @example\n * ```typescript\n * // All releases for organization\n * const releases = await apiService.listReleases({\n * organizationSlug: \"my-org\"\n * });\n *\n * // Search for specific version\n * const filtered = await apiService.listReleases({\n * organizationSlug: \"my-org\",\n * query: \"v1.2.3\"\n * });\n * ```\n */\n async listReleases(\n {\n organizationSlug,\n projectSlug,\n query,\n }: {\n organizationSlug: string;\n projectSlug?: string;\n query?: string;\n },\n opts?: RequestOptions,\n ): Promise<ReleaseList> {\n const searchQuery = new URLSearchParams();\n if (query) {\n searchQuery.set(\"query\", query);\n }\n\n const path = projectSlug\n ? `/projects/${organizationSlug}/${projectSlug}/releases/`\n : `/organizations/${organizationSlug}/releases/`;\n\n const response = await this.request(\n `${path}${searchQuery.toString()}`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return ReleaseListSchema.parse(body);\n }\n\n /**\n * Lists available tags for search queries.\n *\n * Tags represent indexed fields that can be used in Sentry search queries.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.dataset Dataset to query tags for (\"errors\" or \"search_issues\")\n * @param opts Request options\n * @returns Array of available tags with metadata\n *\n * @example\n * ```typescript\n * const tags = await apiService.listTags({\n * organizationSlug: \"my-org\",\n * dataset: \"errors\"\n * });\n * tags.forEach(tag => console.log(`${tag.key}: ${tag.name}`));\n * ```\n */\n async listTags(\n {\n organizationSlug,\n dataset,\n }: {\n organizationSlug: string;\n dataset?: \"errors\" | \"search_issues\";\n },\n opts?: RequestOptions,\n ): Promise<TagList> {\n // TODO: this supports project in the query, but needs fixed\n // to accept slugs\n const searchQuery = new URLSearchParams();\n if (dataset) {\n searchQuery.set(\"dataset\", dataset);\n }\n\n const response = await this.request(\n `/organizations/${organizationSlug}/tags/${searchQuery.toString()}`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return TagListSchema.parse(body);\n }\n\n /**\n * Lists issues within an organization or project.\n *\n * Issues represent groups of similar errors or problems in your application.\n * Supports Sentry's powerful query syntax for filtering and sorting.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier (optional, scopes to specific project)\n * @param params.query Sentry search query (e.g., \"is:unresolved browser:chrome\")\n * @param params.sortBy Sort order (\"user\", \"freq\", \"date\", \"new\")\n * @param opts Request options\n * @returns Array of issues with metadata and statistics\n *\n * @example\n * ```typescript\n * // Recent unresolved issues\n * const issues = await apiService.listIssues({\n * organizationSlug: \"my-org\",\n * query: \"is:unresolved\",\n * sortBy: \"date\"\n * });\n *\n * // High-frequency errors in specific project\n * const critical = await apiService.listIssues({\n * organizationSlug: \"my-org\",\n * projectSlug: \"backend\",\n * query: \"level:error\",\n * sortBy: \"freq\"\n * });\n * ```\n */\n async listIssues(\n {\n organizationSlug,\n projectSlug,\n query,\n sortBy,\n }: {\n organizationSlug: string;\n projectSlug?: string;\n query?: string;\n sortBy?: \"user\" | \"freq\" | \"date\" | \"new\";\n },\n opts?: RequestOptions,\n ): Promise<IssueList> {\n const sentryQuery: string[] = [];\n if (query) {\n sentryQuery.push(query);\n }\n\n const queryParams = new URLSearchParams();\n queryParams.set(\"per_page\", \"10\");\n queryParams.set(\"referrer\", \"sentry-mcp\");\n if (sortBy) queryParams.set(\"sort\", sortBy);\n queryParams.set(\"statsPeriod\", \"24h\");\n queryParams.set(\"query\", sentryQuery.join(\" \"));\n\n queryParams.append(\"collapse\", \"unhandled\");\n\n const apiUrl = projectSlug\n ? `/projects/${organizationSlug}/${projectSlug}/issues/?${queryParams.toString()}`\n : `/organizations/${organizationSlug}/issues/?${queryParams.toString()}`;\n\n const response = await this.request(apiUrl, undefined, opts);\n\n const body = await response.json();\n return IssueListSchema.parse(body);\n }\n\n async getIssue(\n {\n organizationSlug,\n issueId,\n }: {\n organizationSlug: string;\n issueId: string;\n },\n opts?: RequestOptions,\n ): Promise<Issue> {\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return IssueSchema.parse(body);\n }\n\n async getEventForIssue(\n {\n organizationSlug,\n issueId,\n eventId,\n }: {\n organizationSlug: string;\n issueId: string;\n eventId: string;\n },\n opts?: RequestOptions,\n ): Promise<Event> {\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/events/${eventId}/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return EventSchema.parse(body);\n }\n\n async getLatestEventForIssue(\n {\n organizationSlug,\n issueId,\n }: {\n organizationSlug: string;\n issueId: string;\n },\n opts?: RequestOptions,\n ): Promise<Event> {\n return this.getEventForIssue(\n {\n organizationSlug,\n issueId,\n eventId: \"latest\",\n },\n opts,\n );\n }\n\n async listEventAttachments(\n {\n organizationSlug,\n projectSlug,\n eventId,\n }: {\n organizationSlug: string;\n projectSlug: string;\n eventId: string;\n },\n opts?: RequestOptions,\n ): Promise<EventAttachmentList> {\n const response = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/events/${eventId}/attachments/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return EventAttachmentListSchema.parse(body);\n }\n\n async getEventAttachment(\n {\n organizationSlug,\n projectSlug,\n eventId,\n attachmentId,\n }: {\n organizationSlug: string;\n projectSlug: string;\n eventId: string;\n attachmentId: string;\n },\n opts?: RequestOptions,\n ): Promise<{\n attachment: EventAttachment;\n downloadUrl: string;\n filename: string;\n blob: Blob;\n }> {\n // Get the attachment metadata first\n const attachmentsResponse = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/events/${eventId}/attachments/`,\n undefined,\n opts,\n );\n\n const attachments = EventAttachmentListSchema.parse(\n await attachmentsResponse.json(),\n );\n const attachment = attachments.find((att) => att.id === attachmentId);\n\n if (!attachment) {\n throw new Error(\n `Attachment with ID ${attachmentId} not found for event ${eventId}`,\n );\n }\n\n // Download the actual file content\n const downloadUrl = `/projects/${organizationSlug}/${projectSlug}/events/${eventId}/attachments/${attachmentId}/?download=1`;\n const downloadResponse = await this.request(\n downloadUrl,\n {\n method: \"GET\",\n headers: {\n Accept: \"application/octet-stream\",\n },\n },\n opts,\n );\n\n return {\n attachment,\n downloadUrl: downloadResponse.url,\n filename: attachment.name,\n blob: await downloadResponse.blob(),\n };\n }\n\n async updateIssue(\n {\n organizationSlug,\n issueId,\n status,\n assignedTo,\n }: {\n organizationSlug: string;\n issueId: string;\n status?: string;\n assignedTo?: string;\n },\n opts?: RequestOptions,\n ): Promise<Issue> {\n const updateData: Record<string, any> = {};\n if (status !== undefined) updateData.status = status;\n if (assignedTo !== undefined) updateData.assignedTo = assignedTo;\n\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/`,\n {\n method: \"PUT\",\n body: JSON.stringify(updateData),\n },\n opts,\n );\n\n const body = await response.json();\n return IssueSchema.parse(body);\n }\n\n // TODO: Sentry is not yet exposing a reasonable API to fetch trace data\n // async getTrace({\n // organizationSlug,\n // traceId,\n // }: {\n // organizationSlug: string;\n // traceId: string;\n // }): Promise<z.infer<typeof SentryIssueSchema>> {\n // const response = await this.request(\n // `/organizations/${organizationSlug}/issues/${traceId}/`,\n // );\n\n // const body = await response.json();\n // return SentryIssueSchema.parse(body);\n // }\n\n async searchErrors(\n {\n organizationSlug,\n projectSlug,\n filename,\n transaction,\n query,\n sortBy = \"last_seen\",\n }: {\n organizationSlug: string;\n projectSlug?: string;\n filename?: string;\n transaction?: string;\n query?: string;\n sortBy?: \"last_seen\" | \"count\";\n },\n opts?: RequestOptions,\n ) {\n const sentryQuery: string[] = [];\n if (filename) {\n sentryQuery.push(`stack.filename:\"*${filename.replace(/\"/g, '\\\\\"')}\"`);\n }\n if (transaction) {\n sentryQuery.push(`transaction:\"${transaction.replace(/\"/g, '\\\\\"')}\"`);\n }\n if (query) {\n sentryQuery.push(query);\n }\n if (projectSlug) {\n sentryQuery.push(`project:${projectSlug}`);\n }\n\n const queryParams = new URLSearchParams();\n queryParams.set(\"dataset\", \"errors\");\n queryParams.set(\"per_page\", \"10\");\n queryParams.set(\"referrer\", \"sentry-mcp\");\n queryParams.set(\n \"sort\",\n `-${sortBy === \"last_seen\" ? \"last_seen\" : \"count\"}`,\n );\n queryParams.set(\"statsPeriod\", \"24h\");\n queryParams.append(\"field\", \"issue\");\n queryParams.append(\"field\", \"title\");\n queryParams.append(\"field\", \"project\");\n queryParams.append(\"field\", \"last_seen()\");\n queryParams.append(\"field\", \"count()\");\n queryParams.set(\"query\", sentryQuery.join(\" \"));\n // if (projectSlug) queryParams.set(\"project\", projectSlug);\n\n const apiUrl = `/organizations/${organizationSlug}/events/?${queryParams.toString()}`;\n\n const response = await this.request(apiUrl, undefined, opts);\n\n const body = await response.json();\n // TODO(dcramer): If you're using an older version of Sentry this API had a breaking change\n // meaning this endpoint will error.\n return ErrorsSearchResponseSchema.parse(body).data;\n }\n\n async searchSpans(\n {\n organizationSlug,\n projectSlug,\n transaction,\n query,\n sortBy = \"timestamp\",\n }: {\n organizationSlug: string;\n projectSlug?: string;\n transaction?: string;\n query?: string;\n sortBy?: \"timestamp\" | \"duration\";\n },\n opts?: RequestOptions,\n ) {\n const sentryQuery: string[] = [\"is_transaction:true\"];\n if (transaction) {\n sentryQuery.push(`transaction:\"${transaction.replace(/\"/g, '\\\\\"')}\"`);\n }\n if (query) {\n sentryQuery.push(query);\n }\n if (projectSlug) {\n sentryQuery.push(`project:${projectSlug}`);\n }\n\n const queryParams = new URLSearchParams();\n queryParams.set(\"dataset\", \"spans\");\n queryParams.set(\"per_page\", \"10\");\n queryParams.set(\"referrer\", \"sentry-mcp\");\n queryParams.set(\n \"sort\",\n `-${sortBy === \"timestamp\" ? \"timestamp\" : \"span.duration\"}`,\n );\n queryParams.set(\"allowAggregateConditions\", \"0\");\n queryParams.set(\"useRpc\", \"1\");\n queryParams.append(\"field\", \"id\");\n queryParams.append(\"field\", \"trace\");\n queryParams.append(\"field\", \"span.op\");\n queryParams.append(\"field\", \"span.description\");\n queryParams.append(\"field\", \"span.duration\");\n queryParams.append(\"field\", \"transaction\");\n queryParams.append(\"field\", \"project\");\n queryParams.append(\"field\", \"timestamp\");\n queryParams.set(\"query\", sentryQuery.join(\" \"));\n // if (projectSlug) queryParams.set(\"project\", projectSlug);\n\n const apiUrl = `/organizations/${organizationSlug}/events/?${queryParams.toString()}`;\n\n const response = await this.request(apiUrl, undefined, opts);\n\n const body = await response.json();\n return SpansSearchResponseSchema.parse(body).data;\n }\n\n // POST https://us.sentry.io/api/0/issues/5485083130/autofix/\n async startAutofix(\n {\n organizationSlug,\n issueId,\n eventId,\n instruction = \"\",\n }: {\n organizationSlug: string;\n issueId: string;\n eventId?: string;\n instruction?: string;\n },\n opts?: RequestOptions,\n ): Promise<AutofixRun> {\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/autofix/`,\n {\n method: \"POST\",\n body: JSON.stringify({\n event_id: eventId,\n instruction,\n }),\n },\n opts,\n );\n const body = await response.json();\n return AutofixRunSchema.parse(body);\n }\n\n // GET https://us.sentry.io/api/0/issues/5485083130/autofix/\n async getAutofixState(\n {\n organizationSlug,\n issueId,\n }: {\n organizationSlug: string;\n issueId: string;\n },\n opts?: RequestOptions,\n ): Promise<AutofixRunState> {\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/autofix/`,\n undefined,\n opts,\n );\n const body = await response.json();\n return AutofixRunStateSchema.parse(body);\n }\n}\n"],"mappings":";;;;;;;AAiDA,MAAMA,yBAAiD;CACrD,WAAW;CACX,WAAW;CACX,cAAc;CACd,WAAW;CACX,YAAY;AACb;;;;;;;;;;;;;;;;;;AAmBD,IAAa,WAAb,cAA8B,MAAM;CAClC,YACEC,SACOC,QACP;EAEA,IAAI,eAAe;AACnB,MACE,QAAQ,SACN,2DACD,IACD,QAAQ,SAAS,gDAAgD,CAEjE,gBACE;AAEJ,QAAM,aAAa;EAbZ;CAcR;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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friendly messages
|
|
51
51
|
* - URL generation for Sentry resources (issues, traces)
|
|
52
52
|
* - Bearer token authentication
|
|
53
|
+
* - Always uses HTTPS for secure connections
|
|
53
54
|
*
|
|
54
55
|
* @example Basic Usage
|
|
55
56
|
* ```typescript
|
|
@@ -67,7 +68,7 @@ var ApiError = class extends Error {
|
|
|
67
68
|
*
|
|
68
69
|
* @example Multi-Region Support
|
|
69
70
|
* ```typescript
|
|
70
|
-
* // Self-hosted instance
|
|
71
|
+
* // Self-hosted instance with hostname
|
|
71
72
|
* const selfHosted = new SentryApiService({
|
|
72
73
|
* accessToken: "token",
|
|
73
74
|
* host: "sentry.company.com"
|
|
@@ -87,25 +88,28 @@ var SentryApiService = class {
|
|
|
87
88
|
/**
|
|
88
89
|
* Creates a new Sentry API service instance.
|
|
89
90
|
*
|
|
91
|
+
* Always uses HTTPS for secure connections.
|
|
92
|
+
*
|
|
90
93
|
* @param config Configuration object
|
|
91
94
|
* @param config.accessToken OAuth access token for authentication (optional for some endpoints)
|
|
92
|
-
* @param config.host Sentry
|
|
95
|
+
* @param config.host Sentry hostname (e.g. "sentry.io", "sentry.example.com")
|
|
93
96
|
*/
|
|
94
|
-
constructor({ accessToken = null, host =
|
|
97
|
+
constructor({ accessToken = null, host = "sentry.io" }) {
|
|
95
98
|
this.accessToken = accessToken;
|
|
96
|
-
this.host = host
|
|
97
|
-
this.apiPrefix =
|
|
99
|
+
this.host = host;
|
|
100
|
+
this.apiPrefix = `https://${host}/api/0`;
|
|
98
101
|
}
|
|
99
102
|
/**
|
|
100
103
|
* Updates the host for API requests.
|
|
101
104
|
*
|
|
102
105
|
* Used for multi-region support or switching between Sentry instances.
|
|
106
|
+
* Always uses HTTPS protocol.
|
|
103
107
|
*
|
|
104
|
-
* @param host New
|
|
108
|
+
* @param host New hostname to use for API requests
|
|
105
109
|
*/
|
|
106
110
|
setHost(host) {
|
|
107
111
|
this.host = host;
|
|
108
|
-
this.apiPrefix =
|
|
112
|
+
this.apiPrefix = `https://${this.host}/api/0`;
|
|
109
113
|
}
|
|
110
114
|
/**
|
|
111
115
|
* Internal method for making authenticated requests to Sentry API.
|
|
@@ -124,7 +128,7 @@ var SentryApiService = class {
|
|
|
124
128
|
* @throws {Error} Network or parsing errors
|
|
125
129
|
*/
|
|
126
130
|
async request(path, options = {}, { host } = {}) {
|
|
127
|
-
const url = host ?
|
|
131
|
+
const url = host ? `https://${host}/api/0${path}` : `${this.apiPrefix}${path}`;
|
|
128
132
|
const headers = {
|
|
129
133
|
"Content-Type": "application/json",
|
|
130
134
|
"User-Agent": "Sentry MCP Server"
|
|
@@ -168,10 +172,11 @@ var SentryApiService = class {
|
|
|
168
172
|
* Generates a Sentry issue URL for browser navigation.
|
|
169
173
|
*
|
|
170
174
|
* Handles both SaaS (subdomain-based) and self-hosted URL formats.
|
|
175
|
+
* Always uses HTTPS protocol.
|
|
171
176
|
*
|
|
172
177
|
* @param organizationSlug Organization identifier
|
|
173
178
|
* @param issueId Issue identifier (short ID or numeric ID)
|
|
174
|
-
* @returns Full
|
|
179
|
+
* @returns Full URL to the issue in Sentry UI
|
|
175
180
|
*
|
|
176
181
|
* @example
|
|
177
182
|
* ```typescript
|
|
@@ -183,11 +188,14 @@ var SentryApiService = class {
|
|
|
183
188
|
* ```
|
|
184
189
|
*/
|
|
185
190
|
getIssueUrl(organizationSlug, issueId) {
|
|
186
|
-
|
|
191
|
+
const isSaas = this.host === "sentry.io";
|
|
192
|
+
return isSaas ? `https://${organizationSlug}.${this.host}/issues/${issueId}` : `https://${this.host}/organizations/${organizationSlug}/issues/${issueId}`;
|
|
187
193
|
}
|
|
188
194
|
/**
|
|
189
195
|
* Generates a Sentry trace URL for performance investigation.
|
|
190
196
|
*
|
|
197
|
+
* Always uses HTTPS protocol.
|
|
198
|
+
*
|
|
191
199
|
* @param organizationSlug Organization identifier
|
|
192
200
|
* @param traceId Trace identifier (hex string)
|
|
193
201
|
* @returns Full HTTPS URL to the trace in Sentry UI
|
|
@@ -199,7 +207,8 @@ var SentryApiService = class {
|
|
|
199
207
|
* ```
|
|
200
208
|
*/
|
|
201
209
|
getTraceUrl(organizationSlug, traceId) {
|
|
202
|
-
|
|
210
|
+
const isSaas = this.host === "sentry.io";
|
|
211
|
+
return isSaas ? `https://${organizationSlug}.${this.host}/explore/traces/trace/${traceId}` : `https://${this.host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;
|
|
203
212
|
}
|
|
204
213
|
/**
|
|
205
214
|
* Retrieves the authenticated user's profile information.
|
|
@@ -617,4 +626,4 @@ Object.defineProperty(exports, 'SentryApiService', {
|
|
|
617
626
|
return SentryApiService;
|
|
618
627
|
}
|
|
619
628
|
});
|
|
620
|
-
//# sourceMappingURL=client-
|
|
629
|
+
//# sourceMappingURL=client-Dkw5iYu3.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-Dkw5iYu3.cjs","names":["NETWORK_ERROR_MESSAGES: Record<string, string>","message: string","status: number","host: string","path: string","options: RequestInit","headers: Record<string, string>","response: Response","parsed: unknown | undefined","organizationSlug: string","issueId: string","traceId: string","opts?: RequestOptions","updateData: Record<string, any>","sentryQuery: string[]"],"sources":["../src/api-client/client.ts"],"sourcesContent":["import {\n OrganizationListSchema,\n ClientKeySchema,\n TeamListSchema,\n TeamSchema,\n ProjectListSchema,\n ProjectSchema,\n ReleaseListSchema,\n IssueListSchema,\n IssueSchema,\n EventSchema,\n EventAttachmentListSchema,\n ErrorsSearchResponseSchema,\n SpansSearchResponseSchema,\n TagListSchema,\n ApiErrorSchema,\n ClientKeyListSchema,\n AutofixRunSchema,\n AutofixRunStateSchema,\n UserSchema,\n UserRegionsSchema,\n} from \"./schema\";\nimport type {\n AutofixRun,\n AutofixRunState,\n ClientKey,\n ClientKeyList,\n Event,\n EventAttachment,\n EventAttachmentList,\n Issue,\n IssueList,\n OrganizationList,\n Project,\n ProjectList,\n ReleaseList,\n TagList,\n Team,\n TeamList,\n User,\n} from \"./types\";\n// TODO: this is shared - so ideally, for safety, it uses @sentry/core, but currently\n// logger isnt exposed (or rather, it is, but its not the right logger)\n// import { logger } from \"@sentry/node\";\n\n/**\n * Mapping of common network error codes to user-friendly messages.\n * These help users understand and resolve connection issues.\n */\nconst NETWORK_ERROR_MESSAGES: Record<string, string> = {\n EAI_AGAIN: \"DNS temporarily unavailable. Check your internet connection.\",\n ENOTFOUND: \"Hostname not found. Verify the URL is correct.\",\n ECONNREFUSED: \"Connection refused. Ensure the service is accessible.\",\n ETIMEDOUT: \"Connection timed out. Check network connectivity.\",\n ECONNRESET: \"Connection reset. Try again in a moment.\",\n};\n\n/**\n * Custom error class for Sentry API responses.\n *\n * Provides enhanced error messages for LLM consumption and handles\n * common API error scenarios with user-friendly messaging.\n *\n * @example\n * ```typescript\n * try {\n * await apiService.listIssues({ organizationSlug: \"invalid\" });\n * } catch (error) {\n * if (error instanceof ApiError) {\n * console.log(`API Error ${error.status}: ${error.message}`);\n * }\n * }\n * ```\n */\nexport class ApiError extends Error {\n constructor(\n message: string,\n public status: number,\n ) {\n // HACK: improving this error message for the LLMs\n let finalMessage = message;\n if (\n message.includes(\n \"You do not have the multi project stream feature enabled\",\n ) ||\n message.includes(\"You cannot view events from multiple projects\")\n ) {\n finalMessage =\n \"You do not have access to query across multiple projects. Please select a project for your query.\";\n }\n super(finalMessage);\n }\n}\n\ntype RequestOptions = {\n host?: string;\n};\n\n/**\n * Sentry API client service for interacting with Sentry's REST API.\n *\n * This service provides a comprehensive interface to Sentry's API endpoints,\n * handling authentication, error processing, multi-region support, and\n * response validation through Zod schemas.\n *\n * Key Features:\n * - Multi-region support for Sentry SaaS and self-hosted instances\n * - Automatic schema validation with Zod\n * - Enhanced error handling with LLM-friendly messages\n * - URL generation for Sentry resources (issues, traces)\n * - Bearer token authentication\n * - Always uses HTTPS for secure connections\n *\n * @example Basic Usage\n * ```typescript\n * const apiService = new SentryApiService({\n * accessToken: \"your-token\",\n * host: \"sentry.io\"\n * });\n *\n * const orgs = await apiService.listOrganizations();\n * const issues = await apiService.listIssues({\n * organizationSlug: \"my-org\",\n * query: \"is:unresolved\"\n * });\n * ```\n *\n * @example Multi-Region Support\n * ```typescript\n * // Self-hosted instance with hostname\n * const selfHosted = new SentryApiService({\n * accessToken: \"token\",\n * host: \"sentry.company.com\"\n * });\n *\n * // Regional endpoint override\n * const issues = await apiService.listIssues(\n * { organizationSlug: \"org\" },\n * { host: \"eu.sentry.io\" }\n * );\n * ```\n */\nexport class SentryApiService {\n private accessToken: string | null;\n protected host: string;\n protected apiPrefix: string;\n\n /**\n * Creates a new Sentry API service instance.\n *\n * Always uses HTTPS for secure connections.\n *\n * @param config Configuration object\n * @param config.accessToken OAuth access token for authentication (optional for some endpoints)\n * @param config.host Sentry hostname (e.g. \"sentry.io\", \"sentry.example.com\")\n */\n constructor({\n accessToken = null,\n host = \"sentry.io\",\n }: {\n accessToken?: string | null;\n host?: string;\n }) {\n this.accessToken = accessToken;\n this.host = host;\n this.apiPrefix = `https://${host}/api/0`;\n }\n\n /**\n * Updates the host for API requests.\n *\n * Used for multi-region support or switching between Sentry instances.\n * Always uses HTTPS protocol.\n *\n * @param host New hostname to use for API requests\n */\n setHost(host: string) {\n this.host = host;\n this.apiPrefix = `https://${this.host}/api/0`;\n }\n\n /**\n * Internal method for making authenticated requests to Sentry API.\n *\n * Handles:\n * - Bearer token authentication\n * - Error response parsing and enhancement\n * - Multi-region host overrides\n * - Fetch availability validation\n *\n * @param path API endpoint path (without /api/0 prefix)\n * @param options Fetch options\n * @param requestOptions Additional request configuration\n * @returns Promise resolving to Response object\n * @throws {ApiError} Enhanced API errors with user-friendly messages\n * @throws {Error} Network or parsing errors\n */\n private async request(\n path: string,\n options: RequestInit = {},\n { host }: { host?: string } = {},\n ): Promise<Response> {\n const url = host\n ? `https://${host}/api/0${path}`\n : `${this.apiPrefix}${path}`;\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n \"User-Agent\": \"Sentry MCP Server\",\n };\n if (this.accessToken) {\n headers.Authorization = `Bearer ${this.accessToken}`;\n }\n\n // Check if fetch is available, otherwise provide a helpful error message\n if (typeof globalThis.fetch === \"undefined\") {\n throw new Error(\n \"fetch is not available. Please use Node.js >= 18 or ensure fetch is available in your environment.\",\n );\n }\n\n // logger.info(logger.fmt`[sentryApi] ${options.method || \"GET\"} ${url}`);\n let response: Response;\n try {\n response = await fetch(url, {\n ...options,\n headers,\n });\n } catch (error) {\n // Extract the root cause from the error chain\n let rootCause = error;\n while (rootCause instanceof Error && rootCause.cause) {\n rootCause = rootCause.cause;\n }\n\n const errorMessage =\n rootCause instanceof Error ? rootCause.message : String(rootCause);\n\n let friendlyMessage = `Unable to connect to ${url}`;\n\n // Check if we have a specific message for this error\n const errorCode = Object.keys(NETWORK_ERROR_MESSAGES).find((code) =>\n errorMessage.includes(code),\n );\n\n if (errorCode) {\n friendlyMessage += ` - ${NETWORK_ERROR_MESSAGES[errorCode]}`;\n } else {\n friendlyMessage += ` - ${errorMessage}`;\n }\n\n throw new Error(friendlyMessage, { cause: error });\n }\n\n if (!response.ok) {\n const errorText = await response.text();\n let parsed: unknown | undefined;\n try {\n parsed = JSON.parse(errorText);\n } catch (error) {\n console.error(\n `[sentryApi] Failed to parse error response: ${errorText}`,\n error,\n );\n }\n\n if (parsed) {\n const { data, success, error } = ApiErrorSchema.safeParse(parsed);\n\n if (success) {\n throw new ApiError(data.detail, response.status);\n }\n\n console.error(\n `[sentryApi] Failed to parse error response: ${errorText}`,\n error,\n );\n }\n\n throw new Error(\n `API request failed: ${response.status} ${response.statusText}\\n${errorText}`,\n );\n }\n\n return response;\n }\n\n /**\n * Generates a Sentry issue URL for browser navigation.\n *\n * Handles both SaaS (subdomain-based) and self-hosted URL formats.\n * Always uses HTTPS protocol.\n *\n * @param organizationSlug Organization identifier\n * @param issueId Issue identifier (short ID or numeric ID)\n * @returns Full URL to the issue in Sentry UI\n *\n * @example\n * ```typescript\n * // SaaS: https://my-org.sentry.io/issues/PROJ-123\n * apiService.getIssueUrl(\"my-org\", \"PROJ-123\")\n *\n * // Self-hosted: https://sentry.company.com/organizations/my-org/issues/PROJ-123\n * apiService.getIssueUrl(\"my-org\", \"PROJ-123\")\n * ```\n */\n getIssueUrl(organizationSlug: string, issueId: string): string {\n const isSaas = this.host === \"sentry.io\";\n\n return isSaas\n ? `https://${organizationSlug}.${this.host}/issues/${issueId}`\n : `https://${this.host}/organizations/${organizationSlug}/issues/${issueId}`;\n }\n\n /**\n * Generates a Sentry trace URL for performance investigation.\n *\n * Always uses HTTPS protocol.\n *\n * @param organizationSlug Organization identifier\n * @param traceId Trace identifier (hex string)\n * @returns Full HTTPS URL to the trace in Sentry UI\n *\n * @example\n * ```typescript\n * const traceUrl = apiService.getTraceUrl(\"my-org\", \"6a477f5b0f31ef7b6b9b5e1dea66c91d\");\n * // https://my-org.sentry.io/explore/traces/trace/6a477f5b0f31ef7b6b9b5e1dea66c91d\n * ```\n */\n getTraceUrl(organizationSlug: string, traceId: string): string {\n const isSaas = this.host === \"sentry.io\";\n\n return isSaas\n ? `https://${organizationSlug}.${this.host}/explore/traces/trace/${traceId}`\n : `https://${this.host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;\n }\n\n /**\n * Retrieves the authenticated user's profile information.\n *\n * @param opts Request options including host override\n * @returns User profile data\n * @throws {ApiError} If authentication fails or user not found\n */\n async getAuthenticatedUser(opts?: RequestOptions): Promise<User> {\n const response = await this.request(\"/auth/\", undefined, opts);\n const body = await response.json();\n return UserSchema.parse(body);\n }\n\n /**\n * Lists all organizations accessible to the authenticated user.\n *\n * Automatically handles multi-region queries by fetching from all\n * available regions and combining results.\n *\n * @param opts Request options\n * @returns Array of organizations across all accessible regions\n *\n * @example\n * ```typescript\n * const orgs = await apiService.listOrganizations();\n * orgs.forEach(org => {\n * // regionUrl present for Cloud Service, empty for self-hosted\n * console.log(`${org.name} (${org.slug}) - ${org.links?.regionUrl || 'No region URL'}`);\n * });\n * ```\n */\n async listOrganizations(opts?: RequestOptions): Promise<OrganizationList> {\n // TODO: Sentry is currently not returning all orgs without hitting region endpoints\n const regionResponse = await this.request(\n \"/users/me/regions/\",\n undefined,\n opts,\n );\n const regionData = UserRegionsSchema.parse(await regionResponse.json());\n\n return (\n await Promise.all(\n regionData.regions.map(async (region) =>\n this.request(`/organizations/`, undefined, {\n ...opts,\n host: new URL(region.url).host,\n }).then((response) => response.json()),\n ),\n )\n )\n .map((data) => OrganizationListSchema.parse(data))\n .reduce((acc, curr) => acc.concat(curr), []);\n }\n\n /**\n * Lists teams within an organization.\n *\n * @param organizationSlug Organization identifier\n * @param opts Request options including host override\n * @returns Array of teams in the organization\n */\n async listTeams(\n organizationSlug: string,\n opts?: RequestOptions,\n ): Promise<TeamList> {\n const response = await this.request(\n `/organizations/${organizationSlug}/teams/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return TeamListSchema.parse(body);\n }\n\n /**\n * Creates a new team within an organization.\n *\n * @param params Team creation parameters\n * @param params.organizationSlug Organization identifier\n * @param params.name Team name\n * @param opts Request options\n * @returns Created team data\n * @throws {ApiError} If team creation fails (e.g., name conflicts)\n */\n async createTeam(\n {\n organizationSlug,\n name,\n }: {\n organizationSlug: string;\n name: string;\n },\n opts?: RequestOptions,\n ): Promise<Team> {\n const response = await this.request(\n `/organizations/${organizationSlug}/teams/`,\n {\n method: \"POST\",\n body: JSON.stringify({ name }),\n },\n opts,\n );\n\n return TeamSchema.parse(await response.json());\n }\n\n /**\n * Lists projects within an organization.\n *\n * @param organizationSlug Organization identifier\n * @param opts Request options\n * @returns Array of projects in the organization\n */\n async listProjects(\n organizationSlug: string,\n opts?: RequestOptions,\n ): Promise<ProjectList> {\n const response = await this.request(\n `/organizations/${organizationSlug}/projects/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return ProjectListSchema.parse(body);\n }\n\n /**\n * Creates a new project within a team.\n *\n * @param params Project creation parameters\n * @param params.organizationSlug Organization identifier\n * @param params.teamSlug Team identifier\n * @param params.name Project name\n * @param params.platform Platform identifier (e.g., \"javascript\", \"python\")\n * @param opts Request options\n * @returns Created project data\n */\n async createProject(\n {\n organizationSlug,\n teamSlug,\n name,\n platform,\n }: {\n organizationSlug: string;\n teamSlug: string;\n name: string;\n platform?: string;\n },\n opts?: RequestOptions,\n ): Promise<Project> {\n const response = await this.request(\n `/teams/${organizationSlug}/${teamSlug}/projects/`,\n {\n method: \"POST\",\n body: JSON.stringify({\n name,\n platform,\n }),\n },\n opts,\n );\n return ProjectSchema.parse(await response.json());\n }\n\n /**\n * Updates an existing project's configuration.\n *\n * @param params Project update parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Current project identifier\n * @param params.name New project name (optional)\n * @param params.slug New project slug (optional)\n * @param params.platform New platform identifier (optional)\n * @param opts Request options\n * @returns Updated project data\n */\n async updateProject(\n {\n organizationSlug,\n projectSlug,\n name,\n slug,\n platform,\n }: {\n organizationSlug: string;\n projectSlug: string;\n name?: string;\n slug?: string;\n platform?: string;\n },\n opts?: RequestOptions,\n ): Promise<Project> {\n const updateData: Record<string, any> = {};\n if (name !== undefined) updateData.name = name;\n if (slug !== undefined) updateData.slug = slug;\n if (platform !== undefined) updateData.platform = platform;\n\n const response = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/`,\n {\n method: \"PUT\",\n body: JSON.stringify(updateData),\n },\n opts,\n );\n return ProjectSchema.parse(await response.json());\n }\n\n /**\n * Assigns a team to a project.\n *\n * @param params Assignment parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier\n * @param params.teamSlug Team identifier to assign\n * @param opts Request options\n */\n async addTeamToProject(\n {\n organizationSlug,\n projectSlug,\n teamSlug,\n }: {\n organizationSlug: string;\n projectSlug: string;\n teamSlug: string;\n },\n opts?: RequestOptions,\n ): Promise<void> {\n await this.request(\n `/projects/${organizationSlug}/${projectSlug}/teams/${teamSlug}/`,\n {\n method: \"POST\",\n body: JSON.stringify({}),\n },\n opts,\n );\n }\n\n /**\n * Creates a new client key (DSN) for a project.\n *\n * Client keys are used to identify and authenticate SDK requests to Sentry.\n *\n * @param params Key creation parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier\n * @param params.name Human-readable name for the key (optional)\n * @param opts Request options\n * @returns Created client key with DSN information\n *\n * @example\n * ```typescript\n * const key = await apiService.createClientKey({\n * organizationSlug: \"my-org\",\n * projectSlug: \"my-project\",\n * name: \"Production\"\n * });\n * console.log(`DSN: ${key.dsn.public}`);\n * ```\n */\n async createClientKey(\n {\n organizationSlug,\n projectSlug,\n name,\n }: {\n organizationSlug: string;\n projectSlug: string;\n name?: string;\n },\n opts?: RequestOptions,\n ): Promise<ClientKey> {\n const response = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/keys/`,\n {\n method: \"POST\",\n body: JSON.stringify({\n name,\n }),\n },\n opts,\n );\n return ClientKeySchema.parse(await response.json());\n }\n\n /**\n * Lists all client keys (DSNs) for a project.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier\n * @param opts Request options\n * @returns Array of client keys with DSN information\n */\n async listClientKeys(\n {\n organizationSlug,\n projectSlug,\n }: {\n organizationSlug: string;\n projectSlug: string;\n },\n opts?: RequestOptions,\n ): Promise<ClientKeyList> {\n const response = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/keys/`,\n undefined,\n opts,\n );\n return ClientKeyListSchema.parse(await response.json());\n }\n\n /**\n * Lists releases for an organization or specific project.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier (optional, scopes to specific project)\n * @param params.query Search query for filtering releases\n * @param opts Request options\n * @returns Array of releases with deployment and commit information\n *\n * @example\n * ```typescript\n * // All releases for organization\n * const releases = await apiService.listReleases({\n * organizationSlug: \"my-org\"\n * });\n *\n * // Search for specific version\n * const filtered = await apiService.listReleases({\n * organizationSlug: \"my-org\",\n * query: \"v1.2.3\"\n * });\n * ```\n */\n async listReleases(\n {\n organizationSlug,\n projectSlug,\n query,\n }: {\n organizationSlug: string;\n projectSlug?: string;\n query?: string;\n },\n opts?: RequestOptions,\n ): Promise<ReleaseList> {\n const searchQuery = new URLSearchParams();\n if (query) {\n searchQuery.set(\"query\", query);\n }\n\n const path = projectSlug\n ? `/projects/${organizationSlug}/${projectSlug}/releases/`\n : `/organizations/${organizationSlug}/releases/`;\n\n const response = await this.request(\n `${path}${searchQuery.toString()}`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return ReleaseListSchema.parse(body);\n }\n\n /**\n * Lists available tags for search queries.\n *\n * Tags represent indexed fields that can be used in Sentry search queries.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.dataset Dataset to query tags for (\"errors\" or \"search_issues\")\n * @param opts Request options\n * @returns Array of available tags with metadata\n *\n * @example\n * ```typescript\n * const tags = await apiService.listTags({\n * organizationSlug: \"my-org\",\n * dataset: \"errors\"\n * });\n * tags.forEach(tag => console.log(`${tag.key}: ${tag.name}`));\n * ```\n */\n async listTags(\n {\n organizationSlug,\n dataset,\n }: {\n organizationSlug: string;\n dataset?: \"errors\" | \"search_issues\";\n },\n opts?: RequestOptions,\n ): Promise<TagList> {\n // TODO: this supports project in the query, but needs fixed\n // to accept slugs\n const searchQuery = new URLSearchParams();\n if (dataset) {\n searchQuery.set(\"dataset\", dataset);\n }\n\n const response = await this.request(\n `/organizations/${organizationSlug}/tags/${searchQuery.toString()}`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return TagListSchema.parse(body);\n }\n\n /**\n * Lists issues within an organization or project.\n *\n * Issues represent groups of similar errors or problems in your application.\n * Supports Sentry's powerful query syntax for filtering and sorting.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier (optional, scopes to specific project)\n * @param params.query Sentry search query (e.g., \"is:unresolved browser:chrome\")\n * @param params.sortBy Sort order (\"user\", \"freq\", \"date\", \"new\")\n * @param opts Request options\n * @returns Array of issues with metadata and statistics\n *\n * @example\n * ```typescript\n * // Recent unresolved issues\n * const issues = await apiService.listIssues({\n * organizationSlug: \"my-org\",\n * query: \"is:unresolved\",\n * sortBy: \"date\"\n * });\n *\n * // High-frequency errors in specific project\n * const critical = await apiService.listIssues({\n * organizationSlug: \"my-org\",\n * projectSlug: \"backend\",\n * query: \"level:error\",\n * sortBy: \"freq\"\n * });\n * ```\n */\n async listIssues(\n {\n organizationSlug,\n projectSlug,\n query,\n sortBy,\n }: {\n organizationSlug: string;\n projectSlug?: string;\n query?: string;\n sortBy?: \"user\" | \"freq\" | \"date\" | \"new\";\n },\n opts?: RequestOptions,\n ): Promise<IssueList> {\n const sentryQuery: string[] = [];\n if (query) {\n sentryQuery.push(query);\n }\n\n const queryParams = new URLSearchParams();\n queryParams.set(\"per_page\", \"10\");\n queryParams.set(\"referrer\", \"sentry-mcp\");\n if (sortBy) queryParams.set(\"sort\", sortBy);\n queryParams.set(\"statsPeriod\", \"24h\");\n queryParams.set(\"query\", sentryQuery.join(\" \"));\n\n queryParams.append(\"collapse\", \"unhandled\");\n\n const apiUrl = projectSlug\n ? `/projects/${organizationSlug}/${projectSlug}/issues/?${queryParams.toString()}`\n : `/organizations/${organizationSlug}/issues/?${queryParams.toString()}`;\n\n const response = await this.request(apiUrl, undefined, opts);\n\n const body = await response.json();\n return IssueListSchema.parse(body);\n }\n\n async getIssue(\n {\n organizationSlug,\n issueId,\n }: {\n organizationSlug: string;\n issueId: string;\n },\n opts?: RequestOptions,\n ): Promise<Issue> {\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return IssueSchema.parse(body);\n }\n\n async getEventForIssue(\n {\n organizationSlug,\n issueId,\n eventId,\n }: {\n organizationSlug: string;\n issueId: string;\n eventId: string;\n },\n opts?: RequestOptions,\n ): Promise<Event> {\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/events/${eventId}/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return EventSchema.parse(body);\n }\n\n async getLatestEventForIssue(\n {\n organizationSlug,\n issueId,\n }: {\n organizationSlug: string;\n issueId: string;\n },\n opts?: RequestOptions,\n ): Promise<Event> {\n return this.getEventForIssue(\n {\n organizationSlug,\n issueId,\n eventId: \"latest\",\n },\n opts,\n );\n }\n\n async listEventAttachments(\n {\n organizationSlug,\n projectSlug,\n eventId,\n }: {\n organizationSlug: string;\n projectSlug: string;\n eventId: string;\n },\n opts?: RequestOptions,\n ): Promise<EventAttachmentList> {\n const response = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/events/${eventId}/attachments/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return EventAttachmentListSchema.parse(body);\n }\n\n async getEventAttachment(\n {\n organizationSlug,\n projectSlug,\n eventId,\n attachmentId,\n }: {\n organizationSlug: string;\n projectSlug: string;\n eventId: string;\n attachmentId: string;\n },\n opts?: RequestOptions,\n ): Promise<{\n attachment: EventAttachment;\n downloadUrl: string;\n filename: string;\n blob: Blob;\n }> {\n // Get the attachment metadata first\n const attachmentsResponse = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/events/${eventId}/attachments/`,\n undefined,\n opts,\n );\n\n const attachments = EventAttachmentListSchema.parse(\n await attachmentsResponse.json(),\n );\n const attachment = attachments.find((att) => att.id === attachmentId);\n\n if (!attachment) {\n throw new Error(\n `Attachment with ID ${attachmentId} not found for event ${eventId}`,\n );\n }\n\n // Download the actual file content\n const downloadUrl = `/projects/${organizationSlug}/${projectSlug}/events/${eventId}/attachments/${attachmentId}/?download=1`;\n const downloadResponse = await this.request(\n downloadUrl,\n {\n method: \"GET\",\n headers: {\n Accept: \"application/octet-stream\",\n },\n },\n opts,\n );\n\n return {\n attachment,\n downloadUrl: downloadResponse.url,\n filename: attachment.name,\n blob: await downloadResponse.blob(),\n };\n }\n\n async updateIssue(\n {\n organizationSlug,\n issueId,\n status,\n assignedTo,\n }: {\n organizationSlug: string;\n issueId: string;\n status?: string;\n assignedTo?: string;\n },\n opts?: RequestOptions,\n ): Promise<Issue> {\n const updateData: Record<string, any> = {};\n if (status !== undefined) updateData.status = status;\n if (assignedTo !== undefined) updateData.assignedTo = assignedTo;\n\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/`,\n {\n method: \"PUT\",\n body: JSON.stringify(updateData),\n },\n opts,\n );\n\n const body = await response.json();\n return IssueSchema.parse(body);\n }\n\n // TODO: Sentry is not yet exposing a reasonable API to fetch trace data\n // async getTrace({\n // organizationSlug,\n // traceId,\n // }: {\n // organizationSlug: string;\n // traceId: string;\n // }): Promise<z.infer<typeof SentryIssueSchema>> {\n // const response = await this.request(\n // `/organizations/${organizationSlug}/issues/${traceId}/`,\n // );\n\n // const body = await response.json();\n // return SentryIssueSchema.parse(body);\n // }\n\n async searchErrors(\n {\n organizationSlug,\n projectSlug,\n filename,\n transaction,\n query,\n sortBy = \"last_seen\",\n }: {\n organizationSlug: string;\n projectSlug?: string;\n filename?: string;\n transaction?: string;\n query?: string;\n sortBy?: \"last_seen\" | \"count\";\n },\n opts?: RequestOptions,\n ) {\n const sentryQuery: string[] = [];\n if (filename) {\n sentryQuery.push(`stack.filename:\"*${filename.replace(/\"/g, '\\\\\"')}\"`);\n }\n if (transaction) {\n sentryQuery.push(`transaction:\"${transaction.replace(/\"/g, '\\\\\"')}\"`);\n }\n if (query) {\n sentryQuery.push(query);\n }\n if (projectSlug) {\n sentryQuery.push(`project:${projectSlug}`);\n }\n\n const queryParams = new URLSearchParams();\n queryParams.set(\"dataset\", \"errors\");\n queryParams.set(\"per_page\", \"10\");\n queryParams.set(\"referrer\", \"sentry-mcp\");\n queryParams.set(\n \"sort\",\n `-${sortBy === \"last_seen\" ? \"last_seen\" : \"count\"}`,\n );\n queryParams.set(\"statsPeriod\", \"24h\");\n queryParams.append(\"field\", \"issue\");\n queryParams.append(\"field\", \"title\");\n queryParams.append(\"field\", \"project\");\n queryParams.append(\"field\", \"last_seen()\");\n queryParams.append(\"field\", \"count()\");\n queryParams.set(\"query\", sentryQuery.join(\" \"));\n // if (projectSlug) queryParams.set(\"project\", projectSlug);\n\n const apiUrl = `/organizations/${organizationSlug}/events/?${queryParams.toString()}`;\n\n const response = await this.request(apiUrl, undefined, opts);\n\n const body = await response.json();\n // TODO(dcramer): If you're using an older version of Sentry this API had a breaking change\n // meaning this endpoint will error.\n return ErrorsSearchResponseSchema.parse(body).data;\n }\n\n async searchSpans(\n {\n organizationSlug,\n projectSlug,\n transaction,\n query,\n sortBy = \"timestamp\",\n }: {\n organizationSlug: string;\n projectSlug?: string;\n transaction?: string;\n query?: string;\n sortBy?: \"timestamp\" | \"duration\";\n },\n opts?: RequestOptions,\n ) {\n const sentryQuery: string[] = [\"is_transaction:true\"];\n if (transaction) {\n sentryQuery.push(`transaction:\"${transaction.replace(/\"/g, '\\\\\"')}\"`);\n }\n if (query) {\n sentryQuery.push(query);\n }\n if (projectSlug) {\n sentryQuery.push(`project:${projectSlug}`);\n }\n\n const queryParams = new URLSearchParams();\n queryParams.set(\"dataset\", \"spans\");\n queryParams.set(\"per_page\", \"10\");\n queryParams.set(\"referrer\", \"sentry-mcp\");\n queryParams.set(\n \"sort\",\n `-${sortBy === \"timestamp\" ? \"timestamp\" : \"span.duration\"}`,\n );\n queryParams.set(\"allowAggregateConditions\", \"0\");\n queryParams.set(\"useRpc\", \"1\");\n queryParams.append(\"field\", \"id\");\n queryParams.append(\"field\", \"trace\");\n queryParams.append(\"field\", \"span.op\");\n queryParams.append(\"field\", \"span.description\");\n queryParams.append(\"field\", \"span.duration\");\n queryParams.append(\"field\", \"transaction\");\n queryParams.append(\"field\", \"project\");\n queryParams.append(\"field\", \"timestamp\");\n queryParams.set(\"query\", sentryQuery.join(\" \"));\n // if (projectSlug) queryParams.set(\"project\", projectSlug);\n\n const apiUrl = `/organizations/${organizationSlug}/events/?${queryParams.toString()}`;\n\n const response = await this.request(apiUrl, undefined, opts);\n\n const body = await response.json();\n return SpansSearchResponseSchema.parse(body).data;\n }\n\n // POST https://us.sentry.io/api/0/issues/5485083130/autofix/\n async startAutofix(\n {\n organizationSlug,\n issueId,\n eventId,\n instruction = \"\",\n }: {\n organizationSlug: string;\n issueId: string;\n eventId?: string;\n instruction?: string;\n },\n opts?: RequestOptions,\n ): Promise<AutofixRun> {\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/autofix/`,\n {\n method: \"POST\",\n body: JSON.stringify({\n event_id: eventId,\n instruction,\n }),\n },\n opts,\n );\n const body = await response.json();\n return AutofixRunSchema.parse(body);\n }\n\n // GET https://us.sentry.io/api/0/issues/5485083130/autofix/\n async getAutofixState(\n {\n organizationSlug,\n issueId,\n }: {\n organizationSlug: string;\n issueId: string;\n },\n opts?: RequestOptions,\n ): Promise<AutofixRunState> {\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/autofix/`,\n undefined,\n opts,\n );\n const body = await response.json();\n return AutofixRunStateSchema.parse(body);\n }\n}\n"],"mappings":";;;;;;;AAiDA,MAAMA,yBAAiD;CACrD,WAAW;CACX,WAAW;CACX,cAAc;CACd,WAAW;CACX,YAAY;AACb;;;;;;;;;;;;;;;;;;AAmBD,IAAa,WAAb,cAA8B,MAAM;CAClC,YACEC,SACOC,QACP;EAEA,IAAI,eAAe;AACnB,MACE,QAAQ,SACN,2DACD,IACD,QAAQ,SAAS,gDAAgD,CAEjE,gBACE;AAEJ,QAAM,aAAa;EAbZ;CAcR;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDD,IAAa,mBAAb,MAA8B;CAC5B,AAAQ;CACR,AAAU;CACV,AAAU;;;;;;;;;;CAWV,YAAY,EACV,cAAc,MACd,OAAO,aAIR,EAAE;AACD,OAAK,cAAc;AACnB,OAAK,OAAO;AACZ,OAAK,aAAa,UAAU,KAAK;CAClC;;;;;;;;;CAUD,QAAQC,MAAc;AACpB,OAAK,OAAO;AACZ,OAAK,aAAa,UAAU,KAAK,KAAK;CACvC;;;;;;;;;;;;;;;;;CAkBD,MAAc,QACZC,MACAC,UAAuB,CAAE,GACz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,cAAY,OAAO,SAAS,cAAc;AAC1C,cAAY,OAAO,SAAS,UAAU;AACtC,cAAY,OAAO,SAAS,YAAY;AACxC,cAAY,IAAI,SAAS,YAAY,KAAK,IAAI,CAAC;EAG/C,MAAM,UAAU,iBAAiB,iBAAiB,WAAW,YAAY,UAAU;EAEnF,MAAM,WAAW,MAAM,KAAK,QAAQ,gBAAmB,KAAK;EAE5D,MAAM,OAAO,MAAM,SAAS,MAAM;AAClC,SAAO,yCAA0B,MAAM,KAAK,CAAC;CAC9C;CAGD,MAAM,aACJ,EACE,kBACA,SACA,SACA,cAAc,IAMf,EACDF,MACqB;EACrB,MAAM,WAAW,MAAM,KAAK,SACzB,iBAAiB,iBAAiB,UAAU,QAAQ,YACrD;GACE,QAAQ;GACR,MAAM,KAAK,UAAU;IACnB,UAAU;IACV;GACD,EAAC;EACH,GACD,KACD;EACD,MAAM,OAAO,MAAM,SAAS,MAAM;AAClC,SAAO,gCAAiB,MAAM,KAAK;CACpC;CAGD,MAAM,gBACJ,EACE,kBACA,SAID,EACDA,MAC0B;EAC1B,MAAM,WAAW,MAAM,KAAK,SACzB,iBAAiB,iBAAiB,UAAU,QAAQ,oBAErD,KACD;EACD,MAAM,OAAO,MAAM,SAAS,MAAM;AAClC,SAAO,qCAAsB,MAAM,KAAK;CACzC;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, Issue, IssueList, OrganizationList, Project, ProjectList, ReleaseList, TagList, Team, TeamList, User } from "./types-
|
|
1
|
+
import { AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, OrganizationList, Project, ProjectList, ReleaseList, TagList, Team, TeamList, User } from "./types-DpV1JAZj.js";
|
|
2
2
|
|
|
3
3
|
//#region src/api-client/client.d.ts
|
|
4
4
|
|
|
@@ -39,6 +39,7 @@ type RequestOptions = {
|
|
|
39
39
|
* - Enhanced error handling with LLM-friendly messages
|
|
40
40
|
* - URL generation for Sentry resources (issues, traces)
|
|
41
41
|
* - Bearer token authentication
|
|
42
|
+
* - Always uses HTTPS for secure connections
|
|
42
43
|
*
|
|
43
44
|
* @example Basic Usage
|
|
44
45
|
* ```typescript
|
|
@@ -56,7 +57,7 @@ type RequestOptions = {
|
|
|
56
57
|
*
|
|
57
58
|
* @example Multi-Region Support
|
|
58
59
|
* ```typescript
|
|
59
|
-
* // Self-hosted instance
|
|
60
|
+
* // Self-hosted instance with hostname
|
|
60
61
|
* const selfHosted = new SentryApiService({
|
|
61
62
|
* accessToken: "token",
|
|
62
63
|
* host: "sentry.company.com"
|
|
@@ -76,9 +77,11 @@ declare class SentryApiService {
|
|
|
76
77
|
/**
|
|
77
78
|
* Creates a new Sentry API service instance.
|
|
78
79
|
*
|
|
80
|
+
* Always uses HTTPS for secure connections.
|
|
81
|
+
*
|
|
79
82
|
* @param config Configuration object
|
|
80
83
|
* @param config.accessToken OAuth access token for authentication (optional for some endpoints)
|
|
81
|
-
* @param config.host Sentry
|
|
84
|
+
* @param config.host Sentry hostname (e.g. "sentry.io", "sentry.example.com")
|
|
82
85
|
*/
|
|
83
86
|
constructor({
|
|
84
87
|
accessToken,
|
|
@@ -91,8 +94,9 @@ declare class SentryApiService {
|
|
|
91
94
|
* Updates the host for API requests.
|
|
92
95
|
*
|
|
93
96
|
* Used for multi-region support or switching between Sentry instances.
|
|
97
|
+
* Always uses HTTPS protocol.
|
|
94
98
|
*
|
|
95
|
-
* @param host New
|
|
99
|
+
* @param host New hostname to use for API requests
|
|
96
100
|
*/
|
|
97
101
|
setHost(host: string): void;
|
|
98
102
|
/**
|
|
@@ -116,10 +120,11 @@ declare class SentryApiService {
|
|
|
116
120
|
* Generates a Sentry issue URL for browser navigation.
|
|
117
121
|
*
|
|
118
122
|
* Handles both SaaS (subdomain-based) and self-hosted URL formats.
|
|
123
|
+
* Always uses HTTPS protocol.
|
|
119
124
|
*
|
|
120
125
|
* @param organizationSlug Organization identifier
|
|
121
126
|
* @param issueId Issue identifier (short ID or numeric ID)
|
|
122
|
-
* @returns Full
|
|
127
|
+
* @returns Full URL to the issue in Sentry UI
|
|
123
128
|
*
|
|
124
129
|
* @example
|
|
125
130
|
* ```typescript
|
|
@@ -134,6 +139,8 @@ declare class SentryApiService {
|
|
|
134
139
|
/**
|
|
135
140
|
* Generates a Sentry trace URL for performance investigation.
|
|
136
141
|
*
|
|
142
|
+
* Always uses HTTPS protocol.
|
|
143
|
+
*
|
|
137
144
|
* @param organizationSlug Organization identifier
|
|
138
145
|
* @param traceId Trace identifier (hex string)
|
|
139
146
|
* @returns Full HTTPS URL to the trace in Sentry UI
|
|
@@ -451,16 +458,7 @@ declare class SentryApiService {
|
|
|
451
458
|
organizationSlug: string;
|
|
452
459
|
projectSlug: string;
|
|
453
460
|
eventId: string;
|
|
454
|
-
}, opts?: RequestOptions): Promise<
|
|
455
|
-
name: string;
|
|
456
|
-
type: string;
|
|
457
|
-
id: string;
|
|
458
|
-
size: number;
|
|
459
|
-
mimetype: string;
|
|
460
|
-
dateCreated: string;
|
|
461
|
-
sha1: string;
|
|
462
|
-
headers?: Record<string, string> | undefined;
|
|
463
|
-
}[]>;
|
|
461
|
+
}, opts?: RequestOptions): Promise<EventAttachmentList>;
|
|
464
462
|
getEventAttachment({
|
|
465
463
|
organizationSlug,
|
|
466
464
|
projectSlug,
|
|
@@ -472,7 +470,7 @@ declare class SentryApiService {
|
|
|
472
470
|
eventId: string;
|
|
473
471
|
attachmentId: string;
|
|
474
472
|
}, opts?: RequestOptions): Promise<{
|
|
475
|
-
attachment:
|
|
473
|
+
attachment: EventAttachment;
|
|
476
474
|
downloadUrl: string;
|
|
477
475
|
filename: string;
|
|
478
476
|
blob: Blob;
|
|
@@ -503,10 +501,10 @@ declare class SentryApiService {
|
|
|
503
501
|
query?: string;
|
|
504
502
|
sortBy?: "last_seen" | "count";
|
|
505
503
|
}, opts?: RequestOptions): Promise<{
|
|
504
|
+
title: string;
|
|
506
505
|
issue: string;
|
|
507
506
|
"issue.id": string | number;
|
|
508
507
|
project: string;
|
|
509
|
-
title: string;
|
|
510
508
|
"count()": number;
|
|
511
509
|
"last_seen()": string;
|
|
512
510
|
}[]>;
|
|
@@ -523,11 +521,11 @@ declare class SentryApiService {
|
|
|
523
521
|
query?: string;
|
|
524
522
|
sortBy?: "timestamp" | "duration";
|
|
525
523
|
}, opts?: RequestOptions): Promise<{
|
|
526
|
-
transaction: string;
|
|
527
|
-
timestamp: string;
|
|
528
524
|
id: string;
|
|
529
|
-
|
|
525
|
+
timestamp: string;
|
|
530
526
|
trace: string;
|
|
527
|
+
transaction: string;
|
|
528
|
+
project: string;
|
|
531
529
|
"span.op": string;
|
|
532
530
|
"span.description": string;
|
|
533
531
|
"span.duration": number;
|
|
@@ -553,4 +551,4 @@ declare class SentryApiService {
|
|
|
553
551
|
}
|
|
554
552
|
//#endregion
|
|
555
553
|
export { ApiError, SentryApiService };
|
|
556
|
-
//# sourceMappingURL=client-
|
|
554
|
+
//# sourceMappingURL=client-VCJp6Kcu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-VCJp6Kcu.d.ts","names":[],"sources":["../src/api-client/client.ts"],"sourcesContent":[],"mappings":";;;;;;AA0EA;AAkBC;AAkDD;;;;;;;;;;;;;AA0RM,cA9VO,QAAA,SAAiB,KAAK,CA8V7B;EAAgB,MAChB,EAAA,MAAA;EAAI,WAKC,CAAA,OAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA;;KAhVN,cAAA,GAiVA;EAAO,IAsBD,CAAA,EAAA,MAAA;CAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiVnB,cAxoBO,gBAAA,CAwoBP;EAAW,QACX,WAAA;EAAK,UACL,IAAA,EAAA,MAAA;EAAM,UAOD,SAAA,EAAA,MAAA;EAAc;;;;;;;;;EAiDZ,WACP,CAAA;IAAA,WAAA;IAAA;EAOY,CAPZ,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;;;;;YAyBF,iBACN,QAAQ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineTool } from "./defineTool-77H4nSna.js";
|
|
2
|
-
import { apiServiceFromContext } from "./api-utils-
|
|
2
|
+
import { apiServiceFromContext } from "./api-utils-C6QJAzFL.js";
|
|
3
3
|
import { ParamOrganizationSlug, ParamProjectSlug, ParamRegionUrl } from "./schema-DtsnsxMl.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { setTag } from "@sentry/core";
|
|
@@ -56,4 +56,4 @@ var create_dsn_default = defineTool({
|
|
|
56
56
|
|
|
57
57
|
//#endregion
|
|
58
58
|
export { create_dsn_default };
|
|
59
|
-
//# sourceMappingURL=create-dsn-
|
|
59
|
+
//# sourceMappingURL=create-dsn-D530I7Lr.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-dsn-
|
|
1
|
+
{"version":3,"file":"create-dsn-D530I7Lr.js","names":["context: ServerContext"],"sources":["../src/tools/create-dsn.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlug,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"create_dsn\",\n description: [\n \"Create a new Sentry DSN for a specific project.\",\n \"\",\n \"Be careful when using this tool!\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Create a new DSN for a specific project\",\n \"\",\n \"<examples>\",\n \"### Create a new DSN for the 'my-project' project\",\n \"\",\n \"```\",\n \"create_dsn(organizationSlug='my-organization', projectSlug='my-project', name='Production')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If any parameter is ambiguous, you should clarify with the user what they meant.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug,\n name: z\n .string()\n .trim()\n .describe(\"The name of the DSN to create, for example 'Production'.\"),\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 const clientKey = await apiService.createClientKey({\n organizationSlug,\n projectSlug: params.projectSlug,\n name: params.name,\n });\n let output = `# New DSN in **${organizationSlug}/${params.projectSlug}**\\n\\n`;\n output += `**DSN**: ${clientKey.dsn.public}\\n`;\n output += `**Name**: ${clientKey.name}\\n\\n`;\n output += \"# Using this information\\n\\n\";\n output +=\n \"- The `SENTRY_DSN` value is a URL that you can use to initialize Sentry's SDKs.\\n\";\n return output;\n },\n});\n"],"mappings":";;;;;;;AAWA,yBAAe,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;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB;EAClB,WAAW,eAAe,UAAU;EACpC,aAAa;EACb,MAAM,EACH,QAAQ,CACR,MAAM,CACN,SAAS,2DAA2D;CACxE;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;EAE1C,MAAM,YAAY,MAAM,WAAW,gBAAgB;GACjD;GACA,aAAa,OAAO;GACpB,MAAM,OAAO;EACd,EAAC;EACF,IAAI,UAAU,iBAAiB,iBAAiB,GAAG,OAAO,YAAY;AACtE,aAAW,WAAW,UAAU,IAAI,OAAO;AAC3C,aAAW,YAAY,UAAU,KAAK;AACtC,YAAU;AACV,YACE;AACF,SAAO;CACR;AACF,EAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-DWy1uDak.cjs');
|
|
2
2
|
const require_defineTool = require('./defineTool-lWNTzWl_.cjs');
|
|
3
|
-
const require_api_utils = require('./api-utils-
|
|
3
|
+
const require_api_utils = require('./api-utils-d36iteNO.cjs');
|
|
4
4
|
const require_schema = require('./schema-BpJVmev8.cjs');
|
|
5
5
|
const zod = require_chunk.__toESM(require("zod"));
|
|
6
6
|
const __sentry_core = require_chunk.__toESM(require("@sentry/core"));
|
|
@@ -62,4 +62,4 @@ Object.defineProperty(exports, 'create_dsn_default', {
|
|
|
62
62
|
return create_dsn_default;
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
|
-
//# sourceMappingURL=create-dsn-
|
|
65
|
+
//# sourceMappingURL=create-dsn-Dz8nyTFw.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-dsn-
|
|
1
|
+
{"version":3,"file":"create-dsn-Dz8nyTFw.cjs","names":["ParamOrganizationSlug","ParamProjectSlug","context: ServerContext"],"sources":["../src/tools/create-dsn.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlug,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"create_dsn\",\n description: [\n \"Create a new Sentry DSN for a specific project.\",\n \"\",\n \"Be careful when using this tool!\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Create a new DSN for a specific project\",\n \"\",\n \"<examples>\",\n \"### Create a new DSN for the 'my-project' project\",\n \"\",\n \"```\",\n \"create_dsn(organizationSlug='my-organization', projectSlug='my-project', name='Production')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If any parameter is ambiguous, you should clarify with the user what they meant.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug,\n name: z\n .string()\n .trim()\n .describe(\"The name of the DSN to create, for example 'Production'.\"),\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 const clientKey = await apiService.createClientKey({\n organizationSlug,\n projectSlug: params.projectSlug,\n name: params.name,\n });\n let output = `# New DSN in **${organizationSlug}/${params.projectSlug}**\\n\\n`;\n output += `**DSN**: ${clientKey.dsn.public}\\n`;\n output += `**Name**: ${clientKey.name}\\n\\n`;\n output += \"# Using this information\\n\\n\";\n output +=\n \"- The `SENTRY_DSN` value is a URL that you can use to initialize Sentry's SDKs.\\n\";\n return output;\n },\n});\n"],"mappings":";;;;;;;;AAWA,yBAAe,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;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkBA;EAClB,WAAW,8BAAe,UAAU;EACpC,aAAaC;EACb,MAAM,MACH,QAAQ,CACR,MAAM,CACN,SAAS,2DAA2D;CACxE;CACD,MAAM,QAAQ,QAAQC,SAAwB;EAC5C,MAAM,aAAa,wCAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,4BAAO,qBAAqB,iBAAiB;AAC7C,4BAAO,gBAAgB,OAAO,YAAY;EAE1C,MAAM,YAAY,MAAM,WAAW,gBAAgB;GACjD;GACA,aAAa,OAAO;GACpB,MAAM,OAAO;EACd,EAAC;EACF,IAAI,UAAU,iBAAiB,iBAAiB,GAAG,OAAO,YAAY;AACtE,aAAW,WAAW,UAAU,IAAI,OAAO;AAC3C,aAAW,YAAY,UAAU,KAAK;AACtC,YAAU;AACV,YACE;AACF,SAAO;CACR;AACF,EAAC"}
|