Repository navigation
feat(mcp): Return structured output from search_profiles - #2012
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dcramer
force-pushed
the
feat/search-profiles-structured-output
branch
from
November 5, 2026 21:46
79e4831 to
d68a8da
Compare
dcramer
force-pushed
the
feat/search-profiles-structured-output
branch
from
November 5, 2026 22:20
d68a8da to
cf93a12
Compare
dcramer
force-pushed
the
feat/search-profiles-structured-output
branch
from
November 5, 2026 22:35
cf93a12 to
069190f
Compare
Base automatically changed from
feat/search-metrics-structured-output
to
main
November 5, 2026 22:57
search_profiles now declares an outputSchema and returns structuredContent on every success path, using the shared dataset search payload. Rows carry the requested fields plus derived profileUrl (transaction or continuous profile flamegraph) and traceUrl links. Notes say transaction.duration and profile.duration are in nanoseconds (the markdown formatted them). Suggested actions open the first profile with get_profile_details (get_sentry_resource in experimental mode, as the markdown advised) and the first trace with get_sentry_resource. Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
dcramer
force-pushed
the
feat/search-profiles-structured-output
branch
from
November 5, 2026 22:57
069190f to
7a6f79e
Compare
dcramer
added a commit
that referenced
this pull request
Nov 5, 2026
`search_replays` now declares an `outputSchema` and returns
`structuredContent` on every success path, following the Structured
Content policy in `docs/contributing/tool-responses.md`. The model now
sees pretty JSON instead of markdown.
**Payload**
- `searchReplaysOutputSchema` and `buildStructuredReplayResults` in
`replays.ts` map replay fields explicitly:
- id, `replayUrl`, start time, duration
- error/rage/dead click counts
- environment and browser
- `isArchived`
- **User.** Explicit `{id, username, email, ip}`, matching
get_replay_details, instead of the upstream-computed display name. The
tool returns the user data Sentry stored. Tags, SDK and other internal
fields stay out, and a no-leak test checks this. `user` is null for
archived replays, whose rows carry placeholder data ("Archived Replay"
as the id).
- **Lists.** URLs, trace IDs and releases are previewed at 3 each.
`urlCount`, `traceCount` and `releaseCount` give the totals.
- **Suggested actions.** `get_replay_details` for the first replay, plus
`get_sentry_resource` for its first trace.
- Adds a replay overload to `runSearchEvents` and exports
`timeRangeSchema` from `structured.ts`.
**Stack and merge order**
- Order: #1987 (search_errors) → #2006 logs → #2008 traces → #2010
metrics → #2012 profiles → this PR. It targets
`feat/search-profiles-structured-output`. Merge in that order; GitHub
retargets each PR as its base merges.
- **Merge after #2019, or keep the pinned-user test.** The mapping test
pins its own user instead of reading the shared `replay-details.json`
fixture. #2019 adds `username: "taylor"` to that fixture, which would
otherwise break this snapshot.
- If #1987 or a parent PR is squash-merged, rebase with `git rebase
--onto <new base> <old parent head>
feat/search-replays-structured-output`.
- `toolDefinitions.json` will conflict along the stack and with the
sibling structured-output PRs. Regenerate it on rebase with `pnpm run
--filter @sentry/mcp-core generate-definitions`.
**Tokens**
- `measure-tokens` total is unchanged at 47,079. The description and
input schema are unchanged, and the script doesn't count `outputSchema`.
- `outputSchema` adds ~629 tokens to `tools/list`.
- Per call on a realistic fixture: markdown 1930 → JSON 3191 tokens
(1.65x).
**Checks.** All package-scoped, with `SENTRY_AUTH_TOKEN` unset:
- `pnpm --filter @sentry/mcp-server-mocks run build`
- `pnpm run --filter @sentry/mcp-core generate-definitions`, then `git
status`; only the intended files changed
- `pnpm --filter @sentry/mcp-core run tsc`
- full mcp-core vitest: 147 files, 2101 passed, 6 skipped
- `pnpm run lint`
Root `pnpm run tsc` was not run because its cloudflare build uploads
source maps. Evals were skipped because they need API keys.
<!-- junior-request-attribution:start -->
via @dcramer.
<!-- junior-request-attribution:end -->
<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A018aa877508ecba7895b5d9d7ca8674a -->
--
[View
Session](https://junior-prod.sentry.dev/conversations/agent%3A018aa877508ecba7895b5d9d7ca8674a)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A018aa877508ecba7895b5d9d7ca8674a/?project=4510944073809921)
<!-- junior-session-footer:end -->
---------
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: David Cramer <23610+dcramer@users.noreply.github.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
search_profilesnow declares anoutputSchemaand returnsstructuredContenton every success path, using the shared dataset search payload from #1987. The model now sees pretty JSON instead of markdown.profileUrl(transaction or continuous-profile flamegraph, via the now-exportedgetProfileDetailUrl) andtraceUrllinks.transaction.durationandprofile.durationare in nanoseconds; the markdown formatted them.get_profile_details(get_sentry_resourcein experimental mode, as the markdown advised) and the first trace withget_sentry_resource.structuredContentand assert that passthrough fields don't leak.Stack and merge order: #1987 (search_errors) → logs → traces → metrics → profiles → replays (the replays PR isn't open yet). This PR targets
feat/search-metrics-structured-outputand is 4th after #1987 in the stack. Merge in that order; GitHub retargets each PR as its base merges.git rebase --onto <new base> <old parent head> <this branch>so the parent's commits don't replay.toolDefinitions.jsonwill conflict along the stack and with the sibling structured-output PRs. Regenerate it on rebase withpnpm run --filter @sentry/mcp-core generate-definitions.suggested-actions.ts/ai-conversation-actions.tscome from feat(mcp): Return structured output from search_errors #1987 and are byte-identical to the canonical copies (blobsee84917/63ff7bd).Tokens
measure-tokenstotal is unchanged at 47,079: the description and input schema are unchanged, and the script doesn't countoutputSchema.outputSchemaadds ~745 tokens totools/list.Checks: package-scoped only, run with
SENTRY_AUTH_TOKENunset.pnpm run --filter @sentry/mcp-core generate-definitions,pnpm --filter @sentry/mcp-core run tsc,pnpm run lintpnpm run tscwas not run because its cloudflare build uploads source maps. Evals were skipped because they need API keys.via @dcramer.
--
View Session [Sentry]