Skip to content

Add support for showing variables #871

@bendavis78

Description

@bendavis78

Problem:

get_issue_details returns stack frames with file, line, function, and source code, but not local variable values — even when Sentry has captured them. Without variable context, the assistant can't actually diagnose the issue — it has to punt back to the human to check the UI. That defeats the purpose of the MCP integration.

I ran into this today. We had an EncodeError: Object of type str is not JSON serializable in a Celery/Kombu stack. In the Sentry web UI, I can see the value of o at the crash site (json/encoder.py:180) — it was a SimpleLazyObject. That's the whole answer to "what was being encoded?" But the MCP tool only gave me frame metadata, so I had to leave the AI workflow and go look at the UI myself.

Proposed solution:

Rather than bloating every get_issue_details response with variables from every frame, add a separate tool like get_frame_variables(issue_id, event_id, frame_index) that returns the local variables for a specific stack frame. This keeps the common case token-efficient while still letting the assistant drill into the frame that matters.

Another option to save on # of requests might be to include variable data only for the top/bottom frame of each exception by default, since that's where the most useful context usually lives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions