Skip to content

Implement a new tool to fetch build timeline records by their refName #790

@stepank

Description

@stepank

Summary

Implement a new tool to fetch build timeline records by their refName.

Justification

Here's my scenario where I need this tool:

  1. start a new build,
  2. track the progress of the build and wait until the build succeeds,
  3. fetch the logs of one of the stages,
  4. retrieve certain info from the logs.

Step 3 can be done only by log ID. This log ID changes from build to build. Thus, I cannot hard code this log ID and need to look it up in the timeline record of the stage I'm interested in. Note that build timeline response can be very long for some builds (8k+ lines in my case). As a result, it can be truncated, and agents see only a part of it. To address this, I would like to retrieve only certain parts of the timeline. This is why I need the filter by refName.

I have already tested this approach by changing this Azure DevOps MCP and installing it locally. The approach works as expected. If this tool is approved, I have the change ready in my branch and can submit a PR.

Tools

Develop the following tool with full parameter support:

pipelines_get_build_timeline_records_by_refname: Fetches the timeline records of a specific build by reference name.

The tool should support the following parameters:

  1. project: project ID or name to get the build timeline for (string, required),
  2. buildId: ID of the build to get the timeline for (number, required),
  3. refName: Reference name of the timeline record to retrieve (string, required).

This tool should use the already existing build API getBuildTimeline(project, buildId) and filter the result by the given refName. Note that refName may not be unique in the timeline, so the result should be a list of records, not a record.

Related issues

  1. [Enhancement] Add Timeline and Step Analysis to Build Log Retrieval Tool (get_build_log) - closed as not planned.
  2. [Feature Request] Scope timeline to errors only - closed as not planned.
  3. Implement Pipeline Get Timeline API as tool for much more accurate and fast pipeline debugging - implemented, but then reverted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Duplicate 2️⃣this issue or pull request already existsPipelines 🚀builds, releases and pipelines area

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions