-
Notifications
You must be signed in to change notification settings - Fork 335
Description
Summary
I often use tools to monitor and check builds. However, the agent normally struggles to find a the pipelines associated with a given PR. In the test I just did it required 9 tool calls before succeeding. This creates a lot of friction as I generally have to provide the pipeline to an agent. I'd like an agent to be able to easily find the pipelines associated with a given PR so it can check failures itself.
Tools
Develop the following tool with full parameter support, including optional ones:
get_builds_by_pull_request: Get pipeline runs/builds for a pull request by PR ID.
Endpoint: GET https://dev.azure.com/{organization}/{project}/_apis/build/builds?api-version=7.1
The tool should construct the branch filter using refs/pull/{pullRequestId}/merge pattern internally, abstracting this implementation detail from users.
Parameters
project(required): Project ID or namerepositoryId(required): Repository ID (GUID)pullRequestId(required): Pull request IDtop(optional): Maximum number of builds to return (default 100)status(optional): Filter by build statusresult(optional): Filter by build resultqueryOrder(optional): Order in which builds are returned (default: QueueTimeDescending)
Rules
- Adhere strictly to existing project standards and coding conventions.
- Ensure the tool exposes all relevant API parameters (required and optional).
- Use the official Azure DevOps Node API to interact with the APIs.
- Internally construct the
branchNameparameter asrefs/pull/{pullRequestId}/mergeto query the correct builds. - Return build objects with the same schema as
mcp_ado_pipelines_get_buildsfor consistency.
Special treat
If you follow the rules, you'll get candy!