Skip to content

fix(mcp): Return the event-level stacktrace from issue and event tools - #2402

Draft
sentry-junior[bot] wants to merge 1 commit into
mainfrom
fix/mcp-event-level-stacktrace
Draft

sentry-junior[bot] wants to merge 1 commit into
mainfrom
fix/mcp-event-level-stacktrace

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Sentry returns an event's top-level stack, such as a native captureMessage with attach_stacktrace, as an entry of type stacktrace, outside exception and threads (src/sentry/api/serializers/models/event.py:159, src/sentry/interfaces/stacktrace.py:528 in getsentry/sentry). get_event_stacktrace read only threads, and get_issue_details read only exception and threads. As a result these events looked stackless.

  • get_event_stacktrace: when the event has no threads, it returns the event-level stack in a new nullable stacktrace field, and selection.message points to it. status stays no_threads.
  • get_issue_details / get_sentry_resource: the structured output gets event.stacktrace, and the markdown renders a ### Stacktrace section when there is no exception.
  • The crashed-thread frame rendering moves into formatStackFrames, so threads and the new section share it.

This adds output fields, so it has the same closed-outputSchema risk as #2293 for clients that cached an older tools/list.

This doesn't change #2144 (exception-only events in get_event_stacktrace). That's a separate code path.

Fixes #2401

via automation evt_905b9c478746fd9deeb853f85ad7441b · Run ID dispatch_4e78d780ff1972f0f26d34e55cc804be.

--

View Session [Sentry]

Sentry returns an event's top-level stack (a message captured with
attach_stacktrace, common on native) as an entry of type "stacktrace",
outside exceptions and threads. get_event_stacktrace read only threads and
get_issue_details read only exceptions and threads, so these events looked
stackless.

get_event_stacktrace now returns the stack in a new `stacktrace` field when
the event has no threads. get_issue_details adds `event.stacktrace` to its
structured output and renders the stack in markdown when there is no
exception.
@vercel

vercel Bot commented Nov 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 18, 2026 8:38pm UTC

Request Review

This branch was successfully deployed

1 active and 1 inactive deployments
Actions — 3a1a780f Deployed Nov 18, 2026 by sentry-junior[bot] via eval #1966
Preview — 3a1a780f Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Event-level stacktrace is dropped by get_event_stacktrace and get_issue_details

0 participants