Skip to content

feat(mcp-core): Add get_profile_details tool and fix profile schemas - #870

Merged
dcramer merged 5 commits into
mainfrom
dcramer/feat/profile-resource-schemas-discoverability
Mar 27, 2026
Merged

dcramer merged 5 commits into
mainfrom
dcramer/feat/profile-resource-schemas-discoverability

Conversation

@dcramer

@dcramer dcramer commented Mar 26, 2026 •

Copy link
Copy Markdown
Member

Add get_profile_details as a standalone tool for fetching raw profile chunk data. This gives profiling proper discoverability — LLMs can now find and use it directly without needing a URL.

New tool: get_profile_details — fetches raw profile chunk data for a specific profiler session. Returns thread activity, top frames by occurrence, and user/library code breakdown. Requires profilerId, projectSlugOrId, start, and end.

Schema fixes — ProfileFrameSchema, ProfileChunkSchema, and ProfileSampleSchema were missing fields that Sentry's profiling API actually returns: class_name, instruction_addr, raw_function, symbol, lang, colno, queue_address, event_id, and thread priority.

Formatter improvements — formatProfileChunkAnalysis now shows ClassName.function() for Java/Android frames and falls back to module when filename is absent.

Mock fixture — Added profile-chunk.json fixture and MSW handler for /profiling/chunks/ endpoint.

Refs #867

…y_resource

Expand ProfileFrameSchema, ProfileChunkSchema, and ProfileSampleSchema
with fields that Sentry's profiling API actually returns (class_name,
instruction_addr, raw_function, symbol, lang, colno, queue_address,
event_id, thread priority).

Add profile as a supported resourceType in get_sentry_resource so LLMs
can discover and query profiling data directly, not just via URL
auto-detection. Adds projectSlug and transactionName params to support
this.

Update formatProfileChunkAnalysis to show class_name.function for
Java/Android frames and fall back to module when filename is absent.

Add profile-chunk.json mock fixture and MSW handler.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dcramer
dcramer marked this pull request as ready for review March 26, 2026 22:49
… get_sentry_resource changes

Instead of adding profile as a resourceType in get_sentry_resource,
create get_profile_details as its own standalone tool. This gives it
proper discoverability without overloading get_sentry_resource.

The tool fetches raw profile chunk data for a specific profiler session,
formats thread activity, top frames by occurrence, and user/library code
breakdown via formatProfileChunkAnalysis.

Reverts the get_sentry_resource changes from the previous commit
(projectSlug, transactionName params, profile resourceType).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dcramer dcramer changed the title feat(mcp-core): Add profile as first-class resource type in get_sentry_resource feat(mcp-core): Add get_profile_details tool and fix profile schemas Mar 26, 2026
Add hideInExperimentalMode flag so the tool is only visible in
non-experimental mode, matching the pattern used by get_profile.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread packages/mcp-core/src/tools/get-profile-details.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread packages/mcp-core/src/tools/get-profile-details.ts
The Sentry profiling API's project query parameter only accepts
numeric IDs. Add slug-to-ID resolution using apiService.getProject(),
matching the pattern in get_profile.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e_details

Zod schema already enforces profilerId as a required trimmed string,
making the runtime check dead code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dcramer
dcramer merged commit 5ee4c1f into main Mar 27, 2026
16 checks passed
@dcramer
dcramer deleted the dcramer/feat/profile-resource-schemas-discoverability branch March 27, 2026 02:51

This branch was previously deployed

1 inactive deployment
Actions — 56ae7efd Deployed Mar 27, 2026 by dcramer via eval #778
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