Skip to content

Support simpler way to get builds by pipeline IDΒ #711

@AmeliaRose802

Description

@AmeliaRose802

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 name
  • repositoryId (required): Repository ID (GUID)
  • pullRequestId (required): Pull request ID
  • top (optional): Maximum number of builds to return (default 100)
  • status (optional): Filter by build status
  • result (optional): Filter by build result
  • queryOrder (optional): Order in which builds are returned (default: QueueTimeDescending)

Rules

  1. Adhere strictly to existing project standards and coding conventions.
  2. Ensure the tool exposes all relevant API parameters (required and optional).
  3. Use the official Azure DevOps Node API to interact with the APIs.
  4. Internally construct the branchName parameter as refs/pull/{pullRequestId}/merge to query the correct builds.
  5. Return build objects with the same schema as mcp_ado_pipelines_get_builds for consistency.

Special treat

If you follow the rules, you'll get candy!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions