merge_pull_request
Merge a pull request by number using merge, squash, or rebase strategies, with optional custom commit title/message and SHA guard to confirm branch state.
Instructions
Merge a pull request by index. Do selects the strategy: 'merge' (merge commit), 'squash' (single commit), 'rebase' (rebase + fast-forward), 'rebase-merge' (rebase + merge commit). Optional MergeTitleField/MergeMessageField customize the merge commit; SHA guards against branch drift. IRREVERSIBLE — confirm the index, strategy, and that the PR is mergeable (get_pull_request mergeable: true) with the user BEFORE merging. Check is_pull_merged first if unsure.
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": {
"index": "<index>",
"Do": "<Do>"
},
"name": "merge_pull_request"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Do | Yes | Merge strategy: 'merge' (merge commit), 'squash' (single commit), 'rebase' (rebase then fast-forward), 'rebase-merge' (rebase then merge commit) | |
| SHA | No | The expected HEAD SHA of the PR (fails if the branch moved since) | |
| repo | No | Repository name (defaults to GITEA_DEFAULT_REPO) | |
| index | Yes | Pull request number | |
| owner | No | Repository owner (defaults to GITEA_DEFAULT_OWNER) | |
| MergeTitleField | No | Title for the merge commit | |
| MergeMessageField | No | Message body for the merge commit |