Skip to main content
Glama

GitHub get pull request

github_get_pull_request
Read-only

Why can a pull request not merge? Reads one pull request: state, draft, mergeable and mergeable_state, head and base branch and sha, how far the head is ahead of and behind its base, the base branch's required status checks (classic protection and rulesets) with each one's state on the head (passing, failing, pending, missing, unknown), whether the base requires up-to-date branches, the approving reviews it needs and has, the repository's Ankra merge train (on, off, not_connected) with this pull request's place on it or why it left, and merge when green: a pending request (what it waits on) and whether the repository's binding honours one. blocking_reasons lists only causes these reads establish; unknowns lists what could not be read. Read-only. Call it before saying why a pull request is blocked.

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_request_number": "<pull_request_number>"
    },
    "name": "github_get_pull_request"
  }
}

Input Schema

NameRequiredDescriptionDefault
repoYesRepository name. Also accepts the combined 'owner/name' form.
ownerNoRepository owner. May be omitted when the repository name is unambiguous in this organisation, or embedded in 'repo' as 'owner/name'.
pull_request_numberYesThe pull request's number within the repository.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the 'Read-only' sentence is redundant. However, the description adds genuine behavioral context the annotations cannot: it discloses that blocking_reasons only lists causes these reads actually establish and that unknowns lists what could not be read — an important caveat about result completeness for an agent reasoning about merge blockers.

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

Conciseness3/5

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

The opening question is well front-loaded, but the bulk of the text is one enormous comma-chained sentence enumerating a dozen return fields, which is hard to parse. Much of the content earns its place since there is no output schema, but a bulleted or segmented structure would be far more usable.

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

Completeness4/5

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

With no output schema and a read-only tool, the description carries most of the burden and does so: it enumerates the returned dimensions, the meaning of blocking_reasons and unknowns, and the trigger condition. Repo/owner resolution is left to the schema, which fully documents it, so the gaps are minor.

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 description coverage is 100% with only three parameters (repo, owner, pull_request_number), and the description adds nothing parameter-level beyond what the schema already says. Baseline 3 is appropriate when the schema carries the full burden.

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 opens with a concrete diagnostic question and then names the exact resource ('Reads one pull request') and enumerates the specific facts it returns: mergeable_state, ahead/behind counts, required status checks, approvers, merge train placement, merge-when-green. That is far more than a restatement of the name and makes it distinguishable from siblings like scm_merge_pull_request or github_list_workflow_runs.

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?

It gives an explicit when-to-use rule: 'Call it before saying why a pull request is blocked,' which is a clear trigger. It does not name alternatives or exclusions (e.g., when to prefer scm_merge_pull_request or a listing tool), so it stops short of full routing guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.