Skip to main content
Glama
crunchtools

MCP GitHub CrunchTools

by crunchtools

Merge Pull Request Tool

merge_pull_request_tool

Merge a GitHub pull request only after required status checks pass; refuse when checks are missing, pending, or failed, and pin the merge to the checked head SHA.

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.

Input Schema

TableJSON 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

TableJSON 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.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so richly: it discloses that the tool re-verifies checks itself because bypass-list tokens can merge past failing checks, exactly which check conclusions count as passing, that the merge is pinned to the verified head SHA, and the full set of failure modes. This is behavior an agent could not infer from the schema.

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

Conciseness5/5

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

Front-loaded with the core action in sentence one, then behavior and refusal conditions in descending importance. Dense but every sentence carries information an agent needs; no filler or restatement of the name.

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?

An output schema exists, so return values need not be described, and the description fully covers the behavioral surface (safety enforcement, refusal cases, SHA pinning) that the missing annotations would otherwise leave unexplained. Nothing an agent needs to invoke this mutation safely is absent.

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 baseline is 3, but the description adds real meaning beyond it: it explains that sha must be the current head or the call refuses, and that allow_no_required_checks governs the no-required-checks case. merge_method is left to the schema's own enum-like description.

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?

States a specific verb and resource ('Merge a GitHub pull request') with the key scope qualifier (only once required checks are green). No sibling tool in the list performs a merge, so the operation is unambiguous and immediately distinguishable from the get/update/create pull request tools.

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 clear preconditions and enumerates precise refusal conditions (missing/pending/failed checks, stale sha, unreadable branch protection, no required checks unless allow_no_required_checks). It does not explicitly name sibling alternatives or when a caller should prefer a different tool, but the operation is unique among siblings so guidance is effectively complete.

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