Skip to main content
Glama

Get exact-head pull request merge requirements

gh_get_merge_requirements
Read-onlyIdempotent

Aggregate merge requirements for a PR head: branch policy, required checks, review state, base freshness, mergeability, allowed methods. Flags incomplete evidence if policy or head state is unclear.

Instructions

Read-only: aggregate effective branch/ruleset merge policy, current required checks, exact-head review/thread state, base freshness, mergeability, and allowed merge methods for one expected pull-request head. Missing policy visibility or head movement is reported as incomplete evidence and never interpreted as no requirement.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoYesCanonical GitHub repository name without path separators.
ownerYesCanonical GitHub repository owner.
numberYesPositive pull request number.
expected_head_shaYesExact pull-request head SHA whose merge requirements are requested.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
numberYes
warningNo
base_refYes
base_shaYes
mergeableNo
up_to_dateNo
merge_stateNo
review_decisionNo
current_head_shaYes
evidence_sourcesNo
expected_head_shaYes
required_approvalsNo
exact_head_evidenceYes
up_to_date_requiredNo
allowed_merge_methodsNo
head_matches_expectedYes
required_status_checksNo
current_required_checksNo
current_valid_approvalsNo
checks_evidence_completeYes
policy_evidence_completeYes
review_evidence_completeYes
unresolved_review_threadsNo
code_owner_review_requiredNo
last_push_approval_requiredNo
current_valid_approval_countNo
up_to_date_evidence_completeYes
review_requirements_satisfiedNo
allowed_merge_methods_completeYes
conversation_resolution_requiredNo
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the description doesn't need to repeat that. It adds valuable context beyond annotations: 'Missing policy visibility or head movement is reported as incomplete evidence and never interpreted as no requirement.' This clarifies how the tool handles uncertain data, which is not obvious from annotations alone.

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?

The description is a single dense sentence that efficiently enumerates the aggregated components without redundancy. It front-loads the 'Read-only' nature and then lists all policy aspects. Every word earns its place, making it concise yet comprehensive.

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?

Given the tool's complexity (aggregating six different aspects) and the existence of an output schema (which likely defines the full response structure), the description covers the key inputs and outputs adequately. It also includes the critical caveat about incomplete evidence handling, making it sufficiently complete for an agent to understand what to expect.

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

Parameters3/5

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

Schema coverage is 100% as all parameters have descriptions. The tool description doesn't add additional parameter semantics beyond what the schema already provides. It mentions 'expected pull-request head' but that's a restatement of expected_head_sha's description. The description adds no extra nuance to parameters, so baseline 3 is appropriate.

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?

The description clearly states what the tool does with specific verbs and resources: 'aggregate effective branch/ruleset merge policy, current required checks, exact-head review/thread state, base freshness, mergeability, and allowed merge methods'. It distinguishes itself from sibling tools like gh_get_pr_checks or gh_get_pr by focusing on a comprehensive merge requirements aggregation for an exact head SHA.

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?

The description implies when to use it ('for one expected pull-request head') and includes a critical behavioral caveat about missing policy visibility, which helps the agent decide based on incomplete evidence. However, it doesn't explicitly name alternative tools or state 'use this instead of X', though the sibling context makes the distinction clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fvanevski/gh_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server