Skip to content

[REMOTE] When using the capability to run pipelines, the main branch is always used and it is impossible to get the MCP server to run the pipeline on another branch #1053

@GABRIELNGBTUC

Description

@GABRIELNGBTUC

This template is for Azure DevOps Remote MCP Server feedback only.

Important
Internal Microsoft users: Do NOT file issues here. Please use the internal Teams channel to share your feedback.

Issue Type

Select the option that best describes your issue.

  • Feedback on Remote MCP Server
  • Bug in Remote MCP Server
  • Tool or feature request for Remote MCP Server

Tool(s)

pipelines_run_pipeline

Input used by the tool:

{
  "branch": "dev/wip",
  "pipelineId": 180,
  "project": "XX"
}
{
  "project": "XX",
  "pipelineId": 180,
  "resources": {
    "repositories": {
      "self": {
        "refName": "refs/heads/dev/wip"
      }
    }
  }
}

Description

When attempting to run a pipeline, the server is always attempting to run the main branch instead of the specified branch in the chat. In this specific case, this results in an error since we don't have a main branch. But we also tried in another repository with this branch and were unable to force the server to run a pipeline on another branch than main.

Prompt

I want you to find all failed runs of APIOPS pipelines in the XX project for the last 2 days and either:

- Rerun the failed pipeline
- Create a new run for the same pipeline on the same branch used

Output

Unable to resolve the reference 'refs/heads/main' to a specific version. Verify the reference exists in the source repository.

Response

Created 3 todos

The `tool_search_tool_regex` tool is currently unavailable. However, I can see from the deferred tools list that ADO pipeline tools were already listed. Let me try calling them directly: 

Ran `pipelines_get_build_definitions` 
Completed with input: {
  "project": "XX",
  "name": "apiops"
}

No definitions returned with that name. Let me list all projects first to confirm the right project name: 

Ran `core_list_projects` 
Completed with input: {
  "stateFilter": "WellFormed"
}

Good, **XX** project is confirmed (`guid`). Now let me fetch all build definitions to find APIOPS pipelines: 

Ran `pipelines_get_build_definitions` 
Completed with input: {
  "project": "XX"
}

Searched for regex `apiops|api-ops|APIOPS` Searched for regex apiops|api-ops|APIOPS 

Searched for regex apiops|api-ops|APIOPS",  

Read response files here

Now I have all the build definitions. Let me collect all the APIOPS pipelines:

id: 180 - "project APIOPS Extract" (path: \APIOps)

id: 199 - "project APIOPS Extract" (path: \APIOps)

id: 201 - "project APIOPS Extract" (path: \APIOps)

id: 205 - "project APIOPS Extract" (path: \APIOps)

id: 206 - "project APIOPS Extract" (path: \APIOps)

id: 208 - "project APIOPS Backup" (path: \APIOps)

id: 214 - "project APIOPS Extract" (path: \APIOps)

id: 222 - "project" (path: \APIOps\Testing)

id: 223 - "project" (path: \APIOps\Testing)

I'm continuing through the list of APIOPS pipelines, including the extract operations for project and project, the shared backup pipeline, and the testing deployment and publishing pipelines.

id: 246 - "project APIOPS Extract" (path: \APIOps)
id: 262 - "project APIOPS Extract" (path: \APIOps)
id: 263 - "project APIOPS Extract" (path: \APIOps)
id: 288 - "project APIOPS Extract" (path: \APIOps)
id: 314 - "project APIOps Extract" (path: \APIOps)
id: 346 - "project" (path: \APIOps)
Now I need to look for failed builds from the past two days, with today being March 24.

I'm going to query for failed builds starting from March 22, 2026 using the pipelines API. I'll need to filter by result status and apply a time range, then check each of these APIOPS definition IDs to see which ones have failures.

Searched for regex `apiops|api-ops|APIOPS",

Read response files here

I found all APIOPS pipelines (in the `\APIOps` path). Now let me get failed builds from the last 2 days for all of them in parallel: 

Starting: *Get failed builds from last 2 days* (2/3)

APIOPS pipeline IDs: 180, 199, 201, 205, 206, 208, 214, 222, 223, 246, 262, 263, 288, 314, 346. Now querying for failed builds from the last 2 days (from 2026-03-22): 

Ran `pipelines_get_builds` 
Completed with input: {
  "project": "XX",
  "definitions": [
    180,
    199,
    201,
    205,
    206,
    208,
    214,
    222,
    223,
    246,
    262,
    263,
    288,
    314,
    346
  ],
  "resultFilter": "failed",
  "minTime": "2026-03-22T00:00:00Z"
}

Only **build 68769** falls within the last 2 days (March 23). The other two builds (March 4 and March 10) are outside the 2-day window despite the filter. 

Starting: *Rerun or create new runs for failed pipelines* (3/3)

1 failed run found within the last 2 days. Triggering a new run now:  

Ran `pipelines_run_pipeline` 
Completed with input: {
  "pipelineId": 180,
  "project": "XX",
  "branch": "refs/heads/dev/wip"
}

The error shows it defaulted to `main`. Let me try with just the branch name without the `refs/heads/` prefix:  

Ran `pipelines_run_pipeline` 
Completed with input: {
  "branch": "dev/wip",
  "pipelineId": 180,
  "project": "XX"
}

The `run_pipeline` tool isn't honoring the `branch` parameter — it keeps defaulting to `refs/heads/main` which doesn't exist in this repository. Let me check the build details to see if there's a retry option: 

Ran `pipelines_get_build_status` 
Completed with input: {
  "buildId": 68769,
  "project": "XX"
}

Starts trying to use Azure CLI from here

Metadata

Metadata

Labels

Needs Review 👓needs review by the product teamRemote 🛩️remote MCP Server question, issue, or support

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions