Merge Pull Request Tool
merge_pull_request_toolMerge a GitHub pull request, only once its required checks are green.
Instructions
Merge a GitHub pull request, only once its required checks are green.
The tool enforces the base branch's required status checks itself before
merging, because an organization owner's token (or one on a ruleset's
bypass list) lets GitHub merge past failing required checks. It refuses,
naming each offending check, when a required check run or status on the
PR head is missing, pending or failed; when sha is not the current
head; when branch protection cannot be read; and when the base branch
requires no checks at all, unless allow_no_required_checks is True.
Passing check runs conclude success, skipped or neutral. The merge is
pinned to the head SHA that was checked. A token that cannot read
check-runs (any fine-grained token) is judged on the Actions jobs, and a
required check not reported by GitHub Actions is refused as missing.
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": {
"repo": "<repo>",
"pull_number": "<pull_number>"
},
"name": "merge_pull_request_tool"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sha | No | Full commit SHA the PR head must still be at (optional) | |
| repo | Yes | Repository name | |
| owner | No | Repository owner (defaults to GITHUB_DEFAULT_ORG if unset) | |
| pull_number | Yes | Pull request number | |
| merge_method | No | "merge", "squash", or "rebase" (default: merge) | merge |
| allow_no_required_checks | No | Merge even if the base branch requires no status checks (default: False, refuse) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||