feat(tools): Simplify get_sentry_resource and add breadcrumbs#796
Draft
feat(tools): Simplify get_sentry_resource and add breadcrumbs#796
Conversation
…support Simplify get_sentry_resource from 10 input params to 4 (url, resourceType, resourceId, organizationSlug) and add breadcrumbs as a new resource type. - Schema: Replace issueId/eventId/traceId/projectSlug/profilerId/transactionName with a single resourceId that maps to type-specific fields - Breadcrumbs: New resource type that fetches the latest event's breadcrumbs and formats them as a structured log (timestamp, level, category, message, data) - URL override: Allow resourceType='breadcrumbs' alongside an issue URL to fetch breadcrumbs without needing explicit params - Profile: Kept in URL mode only (needs transactionName which doesn't fit resourceId) - Export resolveResourceParams for direct unit testing of URL→params resolution - Add breadcrumbs hint to get_issue_details output - Add eval test for get_sentry_resource - Add inline snapshots for breadcrumbs and guidance message formatting Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Rename truncate to cleanAndTruncate to reflect dual behavior - Use " ".repeat(24) instead of magic whitespace string - Use parts array for breadcrumb line assembly - Extract intermediate variable for breadcrumb entry data cast - Remove redundant comments that restate code - Simplify callHandler test helper - Remove weak enum test covered by integration tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The breadcrumbs hint in get_issue_details output references the experimental get_sentry_resource tool. Gate it behind experimentalMode so it only appears when the tool is actually available. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rumb helpers - Rewrite tool description to use intent-based language, removing "explicit mode" / "URL mode" jargon and "FULLY SUPPORTED" / "URL RECOGNIZED" sections - Update param descriptions and error messages to drop "mode" references - Extract formatBreadcrumbs, formatBreadcrumbData, cleanAndTruncate, and fetchAndFormatBreadcrumbs into internal/tool-helpers/breadcrumbs.ts - Rename test describe blocks from "Explicit mode" to "By type and ID" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
…s only Remove USE THIS TOOL WHEN, hints sections, and remaining "explicit mode" references. Description is now one line + three examples (312 tokens, down from 467). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nt API call When processing event URLs (e.g., /issues/PROJECT-123/events/abc123), the issueId was already parsed but not passed to getIssueDetails. This caused an unnecessary listIssues search to rediscover the issue. Now getIssueDetails uses getIssue directly when issueId is provided. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Simplify
get_sentry_resourceinput schema from 10 parameters to 4 and addbreadcrumbsas a new resource type.Schema simplification: The old schema had separate params for every resource type's identifiers (
issueId,eventId,traceId,projectSlug,profilerId,transactionName,regionUrl). The new schema uses justurl,resourceType,resourceId, andorganizationSlug— whereresourceIdmaps to the type-specific identifier. This reduces token overhead and makes the tool easier for AI agents to use correctly.Breadcrumbs: New resource type that fetches the latest event's breadcrumbs and formats them as a structured log. Can be invoked explicitly (
resourceType='breadcrumbs', resourceId='PROJECT-123') or as a URL override (url='...issue-url...', resourceType='breadcrumbs'). Theget_issue_detailsoutput includes a hint pointing to this, gated behindexperimentalModesinceget_sentry_resourceis an experimental tool.Profile: Kept in URL mode only since it requires
transactionNamewhich doesn't fit the singleresourceIdpattern. Explicit profile support needs a dedicated tool (follow-up).resolveResourceParamsexported: The URL-to-typed-params resolution function is now exported and has 57 dedicated unit tests that don't require API mocks, making URL parsing easy to test and extend.Refs #534