Skip to content

feat(tools): Simplify get_sentry_resource and add breadcrumbs#796

Draft
dcramer wants to merge 6 commits intomainfrom
feat/simplify-get-sentry-resource-add-breadcrumbs
Draft

feat(tools): Simplify get_sentry_resource and add breadcrumbs#796
dcramer wants to merge 6 commits intomainfrom
feat/simplify-get-sentry-resource-add-breadcrumbs

Conversation

@dcramer
Copy link
Member

@dcramer dcramer commented Feb 7, 2026

Simplify get_sentry_resource input schema from 10 parameters to 4 and add breadcrumbs as 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 just url, resourceType, resourceId, and organizationSlug — where resourceId maps 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'). The get_issue_details output includes a hint pointing to this, gated behind experimentalMode since get_sentry_resource is an experimental tool.

Profile: Kept in URL mode only since it requires transactionName which doesn't fit the single resourceId pattern. Explicit profile support needs a dedicated tool (follow-up).

resolveResourceParams exported: 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

dcramer and others added 2 commits February 7, 2026 11:01
…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>
Copy link

@cursor cursor bot left a comment

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.

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>
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