From 60a0ff2f223497556c7912d4cc1c464c3a957028 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Tue, 25 Aug 2026 13:29:32 +0000 Subject: [PATCH 1/2] fix(attachments): stop using attachment SHA1 metadata Objectstore-backed attachments intentionally store empty checksums, so SHA1 from the list API is misleading. Drop it from the event attachment schema and tool output. Co-Authored-By: Jan Michael Auer --- packages/mcp-core/src/api-client/schema.ts | 3 ++- .../mcp-core/src/tools/catalog/get-event-attachment.test.ts | 2 -- packages/mcp-core/src/tools/catalog/get-event-attachment.ts | 6 ++---- .../mcp-server-mocks/src/fixtures/event-attachments.json | 1 - packages/mcp-server-mocks/src/index.ts | 1 - 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/mcp-core/src/api-client/schema.ts b/packages/mcp-core/src/api-client/schema.ts index bd1f456e3..b956210dc 100644 --- a/packages/mcp-core/src/api-client/schema.ts +++ b/packages/mcp-core/src/api-client/schema.ts @@ -1347,7 +1347,8 @@ export const EventAttachmentSchema = z.object({ size: z.number(), mimetype: z.string(), dateCreated: z.string().datetime(), - sha1: z.string(), + // Objectstore-backed attachments intentionally store an empty-string SHA1, so + // we neither require nor surface checksum metadata from this endpoint. headers: z.record(z.string(), z.string()).optional(), }); diff --git a/packages/mcp-core/src/tools/catalog/get-event-attachment.test.ts b/packages/mcp-core/src/tools/catalog/get-event-attachment.test.ts index b1b9b9ebe..280ad211a 100644 --- a/packages/mcp-core/src/tools/catalog/get-event-attachment.test.ts +++ b/packages/mcp-core/src/tools/catalog/get-event-attachment.test.ts @@ -36,7 +36,6 @@ describe("get_event_attachment", () => { **Size:** 1024 bytes **MIME Type:** image/png **Created:** 2025-04-08T21:15:04.000Z - **SHA1:** abc123def456 To download this attachment with the attachmentId provided: Use the Sentry tool \`get_event_attachment\` @@ -87,7 +86,6 @@ describe("get_event_attachment", () => { **Size:** 1024 bytes **MIME Type:** image/png **Created:** 2025-04-08T21:15:04.000Z - **SHA1:** abc123def456 **Download URL:** https://sentry.io/api/0/projects/sentry-mcp-evals/cloudflare-mcp/events/7ca573c0f4814912aaa9bdc77d1a7d51/attachments/123/?download=1 diff --git a/packages/mcp-core/src/tools/catalog/get-event-attachment.ts b/packages/mcp-core/src/tools/catalog/get-event-attachment.ts index 4527c7015..a50e971f6 100644 --- a/packages/mcp-core/src/tools/catalog/get-event-attachment.ts +++ b/packages/mcp-core/src/tools/catalog/get-event-attachment.ts @@ -117,8 +117,7 @@ export default defineTool({ output += `**Type:** ${attachment.attachment.type}\n`; output += `**Size:** ${attachment.attachment.size} bytes\n`; output += `**MIME Type:** ${effectiveMimeType}\n`; - output += `**Created:** ${attachment.attachment.dateCreated}\n`; - output += `**SHA1:** ${attachment.attachment.sha1}\n\n`; + output += `**Created:** ${attachment.attachment.dateCreated}\n\n`; output += `**Download URL:** ${attachment.downloadUrl}\n\n`; if (isBinary) { @@ -166,8 +165,7 @@ export default defineTool({ output += `**Type:** ${attachment.type}\n`; output += `**Size:** ${attachment.size} bytes\n`; output += `**MIME Type:** ${attachment.mimetype}\n`; - output += `**Created:** ${attachment.dateCreated}\n`; - output += `**SHA1:** ${attachment.sha1}\n\n`; + output += `**Created:** ${attachment.dateCreated}\n\n`; output += "To download this attachment with the attachmentId provided:\n"; output += `${formatToolCallInstruction({ toolName: "get_event_attachment", diff --git a/packages/mcp-server-mocks/src/fixtures/event-attachments.json b/packages/mcp-server-mocks/src/fixtures/event-attachments.json index 7ce9f8a5f..d0d591052 100644 --- a/packages/mcp-server-mocks/src/fixtures/event-attachments.json +++ b/packages/mcp-server-mocks/src/fixtures/event-attachments.json @@ -6,7 +6,6 @@ "size": 1024, "mimetype": "image/png", "dateCreated": "2025-04-08T21:15:04.000Z", - "sha1": "abc123def456", "headers": { "Content-Type": "image/png" } diff --git a/packages/mcp-server-mocks/src/index.ts b/packages/mcp-server-mocks/src/index.ts index 69bea77aa..e97c1757c 100644 --- a/packages/mcp-server-mocks/src/index.ts +++ b/packages/mcp-server-mocks/src/index.ts @@ -1607,7 +1607,6 @@ export const restHandlers = buildHandlers([ size: 1024, mimetype: "application/octet-stream", dateCreated: "2025-04-08T21:15:04.000Z", - sha1: "abc123def456", headers: { "Content-Type": "application/octet-stream" }, }, ]), From b852d97d66abe97c6391d9a00166e3a64d7a5984 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Tue, 25 Aug 2026 13:32:35 +0000 Subject: [PATCH 2/2] fix(attachments): clarify unavailable SHA1 comment Co-Authored-By: Jan Michael Auer --- packages/mcp-core/src/api-client/schema.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mcp-core/src/api-client/schema.ts b/packages/mcp-core/src/api-client/schema.ts index b956210dc..85167b782 100644 --- a/packages/mcp-core/src/api-client/schema.ts +++ b/packages/mcp-core/src/api-client/schema.ts @@ -1347,8 +1347,8 @@ export const EventAttachmentSchema = z.object({ size: z.number(), mimetype: z.string(), dateCreated: z.string().datetime(), - // Objectstore-backed attachments intentionally store an empty-string SHA1, so - // we neither require nor surface checksum metadata from this endpoint. + // Objectstore-backed attachments do not store a usable SHA1 (checksum is + // unavailable), so we neither require nor surface it from this endpoint. headers: z.record(z.string(), z.string()).optional(), });