Repository navigation
feat(tools): add get_issue_tag_values tool for tag distribution - #706
Merged
Merged
Conversation
Add new MCP tool to expose Sentry's Tag Distributions view, allowing AI agents to get aggregate counts of unique tag values for an issue. Changes: - Add getIssueTagValues method to API client - Add IssueTagValuesSchema for response validation - Create get-issue-tag-values tool with full documentation - Add MSW mock handler and fixture for testing - Add comprehensive unit tests - Update use-sentry handler tests for new tool count Co-Authored-By: Cursor <noreply@cursor.sh>
drazisil-codecov
temporarily deployed
to
Actions
January 9, 2026 14:59 — with
GitHub Actions
Inactive
drazisil-codecov
marked this pull request as ready for review
January 9, 2026 15:02
Member
|
Given the ticket has been open and we dont yet have a better idea, I think I'm good with this. Gonna run a couple checks on it then we'll merge |
Add regex validation to tagKey in get_issue_tag_values tool to prevent path traversal attacks. The tagKey is now restricted to alphanumeric characters, dots, hyphens, and underscores, matching the pattern used for other URL path parameters like organizationSlug. Also removes unused topTotal variable from output formatting. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Make firstSeen/lastSeen nullable in IssueTagValueSchema to handle API responses that return null instead of omitting the field - Escape pipe, backtick, and newline characters in markdown table output to prevent table formatting issues Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Address CodeQL security alert by escaping backslash characters before escaping other special markdown characters. This prevents incomplete escaping when input contains backslashes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Address Cursor Bot feedback - the get_issue_details suggestion now includes the required organizationSlug parameter. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This branch was previously 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.
Summary
Adds new MCP tool
get_issue_tag_valuesto expose Sentry's Tag Distributions view. This addresses CCMRG-1999.Context
Currently, the Sentry MCP doesn't expose the Tag Distributions view (like
https://sentry.io/issues/{id}/distributions/url/). This makes it impossible for AI agents to get aggregate counts of unique tag values for an issue (e.g., "how many unique repos are affected by this error").Key Changes
getIssueTagValues()method callingGET /api/0/issues/{issue_id}/tags/{tag_name}/IssueTagValuesSchemaZod schema for response validationget_issue_tag_valuestool with full documentation, examples, and hintsuse-sentryhandler tests for new tool count (21 tools)Example Usage
Breaking Changes
None