Skip to main content
Glama

Get pull request diff

get_pull_request_diff
Read-only

Fetch the unified diff or patch for a pull request to inspect proposed code changes and review modifications before merging.

Instructions

Get the unified diff (or patch) of a pull request.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoYesRepository name
indexYesPull request number
ownerYesRepository owner (user or organization)
formatNodiff

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, openWorldHint=true and destructiveHint=false, so the safety profile is covered. The description adds that the payload is a raw unified diff/patch rather than structured metadata, which is useful, but it says nothing about large-PR truncation, size limits, or error behavior for invalid PR numbers.

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?

One short sentence that front-loads the verb and the resource with zero filler. Nothing to trim and nothing buried.

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

Completeness3/5

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

With no output schema, the description correctly tells the agent the return value is a diff/patch string, which covers the essentials for a simple read. It is still thin for a PR-diff tool: no note on truncation for large diffs, on whether the diff is against base or merge commit, or on format defaults beyond the schema default.

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 75% and the three required params (owner, repo, index) are already documented in the schema. The description usefully explains the otherwise undocumented 'format' enum by naming both 'diff' and 'patch' as accepted outputs, adding meaning beyond the schema.

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 (get) and resource (pull request diff) and clarifies the return form as a unified diff or patch. However, it does not distinguish itself from the nearby sibling list_pull_request_files, which an agent could reasonably confuse with this tool.

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

Usage Guidelines2/5

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

Provides no when-to-use guidance, prerequisites, or alternatives. An agent has to infer on its own whether to call this or list_pull_request_files/list_pull_request_reviews to inspect a PR's changes.

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