merge_pull_request
Complete active Azure DevOps pull requests immediately or enable/cancel auto-complete with merge strategy, source branch deletion, work item transitions, and policy bypass.
Instructions
Complete (merge) an active pull request immediately or enable/cancel auto-complete with merge strategy, source branch deletion, work item transitions, and policy bypass options (repositoryId optional; derived from pullRequestId when omitted; works on both Azure DevOps Services and Azure DevOps Server)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pullRequestId": "<pullRequestId>"
},
"name": "merge_pull_request"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | No | The ID or name of the project (Default: MyProject; derived from pullRequestId when omitted and no default project is configured) | |
| autoComplete | No | Set true to enable auto-complete (merge automatically once policies pass), false to cancel auto-complete, or omit to complete/merge immediately | |
| bypassPolicy | No | Explicitly bypass branch policies when completing (requires Bypass Policies permission) | |
| bypassReason | No | Reason recorded when bypassPolicy is true | |
| repositoryId | No | The ID or name of the repository (optional; derived from pullRequestId when omitted) | |
| mergeStrategy | No | Merge strategy: noFastForward (standard merge commit), squash, rebase, or rebaseMerge (optional; defaults to repository policy when omitted) | |
| pullRequestId | Yes | The ID of the pull request to merge or complete | |
| deleteSourceBranch | No | Delete the source branch after the pull request completes | |
| mergeCommitMessage | No | Custom commit message for the merge or squash commit | |
| transitionWorkItems | No | Transition linked work items to the next logical state upon completion | |
| lastMergeSourceCommitId | No | Optional expected source head commit SHA for optimistic concurrency; if omitted during immediate completion, fetched automatically from the pull request | |
| autoCompleteIgnoreConfigIds | No | Optional policy configuration IDs that auto-complete should not wait for (requires autoComplete: true; only applies to optional policies) |