Skip to content

feat(mcp): Add send_feedback tool wired to Sentry User Feedback#32

Merged
sergical merged 2 commits into
mainfrom
feat/send-feedback-tool
Jul 24, 2026
Merged

feat(mcp): Add send_feedback tool wired to Sentry User Feedback#32
sergical merged 2 commits into
mainfrom
feat/send-feedback-tool

Conversation

@sergical

Copy link
Copy Markdown
Member

Why

Agents are the primary callers of this server, and they experience its rough edges first — unhelpful 400s, combination rules they trip over, queries they can't express. This gives them a direct channel: a send_feedback tool that files reports into Sentry User Feedback, linked to the active trace, so friction shows up where we already triage.

What

  • New send_feedback tool (src/tools/send-feedback.ts): bounded message (10–4000 chars), category enum, optional tool_name; captured via Sentry.captureFeedback with feedback.category / feedback.tool tags.
  • Gated by ServerConfig.enableFeedbackTool — enabled on both Worker endpoints, off for STDIO (no Sentry SDK there, so the tool is hidden rather than silently dropping submissions).
  • /internal feedback auto-attributes to the signed-in user via the existing Sentry.setUser isolation scope; /mcp stays anonymous per the BYOK privacy posture.
  • Server instructions gain a FEEDBACK line so models know when to use it.
  • Tests: unit (capture + tags + defaults + annotations) and integration (registration gating, instructions, round-trip, schema rejection).

🤖 Generated with Claude Code

Lets calling agents file friction reports (confusing errors, queries they
could not express, unexpected results) directly into Sentry User Feedback,
linked to the active trace. On /internal the feedback inherits the
authenticated user from the isolation scope; BYOK /mcp feedback stays
anonymous, matching the endpoint privacy posture.

Gated by ServerConfig.enableFeedbackTool (Worker only) — the STDIO entry
point has no Sentry SDK, so the tool is hidden there rather than silently
dropping submissions. Server instructions gain a line telling models when
to reach for it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread src/tools/send-feedback.ts
…thScope

Addresses the Seer bug prediction on this PR: @sentry/core v10 declares
withScope<T>((scope) => T): T, so the callback's return value (the
captureFeedback event id) is propagated, not dropped. The integration test
uses the unmocked SDK and now asserts the id is a real 32-hex event id,
proving the behavior in CI rather than only in a mock.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sergical
sergical merged commit ce23258 into main Jul 24, 2026
14 checks passed
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.

1 participant