Repository navigation
fix(tools): Find a project by numeric ID in find_projects - #2360
Merged
Merged
Conversation
Sentry's projects endpoint matches free-text queries against name and slug only, so find_projects returned nothing when an agent passed a numeric project ID. Send a numeric query as `id:<n>` first and fall back to the name/slug search when no project has that ID.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
MathurAditya724
approved these changes
Nov 18, 2026
MathurAditya724
left a comment
Member
There was a problem hiding this comment.
Verified id: query behavior against current Sentry organization_projects.py and tested numeric lookup, free-text fallback, and existing behavior (6 tests pass). No blocking issues found.
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.
Agents that hold a numeric project ID (from alert rules, events, etc.) had no way to turn it into a project slug through the MCP.
find_projectssendsqueryas free text, and Sentry's projects endpoint matches free text only against name and slug. The ID is only matched by anid:<n>token (getsentry/sentrysrc/sentry/core/endpoints/organization_projects.py:219-230), sofind_projects(query="4509062593708032")returned an empty list.Now an all-digits
query(with no cursor) is sent asid:<n>first. If no project has that ID, the tool falls back to the old name/slug search, so a query like2024still findsweb-2024. Thequerydescription now says it takes a numeric project ID.Nothing breaks: the output schema is unchanged and still returns slugs only. Adding
id/namefields would break clients that cached the old closed output schema (#2293).Closes #2359. Reported in MCP-SERVER-GRR.
via automation
evt_905b9c478746fd9deeb853f85ad7441b· Run IDdispatch_5ed2bb04d2df0e73a87d39773cc76cce.--
View Session [Sentry]