Skip to main content
Glama
MCP GitHub CrunchTools

MCP GitHub CrunchTools

by crunchtools

Merge Pull Request Tool

merge_pull_request_tool

Merge 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

NameRequiredDescriptionDefault
shaNoFull commit SHA the PR head must still be at (optional)
repoYesRepository name
ownerNoRepository owner (defaults to GITHUB_DEFAULT_ORG if unset)
pull_numberYesPull request number
merge_methodNo"merge", "squash", or "rebase" (default: merge)merge
allow_no_required_checksNoMerge even if the base branch requires no status checks (default: False, refuse)

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.3.0
    • addedInput schema / properties / allow_no_required_checks
      Added value: +{
      +  "default": false,
      +  "description": "Merge even if the base branch requires no\nstatus checks (default: False, refuse)",
      +  "type": "boolean"
      +}
  2. Addedv1.2.0

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations at all, the description carries the full burden and meets it: it discloses the refusal cases by name, the bypass-token hazard it guards against, the pinned-head-SHA guarantee, which conclusions count as passing (success/skipped/neutral), and the fine-grained-token fallback to Actions jobs. That is exactly the mutation-safety context an agent needs before calling a destructive, irreversible operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action and its gating condition are front-loaded in the first sentence, and the remaining detail is genuinely load-bearing rather than filler. It is dense and long for a single paragraph, but no sentence is redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 6-parameter, irreversible write tool with no annotations, the description supplies the safety profile, the failure modes, and the token caveats; an output schema exists so return values need not be explained. Nothing an agent needs in order to call this correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns above that by explaining the semantics behind sha (a mismatch aborts the merge) and allow_no_required_checks (default refuse when the base branch requires nothing), which the schema states only tersely. merge_method and owner are left to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource ("Merge a GitHub pull request") plus the gating condition ("only once its required checks are green"). This clearly separates it from sibling read tools like get_pull_request_checks_tool and from update_pull_request_tool, which cannot merge.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a rich conditional picture of when the tool will proceed versus refuse (missing/pending/failed checks, sha mismatch, unreadable protection, no required checks unless allow_no_required_checks). It does not explicitly route the agent to siblings such as get_pull_request_checks_tool for a pre-flight check, so it stops short of the top band.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.