@sentry/mcp-server 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/README.md +1 -1
  2. package/dist/api-client/client.cjs +2 -2
  3. package/dist/api-client/client.d.cts +3 -3
  4. package/dist/api-client/client.d.ts +3 -3
  5. package/dist/api-client/client.js +2 -2
  6. package/dist/api-client/client.test.cjs +2 -2
  7. package/dist/api-client/client.test.js +2 -2
  8. package/dist/api-client/index.cjs +2 -2
  9. package/dist/api-client/index.d.cts +3 -3
  10. package/dist/api-client/index.d.ts +3 -3
  11. package/dist/api-client/index.js +2 -2
  12. package/dist/api-client/schema.cjs +1 -1
  13. package/dist/api-client/schema.d.cts +1 -1
  14. package/dist/api-client/schema.d.ts +1 -1
  15. package/dist/api-client/schema.js +1 -1
  16. package/dist/api-client/types.d.cts +2 -2
  17. package/dist/api-client/types.d.ts +2 -2
  18. package/dist/{client-DQ837FXP.cjs → client-B4Ux5Zdg.cjs} +7 -4
  19. package/dist/client-B4Ux5Zdg.cjs.map +1 -0
  20. package/dist/{client-CTm4cvI7.js → client-Bz_PNC8o.js} +7 -4
  21. package/dist/client-Bz_PNC8o.js.map +1 -0
  22. package/dist/{client-1dRfG57H.d.ts → client-J6VSRmQS.d.ts} +5 -3
  23. package/dist/client-J6VSRmQS.d.ts.map +1 -0
  24. package/dist/{client-BsYOQsEI.d.cts → client-tE6FD__9.d.cts} +5 -3
  25. package/dist/client-tE6FD__9.d.cts.map +1 -0
  26. package/dist/{formatting-C-0bHtbh.cjs → formatting-B0SJqiqX.cjs} +11 -3
  27. package/dist/formatting-B0SJqiqX.cjs.map +1 -0
  28. package/dist/{formatting-BQRAzO5v.js → formatting-ggD6YRYR.js} +11 -3
  29. package/dist/formatting-ggD6YRYR.js.map +1 -0
  30. package/dist/index.cjs +11 -11
  31. package/dist/index.js +11 -11
  32. package/dist/internal/formatting.cjs +1 -1
  33. package/dist/internal/formatting.d.cts +3 -3
  34. package/dist/internal/formatting.d.cts.map +1 -1
  35. package/dist/internal/formatting.d.ts +3 -3
  36. package/dist/internal/formatting.d.ts.map +1 -1
  37. package/dist/internal/formatting.js +1 -1
  38. package/dist/internal/issue-helpers.test.cjs +2 -2
  39. package/dist/internal/issue-helpers.test.cjs.map +1 -1
  40. package/dist/internal/issue-helpers.test.js +2 -2
  41. package/dist/internal/issue-helpers.test.js.map +1 -1
  42. package/dist/{promptDefinitions-Dcz3d9wL.d.cts → promptDefinitions-BR7PxWcH.d.cts} +3 -3
  43. package/dist/promptDefinitions-BR7PxWcH.d.cts.map +1 -0
  44. package/dist/{promptDefinitions-CPTadtuI.js → promptDefinitions-DBNOeSg-.js} +5 -5
  45. package/dist/promptDefinitions-DBNOeSg-.js.map +1 -0
  46. package/dist/{promptDefinitions-5jiZMBg5.cjs → promptDefinitions-pHRpPOpJ.cjs} +5 -5
  47. package/dist/promptDefinitions-pHRpPOpJ.cjs.map +1 -0
  48. package/dist/{promptDefinitions-DrGK-v8n.d.ts → promptDefinitions-tpKruPny.d.ts} +3 -3
  49. package/dist/promptDefinitions-tpKruPny.d.ts.map +1 -0
  50. package/dist/promptDefinitions.cjs +2 -2
  51. package/dist/promptDefinitions.d.cts +1 -1
  52. package/dist/promptDefinitions.d.ts +1 -1
  53. package/dist/promptDefinitions.js +2 -2
  54. package/dist/prompts.d.cts +5 -5
  55. package/dist/prompts.d.ts +5 -5
  56. package/dist/{schema-KEMqYaQn.cjs → schema-3VLYcf4D.cjs} +9 -2
  57. package/dist/schema-3VLYcf4D.cjs.map +1 -0
  58. package/dist/{schema-DwPOkoSP.d.ts → schema-B7A-FyIi.d.ts} +341 -263
  59. package/dist/{schema-DwPOkoSP.d.ts.map → schema-B7A-FyIi.d.ts.map} +1 -1
  60. package/dist/schema-BKa41TQ4.js +17 -0
  61. package/dist/schema-BKa41TQ4.js.map +1 -0
  62. package/dist/{schema-nyYqVk4Y.js → schema-Dltbjui7.js} +9 -2
  63. package/dist/schema-Dltbjui7.js.map +1 -0
  64. package/dist/{schema-CaJV2aIO.d.cts → schema-PvgLrC1b.d.cts} +339 -261
  65. package/dist/{schema-CaJV2aIO.d.cts.map → schema-PvgLrC1b.d.cts.map} +1 -1
  66. package/dist/schema-jk88gqOu.cjs +78 -0
  67. package/dist/schema-jk88gqOu.cjs.map +1 -0
  68. package/dist/schema.cjs +3 -1
  69. package/dist/schema.d.cts +3 -1
  70. package/dist/schema.d.cts.map +1 -1
  71. package/dist/schema.d.ts +3 -1
  72. package/dist/schema.d.ts.map +1 -1
  73. package/dist/schema.js +2 -2
  74. package/dist/{server-BWoJZj5B.cjs → server-VwFSUPQn.cjs} +5 -5
  75. package/dist/{server-BWoJZj5B.cjs.map → server-VwFSUPQn.cjs.map} +1 -1
  76. package/dist/{server-DtNbD1c-.js → server-yb4PkNyo.js} +5 -5
  77. package/dist/{server-DtNbD1c-.js.map → server-yb4PkNyo.js.map} +1 -1
  78. package/dist/server.cjs +8 -8
  79. package/dist/server.d.cts +3 -3
  80. package/dist/server.d.ts +3 -3
  81. package/dist/server.js +8 -8
  82. package/dist/{stdio-BLzMxGqU.cjs → stdio-65sYKLOk.cjs} +2 -2
  83. package/dist/{stdio-BLzMxGqU.cjs.map → stdio-65sYKLOk.cjs.map} +1 -1
  84. package/dist/{stdio-D4oW-qT6.js → stdio-DkU2-spy.js} +2 -2
  85. package/dist/{stdio-D4oW-qT6.js.map → stdio-DkU2-spy.js.map} +1 -1
  86. package/dist/test-setup.cjs +1338 -1142
  87. package/dist/test-setup.cjs.map +1 -1
  88. package/dist/test-setup.js +1338 -1141
  89. package/dist/test-setup.js.map +1 -1
  90. package/dist/{toolDefinitions-K_TVqaLU.d.cts → toolDefinitions-B94CNDbt.d.cts} +22 -22
  91. package/dist/toolDefinitions-B94CNDbt.d.cts.map +1 -0
  92. package/dist/{toolDefinitions-BF-D81bS.js → toolDefinitions-Bb_1ejkl.js} +83 -78
  93. package/dist/toolDefinitions-Bb_1ejkl.js.map +1 -0
  94. package/dist/{toolDefinitions-CO65cU86.cjs → toolDefinitions-DIhvw3vk.cjs} +83 -78
  95. package/dist/toolDefinitions-DIhvw3vk.cjs.map +1 -0
  96. package/dist/{toolDefinitions-CCscRQoM.d.ts → toolDefinitions-q_1-70fG.d.ts} +22 -22
  97. package/dist/toolDefinitions-q_1-70fG.d.ts.map +1 -0
  98. package/dist/toolDefinitions.cjs +2 -2
  99. package/dist/toolDefinitions.d.cts +1 -1
  100. package/dist/toolDefinitions.d.ts +1 -1
  101. package/dist/toolDefinitions.js +2 -2
  102. package/dist/toolDefinitions.test.cjs +2 -2
  103. package/dist/toolDefinitions.test.js +2 -2
  104. package/dist/{tools-BYt-G6p2.cjs → tools-BdkmyaZo.cjs} +36 -52
  105. package/dist/tools-BdkmyaZo.cjs.map +1 -0
  106. package/dist/{tools-B8ufMRZx.js → tools-CMFpMPpD.js} +36 -52
  107. package/dist/tools-CMFpMPpD.js.map +1 -0
  108. package/dist/tools.cjs +4 -4
  109. package/dist/tools.d.cts +24 -24
  110. package/dist/tools.d.cts.map +1 -1
  111. package/dist/tools.d.ts +24 -24
  112. package/dist/tools.d.ts.map +1 -1
  113. package/dist/tools.js +4 -4
  114. package/dist/tools.test.cjs +111 -34
  115. package/dist/tools.test.cjs.map +1 -1
  116. package/dist/tools.test.js +111 -34
  117. package/dist/tools.test.js.map +1 -1
  118. package/dist/transports/stdio.cjs +9 -9
  119. package/dist/transports/stdio.d.cts +3 -3
  120. package/dist/transports/stdio.d.ts +3 -3
  121. package/dist/transports/stdio.js +9 -9
  122. package/dist/{types-CPuN4Qmi.d.cts → types-B03G337q.d.cts} +2 -2
  123. package/dist/{types-CPuN4Qmi.d.cts.map → types-B03G337q.d.cts.map} +1 -1
  124. package/dist/{types-Ds7qzCBB.d.ts → types-CN4NEway.d.ts} +2 -2
  125. package/dist/{types-Ds7qzCBB.d.ts.map → types-CN4NEway.d.ts.map} +1 -1
  126. package/dist/{types-TaJcaAVg.d.cts → types-OeoNXRm-.d.cts} +3 -3
  127. package/dist/{types-TaJcaAVg.d.cts.map → types-OeoNXRm-.d.cts.map} +1 -1
  128. package/dist/{types-DyM4kaGZ.d.ts → types-jftb-CP9.d.ts} +3 -3
  129. package/dist/{types-DyM4kaGZ.d.ts.map → types-jftb-CP9.d.ts.map} +1 -1
  130. package/dist/types.d.cts +3 -3
  131. package/dist/types.d.ts +3 -3
  132. package/dist/{version-B0O4KvZ9.cjs → version-CDnh7DyW.cjs} +2 -2
  133. package/dist/{version-B0O4KvZ9.cjs.map → version-CDnh7DyW.cjs.map} +1 -1
  134. package/dist/version-TjO7fHpC.js +6 -0
  135. package/dist/{version-dTEKpaGt.js.map → version-TjO7fHpC.js.map} +1 -1
  136. package/dist/version.cjs +1 -1
  137. package/dist/version.js +1 -1
  138. package/package.json +3 -3
  139. package/dist/client-1dRfG57H.d.ts.map +0 -1
  140. package/dist/client-BsYOQsEI.d.cts.map +0 -1
  141. package/dist/client-CTm4cvI7.js.map +0 -1
  142. package/dist/client-DQ837FXP.cjs.map +0 -1
  143. package/dist/formatting-BQRAzO5v.js.map +0 -1
  144. package/dist/formatting-C-0bHtbh.cjs.map +0 -1
  145. package/dist/promptDefinitions-5jiZMBg5.cjs.map +0 -1
  146. package/dist/promptDefinitions-CPTadtuI.js.map +0 -1
  147. package/dist/promptDefinitions-Dcz3d9wL.d.cts.map +0 -1
  148. package/dist/promptDefinitions-DrGK-v8n.d.ts.map +0 -1
  149. package/dist/schema-BCkBPgjj.cjs +0 -64
  150. package/dist/schema-BCkBPgjj.cjs.map +0 -1
  151. package/dist/schema-CJrk_GUH.js +0 -15
  152. package/dist/schema-CJrk_GUH.js.map +0 -1
  153. package/dist/schema-KEMqYaQn.cjs.map +0 -1
  154. package/dist/schema-nyYqVk4Y.js.map +0 -1
  155. package/dist/toolDefinitions-BF-D81bS.js.map +0 -1
  156. package/dist/toolDefinitions-CCscRQoM.d.ts.map +0 -1
  157. package/dist/toolDefinitions-CO65cU86.cjs.map +0 -1
  158. package/dist/toolDefinitions-K_TVqaLU.d.cts.map +0 -1
  159. package/dist/tools-B8ufMRZx.js.map +0 -1
  160. package/dist/tools-BYt-G6p2.cjs.map +0 -1
  161. package/dist/version-dTEKpaGt.js +0 -6
@@ -1 +0,0 @@
1
- {"version":3,"file":"client-DQ837FXP.cjs","names":["message: string","status: number","host: string","path: string","options: RequestInit","headers: Record<string, string>","parsed: unknown | undefined","organizationSlug: string","issueId: string","traceId: string","opts?: RequestOptions","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 ErrorsSearchResponseSchema,\n SpansSearchResponseSchema,\n TagListSchema,\n ApiErrorSchema,\n ClientKeyListSchema,\n AutofixRunSchema,\n AutofixRunStateSchema,\n} from \"./schema\";\nimport type {\n AutofixRun,\n AutofixRunState,\n ClientKey,\n ClientKeyList,\n Event,\n Issue,\n IssueList,\n OrganizationList,\n Project,\n ProjectList,\n ReleaseList,\n TagList,\n Team,\n TeamList,\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\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\nexport class SentryApiService {\n private accessToken: string | null;\n protected host: string;\n protected apiPrefix: string;\n\n constructor({\n accessToken = null,\n host = process.env.SENTRY_HOST,\n }: {\n accessToken?: string | null;\n host?: string;\n }) {\n this.accessToken = accessToken;\n this.host = host || \"sentry.io\";\n this.apiPrefix = new URL(\"/api/0\", `https://${this.host}`).href;\n }\n\n setHost(host: string) {\n this.host = host;\n this.apiPrefix = new URL(\"/api/0\", `https://${this.host}`).href;\n }\n\n private async request(\n path: string,\n options: RequestInit = {},\n { host }: { host?: string } = {},\n ): Promise<Response> {\n const url = host\n ? new URL(`/api/0${path}`, `https://${host}`).href\n : `${this.apiPrefix}${path}`;\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n };\n if (this.accessToken) {\n headers.Authorization = `Bearer ${this.accessToken}`;\n }\n\n // logger.info(logger.fmt`[sentryApi] ${options.method || \"GET\"} ${url}`);\n const response = await fetch(url, {\n ...options,\n headers,\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 getIssueUrl(organizationSlug: string, issueId: string): string {\n return this.host !== \"sentry.io\"\n ? `https://${this.host}/organizations/${organizationSlug}/issues/${issueId}`\n : `https://${organizationSlug}.${this.host}/issues/${issueId}`;\n }\n\n getTraceUrl(organizationSlug: string, traceId: string): string {\n return this.host !== \"sentry.io\"\n ? `https://${this.host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`\n : `https://${organizationSlug}.${this.host}/explore/traces/trace/${traceId}`;\n }\n\n async listOrganizations(opts?: RequestOptions): Promise<OrganizationList> {\n const response = await this.request(\"/organizations/\", undefined, opts);\n\n const body = await response.json();\n return OrganizationListSchema.parse(body);\n }\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 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 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 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 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 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 async listReleases(\n {\n organizationSlug,\n projectSlug,\n }: {\n organizationSlug: string;\n projectSlug?: string;\n },\n opts?: RequestOptions,\n ): Promise<ReleaseList> {\n const response = await this.request(\n projectSlug\n ? `/projects/${organizationSlug}/${projectSlug}/releases/`\n : `/organizations/${organizationSlug}/releases/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return ReleaseListSchema.parse(body);\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 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 // 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":";;;;AAuCA,IAAa,WAAb,cAA8B,MAAM;CAClC,YACEA,SACOC,QACP;EAEA,IAAI,eAAe;AACnB,MACE,QAAQ,SACN,2DACD,IACD,QAAQ,SAAS,gDAAgD,CAEjE,gBACE;AAEJ,QAAM,aAAa;EA2iBtB,KAxjBU;CAcR;AACF;AAMD,IAAa,mBAAb,MAA8B;CAC5B,AAAQ;CACR,AAAU;CACV,AAAU;CAEV,YAAY,EACV,cAAc,MACd,OAAO,QAAQ,IAAI,aAIpB,EAAE;AACD,OAAK,cAAc;AACnB,OAAK,OAAO,QAAQ;AACpB,OAAK,YAAY,IAAI,IAAI,WAAW,UAAU,K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M;AAClC,SAAO,yCAA0B,MAAM,KAAK,CAAC;CAC9C;CAGD,MAAM,aACJ,EACE,kBACA,SACA,SACA,cAAc,IAMf,EACDD,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 +0,0 @@
1
- {"version":3,"file":"formatting-BQRAzO5v.js","names":["frame: z.infer<typeof FrameInterface>","platform: string | undefined | null","event: Event","data: z.infer<typeof ErrorEntrySchema>","data: z.infer<typeof RequestEntrySchema>"],"sources":["../src/internal/formatting.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type { Event, Issue } from \"../api-client/types\";\nimport type {\n ErrorEntrySchema,\n ErrorEventSchema,\n FrameInterface,\n RequestEntrySchema,\n SentryApiService,\n} from \"../api-client\";\n\nexport function formatFrameHeader(\n frame: z.infer<typeof FrameInterface>,\n platform: string | undefined | null,\n) {\n if (platform?.startsWith(\"javascript\")) {\n return `${[frame.filename, frame.lineNo, frame.colNo]\n .filter((i) => !!i)\n .join(\":\")}${frame.function ? ` (${frame.function})` : \"\"}`;\n }\n return `${frame.function ? `\"${frame.function}\"` : \"unknown function\"} in \"${frame.filename || frame.module}\"${\n frame.lineNo\n ? ` at line ${frame.lineNo}${frame.colNo !== null ? `:${frame.colNo}` : \"\"}`\n : \"\"\n }`;\n}\n\nexport function formatEventOutput(event: Event) {\n let output = \"\";\n for (const entry of event.entries) {\n if (entry.type === \"exception\") {\n output += formatExceptionInterfaceOutput(\n event,\n entry.data as z.infer<typeof ErrorEntrySchema>,\n );\n }\n if (entry.type === \"request\") {\n output += formatRequestInterfaceOutput(\n event,\n entry.data as z.infer<typeof RequestEntrySchema>,\n );\n }\n }\n return output;\n}\n\nfunction formatExceptionInterfaceOutput(\n event: Event,\n data: z.infer<typeof ErrorEntrySchema>,\n) {\n let output = \"\";\n // TODO: support chained exceptions\n const firstError = data.value ?? data.values[0];\n if (!firstError) {\n return \"\";\n }\n output += `**Error:**\\n${\"```\"}\\n${firstError.type}: ${\n firstError.value\n }\\n${\"```\"}\\n\\n`;\n if (!firstError.stacktrace || !firstError.stacktrace.frames) {\n return output;\n }\n output += `**Stacktrace:**\\n${\"```\"}\\n${firstError.stacktrace.frames\n .map((frame) => {\n const context = frame.context?.length\n ? `${frame.context\n .filter(([lineno, _]) => lineno === frame.lineNo)\n .map(([_, code]) => `\\n${code}`)\n .join(\"\")}`\n : \"\";\n\n return `${formatFrameHeader(frame, event.platform)}${context}`;\n })\n .join(\"\\n\")}\\n${\"```\"}\\n\\n`;\n return output;\n}\n\nfunction formatRequestInterfaceOutput(\n event: Event,\n data: z.infer<typeof RequestEntrySchema>,\n) {\n if (!data.method || !data.url) {\n return \"\";\n }\n return `**HTTP Method:** ${data.method}\\n**URL:** ${data.url}\\n`;\n}\n\nexport function formatIssueOutput({\n organizationSlug,\n issue,\n event,\n apiService,\n}: {\n organizationSlug: string;\n issue: Issue;\n event: Event;\n apiService: SentryApiService;\n}) {\n let output = `# Issue ${issue.shortId} in **${organizationSlug}**\\n\\n`;\n output += `**Description**: ${issue.title}\\n`;\n output += `**Culprit**: ${issue.culprit}\\n`;\n output += `**First Seen**: ${new Date(issue.firstSeen).toISOString()}\\n`;\n output += `**Last Seen**: ${new Date(issue.lastSeen).toISOString()}\\n`;\n output += `**Occurrences**: ${issue.count}\\n`;\n output += `**Users Impacted**: ${issue.userCount}\\n`;\n output += `**Status**: ${issue.status}\\n`;\n output += `**Platform**: ${issue.platform}\\n`;\n output += `**Project**: ${issue.project.name}\\n`;\n output += `**URL**: ${apiService.getIssueUrl(organizationSlug, issue.shortId)}\\n`;\n output += \"\\n\";\n output += \"## Event Details\\n\\n\";\n output += `**Event ID**: ${event.id}\\n`;\n if (event.type === \"error\") {\n output += `**Occurred At**: ${new Date((event as z.infer<typeof ErrorEventSchema>).dateCreated).toISOString()}\\n`;\n }\n if (event.message) {\n output += `**Message**:\\n${event.message}\\n`;\n }\n output += formatEventOutput(event);\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the IssueID in commit messages (e.g. \\`Fixes ${issue.shortId}\\`) to automatically close the issue when the commit is merged.\\n`;\n output +=\n \"- The stacktrace includes both first-party application code as well as third-party code, its important to triage to first-party code.\\n\";\n return output;\n}\n"],"mappings":";AAUA,SAAgB,kBACdA,OACAC,UACA;AACA,KAAI,UAAU,WAAW,aAAa,CACpC,SAAQ,EAAE;EAAC,MAAM;EAAU,MAAM;EAAQ,MAAM;CAAM,EAClD,OAAO,CAAC,QAAQ,EAAE,CAClB,KAAK,IAAI,CAAC,EAAE,MAAM,YAAY,IAAI,MAAM,SAAS,KAAK,GAAG;AAE9D,SAAQ,EAAE,MAAM,YAAY,GAAG,MAAM,SAAS,KAAK,mBAAmB,OAAO,MAAM,YAAY,MAAM,OAAO,GAC1G,MAAM,UACD,WAAW,MAAM,OAAO,EAAE,MAAM,UAAU,QAAQ,GAAG,MAAM,MAAM,IAAI,GAAG,IACzE,GACL;AACF;AAED,SAAgB,kBAAkBC,OAAc;CAC9C,IAAI,SAAS;AACb,MAAK,MAAM,SAAS,MAAM,SAAS;AACjC,MAAI,MAAM,SAAS,YACjB,WAAU,+BACR,OACA,MAAM,KACP;AAEH,MAAI,MAAM,SAAS,UACjB,WAAU,6BACR,OACA,MAAM,KACP;CAEJ;AACD,QAAO;AACR;AAED,SAAS,+BACPA,OACAC,MACA;CACA,IAAI,SAAS;CAEb,MAAM,aAAa,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AAS,QACjB,YAAW,mBAAmB,IAAI,KAAM,MAA2C,aAAa,aAAa,CAAC;AAEhH,KAAI,MAAM,QACR,YAAW,gBAAgB,MAAM,QAAQ;AAE3C,WAAU,kBAAkB,MAAM;AAClC,WAAU;AACV,YAAW,mEAAmE,MAAM,QAAQ;AAC5F,WACE;AACF,QAAO;AACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatting-C-0bHtbh.cjs","names":["frame: z.infer<typeof FrameInterface>","platform: string | undefined | null","event: Event","data: z.infer<typeof ErrorEntrySchema>","data: z.infer<typeof RequestEntrySchema>"],"sources":["../src/internal/formatting.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type { Event, Issue } from \"../api-client/types\";\nimport type {\n ErrorEntrySchema,\n ErrorEventSchema,\n FrameInterface,\n RequestEntrySchema,\n SentryApiService,\n} from \"../api-client\";\n\nexport function formatFrameHeader(\n frame: z.infer<typeof FrameInterface>,\n platform: string | undefined | null,\n) {\n if (platform?.startsWith(\"javascript\")) {\n return `${[frame.filename, frame.lineNo, frame.colNo]\n .filter((i) => !!i)\n .join(\":\")}${frame.function ? ` (${frame.function})` : \"\"}`;\n }\n return `${frame.function ? `\"${frame.function}\"` : \"unknown function\"} in \"${frame.filename || frame.module}\"${\n frame.lineNo\n ? ` at line ${frame.lineNo}${frame.colNo !== null ? `:${frame.colNo}` : \"\"}`\n : \"\"\n }`;\n}\n\nexport function formatEventOutput(event: Event) {\n let output = \"\";\n for (const entry of event.entries) {\n if (entry.type === \"exception\") {\n output += formatExceptionInterfaceOutput(\n event,\n entry.data as z.infer<typeof ErrorEntrySchema>,\n );\n }\n if (entry.type === \"request\") {\n output += formatRequestInterfaceOutput(\n event,\n entry.data as z.infer<typeof RequestEntrySchema>,\n );\n }\n }\n return output;\n}\n\nfunction formatExceptionInterfaceOutput(\n event: Event,\n data: z.infer<typeof ErrorEntrySchema>,\n) {\n let output = \"\";\n // TODO: support chained exceptions\n const firstError = data.value ?? data.values[0];\n if (!firstError) {\n return \"\";\n }\n output += `**Error:**\\n${\"```\"}\\n${firstError.type}: ${\n firstError.value\n }\\n${\"```\"}\\n\\n`;\n if (!firstError.stacktrace || !firstError.stacktrace.frames) {\n return output;\n }\n output += `**Stacktrace:**\\n${\"```\"}\\n${firstError.stacktrace.frames\n .map((frame) => {\n const context = frame.context?.length\n ? `${frame.context\n .filter(([lineno, _]) => lineno === frame.lineNo)\n .map(([_, code]) => `\\n${code}`)\n .join(\"\")}`\n : \"\";\n\n return `${formatFrameHeader(frame, event.platform)}${context}`;\n })\n .join(\"\\n\")}\\n${\"```\"}\\n\\n`;\n return output;\n}\n\nfunction formatRequestInterfaceOutput(\n event: Event,\n data: z.infer<typeof RequestEntrySchema>,\n) {\n if (!data.method || !data.url) {\n return \"\";\n }\n return `**HTTP Method:** ${data.method}\\n**URL:** ${data.url}\\n`;\n}\n\nexport function formatIssueOutput({\n organizationSlug,\n issue,\n event,\n apiService,\n}: {\n organizationSlug: string;\n issue: Issue;\n event: Event;\n apiService: SentryApiService;\n}) {\n let output = `# Issue ${issue.shortId} in **${organizationSlug}**\\n\\n`;\n output += `**Description**: ${issue.title}\\n`;\n output += `**Culprit**: ${issue.culprit}\\n`;\n output += `**First Seen**: ${new Date(issue.firstSeen).toISOString()}\\n`;\n output += `**Last Seen**: ${new Date(issue.lastSeen).toISOString()}\\n`;\n output += `**Occurrences**: ${issue.count}\\n`;\n output += `**Users Impacted**: ${issue.userCount}\\n`;\n output += `**Status**: ${issue.status}\\n`;\n output += `**Platform**: ${issue.platform}\\n`;\n output += `**Project**: ${issue.project.name}\\n`;\n output += `**URL**: ${apiService.getIssueUrl(organizationSlug, issue.shortId)}\\n`;\n output += \"\\n\";\n output += \"## Event Details\\n\\n\";\n output += `**Event ID**: ${event.id}\\n`;\n if (event.type === \"error\") {\n output += `**Occurred At**: ${new Date((event as z.infer<typeof ErrorEventSchema>).dateCreated).toISOString()}\\n`;\n }\n if (event.message) {\n output += `**Message**:\\n${event.message}\\n`;\n }\n output += formatEventOutput(event);\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the IssueID in commit messages (e.g. \\`Fixes ${issue.shortId}\\`) to automatically close the issue when the commit is merged.\\n`;\n output +=\n \"- The stacktrace includes both first-party application code as well as third-party code, its important to triage to first-party code.\\n\";\n return output;\n}\n"],"mappings":";;;AAUA,SAAgB,kBACdA,OACAC,UACA;AACA,KAAI,UAAU,WAAW,aAAa,CACpC,SAAQ,EAAE;EAAC,MAAM;EAAU,MAAM;EAAQ,MAAM;CAAM,EAClD,OAAO,CAAC,QAAQ,EAAE,CAClB,KAAK,IAAI,CAAC,EAAE,MAAM,YAAY,IAAI,MAAM,SAAS,KAAK,GAAG;AAE9D,SAAQ,EAAE,MAAM,YAAY,GAAG,MAAM,SAAS,KAAK,mBAAmB,OAAO,MAAM,YAAY,MAAM,OAAO,GAC1G,MAAM,UACD,WAAW,MAAM,OAAO,EAAE,MAAM,UAAU,QAAQ,GAAG,MAAM,MAAM,IAAI,GAAG,IACzE,GACL;AACF;AAED,SAAgB,kBAAkBC,OAAc;CAC9C,IAAI,SAAS;AACb,MAAK,MAAM,SAAS,MAAM,SAAS;AACjC,MAAI,MAAM,SAAS,YACjB,WAAU,+BACR,OACA,MAAM,KACP;AAEH,MAAI,MAAM,SAAS,UACjB,WAAU,6BACR,OACA,MAAM,KACP;CAEJ;AACD,QAAO;AACR;AAED,SAAS,+BACPA,OACAC,MACA;CACA,IAAI,SAAS;CAEb,MAAM,aAAa,KAAK,SAAS,KAAK,OAAO;AAC7C,MAAK,WACH,QAAO;AAET,YAAW,sBAAwB,WAAW,KAAK,IACjD,WAAW,MACZ;AACD,MAAK,WAAW,eAAe,WAAW,WAAW,OACnD,QAAO;AAET,YAAW,2BAA6B,WAAW,WAAW,OAC3D,IAAI,CAAC,UAAU;EACd,MAAM,UAAU,MAAM,SAAS,UAC1B,EAAE,MAAM,QACN,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,WAAW,MAAM,OAAO,CAChD,IAAI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ourcesContent":["import { z } from \"zod\";\nimport { ParamOrganizationSlug } from \"./schema\";\n\nexport const PROMPT_DEFINITIONS = [\n {\n name: \"find_errors_in_file\" as const,\n description: [\n \"Use this prompt when you need to find errors in Sentry for a given file.\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug,\n filename: z.string(),\n },\n },\n {\n name: \"fix_issue_with_seer\" as const,\n description: [\n \"Use this prompt when you need to fix an issue with Seer.\",\n \"You can pass in either an `issueId` and `organizationSlug`, or an `issueUrl`.\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n issueId: z.string().optional(),\n issueUrl: z.string().optional(),\n },\n },\n];\n"],"mappings":";;;;;;AAGA,MAAa,qBAAqB,CAChC;CACE,MAAM;CACN,aAAa,CACX,0EACD,EAAC,KAAK,KAAK;CACZ,cAAc;EACZ,kBAAkBA;EAClB,UAAU,MAAE,QAAQ;CACrB;AACF,GACD;CACE,MAAM;CACN,aAAa,CACX,4DACA,+EACD,EAAC,KAAK,KAAK;CACZ,cAAc;EACZ,kBAAkB,qCAAsB,UAAU;EAClD,SAAS,MAAE,QAAQ,CAAC,UAAU;EAC9B,UAAU,MAAE,QAAQ,CAAC,UAAU;CAChC;AACF,CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"promptDefinitions-CPTadtuI.js","names":[],"sources":["../src/promptDefinitions.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { ParamOrganizationSlug } from \"./schema\";\n\nexport const PROMPT_DEFINITIONS = [\n {\n name: \"find_errors_in_file\" as const,\n description: [\n \"Use this prompt when you need to find errors in Sentry for a given file.\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug,\n filename: z.string(),\n },\n },\n {\n name: \"fix_issue_with_seer\" as const,\n description: [\n \"Use this prompt when you need to fix an issue with Seer.\",\n \"You can pass in either an `issueId` and `organizationSlug`, or an `issueUrl`.\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n issueId: z.string().optional(),\n issueUrl: z.string().optional(),\n },\n },\n];\n"],"mappings":";;;;AAGA,MAAa,qBAAqB,CAChC;CACE,MAAM;CACN,aAAa,CACX,0EACD,EAAC,KAAK,KAAK;CACZ,cAAc;EACZ,kBAAkB;EAClB,UAAU,EAAE,QAAQ;CACrB;AACF,GACD;CACE,MAAM;CACN,aAAa,CACX,4DACA,+EACD,EAAC,KAAK,KAAK;CACZ,cAAc;EACZ,kBAAkB,sBAAsB,UAAU;EAClD,SAAS,EAAE,QAAQ,CAAC,UAAU;EAC9B,UAAU,EAAE,QAAQ,CAAC,UAAU;CAChC;AACF,CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"promptDefinitions-Dcz3d9wL.d.cts","names":[],"sources":["../src/promptDefinitions.ts"],"sourcesContent":null,"mappings":";;;cAGa;;EAAA,WAAA,EAAA,MAAA;EAuBZ,YAAA,EAAA;IAAA,gBAAA,EAAA,CAAA,CAAA,SAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"promptDefinitions-DrGK-v8n.d.ts","names":[],"sources":["../src/promptDefinitions.ts"],"sourcesContent":null,"mappings":";;;cAGa;;EAAA,WAAA,EAAA,MAAA;EAuBZ,YAAA,EAAA;IAAA,gBAAA,EAAA,CAAA,CAAA,SAAA"}
@@ -1,64 +0,0 @@
1
- "use strict";
2
- const require_chunk = require('./chunk-BtT13l48.cjs');
3
- const zod = require_chunk.__toESM(require("zod"));
4
-
5
- //#region src/schema.ts
6
- const ParamOrganizationSlug = zod.z.string().toLowerCase().describe("The organization's slug. This will default to the first org you have access to.");
7
- const ParamTeamSlug = zod.z.string().toLowerCase().describe("The team's slug. This will default to the first team you have access to.");
8
- const ParamProjectSlug = zod.z.string().toLowerCase().describe("The project's slug. This will default to all projects you have access to. It is encouraged to specify this when possible.");
9
- const ParamIssueShortId = zod.z.string().toUpperCase().describe("The Issue ID. e.g. `PROJECT-1Z43`");
10
- const ParamPlatform = zod.z.string().toLowerCase().describe("The platform for the project (e.g., python, javascript, react, etc.)");
11
- const ParamTransaction = zod.z.string().describe("The transaction name (also known as the endpoint, or route name).");
12
- const ParamQuery = zod.z.string().describe(`The search query to apply. Use the \`help(subject="query_syntax")\` tool to get more information about the query syntax rather than guessing.`);
13
- const ParamRegionUrl = zod.z.string().describe("The region URL for the organization you're querying, if known.");
14
-
15
- //#endregion
16
- Object.defineProperty(exports, 'ParamIssueShortId', {
17
- enumerable: true,
18
- get: function () {
19
- return ParamIssueShortId;
20
- }
21
- });
22
- Object.defineProperty(exports, 'ParamOrganizationSlug', {
23
- enumerable: true,
24
- get: function () {
25
- return ParamOrganizationSlug;
26
- }
27
- });
28
- Object.defineProperty(exports, 'ParamPlatform', {
29
- enumerable: true,
30
- get: function () {
31
- return ParamPlatform;
32
- }
33
- });
34
- Object.defineProperty(exports, 'ParamProjectSlug', {
35
- enumerable: true,
36
- get: function () {
37
- return ParamProjectSlug;
38
- }
39
- });
40
- Object.defineProperty(exports, 'ParamQuery', {
41
- enumerable: true,
42
- get: function () {
43
- return ParamQuery;
44
- }
45
- });
46
- Object.defineProperty(exports, 'ParamRegionUrl', {
47
- enumerable: true,
48
- get: function () {
49
- return ParamRegionUrl;
50
- }
51
- });
52
- Object.defineProperty(exports, 'ParamTeamSlug', {
53
- enumerable: true,
54
- get: function () {
55
- return ParamTeamSlug;
56
- }
57
- });
58
- Object.defineProperty(exports, 'ParamTransaction', {
59
- enumerable: true,
60
- get: function () {
61
- return ParamTransaction;
62
- }
63
- });
64
- //# sourceMappingURL=schema-BCkBPgjj.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema-BCkBPgjj.cjs","names":[],"sources":["../src/schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const ParamOrganizationSlug = z\n .string()\n .toLowerCase()\n .describe(\n \"The organization's slug. This will default to the first org you have access to.\",\n );\n\nexport const ParamTeamSlug = z\n .string()\n .toLowerCase()\n .describe(\n \"The team's slug. This will default to the first team you have access to.\",\n );\n\nexport const ParamProjectSlug = z\n .string()\n .toLowerCase()\n .describe(\n \"The project's slug. This will default to all projects you have access to. It is encouraged to specify this when possible.\",\n );\n\nexport const ParamIssueShortId = z\n .string()\n .toUpperCase()\n .describe(\"The Issue ID. e.g. `PROJECT-1Z43`\");\n\nexport const ParamPlatform = z\n .string()\n .toLowerCase()\n .describe(\n \"The platform for the project (e.g., python, javascript, react, etc.)\",\n );\n\nexport const ParamTransaction = z\n .string()\n .describe(\n \"The transaction name (also known as the endpoint, or route name).\",\n );\n\nexport const ParamQuery = z\n .string()\n .describe(\n `The search query to apply. Use the \\`help(subject=\"query_syntax\")\\` tool to get more information about the query syntax rather than guessing.`,\n );\n\nexport const ParamRegionUrl = z\n .string()\n .describe(\"The region URL for the organization you're querying, if known.\");\n"],"mappings":";;;;;AAEA,MAAa,wBAAwB,MAClC,QAAQ,CACR,aAAa,CACb,SACC,kFACD;AAEH,MAAa,gBAAgB,MAC1B,QAAQ,CACR,aAAa,CACb,SACC,2EACD;AAEH,MAAa,mBAAmB,MAC7B,QAAQ,CACR,aAAa,CACb,SACC,4HACD;AAEH,MAAa,oBAAoB,MAC9B,QAAQ,CACR,aAAa,CACb,SAAS,oCAAoC;AAEhD,MAAa,gBAAgB,MAC1B,QAAQ,CACR,aAAa,CACb,SACC,uEACD;AAEH,MAAa,mBAAmB,MAC7B,QAAQ,CACR,SACC,oEACD;AAEH,MAAa,aAAa,MACvB,QAAQ,CACR,UACE,+IACF;AAEH,MAAa,iBAAiB,MAC3B,QAAQ,CACR,SAAS,iEAAiE"}
@@ -1,15 +0,0 @@
1
- import { z } from "zod";
2
-
3
- //#region src/schema.ts
4
- const ParamOrganizationSlug = z.string().toLowerCase().describe("The organization's slug. This will default to the first org you have access to.");
5
- const ParamTeamSlug = z.string().toLowerCase().describe("The team's slug. This will default to the first team you have access to.");
6
- const ParamProjectSlug = z.string().toLowerCase().describe("The project's slug. This will default to all projects you have access to. It is encouraged to specify this when possible.");
7
- const ParamIssueShortId = z.string().toUpperCase().describe("The Issue ID. e.g. `PROJECT-1Z43`");
8
- const ParamPlatform = z.string().toLowerCase().describe("The platform for the project (e.g., python, javascript, react, etc.)");
9
- const ParamTransaction = z.string().describe("The transaction name (also known as the endpoint, or route name).");
10
- const ParamQuery = z.string().describe(`The search query to apply. Use the \`help(subject="query_syntax")\` tool to get more information about the query syntax rather than guessing.`);
11
- const ParamRegionUrl = z.string().describe("The region URL for the organization you're querying, if known.");
12
-
13
- //#endregion
14
- export { ParamIssueShortId, ParamOrganizationSlug, ParamPlatform, ParamProjectSlug, ParamQuery, ParamRegionUrl, ParamTeamSlug, ParamTransaction };
15
- //# sourceMappingURL=schema-CJrk_GUH.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema-CJrk_GUH.js","names":[],"sources":["../src/schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const ParamOrganizationSlug = z\n .string()\n .toLowerCase()\n .describe(\n \"The organization's slug. This will default to the first org you have access to.\",\n );\n\nexport const ParamTeamSlug = z\n .string()\n .toLowerCase()\n .describe(\n \"The team's slug. This will default to the first team you have access to.\",\n );\n\nexport const ParamProjectSlug = z\n .string()\n .toLowerCase()\n .describe(\n \"The project's slug. This will default to all projects you have access to. It is encouraged to specify this when possible.\",\n );\n\nexport const ParamIssueShortId = z\n .string()\n .toUpperCase()\n .describe(\"The Issue ID. e.g. `PROJECT-1Z43`\");\n\nexport const ParamPlatform = z\n .string()\n .toLowerCase()\n .describe(\n \"The platform for the project (e.g., python, javascript, react, etc.)\",\n );\n\nexport const ParamTransaction = z\n .string()\n .describe(\n \"The transaction name (also known as the endpoint, or route name).\",\n );\n\nexport const ParamQuery = z\n .string()\n .describe(\n `The search query to apply. Use the \\`help(subject=\"query_syntax\")\\` tool to get more information about the query syntax rather than guessing.`,\n );\n\nexport const ParamRegionUrl = z\n .string()\n .describe(\"The region URL for the organization you're querying, if known.\");\n"],"mappings":";;;AAEA,MAAa,wBAAwB,EAClC,QAAQ,CACR,aAAa,CACb,SACC,kFACD;AAEH,MAAa,gBAAgB,EAC1B,QAAQ,CACR,aAAa,CACb,SACC,2EACD;AAEH,MAAa,mBAAmB,EAC7B,QAAQ,CACR,aAAa,CACb,SACC,4HACD;AAEH,MAAa,oBAAoB,EAC9B,QAAQ,CACR,aAAa,CACb,SAAS,oCAAoC;AAEhD,MAAa,gBAAgB,EAC1B,QAAQ,CACR,aAAa,CACb,SACC,uEACD;AAEH,MAAa,mBAAmB,EAC7B,QAAQ,CACR,SACC,oEACD;AAEH,MAAa,aAAa,EACvB,QAAQ,CACR,UACE,+IACF;AAEH,MAAa,iBAAiB,EAC3B,QAAQ,CACR,SAAS,iEAAiE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema-KEMqYaQn.cjs","names":[],"sources":["../src/api-client/schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const ApiErrorSchema = z\n .object({\n detail: z.string(),\n })\n .passthrough();\n\nexport const OrganizationSchema = z.object({\n id: z.union([z.string(), z.number()]),\n slug: z.string(),\n name: z.string(),\n links: z.object({\n regionUrl: z.string().url(),\n organizationUrl: z.string().url(),\n }),\n});\n\nexport const OrganizationListSchema = z.array(OrganizationSchema);\n\nexport const TeamSchema = z.object({\n id: z.union([z.string(), z.number()]),\n slug: z.string(),\n name: z.string(),\n});\n\nexport const TeamListSchema = z.array(TeamSchema);\n\nexport const ProjectSchema = z.object({\n id: z.union([z.string(), z.number()]),\n slug: z.string(),\n name: z.string(),\n});\n\nexport const ProjectListSchema = z.array(ProjectSchema);\n\nexport const ClientKeySchema = z.object({\n id: z.union([z.string(), z.number()]),\n name: z.string(),\n dsn: z.object({\n public: z.string(),\n }),\n isActive: z.boolean(),\n dateCreated: z.string().datetime(),\n});\n\nexport const ClientKeyListSchema = z.array(ClientKeySchema);\n\nexport const ReleaseSchema = z.object({\n id: z.union([z.string(), z.number()]),\n version: z.string(),\n shortVersion: z.string(),\n dateCreated: z.string().datetime(),\n dateReleased: z.string().datetime().nullable(),\n firstEvent: z.string().datetime().nullable(),\n lastEvent: z.string().datetime().nullable(),\n newGroups: z.number(),\n lastCommit: z\n .object({\n id: z.union([z.string(), z.number()]),\n message: z.string(),\n dateCreated: z.string().datetime(),\n author: z.object({\n name: z.string(),\n email: z.string(),\n }),\n })\n .nullable(),\n lastDeploy: z\n .object({\n id: z.union([z.string(), z.number()]),\n environment: z.string(),\n dateStarted: z.string().datetime().nullable(),\n dateFinished: z.string().datetime().nullable(),\n })\n .nullable(),\n projects: z.array(ProjectSchema),\n});\n\nexport const ReleaseListSchema = z.array(ReleaseSchema);\n\nexport const TagSchema = z.object({\n key: z.string(),\n name: z.string(),\n totalValues: z.number(),\n});\n\nexport const TagListSchema = z.array(TagSchema);\n\nexport const IssueSchema = z.object({\n id: z.union([z.string(), z.number()]),\n shortId: z.string(),\n title: z.string(),\n firstSeen: z.string().datetime(),\n lastSeen: z.string().datetime(),\n count: z.union([z.string(), z.number()]),\n userCount: z.union([z.string(), z.number()]),\n permalink: z.string().url(),\n project: ProjectSchema,\n platform: z.string(),\n status: z.string(),\n culprit: z.string(),\n type: z.union([z.literal(\"error\"), z.literal(\"transaction\"), z.unknown()]),\n});\n\nexport const IssueListSchema = z.array(IssueSchema);\n\nexport const FrameInterface = z\n .object({\n filename: z.string().nullable(),\n function: z.string().nullable(),\n lineNo: z.number().nullable(),\n colNo: z.number().nullable(),\n absPath: z.string().nullable(),\n module: z.string().nullable(),\n // lineno, source code\n context: z.array(z.tuple([z.number(), z.string()])),\n })\n .partial();\n\n// XXX: Sentry's schema generally speaking is \"assume all user input is missing\"\n// so we need to handle effectively every field being optional or nullable.\nexport const ExceptionInterface = z\n .object({\n mechanism: z\n .object({\n type: z.string().nullable(),\n handled: z.boolean().nullable(),\n })\n .partial(),\n type: z.string().nullable(),\n value: z.string().nullable(),\n stacktrace: z.object({\n frames: z.array(FrameInterface),\n }),\n })\n .partial();\n\nexport const ErrorEntrySchema = z.object({\n // XXX: Sentry can return either of these. Not sure why we never normalized it.\n values: z.array(ExceptionInterface.optional()),\n value: ExceptionInterface.nullable().optional(),\n});\n\nexport const RequestEntrySchema = z.object({\n method: z.string().nullable(),\n url: z.string().url().nullable(),\n // TODO:\n // query: z.array(z.tuple([z.string(), z.string()])).nullable(),\n // data: z.unknown().nullable(),\n // headers: z.array(z.tuple([z.string(), z.string()])).nullable(),\n});\n\nconst BaseEventSchema = z.object({\n id: z.string(),\n title: z.string(),\n message: z.string().nullable(),\n platform: z.string().nullable(),\n type: z.unknown(),\n entries: z.array(\n z.union([\n // TODO: there are other types\n z.object({\n type: z.literal(\"exception\"),\n data: ErrorEntrySchema,\n }),\n z.object({\n type: z.literal(\"spans\"),\n data: z.unknown(),\n }),\n z.object({\n type: z.literal(\"request\"),\n data: z.unknown(),\n }),\n z.object({\n type: z.literal(\"breadcrumbs\"),\n data: z.unknown(),\n }),\n z.object({\n type: z.string(),\n data: z.unknown(),\n }),\n ]),\n ),\n});\n\nexport const ErrorEventSchema = BaseEventSchema.omit({\n type: true,\n}).extend({\n type: z.literal(\"error\"),\n culprit: z.string().nullable(),\n dateCreated: z.string().datetime(),\n});\n\nexport const TransactionEventSchema = BaseEventSchema.omit({\n type: true,\n}).extend({\n type: z.literal(\"transaction\"),\n occurrence: z.object({\n issueTitle: z.string(),\n culprit: z.string().nullable(),\n }),\n});\n\nexport const UnknownEventSchema = BaseEventSchema.omit({\n type: true,\n}).extend({\n type: z.unknown(),\n});\n\n// XXX: This API response is kind of a disaster. We are not propagating the appropriate\n// columns and it makes this really hard to work with. Errors and Transaction-based issues\n// are completely different, for example.\nexport const EventSchema = z.union([\n ErrorEventSchema,\n TransactionEventSchema,\n UnknownEventSchema,\n]);\n\nexport const EventsResponseSchema = z.object({\n data: z.array(z.unknown()),\n meta: z\n .object({\n fields: z.record(z.string(), z.string()),\n })\n .passthrough(),\n});\n\n// https://us.sentry.io/api/0/organizations/sentry/events/?dataset=errors&field=issue&field=title&field=project&field=timestamp&field=trace&per_page=5&query=event.type%3Aerror&referrer=sentry-mcp&sort=-timestamp&statsPeriod=1w\nexport const ErrorsSearchResponseSchema = EventsResponseSchema.extend({\n data: z.array(\n z.object({\n issue: z.string(),\n \"issue.id\": z.union([z.string(), z.number()]),\n project: z.string(),\n title: z.string(),\n \"count()\": z.number(),\n \"last_seen()\": z.string(),\n }),\n ),\n});\n\nexport const SpansSearchResponseSchema = EventsResponseSchema.extend({\n data: z.array(\n z.object({\n id: z.string(),\n trace: z.string(),\n \"span.op\": z.string(),\n \"span.description\": z.string(),\n \"span.duration\": z.number(),\n transaction: z.string(),\n project: z.string(),\n timestamp: z.string(),\n }),\n ),\n});\n\nexport const AutofixRunSchema = z\n .object({\n run_id: z.union([z.string(), z.number()]),\n })\n .passthrough();\n\nconst AutofixStatusSchema = z.enum([\n \"PENDING\",\n \"PROCESSING\",\n \"IN_PROGRESS\",\n \"NEED_MORE_INFORMATION\",\n \"COMPLETED\",\n \"FAILED\",\n \"ERROR\",\n \"CANCELLED\",\n \"WAITING_FOR_USER_RESPONSE\",\n]);\n\nconst AutofixRunStepBaseSchema = z.object({\n type: z.string(),\n key: z.string(),\n index: z.number(),\n status: AutofixStatusSchema,\n title: z.string(),\n output_stream: z.string().nullable(),\n progress: z.array(\n z.object({\n data: z.unknown().nullable(),\n message: z.string(),\n timestamp: z.string(),\n type: z.enum([\"INFO\", \"WARNING\", \"ERROR\"]),\n }),\n ),\n});\n\nexport const AutofixRunStepDefaultSchema = AutofixRunStepBaseSchema.extend({\n type: z.literal(\"default\"),\n insights: z\n .array(\n z.object({\n change_diff: z.unknown().nullable(),\n generated_at_memory_index: z.number(),\n insight: z.string(),\n justification: z.string(),\n type: z.literal(\"insight\"),\n }),\n )\n .nullable(),\n}).passthrough();\n\nexport const AutofixRunStepRootCauseAnalysisSchema =\n AutofixRunStepBaseSchema.extend({\n type: z.literal(\"root_cause_analysis\"),\n causes: z.array(\n z.object({\n description: z.string(),\n id: z.number(),\n root_cause_reproduction: z.array(\n z.object({\n code_snippet_and_analysis: z.string(),\n is_most_important_event: z.boolean(),\n relevant_code_file: z\n .object({\n file_path: z.string(),\n repo_name: z.string(),\n })\n .nullable(),\n timeline_item_type: z.string(),\n title: z.string(),\n }),\n ),\n }),\n ),\n }).passthrough();\n\nexport const AutofixRunStepSolutionSchema = AutofixRunStepBaseSchema.extend({\n type: z.literal(\"solution\"),\n solution: z.array(\n z.object({\n code_snippet_and_analysis: z.string().nullable(),\n is_active: z.boolean(),\n is_most_important_event: z.boolean(),\n relevant_code_file: z.null(),\n timeline_item_type: z.union([\n z.literal(\"internal_code\"),\n z.literal(\"repro_test\"),\n ]),\n title: z.string(),\n }),\n ),\n}).passthrough();\n\nexport const AutofixRunStepSchema = z.union([\n AutofixRunStepDefaultSchema,\n AutofixRunStepRootCauseAnalysisSchema,\n AutofixRunStepSolutionSchema,\n AutofixRunStepBaseSchema.passthrough(),\n]);\n\nexport const AutofixRunStateSchema = z.object({\n autofix: z\n .object({\n run_id: z.number(),\n request: z.unknown(),\n updated_at: z.string(),\n status: AutofixStatusSchema,\n steps: z.array(AutofixRunStepSchema),\n })\n .passthrough()\n .nullable(),\n});\n"],"mappings":";;;;;AAEA,MAAa,iBAAiB,MAC3B,OAAO,EACN,QAAQ,MAAE,QAAQ,CACnB,EAAC,CACD,aAAa;AAEhB,MAAa,qBAAqB,MAAE,OAAO;CACzC,IAAI,MAAE,MAAM,CAAC,MAAE,QAAQ,EAAE,MAAE,QAAQ,AAAC,EAAC;CACrC,MAAM,MAAE,QAAQ;CAChB,MAAM,MAAE,QAAQ;CAChB,OAAO,MAAE,OAAO;EACd,WAAW,MAAE,QAAQ,CAAC,KAAK;EAC3B,iBAAiB,MAAE,QAAQ,CAAC,KAAK;CAClC,EAAC;AACH,EAAC;AAEF,MAAa,yBAAyB,MAAE,MAAM,mBAAmB;AAEjE,MAAa,aAAa,MAAE,OAAO;CACjC,IAAI,MAAE,MAAM,CAAC,MAAE,QAAQ,EAAE,MAAE,QAAQ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AACrC,EAAC,CACD,aAAa,CACb,UAAU,CACd,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema-nyYqVk4Y.js","names":[],"sources":["../src/api-client/schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const ApiErrorSchema = z\n .object({\n detail: z.string(),\n })\n .passthrough();\n\nexport const OrganizationSchema = z.object({\n id: z.union([z.string(), z.number()]),\n slug: z.string(),\n name: z.string(),\n links: z.object({\n regionUrl: z.string().url(),\n organizationUrl: z.string().url(),\n }),\n});\n\nexport const OrganizationListSchema = z.array(OrganizationSchema);\n\nexport const TeamSchema = z.object({\n id: z.union([z.string(), z.number()]),\n slug: z.string(),\n name: z.string(),\n});\n\nexport const TeamListSchema = z.array(TeamSchema);\n\nexport const ProjectSchema = z.object({\n id: z.union([z.string(), z.number()]),\n slug: z.string(),\n name: z.string(),\n});\n\nexport const ProjectListSchema = z.array(ProjectSchema);\n\nexport const ClientKeySchema = z.object({\n id: z.union([z.string(), z.number()]),\n name: z.string(),\n dsn: z.object({\n public: z.string(),\n }),\n isActive: z.boolean(),\n dateCreated: z.string().datetime(),\n});\n\nexport const ClientKeyListSchema = z.array(ClientKeySchema);\n\nexport const ReleaseSchema = z.object({\n id: z.union([z.string(), z.number()]),\n version: z.string(),\n shortVersion: z.string(),\n dateCreated: z.string().datetime(),\n dateReleased: z.string().datetime().nullable(),\n firstEvent: z.string().datetime().nullable(),\n lastEvent: z.string().datetime().nullable(),\n newGroups: z.number(),\n lastCommit: z\n .object({\n id: z.union([z.string(), z.number()]),\n message: z.string(),\n dateCreated: z.string().datetime(),\n author: z.object({\n name: z.string(),\n email: z.string(),\n }),\n })\n .nullable(),\n lastDeploy: z\n .object({\n id: z.union([z.string(), z.number()]),\n environment: z.string(),\n dateStarted: z.string().datetime().nullable(),\n dateFinished: z.string().datetime().nullable(),\n })\n .nullable(),\n projects: z.array(ProjectSchema),\n});\n\nexport const ReleaseListSchema = z.array(ReleaseSchema);\n\nexport const TagSchema = z.object({\n key: z.string(),\n name: z.string(),\n totalValues: z.number(),\n});\n\nexport const TagListSchema = z.array(TagSchema);\n\nexport const IssueSchema = z.object({\n id: z.union([z.string(), z.number()]),\n shortId: z.string(),\n title: z.string(),\n firstSeen: z.string().datetime(),\n lastSeen: z.string().datetime(),\n count: z.union([z.string(), z.number()]),\n userCount: z.union([z.string(), z.number()]),\n permalink: z.string().url(),\n project: ProjectSchema,\n platform: z.string(),\n status: z.string(),\n culprit: z.string(),\n type: z.union([z.literal(\"error\"), z.literal(\"transaction\"), z.unknown()]),\n});\n\nexport const IssueListSchema = z.array(IssueSchema);\n\nexport const FrameInterface = z\n .object({\n filename: z.string().nullable(),\n function: z.string().nullable(),\n lineNo: z.number().nullable(),\n colNo: z.number().nullable(),\n absPath: z.string().nullable(),\n module: z.string().nullable(),\n // lineno, source code\n context: z.array(z.tuple([z.number(), z.string()])),\n })\n .partial();\n\n// XXX: Sentry's schema generally speaking is \"assume all user input is missing\"\n// so we need to handle effectively every field being optional or nullable.\nexport const ExceptionInterface = z\n .object({\n mechanism: z\n .object({\n type: z.string().nullable(),\n handled: z.boolean().nullable(),\n })\n .partial(),\n type: z.string().nullable(),\n value: z.string().nullable(),\n stacktrace: z.object({\n frames: z.array(FrameInterface),\n }),\n })\n .partial();\n\nexport const ErrorEntrySchema = z.object({\n // XXX: Sentry can return either of these. Not sure why we never normalized it.\n values: z.array(ExceptionInterface.optional()),\n value: ExceptionInterface.nullable().optional(),\n});\n\nexport const RequestEntrySchema = z.object({\n method: z.string().nullable(),\n url: z.string().url().nullable(),\n // TODO:\n // query: z.array(z.tuple([z.string(), z.string()])).nullable(),\n // data: z.unknown().nullable(),\n // headers: z.array(z.tuple([z.string(), z.string()])).nullable(),\n});\n\nconst BaseEventSchema = z.object({\n id: z.string(),\n title: z.string(),\n message: z.string().nullable(),\n platform: z.string().nullable(),\n type: z.unknown(),\n entries: z.array(\n z.union([\n // TODO: there are other types\n z.object({\n type: z.literal(\"exception\"),\n data: ErrorEntrySchema,\n }),\n z.object({\n type: z.literal(\"spans\"),\n data: z.unknown(),\n }),\n z.object({\n type: z.literal(\"request\"),\n data: z.unknown(),\n }),\n z.object({\n type: z.literal(\"breadcrumbs\"),\n data: z.unknown(),\n }),\n z.object({\n type: z.string(),\n data: z.unknown(),\n }),\n ]),\n ),\n});\n\nexport const ErrorEventSchema = BaseEventSchema.omit({\n type: true,\n}).extend({\n type: z.literal(\"error\"),\n culprit: z.string().nullable(),\n dateCreated: z.string().datetime(),\n});\n\nexport const TransactionEventSchema = BaseEventSchema.omit({\n type: true,\n}).extend({\n type: z.literal(\"transaction\"),\n occurrence: z.object({\n issueTitle: z.string(),\n culprit: z.string().nullable(),\n }),\n});\n\nexport const UnknownEventSchema = BaseEventSchema.omit({\n type: true,\n}).extend({\n type: z.unknown(),\n});\n\n// XXX: This API response is kind of a disaster. We are not propagating the appropriate\n// columns and it makes this really hard to work with. Errors and Transaction-based issues\n// are completely different, for example.\nexport const EventSchema = z.union([\n ErrorEventSchema,\n TransactionEventSchema,\n UnknownEventSchema,\n]);\n\nexport const EventsResponseSchema = z.object({\n data: z.array(z.unknown()),\n meta: z\n .object({\n fields: z.record(z.string(), z.string()),\n })\n .passthrough(),\n});\n\n// https://us.sentry.io/api/0/organizations/sentry/events/?dataset=errors&field=issue&field=title&field=project&field=timestamp&field=trace&per_page=5&query=event.type%3Aerror&referrer=sentry-mcp&sort=-timestamp&statsPeriod=1w\nexport const ErrorsSearchResponseSchema = EventsResponseSchema.extend({\n data: z.array(\n z.object({\n issue: z.string(),\n \"issue.id\": z.union([z.string(), z.number()]),\n project: z.string(),\n title: z.string(),\n \"count()\": z.number(),\n \"last_seen()\": z.string(),\n }),\n ),\n});\n\nexport const SpansSearchResponseSchema = EventsResponseSchema.extend({\n data: z.array(\n z.object({\n id: z.string(),\n trace: z.string(),\n \"span.op\": z.string(),\n \"span.description\": z.string(),\n \"span.duration\": z.number(),\n transaction: z.string(),\n project: z.string(),\n timestamp: z.string(),\n }),\n ),\n});\n\nexport const AutofixRunSchema = z\n .object({\n run_id: z.union([z.string(), z.number()]),\n })\n .passthrough();\n\nconst AutofixStatusSchema = z.enum([\n \"PENDING\",\n \"PROCESSING\",\n \"IN_PROGRESS\",\n \"NEED_MORE_INFORMATION\",\n \"COMPLETED\",\n \"FAILED\",\n \"ERROR\",\n \"CANCELLED\",\n \"WAITING_FOR_USER_RESPONSE\",\n]);\n\nconst AutofixRunStepBaseSchema = z.object({\n type: z.string(),\n key: z.string(),\n index: z.number(),\n status: AutofixStatusSchema,\n title: z.string(),\n output_stream: z.string().nullable(),\n progress: z.array(\n z.object({\n data: z.unknown().nullable(),\n message: z.string(),\n timestamp: z.string(),\n type: z.enum([\"INFO\", \"WARNING\", \"ERROR\"]),\n }),\n ),\n});\n\nexport const AutofixRunStepDefaultSchema = AutofixRunStepBaseSchema.extend({\n type: z.literal(\"default\"),\n insights: z\n .array(\n z.object({\n change_diff: z.unknown().nullable(),\n generated_at_memory_index: z.number(),\n insight: z.string(),\n justification: z.string(),\n type: z.literal(\"insight\"),\n }),\n )\n .nullable(),\n}).passthrough();\n\nexport const AutofixRunStepRootCauseAnalysisSchema =\n AutofixRunStepBaseSchema.extend({\n type: z.literal(\"root_cause_analysis\"),\n causes: z.array(\n z.object({\n description: z.string(),\n id: z.number(),\n root_cause_reproduction: z.array(\n z.object({\n code_snippet_and_analysis: z.string(),\n is_most_important_event: z.boolean(),\n relevant_code_file: z\n .object({\n file_path: z.string(),\n repo_name: z.string(),\n })\n .nullable(),\n timeline_item_type: z.string(),\n title: z.string(),\n }),\n ),\n }),\n ),\n }).passthrough();\n\nexport const AutofixRunStepSolutionSchema = AutofixRunStepBaseSchema.extend({\n type: z.literal(\"solution\"),\n solution: z.array(\n z.object({\n code_snippet_and_analysis: z.string().nullable(),\n is_active: z.boolean(),\n is_most_important_event: z.boolean(),\n relevant_code_file: z.null(),\n timeline_item_type: z.union([\n z.literal(\"internal_code\"),\n z.literal(\"repro_test\"),\n ]),\n title: z.string(),\n }),\n ),\n}).passthrough();\n\nexport const AutofixRunStepSchema = z.union([\n AutofixRunStepDefaultSchema,\n AutofixRunStepRootCauseAnalysisSchema,\n AutofixRunStepSolutionSchema,\n AutofixRunStepBaseSchema.passthrough(),\n]);\n\nexport const AutofixRunStateSchema = z.object({\n autofix: z\n .object({\n run_id: z.number(),\n request: z.unknown(),\n updated_at: z.string(),\n status: AutofixStatusSchema,\n steps: z.array(AutofixRunStepSchema),\n })\n .passthrough()\n .nullable(),\n});\n"],"mappings":";;;AAEA,MAAa,iBAAiB,EAC3B,OAAO,EACN,QAAQ,EAAE,QAAQ,CACnB,EAAC,CACD,aAAa;AAEhB,MAAa,qBAAqB,EAAE,OAAO;CACzC,IAAI,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,QAAQ,AAAC,EAAC;CACrC,MAAM,EAAE,QAAQ;CAChB,MAAM,EAAE,QAAQ;CAChB,OAAO,EAAE,OAAO;EACd,WAAW,EAAE,QAAQ,CAAC,KAAK;EAC3B,iBAAiB,EAAE,QAAQ,CAAC,KAAK;CAClC,EAAC;AACH,EAAC;AAEF,MAAa,yBAAyB,EAAE,MAAM,mBAAmB;AAEjE,MAAa,aAAa,EAAE,OAAO;CACjC,IAAI,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,QAAQ,AAAC,EAAC;CACrC,MAAM,EAAE,QAAQ;CAChB,MAAM,EAAE,QAAQ;AACjB,EAAC;AAEF,MAAa,iBAAiB,EAAE,MAAM,WAAW;AAEjD,MAAa,gBAAgB,EAAE,OAAO;CACpC,IAAI,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,QAAQ,AAAC,EAAC;CACrC,MAAM,EAAE,QAAQ;CAChB,MAAM,EAAE,QAAQ;AACjB,EAAC;AAEF,MAAa,oBAAoB,EAAE,MAAM,cAAc;AAEvD,MAAa,kBAAkB,EAAE,OAAO;CACtC,IAAI,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,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jB,OAAO;IACN,WAAW,EAAE,QAAQ;IACrB,WAAW,EAAE,QAAQ;GACtB,EAAC,CACD,UAAU;GACb,oBAAoB,EAAE,QAAQ;GAC9B,OAAO,EAAE,QAAQ;EAClB,EAAC,CACH;CACF,EAAC,CACH;AACF,EAAC,CAAC,aAAa;AAElB,MAAa,+BAA+B,yBAAyB,OAAO;CAC1E,MAAM,EAAE,QAAQ,WAAW;CAC3B,UAAU,EAAE,MACV,EAAE,OAAO;EACP,2BAA2B,EAAE,QAAQ,CAAC,UAAU;EAChD,WAAW,EAAE,SAAS;EACtB,yBAAyB,EAAE,SAAS;EACpC,oBAAoB,EAAE,MAAM;EAC5B,oBAAoB,EAAE,MAAM,CAC1B,EAAE,QAAQ,gBAAgB,EAC1B,EAAE,QAAQ,aAAa,AACxB,EAAC;EACF,OAAO,EAAE,QAAQ;CAClB,EAAC,CACH;AACF,EAAC,CAAC,aAAa;AAEhB,MAAa,uBAAuB,EAAE,MAAM;CAC1C;CACA;CACA;CACA,yBAAyB,aAAa;AACvC,EAAC;AAEF,MAAa,wBAAwB,EAAE,OAAO,EAC5C,SAAS,EACN,OAAO;CACN,QAAQ,EAAE,QAAQ;CAClB,SAAS,EAAE,SAAS;CACpB,YAAY,EAAE,QAAQ;CACtB,QAAQ;CACR,OAAO,EAAE,MAAM,qBAAqB;AACrC,EAAC,CACD,aAAa,CACb,UAAU,CACd,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"toolDefinitions-BF-D81bS.js","names":[],"sources":["../src/toolDefinitions.ts"],"sourcesContent":["// TODO: this gets imported by the client code and thus is separated from server code\n// to avoid bundling issues. We'd like to find a better solution that isnt so brittle and keeps this code co-located w/ its tool calls.\nimport {\n ParamOrganizationSlug,\n ParamIssueShortId,\n ParamPlatform,\n ParamProjectSlug,\n ParamQuery,\n ParamTransaction,\n ParamRegionUrl,\n} from \"./schema\";\nimport { z } from \"zod\";\n\nexport const TOOL_DEFINITIONS = [\n {\n name: \"list_organizations\" as const,\n description: [\n \"List all organizations that the user has access to in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- View all organizations in Sentry\",\n \"- Find an organization's slug to aid other tool requests\",\n ].join(\"\\n\"),\n },\n {\n name: \"list_teams\" as const,\n description: [\n \"List all teams in an organization in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- View all teams in a Sentry organization\",\n \"- Find an team's slug to aid other tool requests\",\n \"\",\n \"<hints>\",\n \"- If you're uncertain about which organization to query, you should call `list_organizations()` first.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n },\n },\n {\n name: \"list_projects\" as const,\n description: [\n \"Retrieve a list of projects in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- View all projects in a Sentry organization\",\n \"- Find an project's slug to aid other tool requests\",\n \"\",\n \"<hints>\",\n \"- If you're uncertain about which organization to query, you should call `list_organizations()` first.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n },\n },\n {\n name: \"list_issues\" as const,\n description: [\n \"List all issues in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- View all issues in a Sentry organization\",\n \"\",\n \"If you're looking for more granular data beyond a summary of identified problems, you should use the `search_errors()` or `search_transactions()` tools instead.\",\n \"\",\n \"<examples>\",\n \"### Find the newest unresolved issues across 'my-organization'\",\n \"\",\n \"```\",\n \"list_issues(organizationSlug='my-organization', query='is:unresolved', sortBy='last_seen')\",\n \"```\",\n \"\",\n \"### Find the most frequently occurring crashes in the 'my-project' project\",\n \"\",\n \"```\",\n \"list_issues(organizationSlug='my-organization', projectSlug='my-project', query='is:unresolved error.handled:false', sortBy='count')\",\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 only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you should call `list_organizations()` first.\",\n \"- You can use the `list_tags()` tool to see what user-defined tags are available.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug.optional(),\n query: ParamQuery.optional(),\n sortBy: z\n .enum([\"last_seen\", \"first_seen\", \"count\", \"userCount\"])\n .describe(\n \"Sort the results either by the last time they occurred, the first time they occurred, the count of occurrences, or the number of users affected.\",\n )\n .optional(),\n },\n },\n {\n name: \"list_releases\" as const,\n description: [\n \"List all releases in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Find recent releases in a Sentry organization\",\n \"- Find the most recent version released of a specific project\",\n \"- Determine when a release was deployed to an environment\",\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 only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you should call `list_organizations()` first.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug.optional(),\n },\n },\n {\n name: \"list_tags\" as const,\n description: [\n \"List all tags in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Find tags available to use in searches\",\n \"\",\n \"<hints>\",\n \"- If you're uncertain about which organization to query, you should call `list_organizations()` first.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n },\n },\n {\n name: \"get_issue_details\" as const,\n description: [\n \"Retrieve issue details from Sentry for a specific Issue ID, including the stacktrace and error message if available. Either issueId or issueUrl MUST be provided.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Investigate a specific production error\",\n \"- Access detailed error information and stacktraces from Sentry\",\n \"\",\n \"<examples>\",\n \"### Get details for issue ID 'CLOUDFLARE-MCP-41'\",\n \"\",\n \"```\",\n \"get_issue_details(organizationSlug='my-organization', issueId='CLOUDFLARE-MCP-41')\",\n \"```\",\n \"\",\n \"### Get details for event ID 'c49541c747cb4d8aa3efb70ca5aba243'\",\n \"\",\n \"```\",\n \"get_event_details(organizationSlug='my-organization', eventId='c49541c747cb4d8aa3efb70ca5aba243')\",\n \"```\",\n \"</examples>\",\n\n \"<hints>\",\n \"- If the user provides the `issueUrl`, you can ignore the other parameters.\",\n \"- If the user provides `issueId` or `eventId` (only one is needed), `organizationSlug` is required.\",\n \"- If you're uncertain about which organization to query, you should call `list_organizations()` first.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n issueId: ParamIssueShortId.optional(),\n eventId: z.string().describe(\"The ID of the event.\").optional(),\n issueUrl: z\n .string()\n .url()\n .describe(\"The URL of the issue to retrieve details for.\")\n .optional(),\n },\n },\n {\n name: \"search_errors\" as const,\n description: [\n \"Query Sentry for errors using advanced search syntax.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Search for production errors in a specific file.\",\n \"- Analyze error patterns and frequencies.\",\n \"- Find recent or frequently occurring errors.\",\n \"\",\n \"<examples>\",\n \"### Find common errors within a file\",\n \"\",\n \"To find common errors within a file, you can use the `filename` parameter. This is a suffix based search, so only using the filename or the direct parent folder of the file. The parent folder is preferred when the filename is in a subfolder or a common filename. If you provide generic filenames like `index.js` you're going to end up finding errors that are might be from completely different projects.\",\n \"\",\n \"```\",\n \"search_errors(organizationSlug='my-organization', filename='index.js', sortBy='count')\",\n \"```\",\n \"\",\n \"### Find recent crashes from the 'peated' project\",\n \"\",\n \"```\",\n \"search_errors(organizationSlug='my-organization', query='is:unresolved error.handled:false', projectSlug='peated', sortBy='last_seen')\",\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 only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you should call `list_organizations()` first.\",\n \"- If you are looking for issues, in a way that you might be looking for something like 'unresolved errors', you should use the `list_issues()` tool\",\n \"- You can use the `list_tags()` tool to see what user-defined tags are available.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug.optional(),\n filename: z\n .string()\n .describe(\"The filename to search for errors in.\")\n .optional(),\n transaction: ParamTransaction.optional(),\n query: ParamQuery.optional(),\n sortBy: z\n .enum([\"last_seen\", \"count\"])\n .optional()\n .default(\"last_seen\")\n .describe(\n \"Sort the results either by the last time they occurred or the count of occurrences.\",\n ),\n },\n },\n {\n name: \"search_transactions\" as const,\n description: [\n \"Query Sentry for transactions using advanced search syntax.\",\n \"\",\n \"Transactions are segments of traces that are associated with a specific route or endpoint.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Search for production transaction data to understand performance.\",\n \"- Analyze traces and latency patterns.\",\n \"- Find examples of recent requests to endpoints.\",\n \"\",\n \"<examples>\",\n \"### Find slow requests to a route\",\n \"\",\n \"...\",\n \"\",\n \"```\",\n \"search_transactions(organizationSlug='my-organization', transaction='/checkout', sortBy='latency')\",\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 only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you might want to call `list_organizations()` first.\",\n \"- You can use the `list_tags()` tool to see what user-defined tags are available.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug.optional(),\n transaction: ParamTransaction.optional(),\n query: ParamQuery.optional(),\n sortBy: z\n .enum([\"timestamp\", \"duration\"])\n .optional()\n .default(\"timestamp\")\n .describe(\n \"Sort the results either by the timestamp of the request (most recent first) or the duration of the request (longest first).\",\n ),\n },\n },\n {\n name: \"create_team\" as const,\n description: [\n \"Create a new team in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Create a new team in a Sentry organization\",\n \"\",\n \"<hints>\",\n \"- If any parameter is ambiguous, you should clarify with the user what they meant.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n name: z.string().describe(\"The name of the team to create.\"),\n },\n },\n {\n name: \"create_project\" as const,\n description: [\n \"Create a new project in Sentry, giving you access to a new SENTRY_DSN.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Create a new project in a Sentry organization\",\n \"\",\n \"<examples>\",\n \"### Create a new javascript project in the 'my-organization' organization\",\n \"\",\n \"```\",\n \"create_project(organizationSlug='my-organization', teamSlug='my-team', name='my-project', platform='javascript')\",\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>/<teamSlug>.\",\n \"- If any parameter is ambiguous, you should clarify with the user what they meant.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n teamSlug: z.string().toLowerCase().describe(\"The team's slug.\"),\n name: z\n .string()\n .describe(\n \"The name of the project to create. Typically this is commonly the name of the repository or service. It is only used as a visual label in Sentry.\",\n ),\n platform: ParamPlatform.optional(),\n },\n },\n {\n name: \"create_dsn\" as const,\n description: [\n \"Create a new Sentry DSN for a specific project.\",\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='Default')\",\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 paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: z.string().toLowerCase().describe(\"The project's slug.\"),\n name: z.string().describe(\"The name of the DSN to create.\"),\n },\n },\n {\n name: \"list_dsns\" as const,\n description: [\n \"List all Sentry DSNs for a specific project.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Retrieve a SENTRY_DSN for a specific project\",\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 only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you might want to call `list_organizations()` first.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: z.string().toLowerCase().describe(\"The project's slug.\"),\n },\n },\n {\n name: \"begin_seer_issue_fix\" as const,\n description: [\n \"Use Seer to analyze an issue in Sentry, identify a root cause, and suggest a fix for it.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Determine the root cause of an issue.\",\n \"- Generate a plan for fixing an issue.\",\n \"- Implement a fix for an issue.\",\n \"\",\n \"This operation may take some time, so you should call `get_seer_issue_fix_status()` to check the status of the analysis after you begin it.\",\n \"\",\n \"<examples>\",\n \"### Analyze and propose a fix for 'ISSUE-123' in Sentry\",\n \"\",\n \"```\",\n \"begin_seer_issue_fix(organizationSlug='my-organization', issueId='ISSUE-123')\",\n \"```\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- Always check to see if an issue fix is already in progress for before calling this tool by using `get_seer_issue_fix_status()`.\",\n \"- If the user provides the issueUrl, you can ignore the organizationSlug and issueId parameters.\",\n \"- If you're uncertain about which organization to query, you should call `list_organizations()` first. This especially important if an issueId is passed.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n issueId: ParamIssueShortId.optional(),\n issueUrl: z\n .string()\n .url()\n .describe(\"The URL of the issue to retrieve details for.\")\n .optional(),\n },\n },\n {\n name: \"get_seer_issue_fix_status\" as const,\n description: [\n \"Get the status of a root cause analysis for an issue in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Get the root cause analysis for an issue.\",\n \"- Get the status of a fix for an issue.\",\n \"\",\n \"<examples>\",\n \"### Get the status of a fix for the 'ISSUE-123' issue\",\n \"\",\n \"```\",\n \"get_seer_issue_fix_status(organizationSlug='my-organization', issueId='ISSUE-123')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user provides the issueUrl, you can ignore the organizationSlug and issueId parameters.\",\n \"- If you're uncertain about which organization to query, you should call `list_organizations()` first. This especially important if an issueId is passed.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n issueId: ParamIssueShortId.optional(),\n issueUrl: z\n .string()\n .url()\n .describe(\"The URL of the issue to retrieve details for.\")\n .optional(),\n },\n },\n];\n"],"mappings":";;;;AAaA,MAAa,mBAAmB;CAC9B;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;CACb;CACD;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;EACZ,cAAc;GACZ,kBAAkB,sBAAsB,UAAU;GAClD,WAAW,eAAe,UAAU;EACrC;CACF;CACD;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;EACZ,cAAc;GACZ,kBAAkB,sBAAsB,UAAU;GAClD,WAAW,eAAe,UAAU;EACrC;CACF;CACD;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;EACZ,cAAc;GACZ,kBAAkB,sBAAsB,UAAU;GAClD,WAAW,eAAe,UAAU;GACpC,aAAa,iBAAiB,UAAU;GACxC,OAAO,WAAW,UAAU;GAC5B,QAAQ,EACL,KAAK;IAAC;IAAa;IAAc;IAAS;GAAY,EAAC,CACvD,SACC,mJACD,CACA,UAAU;EACd;CACF;CACD;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;EACZ,cAAc;GACZ,kBAAkB,sBAAsB,UAAU;GAClD,WAAW,eAAe,UAAU;GACpC,aAAa,iBAAiB,UAAU;EACzC;CACF;CACD;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;EACZ,cAAc;GACZ,kBAAkB,sBAAsB,UAAU;GAClD,WAAW,eAAe,UAAU;EACrC;CACF;CACD;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GAEA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;EACZ,cAAc;GACZ,kBAAkB,sBAAsB,UAAU;GAClD,WAAW,eAAe,UA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DAAgD,CACzD,UAAU;EACd;CACF;CACD;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;EACZ,cAAc;GACZ,kBAAkB,sBAAsB,UAAU;GAClD,WAAW,eAAe,UAAU;GACpC,SAAS,kBAAkB,UAAU;GACrC,UAAU,EACP,QAAQ,CACR,KAAK,CACL,SAAS,gDAAgD,CACzD,UAAU;EACd;CACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"toolDefinitions-CCscRQoM.d.ts","names":[],"sources":["../src/toolDefinitions.ts"],"sourcesContent":null,"mappings":";;;cAaa;;EAAA,WAAA,EAAA,MAqbZ;EAAA,YAAA,CAAA,EAAA,SAAA;CAAA,GAAA;;;;oCAAA,CAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"toolDefinitions-CO65cU86.cjs","names":[],"sources":["../src/toolDefinitions.ts"],"sourcesContent":["// TODO: this gets imported by the client code and thus is separated from server code\n// to avoid bundling issues. We'd like to find a better solution that isnt so brittle and keeps this code co-located w/ its tool calls.\nimport {\n ParamOrganizationSlug,\n ParamIssueShortId,\n ParamPlatform,\n ParamProjectSlug,\n ParamQuery,\n ParamTransaction,\n ParamRegionUrl,\n} from \"./schema\";\nimport { z } from \"zod\";\n\nexport const TOOL_DEFINITIONS = [\n {\n name: \"list_organizations\" as const,\n description: [\n \"List all organizations that the user has access to in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- View all organizations in Sentry\",\n \"- Find an organization's slug to aid other tool requests\",\n ].join(\"\\n\"),\n },\n {\n name: \"list_teams\" as const,\n description: [\n \"List all teams in an organization in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- View all teams in a Sentry organization\",\n \"- Find an team's slug to aid other tool requests\",\n \"\",\n \"<hints>\",\n \"- If you're uncertain about which organization to query, you should call `list_organizations()` first.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n },\n },\n {\n name: \"list_projects\" as const,\n description: [\n \"Retrieve a list of projects in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- View all projects in a Sentry organization\",\n \"- Find an project's slug to aid other tool requests\",\n \"\",\n \"<hints>\",\n \"- If you're uncertain about which organization to query, you should call `list_organizations()` first.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n },\n },\n {\n name: \"list_issues\" as const,\n description: [\n \"List all issues in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- View all issues in a Sentry organization\",\n \"\",\n \"If you're looking for more granular data beyond a summary of identified problems, you should use the `search_errors()` or `search_transactions()` tools instead.\",\n \"\",\n \"<examples>\",\n \"### Find the newest unresolved issues across 'my-organization'\",\n \"\",\n \"```\",\n \"list_issues(organizationSlug='my-organization', query='is:unresolved', sortBy='last_seen')\",\n \"```\",\n \"\",\n \"### Find the most frequently occurring crashes in the 'my-project' project\",\n \"\",\n \"```\",\n \"list_issues(organizationSlug='my-organization', projectSlug='my-project', query='is:unresolved error.handled:false', sortBy='count')\",\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 only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you should call `list_organizations()` first.\",\n \"- You can use the `list_tags()` tool to see what user-defined tags are available.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug.optional(),\n query: ParamQuery.optional(),\n sortBy: z\n .enum([\"last_seen\", \"first_seen\", \"count\", \"userCount\"])\n .describe(\n \"Sort the results either by the last time they occurred, the first time they occurred, the count of occurrences, or the number of users affected.\",\n )\n .optional(),\n },\n },\n {\n name: \"list_releases\" as const,\n description: [\n \"List all releases in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Find recent releases in a Sentry organization\",\n \"- Find the most recent version released of a specific project\",\n \"- Determine when a release was deployed to an environment\",\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 only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you should call `list_organizations()` first.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug.optional(),\n },\n },\n {\n name: \"list_tags\" as const,\n description: [\n \"List all tags in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Find tags available to use in searches\",\n \"\",\n \"<hints>\",\n \"- If you're uncertain about which organization to query, you should call `list_organizations()` first.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n },\n },\n {\n name: \"get_issue_details\" as const,\n description: [\n \"Retrieve issue details from Sentry for a specific Issue ID, including the stacktrace and error message if available. Either issueId or issueUrl MUST be provided.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Investigate a specific production error\",\n \"- Access detailed error information and stacktraces from Sentry\",\n \"\",\n \"<examples>\",\n \"### Get details for issue ID 'CLOUDFLARE-MCP-41'\",\n \"\",\n \"```\",\n \"get_issue_details(organizationSlug='my-organization', issueId='CLOUDFLARE-MCP-41')\",\n \"```\",\n \"\",\n \"### Get details for event ID 'c49541c747cb4d8aa3efb70ca5aba243'\",\n \"\",\n \"```\",\n \"get_event_details(organizationSlug='my-organization', eventId='c49541c747cb4d8aa3efb70ca5aba243')\",\n \"```\",\n \"</examples>\",\n\n \"<hints>\",\n \"- If the user provides the `issueUrl`, you can ignore the other parameters.\",\n \"- If the user provides `issueId` or `eventId` (only one is needed), `organizationSlug` is required.\",\n \"- If you're uncertain about which organization to query, you should call `list_organizations()` first.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n issueId: ParamIssueShortId.optional(),\n eventId: z.string().describe(\"The ID of the event.\").optional(),\n issueUrl: z\n .string()\n .url()\n .describe(\"The URL of the issue to retrieve details for.\")\n .optional(),\n },\n },\n {\n name: \"search_errors\" as const,\n description: [\n \"Query Sentry for errors using advanced search syntax.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Search for production errors in a specific file.\",\n \"- Analyze error patterns and frequencies.\",\n \"- Find recent or frequently occurring errors.\",\n \"\",\n \"<examples>\",\n \"### Find common errors within a file\",\n \"\",\n \"To find common errors within a file, you can use the `filename` parameter. This is a suffix based search, so only using the filename or the direct parent folder of the file. The parent folder is preferred when the filename is in a subfolder or a common filename. If you provide generic filenames like `index.js` you're going to end up finding errors that are might be from completely different projects.\",\n \"\",\n \"```\",\n \"search_errors(organizationSlug='my-organization', filename='index.js', sortBy='count')\",\n \"```\",\n \"\",\n \"### Find recent crashes from the 'peated' project\",\n \"\",\n \"```\",\n \"search_errors(organizationSlug='my-organization', query='is:unresolved error.handled:false', projectSlug='peated', sortBy='last_seen')\",\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 only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you should call `list_organizations()` first.\",\n \"- If you are looking for issues, in a way that you might be looking for something like 'unresolved errors', you should use the `list_issues()` tool\",\n \"- You can use the `list_tags()` tool to see what user-defined tags are available.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug.optional(),\n filename: z\n .string()\n .describe(\"The filename to search for errors in.\")\n .optional(),\n transaction: ParamTransaction.optional(),\n query: ParamQuery.optional(),\n sortBy: z\n .enum([\"last_seen\", \"count\"])\n .optional()\n .default(\"last_seen\")\n .describe(\n \"Sort the results either by the last time they occurred or the count of occurrences.\",\n ),\n },\n },\n {\n name: \"search_transactions\" as const,\n description: [\n \"Query Sentry for transactions using advanced search syntax.\",\n \"\",\n \"Transactions are segments of traces that are associated with a specific route or endpoint.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Search for production transaction data to understand performance.\",\n \"- Analyze traces and latency patterns.\",\n \"- Find examples of recent requests to endpoints.\",\n \"\",\n \"<examples>\",\n \"### Find slow requests to a route\",\n \"\",\n \"...\",\n \"\",\n \"```\",\n \"search_transactions(organizationSlug='my-organization', transaction='/checkout', sortBy='latency')\",\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 only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you might want to call `list_organizations()` first.\",\n \"- You can use the `list_tags()` tool to see what user-defined tags are available.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug.optional(),\n transaction: ParamTransaction.optional(),\n query: ParamQuery.optional(),\n sortBy: z\n .enum([\"timestamp\", \"duration\"])\n .optional()\n .default(\"timestamp\")\n .describe(\n \"Sort the results either by the timestamp of the request (most recent first) or the duration of the request (longest first).\",\n ),\n },\n },\n {\n name: \"create_team\" as const,\n description: [\n \"Create a new team in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Create a new team in a Sentry organization\",\n \"\",\n \"<hints>\",\n \"- If any parameter is ambiguous, you should clarify with the user what they meant.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n name: z.string().describe(\"The name of the team to create.\"),\n },\n },\n {\n name: \"create_project\" as const,\n description: [\n \"Create a new project in Sentry, giving you access to a new SENTRY_DSN.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Create a new project in a Sentry organization\",\n \"\",\n \"<examples>\",\n \"### Create a new javascript project in the 'my-organization' organization\",\n \"\",\n \"```\",\n \"create_project(organizationSlug='my-organization', teamSlug='my-team', name='my-project', platform='javascript')\",\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>/<teamSlug>.\",\n \"- If any parameter is ambiguous, you should clarify with the user what they meant.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n teamSlug: z.string().toLowerCase().describe(\"The team's slug.\"),\n name: z\n .string()\n .describe(\n \"The name of the project to create. Typically this is commonly the name of the repository or service. It is only used as a visual label in Sentry.\",\n ),\n platform: ParamPlatform.optional(),\n },\n },\n {\n name: \"create_dsn\" as const,\n description: [\n \"Create a new Sentry DSN for a specific project.\",\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='Default')\",\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 paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: z.string().toLowerCase().describe(\"The project's slug.\"),\n name: z.string().describe(\"The name of the DSN to create.\"),\n },\n },\n {\n name: \"list_dsns\" as const,\n description: [\n \"List all Sentry DSNs for a specific project.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Retrieve a SENTRY_DSN for a specific project\",\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 only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you might want to call `list_organizations()` first.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: z.string().toLowerCase().describe(\"The project's slug.\"),\n },\n },\n {\n name: \"begin_seer_issue_fix\" as const,\n description: [\n \"Use Seer to analyze an issue in Sentry, identify a root cause, and suggest a fix for it.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Determine the root cause of an issue.\",\n \"- Generate a plan for fixing an issue.\",\n \"- Implement a fix for an issue.\",\n \"\",\n \"This operation may take some time, so you should call `get_seer_issue_fix_status()` to check the status of the analysis after you begin it.\",\n \"\",\n \"<examples>\",\n \"### Analyze and propose a fix for 'ISSUE-123' in Sentry\",\n \"\",\n \"```\",\n \"begin_seer_issue_fix(organizationSlug='my-organization', issueId='ISSUE-123')\",\n \"```\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- Always check to see if an issue fix is already in progress for before calling this tool by using `get_seer_issue_fix_status()`.\",\n \"- If the user provides the issueUrl, you can ignore the organizationSlug and issueId parameters.\",\n \"- If you're uncertain about which organization to query, you should call `list_organizations()` first. This especially important if an issueId is passed.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n issueId: ParamIssueShortId.optional(),\n issueUrl: z\n .string()\n .url()\n .describe(\"The URL of the issue to retrieve details for.\")\n .optional(),\n },\n },\n {\n name: \"get_seer_issue_fix_status\" as const,\n description: [\n \"Get the status of a root cause analysis for an issue in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Get the root cause analysis for an issue.\",\n \"- Get the status of a fix for an issue.\",\n \"\",\n \"<examples>\",\n \"### Get the status of a fix for the 'ISSUE-123' issue\",\n \"\",\n \"```\",\n \"get_seer_issue_fix_status(organizationSlug='my-organization', issueId='ISSUE-123')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user provides the issueUrl, you can ignore the organizationSlug and issueId parameters.\",\n \"- If you're uncertain about which organization to query, you should call `list_organizations()` first. This especially important if an issueId is passed.\",\n \"</hints>\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n issueId: ParamIssueShortId.optional(),\n issueUrl: z\n .string()\n .url()\n .describe(\"The URL of the issue to retrieve details for.\")\n .optional(),\n },\n },\n];\n"],"mappings":";;;;;;AAaA,MAAa,mBAAmB;CAC9B;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;CACb;CACD;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;EACZ,cAAc;GACZ,kBAAkB,qCAAsB,UAAU;GAClD,WAAW,8BAAe,UAAU;EACrC;CACF;CACD;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;EACZ,cAAc;GACZ,kBAAkB,qCAAsB,UAAU;GAClD,WAAW,8BAAe,UAAU;EACrC;CACF;CACD;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;EACZ,cAAc;GACZ,kBAAkB,qCAAsB,UAAU;GAClD,WAAW,8BAAe,UAAU;GACpC,aAAa,gCAAiB,UAAU;GACxC,OAAO,0BAAW,UAAU;GAC5B,QAAQ,MACL,KAAK;IAAC;IAAa;IAAc;IAAS;GAAY,EAAC,CACvD,SACC,mJACD,CACA,UAAU;EACd;CACF;CACD;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;EACZ,cAAc;GACZ,kBAAkB,qCAAsB,UAAU;GAClD,WAAW,8BAAe,UAAU;GACpC,aAAa,gCAAiB,UAAU;EACzC;CACF;CACD;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;EACZ,cAAc;GACZ,kBAAkB,qCAAsB,UAAU;GAClD,WAAW,8BAAe,UAAU;EACrC;CACF;CACD;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GAEA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;EACZ,cAAc;GACZ,kBAAkB,qCAAsB,UAAU;GAClD,WAAW,8BAAe,UAAU;GACpC,SAAS,iCAAkB,UAAU;GACrC,SAAS,MAAE,QAAQ,CAAC,SAAS,uBAAuB,CAAC,UAAU;GAC/D,UAAU,MACP,QAAQ,CACR,KAAK,CACL,SAAS,gDAAgD,CACzD,UAAU;EACd;CACF;CACD;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;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,CAAC,SAAS,mBAAmB;GAC/D,MAAM,MACH,QAAQ,CACR,SACC,oJACD;GACH,UAAU,6BAAc,UAAU;EACnC;CACF;CACD;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;EACZ,cAAc;GACZ,kBAAkB,qCAAsB,UAAU;GAClD,WAAW,8BAAe,UAAU;GACpC,aAAa,MAAE,QAAQ,CAAC,aAAa,CAAC,SAAS,sBAAsB;GACrE,MAAM,MAAE,QAAQ,CAAC,SAAS,iCAAiC;EAC5D;CACF;CACD;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;EACZ,cAAc;GACZ,kBAAkB,qCAAsB,UAAU;GAClD,WAAW,8BAAe,UAAU;GACpC,aAAa,MAAE,QAAQ,CAAC,aAAa,CAAC,SAAS,sBAAsB;EACtE;CACF;CACD;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;EACZ,cAAc;GACZ,kBAAkB,qCAAsB,UAAU;GAClD,WAAW,8BAAe,UAAU;GACpC,SAAS,iCAAkB,UAAU;GACrC,UAAU,MACP,QAAQ,CACR,KAAK,CACL,SAAS,gDAAgD,CACzD,UAAU;EACd;CACF;CACD;EACE,MAAM;EACN,aAAa;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;EACZ,cAAc;GACZ,kBAAkB,qCAAsB,UAAU;GAClD,WAAW,8BAAe,UAAU;GACpC,SAAS,iCAAkB,UAAU;GACrC,UAAU,MACP,QAAQ,CACR,KAAK,CACL,SAAS,gDAAgD,CACzD,UAAU;EACd;CACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"toolDefinitions-K_TVqaLU.d.cts","names":[],"sources":["../src/toolDefinitions.ts"],"sourcesContent":null,"mappings":";;;cAaa;;EAAA,WAAA,EAAA,MAqbZ;EAAA,YAAA,CAAA,EAAA,SAAA;CAAA,GAAA;;;;oCAAA,CAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools-B8ufMRZx.js","names":["context: ServerContext","opts: { regionUrl?: string }","orgSlug","issue","event","clientKey: ClientKey | null","step: z.infer<typeof AutofixRunStepSchema>","typedStep"],"sources":["../src/tools.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport {\n type AutofixRunStepDefaultSchema,\n type AutofixRunStepRootCauseAnalysisSchema,\n type AutofixRunStepSchema,\n type AutofixRunStepSolutionSchema,\n type ClientKey,\n SentryApiService,\n} from \"./api-client/index\";\nimport { formatIssueOutput } from \"./internal/formatting\";\nimport { parseIssueParams } from \"./internal/issue-helpers\";\nimport { logError } from \"./logging\";\nimport type { ServerContext, ToolHandlers } from \"./types\";\nimport { setTag } from \"@sentry/core\";\n\nfunction apiServiceFromContext(\n context: ServerContext,\n opts: { regionUrl?: string } = {},\n) {\n return new SentryApiService({\n host: opts.regionUrl ? new URL(opts.regionUrl).host : context.host,\n accessToken: context.accessToken,\n });\n}\n\nexport const TOOL_HANDLERS = {\n list_organizations: async (context) => {\n const apiService = apiServiceFromContext(context);\n const organizations = await apiService.listOrganizations();\n\n let output = \"# Organizations\\n\\n\";\n\n if (organizations.length === 0) {\n output += \"You don't appear to be a member of any organizations.\\n\";\n return output;\n }\n\n output += organizations\n .map((org) =>\n [\n `## **${org.slug}**`,\n \"\",\n `**Web URL:** ${org.links.organizationUrl}`,\n `**Region URL:** ${org.links.regionUrl}`,\n ].join(\"\\n\"),\n )\n .join(\"\\n\\n\");\n\n output += \"\\n\\n# Using this information\\n\\n\";\n output += `- The organization's name is the identifier for the organization, and is used in many tools for \\`organizationSlug\\`.\\n`;\n output += `- If a tool supports passing in the \\`regionUrl\\`, you should also pass in the correct value there.\\n`;\n\n return output;\n },\n list_teams: async (context, params) => {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n let organizationSlug = params.organizationSlug;\n if (!organizationSlug && context.organizationSlug) {\n organizationSlug = context.organizationSlug;\n }\n if (!organizationSlug) {\n throw new Error(\"Organization slug is required\");\n }\n setTag(\"organization.slug\", organizationSlug);\n\n const teams = await apiService.listTeams(organizationSlug);\n let output = `# Teams in **${organizationSlug}**\\n\\n`;\n if (teams.length === 0) {\n output += \"No teams found.\\n\";\n return output;\n }\n output += teams.map((team) => `- ${team.slug}\\n`).join(\"\");\n return output;\n },\n list_projects: async (context, params) => {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n let organizationSlug = params.organizationSlug;\n if (!organizationSlug && context.organizationSlug) {\n organizationSlug = context.organizationSlug;\n }\n if (!organizationSlug) {\n throw new Error(\"Organization slug is required\");\n }\n setTag(\"organization.slug\", organizationSlug);\n\n const projects = await apiService.listProjects(organizationSlug);\n let output = `# Projects in **${organizationSlug}**\\n\\n`;\n if (projects.length === 0) {\n output += \"No projects found.\\n\";\n return output;\n }\n output += projects.map((project) => `- **${project.slug}**\\n`).join(\"\");\n return output;\n },\n list_issues: async (context, params) => {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n let organizationSlug = params.organizationSlug;\n if (!organizationSlug && context.organizationSlug) {\n organizationSlug = context.organizationSlug;\n }\n if (!organizationSlug) {\n throw new Error(\"Organization slug is required\");\n }\n setTag(\"organization.slug\", organizationSlug);\n\n const sortByMap = {\n last_seen: \"date\" as const,\n first_seen: \"new\" as const,\n count: \"freq\" as const,\n userCount: \"user\" as const,\n };\n const issues = await apiService.listIssues({\n organizationSlug,\n projectSlug: params.projectSlug,\n query: params.query,\n sortBy: params.sortBy\n ? sortByMap[params.sortBy as keyof typeof sortByMap]\n : undefined,\n });\n let output = `# Issues in **${organizationSlug}${params.projectSlug ? `/${params.projectSlug}` : \"\"}**\\n\\n`;\n if (issues.length === 0) {\n output += \"No issues found.\\n\";\n return output;\n }\n output += issues\n .map((issue) =>\n [\n `## ${issue.shortId}`,\n \"\",\n `**Description**: ${issue.title}`,\n `**Culprit**: ${issue.culprit}`,\n `**First Seen**: ${new Date(issue.firstSeen).toISOString()}`,\n `**Last Seen**: ${new Date(issue.lastSeen).toISOString()}`,\n `**URL**: ${apiService.getIssueUrl(organizationSlug, issue.shortId)}`,\n ].join(\"\\n\"),\n )\n .join(\"\\n\\n\");\n output += \"\\n\\n\";\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the Issue ID in commit messages (e.g. \\`Fixes <issueID>\\`) to automatically close the issue when the commit is merged.\\n`;\n output += `- You can get more details about a specific issue by using the tool: \\`get_issue_details(organizationSlug=\"${organizationSlug}\", issueId=<issueID>)\\`\\n`;\n return output;\n },\n list_releases: async (context, params) => {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n let organizationSlug = params.organizationSlug;\n if (!organizationSlug && context.organizationSlug) {\n organizationSlug = context.organizationSlug;\n }\n if (!organizationSlug) {\n throw new Error(\"Organization slug is required\");\n }\n setTag(\"organization.slug\", organizationSlug);\n\n const releases = await apiService.listReleases({\n organizationSlug,\n projectSlug: params.projectSlug,\n });\n let output = `# Releases in **${organizationSlug}${params.projectSlug ? `/${params.projectSlug}` : \"\"}**\\n\\n`;\n if (releases.length === 0) {\n output += \"No releases found.\\n\";\n return output;\n }\n output += releases\n .map((release) => {\n const releaseInfo = [\n `## ${release.shortVersion}`,\n \"\",\n `**Created**: ${new Date(release.dateCreated).toISOString()}`,\n ];\n if (release.dateReleased) {\n releaseInfo.push(\n `**Released**: ${new Date(release.dateReleased).toISOString()}`,\n );\n }\n if (release.firstEvent) {\n releaseInfo.push(\n `**First Event**: ${new Date(release.firstEvent).toISOString()}`,\n );\n }\n if (release.lastEvent) {\n releaseInfo.push(\n `**Last Event**: ${new Date(release.lastEvent).toISOString()}`,\n );\n }\n if (release.newGroups !== undefined) {\n releaseInfo.push(`**New Issues**: ${release.newGroups}`);\n }\n if (release.projects && release.projects.length > 0) {\n releaseInfo.push(\n `**Projects**: ${release.projects.map((p) => p.name).join(\", \")}`,\n );\n }\n if (release.lastCommit) {\n releaseInfo.push(\"\", `### Last Commit`, \"\");\n releaseInfo.push(`**Commit ID**: ${release.lastCommit.id}`);\n releaseInfo.push(`**Commit Message**: ${release.lastCommit.message}`);\n releaseInfo.push(\n `**Commit Author**: ${release.lastCommit.author.name}`,\n );\n releaseInfo.push(\n `**Commit Date**: ${new Date(release.lastCommit.dateCreated).toISOString()}`,\n );\n }\n if (release.lastDeploy) {\n releaseInfo.push(\"\", `### Last Deploy`, \"\");\n releaseInfo.push(`**Deploy ID**: ${release.lastDeploy.id}`);\n releaseInfo.push(\n `**Environment**: ${release.lastDeploy.environment}`,\n );\n if (release.lastDeploy.dateStarted) {\n releaseInfo.push(\n `**Deploy Started**: ${new Date(release.lastDeploy.dateStarted).toISOString()}`,\n );\n }\n if (release.lastDeploy.dateFinished) {\n releaseInfo.push(\n `**Deploy Finished**: ${new Date(release.lastDeploy.dateFinished).toISOString()}`,\n );\n }\n }\n return releaseInfo.join(\"\\n\");\n })\n .join(\"\\n\\n\");\n output += \"\\n\\n\";\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the Release version in commit messages or documentation.\\n`;\n output += `- You can search for issues in a specific release using the \\`search_errors()\\` tool with the query \\`release:${releases.length ? releases[0]!.version : \"VERSION\"}\\`.\\n`;\n return output;\n },\n list_tags: async (context, params) => {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n let organizationSlug = params.organizationSlug;\n if (!organizationSlug && context.organizationSlug) {\n organizationSlug = context.organizationSlug;\n }\n if (!organizationSlug) {\n throw new Error(\"Organization slug is required\");\n }\n setTag(\"organization.slug\", organizationSlug);\n\n const tagList = await apiService.listTags({ organizationSlug }, {});\n let output = `# Tags in **${organizationSlug}**\\n\\n`;\n if (tagList.length === 0) {\n output += \"No tags found.\\n\";\n return output;\n }\n output += tagList.map((tag) => [`- ${tag.key}`].join(\"\\n\")).join(\"\\n\");\n output += \"\\n\\n\";\n output += \"# Using this information\\n\\n\";\n output += `- You can reference tags in the \\`query\\` parameter of various tools: \\`tagName:tagValue\\`.\\n`;\n return output;\n },\n get_issue_details: async (context, params) => {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n\n if (params.eventId) {\n const orgSlug = params.organizationSlug ?? context.organizationSlug;\n if (!orgSlug) {\n throw new Error(\"Organization slug is required\");\n }\n setTag(\"organization.slug\", orgSlug);\n const [issue] = await apiService.listIssues({\n organizationSlug: orgSlug,\n query: params.eventId,\n });\n if (!issue) {\n return `# Event Not Found\\n\\nNo issue found for Event ID: ${params.eventId}`;\n }\n const event = await apiService.getEventForIssue({\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n eventId: params.eventId,\n });\n return formatIssueOutput({\n organizationSlug: orgSlug,\n issue,\n event,\n apiService,\n });\n }\n\n const { organizationSlug: orgSlug, issueId: parsedIssueId } =\n parseIssueParams({\n organizationSlug: params.organizationSlug ?? context.organizationSlug,\n issueId: params.issueId,\n issueUrl: params.issueUrl,\n });\n setTag(\"organization.slug\", orgSlug);\n\n const [issue, event] = await Promise.all([\n apiService.getIssue({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n }),\n apiService.getLatestEventForIssue({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n }),\n ]);\n\n return formatIssueOutput({\n organizationSlug: orgSlug,\n issue,\n event,\n apiService,\n });\n },\n search_errors: async (context, params) => {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n let organizationSlug = params.organizationSlug;\n if (!organizationSlug && context.organizationSlug) {\n organizationSlug = context.organizationSlug;\n }\n if (!organizationSlug) {\n throw new Error(\"Organization slug is required\");\n }\n setTag(\"organization.slug\", organizationSlug);\n\n const eventList = await apiService.searchErrors({\n organizationSlug,\n projectSlug: params.projectSlug,\n filename: params.filename,\n query: params.query,\n transaction: params.transaction,\n sortBy: params.sortBy as \"last_seen\" | \"count\" | undefined,\n });\n let output = `# Errors in **${organizationSlug}${params.projectSlug ? `/${params.projectSlug}` : \"\"}**\\n\\n`;\n if (params.query)\n output += `These errors match the query \\`${params.query}\\`\\n`;\n if (params.filename)\n output += `These errors are limited to the file suffix \\`${params.filename}\\`\\n`;\n output += \"\\n\";\n if (eventList.length === 0) {\n output += `No results found\\n\\n`;\n output += `We searched within the ${organizationSlug} organization.\\n\\n`;\n return output;\n }\n for (const eventSummary of eventList) {\n output += `## ${eventSummary.issue}\\n\\n`;\n output += `**Description**: ${eventSummary.title}\\n`;\n output += `**Issue ID**: ${eventSummary.issue}\\n`;\n output += `**URL**: ${apiService.getIssueUrl(organizationSlug, eventSummary.issue)}\\n`;\n output += `**Project**: ${eventSummary.project}\\n`;\n output += `**Last Seen**: ${eventSummary[\"last_seen()\"]}\\n`;\n output += `**Occurrences**: ${eventSummary[\"count()\"]}\\n\\n`;\n }\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the Issue ID in commit messages (e.g. \\`Fixes <issueID>\\`) to automatically close the issue when the commit is merged.\\n`;\n output += `- You can get more details about an error by using the tool: \\`get_issue_details(organizationSlug=\"${organizationSlug}\", issueId=<issueID>)\\`\\n`;\n return output;\n },\n search_transactions: async (context, params) => {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n let organizationSlug = params.organizationSlug;\n if (!organizationSlug && context.organizationSlug) {\n organizationSlug = context.organizationSlug;\n }\n if (!organizationSlug) {\n throw new Error(\"Organization slug is required\");\n }\n setTag(\"organization.slug\", organizationSlug);\n\n const eventList = await apiService.searchSpans({\n organizationSlug,\n projectSlug: params.projectSlug,\n transaction: params.transaction,\n query: params.query,\n sortBy: params.sortBy as \"timestamp\" | \"duration\" | undefined,\n });\n let output = `# Transactions in **${organizationSlug}${params.projectSlug ? `/${params.projectSlug}` : \"\"}**\\n\\n`;\n if (params.query)\n output += `These spans match the query \\`${params.query}\\`\\n`;\n if (params.transaction)\n output += `These spans are limited to the transaction \\`${params.transaction}\\`\\n`;\n output += \"\\n\";\n if (eventList.length === 0) {\n output += `No results found\\n\\n`;\n output += `We searched within the ${organizationSlug} organization.\\n\\n`;\n return output;\n }\n for (const eventSummary of eventList) {\n output += `## ${eventSummary.transaction}\\n\\n`;\n output += `**Span ID**: ${eventSummary.id}\\n`;\n output += `**Trace ID**: ${eventSummary.trace}\\n`;\n output += `**Span Operation**: ${eventSummary[\"span.op\"]}\\n`;\n output += `**Span Description**: ${eventSummary[\"span.description\"]}\\n`;\n output += `**Duration**: ${eventSummary[\"span.duration\"]}\\n`;\n output += `**Timestamp**: ${eventSummary.timestamp}\\n`;\n output += `**Project**: ${eventSummary.project}\\n`;\n output += `**URL**: ${apiService.getTraceUrl(organizationSlug, eventSummary.trace)}\\n\\n`;\n }\n return output;\n },\n create_team: async (context, params) => {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n let organizationSlug = params.organizationSlug;\n if (!organizationSlug && context.organizationSlug) {\n organizationSlug = context.organizationSlug;\n }\n if (!organizationSlug) {\n throw new Error(\"Organization slug is required\");\n }\n setTag(\"organization.slug\", organizationSlug);\n\n const team = await apiService.createTeam({\n organizationSlug,\n name: params.name,\n });\n let output = `# New Team in **${organizationSlug}**\\n\\n`;\n output += `**ID**: ${team.id}\\n`;\n output += `**Slug**: ${team.slug}\\n`;\n output += `**Name**: ${team.name}\\n`;\n output += \"# Using this information\\n\\n\";\n output += `- You should always inform the user of the Team Slug value.\\n`;\n return output;\n },\n create_project: async (context, params) => {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n let organizationSlug = params.organizationSlug;\n if (!organizationSlug && context.organizationSlug) {\n organizationSlug = context.organizationSlug;\n }\n if (!organizationSlug) {\n throw new Error(\"Organization slug is required\");\n }\n setTag(\"organization.slug\", organizationSlug);\n\n const project = await apiService.createProject({\n organizationSlug,\n teamSlug: params.teamSlug,\n name: params.name,\n platform: params.platform,\n });\n let clientKey: ClientKey | null = null;\n try {\n clientKey = await apiService.createClientKey({\n organizationSlug,\n projectSlug: project.slug,\n name: \"Default\",\n });\n } catch (err) {\n logError(err);\n }\n let output = `# New Project in **${organizationSlug}**\\n\\n`;\n output += `**ID**: ${project.id}\\n`;\n output += `**Slug**: ${project.slug}\\n`;\n output += `**Name**: ${project.name}\\n`;\n if (clientKey) {\n output += `**SENTRY_DSN**: ${clientKey?.dsn.public}\\n\\n`;\n } else {\n output += \"**SENTRY_DSN**: There was an error fetching this value.\\n\\n\";\n }\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the **SENTRY_DSN** value to initialize Sentry's SDKs.\\n`;\n output += `- You should always inform the user of the **SENTRY_DSN** and Project Slug values.\\n`;\n return output;\n },\n create_dsn: async (context, params) => {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n let organizationSlug = params.organizationSlug;\n if (!organizationSlug && context.organizationSlug) {\n organizationSlug = context.organizationSlug;\n }\n if (!organizationSlug) {\n throw new Error(\"Organization slug is required\");\n }\n setTag(\"organization.slug\", organizationSlug);\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 list_dsns: async (context, params) => {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n let organizationSlug = params.organizationSlug;\n if (!organizationSlug && context.organizationSlug) {\n organizationSlug = context.organizationSlug;\n }\n if (!organizationSlug) {\n throw new Error(\"Organization slug is required\");\n }\n setTag(\"organization.slug\", organizationSlug);\n\n const clientKeys = await apiService.listClientKeys({\n organizationSlug,\n projectSlug: params.projectSlug,\n });\n let output = `# DSNs in **${organizationSlug}/${params.projectSlug}**\\n\\n`;\n if (clientKeys.length === 0) {\n output +=\n \"No DSNs were found.\\n\\nYou can create new one using the `create_dsn` tool.\";\n return output;\n }\n for (const clientKey of clientKeys) {\n output += `## ${clientKey.name}\\n`;\n output += `**ID**: ${clientKey.id}\\n`;\n output += `**DSN**: ${clientKey.dsn.public}\\n\\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 begin_seer_issue_fix: async (context, params) => {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const { organizationSlug: orgSlug, issueId: parsedIssueId } =\n parseIssueParams({\n organizationSlug: params.organizationSlug ?? context.organizationSlug,\n issueId: params.issueId,\n issueUrl: params.issueUrl,\n });\n setTag(\"organization.slug\", orgSlug);\n\n const data = await apiService.startAutofix({\n organizationSlug: orgSlug,\n issueId: parsedIssueId,\n });\n return [\n `# Issue Fix Started for Issue ${parsedIssueId}`,\n \"\",\n `**Run ID:**: ${data.run_id}`,\n \"\",\n \"This operation may take some time, so you should call `get_seer_issue_fix_status()` to check the status of the analysis, and repeat the process until its finished.\",\n \"\",\n \"You should also inform the user that the operation may take some time, and give them updates whenever you check the status of the operation..\",\n \"\",\n \"```\",\n params.issueUrl\n ? `get_seer_issue_fix_status(issueUrl=\"${params.issueUrl}\")`\n : `get_seer_issue_fix_status(organizationSlug=\"${orgSlug}\", issueId=\"${parsedIssueId}\")`,\n \"```\",\n ].join(\"\\n\");\n },\n get_seer_issue_fix_status: async (context, params) => {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const { organizationSlug: orgSlug, issueId: parsedIssueId } =\n parseIssueParams({\n organizationSlug: params.organizationSlug ?? context.organizationSlug,\n issueId: params.issueId,\n issueUrl: params.issueUrl,\n });\n setTag(\"organization.slug\", orgSlug);\n const { autofix } = await apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n });\n let output = `# Issue Fix Status for Issue ${parsedIssueId}\\n\\n`;\n if (!autofix) {\n output += `No issue fix process found for ${parsedIssueId}.\\n\\nYou can initiate a new issue fix execution using the \\`begin_seer_issue_fix\\` tool.`;\n return output;\n }\n for (const step of autofix.steps) {\n output += getOutputForAutofixStep(step);\n output += \"\\n\";\n }\n return output;\n },\n} satisfies ToolHandlers;\n\nfunction getOutputForAutofixStep(step: z.infer<typeof AutofixRunStepSchema>) {\n let output = `## ${step.title}\\n\\n`;\n\n if (step.status === \"FAILED\") {\n output += `**Sentry hit an error completing this step.\\n\\n`;\n return output;\n }\n\n if (step.status !== \"COMPLETED\") {\n output += `**Sentry is still working on this step. Please check back in a minute.**\\n\\n`;\n return output;\n }\n\n if (step.type === \"root_cause_analysis\") {\n const typedStep = step as z.infer<\n typeof AutofixRunStepRootCauseAnalysisSchema\n >;\n\n for (const cause of typedStep.causes) {\n if (typedStep.description) {\n output += `${typedStep.description}\\n\\n`;\n }\n for (const entry of cause.root_cause_reproduction) {\n output += `**${entry.title}**\\n\\n`;\n output += `${entry.code_snippet_and_analysis}\\n\\n`;\n }\n }\n return output;\n }\n\n if (step.type === \"solution\") {\n const typedStep = step as z.infer<typeof AutofixRunStepSolutionSchema>;\n output += `${typedStep.description}\\n\\n`;\n for (const entry of typedStep.solution) {\n output += `**${entry.title}**\\n`;\n output += `${entry.code_snippet_and_analysis}\\n\\n`;\n }\n\n if (typedStep.status === \"FAILED\") {\n output += `**Sentry hit an error completing this step.\\n\\n`;\n } else if (typedStep.status !== \"COMPLETED\") {\n output += `**Sentry is still working on this step.**\\n\\n`;\n }\n\n return output;\n }\n\n const typedStep = step as z.infer<typeof AutofixRunStepDefaultSchema>;\n if (typedStep.insights && typedStep.insights.length > 0) {\n for (const entry of typedStep.insights) {\n output += `**${entry.insight}**\\n`;\n output += `${entry.justification}\\n\\n`;\n }\n } else if (step.output_stream) {\n output += `${step.output_stream}\\n`;\n }\n\n return output;\n}\n"],"mappings":";;;;;;;AAeA,SAAS,sBACPA,SACAC,OAA+B,CAAE,GACjC;AACA,QAAO,IAAI,iBAAiB;EAC1B,MAAM,KAAK,YAAY,IAAI,IAAI,KAAK,WAAW,OAAO,QAAQ;EAC9D,aAAa,QAAQ;CACtB;AACF;AAED,MAAa,gBAAgB;CAC3B,oBAAoB,OAAO,YAAY;EACrC,MAAM,aAAa,sBAAsB,QAAQ;EACjD,MAAM,gBAAgB,MAAM,WAAW,mBAAmB;EAE1D,IAAI,SAAS;AAEb,MAAI,cAAc,WAAW,GAAG;AAC9B,aAAU;AACV,UAAO;EACR;AAED,YAAU,cACP,IAAI,CAAC,QACJ;IACG,OAAO,IAAI,KAAK;GACjB;IACC,eAAe,IAAI,MAAM,gBAAgB;IACzC,kBAAkB,IAAI,MAAM,UAAU;EACxC,EAAC,KAAK,KAAK,CACb,CACA,KAAK,OAAO;AAEf,YAAU;AACV,aAAW;AACX,aAAW;AAEX,SAAO;CACR;CACD,YAAY,OAAO,SAAS,WAAW;EACrC,MAAM,aAAa,sBAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,IAAI,mBAAmB,OAAO;AAC9B,OAAK,oBAAoB,QAAQ,iBAC/B,oBAAmB,QAAQ;AAE7B,OAAK,iBACH,OAAM,IAAI,MAAM;AAElB,SAAO,qBAAqB,iBAAiB;EAE7C,MAAM,QAAQ,MAAM,WAAW,UAAU,iBAAiB;EAC1D,IAAI,UAAU,eAAe,iBAAiB;AAC9C,MAAI,MAAM,WAAW,GAAG;AACtB,aAAU;AACV,UAAO;EACR;AACD,YAAU,MAAM,IAAI,CAAC,UAAU,IAAI,KAAK,KAAK,IAAI,CAAC,KAAK,GAAG;AAC1D,SAAO;CACR;CACD,eAAe,OAAO,SAAS,WAAW;EACxC,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