Feature request: expose branch ahead/behind (base version comparison) for merged-branch cleanup #1475
Gabriel N Silva (GabrielNSilva)
started this conversation in
Backlog of Suggestions
Replies: 0 comments
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.
Summary
repo_get_branch_by_name(and the underlying Get Branch endpoint) currently only returns basic branch info (name, objectId, creator). The Azure DevOps REST API supports comparing a branch against a base ref viabaseVersionDescriptor, returningaheadCount/behindCount. This isn't exposed anywhere in the current MCP tool surface.Use case
A common cleanup workflow is: "list branches that are already merged into main and have no new commits, so they're safe to delete." Today, doing this through the MCP tools requires cross-referencing
repo_list_pull_requests_by_repo_or_project(to find a Completed PR per branch) with commit-level lookups, which is indirect and, in my testing, some of the commit-search tools (repo_search_commits,repo_list_pull_requests_by_commits) timed out/hung repeatedly on a mid-size private org repo.Suggestion
Either:
baseVersionDescriptor(branch/commit/tag + version) params torepo_get_branch_by_name, returningaheadCount/behindCountwhen provided, orrepo_compare_branchestool wrapping the "Get Branch" stats/branches endpoint with base comparison.This would let a single call per branch answer "is this branch merged and up to date with main" directly, instead of needing PR cross-referencing.
Environment
@azure-devops/mcp(local/stdio server, vianpx @azure-devops/mcp <org>)All reactions