Skip to main content
Glama

GitHub pull request context

gh_pr_context
Read-onlyIdempotent

Fetches pull request review context in one call, including title, body excerpt, changed files, review states, and comments for read-only code review.

Instructions

Fetch everything needed to review a pull request in one call: title, body excerpt, base/head, size, changed files, review states and review comments. Read-only.

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>",
      "number": "<number>"
    },
    "name": "gh_pr_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
repoYesRepository as owner/name
numberYesPull request number

Output Schema

NameRequiredDescriptionDefault
baseYes
headYes
repoYesRepository as owner/name
draftYes
filesYes
stateYes
titleYes
authorYes
numberYes
reviewsYes
commentsYes
additionsYes
deletionsYes
bodyExcerptYes
changedFilesYesFiles changed in total, which can exceed the files array
filesTruncatedYesTrue when the PR changes more files than the 100 kept

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=true, so the trailing 'Read-only.' sentence mostly restates structured data. The only added behavioral nuance is the hint of a 'body excerpt' (truncation) and the single-call framing, which is modest value over the annotations.

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?

A single front-loaded sentence that lists contents efficiently with zero padding. The closing 'Read-only.' is redundant with readOnlyHint and is the one phrase that does not earn its place.

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 an output schema present, return values need no explanation, and both required parameters are described in the schema; the description still summarizes contents so an agent can select it. Given the safety profile is fully covered by annotations, only minor selection guidance (no named alternatives) is missing.

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?

Both parameters (repo as owner/name, positive integer PR number) are fully documented in the schema at 100% coverage, so the schema already carries the semantics. The description adds no parameter-level detail beyond what is structured, making the baseline 3 appropriate.

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

Purpose4/5

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

States a specific verb ('Fetch') plus the resource ('pull request context'), then enumerates the returned contents (title, body excerpt, base/head, size, changed files, review states, comments), which makes it distinguishable from git_diff or gh_ci_failures in practice. No sibling is named explicitly, so it stops short of a 5.

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?

'Everything needed to review a pull request in one call' clearly establishes the situation in which to use it and implicitly argues against assembling the data from several tools. There are no explicit exclusions or named alternatives, which keeps it below 5.

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