Repository navigation
Add org-scoped "my pull requests" tool (created by / reviewing) #1593
Cooper Cox (coopercox-ms)
started this conversation in
Backlog of Suggestions
Replies: 1 comment
|
I am not seeing anyone else request this tool. I have some ideas on what we could change, but I would like to see more interest in it before we add another tool that we need to maintaint. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Implement one new tool that returns pull requests with an organization-scoped list action so callers can retrieve pull requests across every project and repository in an Azure DevOps organization with one MCP call.
This is particularly useful for personal work views such as:
The current
listaction requires eitherprojectorrepositoryId, forcing clients to enumerate projects and issue many calls. Azure DevOps itself presents an organization-wide My Work → Pull requests view, and the projectless Git API endpoint returns pull requests from multiple projects in one response.Tool
Extend the existing consolidated tool rather than introducing a separate tool:
repo_pull_requestwithaction: "list_org"List pull requests across all projects and repositories visible to the authenticated user in an organization.
Endpoint:
Example requests:
Parameters to expose where supported:
creatorIdreviewerIdstatusrepositoryIdsourceRefNamesourceRepositoryIdtargetRefNameminTimemaxTimequeryTimeRangeTypeincludeLinkstopskipAlso retain these convenience filters:
created_by_me— resolves the authenticated user's IDcreated_by_user— resolves an email address to an IDi_am_reviewer— resolves the authenticated user's IDuser_is_reviewer— resolves an email address to an IDThe
created_by_meandi_am_reviewerconvenience filters should resolve the authenticated user's identity through the existinggetCurrentUserDetails()helper.creatorIdandreviewerIdshould pass directly to the API. The convenience parameters exist so normal callers do not need to discover identity GUIDs. The issue should require a clear validation error if multiple creator or reviewer filters conflict.Results should include enough context to identify each PR across the organization:
Validation
The projectless endpoint has been tested successfully and:
However, the projectless form does not appear to be documented alongside the supported Get Pull Requests By Project API:
https://learn.microsoft.com/rest/api/azure/devops/git/pull-requests/get-pull-requests-by-project?view=azure-devops-rest-7.1
Please confirm whether the organization-scoped route is supported. If it is considered an internal or unsupported route, an MCP-managed aggregation action would still be valuable: the server could enumerate projects internally and return one combined, paginated response so MCP clients do not need to make one call per project.
Implementation guidance
Modify the existing
repo_pull_requestactionlist; do not add a newtop-level MCP tool or duplicate its filtering logic.
The current implementation rejects requests when both
repositoryIdandprojectare absent:Replace that restriction with three-way scope dispatch:
The organization branch must issue:
GET https://dev.azure.com/{organization}/_apis/git/pullrequestsReuse the existing
searchCriteriaconstruction, identity resolution,pagination, trimming, and response shape for all three scopes.
Do not implement organization scope by enumerating projects. It should remain
one Azure DevOps request.
Rules
repo_pull_requesttool.listbehavior.Special treat
If you follow the rules, you'll get candy!
All reactions