Skip to main content
Glama

github_get_pull_diff

Fetch a GitHub pull request's diff or patch in read-only form, truncated to 30,000 characters, to review code changes without modifying repository data.

Instructions

读取 Pull Request 的 diff/patch(只读,截断到 30000 字符)。

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": {
      "owner": "<owner>",
      "repo": "<repo>"
    },
    "name": "github_get_pull_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
repoYes仓库名
ownerYes仓库所有者(用户或组织)
numberNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden, and it does disclose two genuinely useful traits: the operation is read-only and output is truncated to 30000 characters. It stops short of saying what happens on truncation (whether a flag or notice is returned), whether there is a large-diff fallback, or what auth is needed.

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?

One compact sentence with the read-only and truncation caveats parenthesized right after the purpose, so the most important constraints are front-loaded. It is arguably over-terse given the missing parameter and usage context, but no wording is wasted.

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?

For a simple read tool with no output schema and no annotations, the description covers the core semantics and the truncation limit. It is incomplete on which PR is targeted (the optional `number`), error behavior, and return shape beyond 'diff/patch', which an agent would need before calling it confidently.

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

Parameters2/5

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

Schema coverage sits at 67%, and the undocumented parameter is `number` — the very field that selects which Pull Request's diff is read. The description says nothing about any parameter, so it does not compensate for that gap or explain why `number` is optional while owner/repo are required.

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?

The description uses a specific verb+resource combination (读取 Pull Request 的 diff/patch), which unambiguously separates it from github_get_pull (PR metadata) or github_get_commit. It's clear what the tool returns; it just doesn't explicitly name the sibling it replaces.

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?

There is no when-to-use guidance, no mention of when to prefer github_get_pull or github_get_file instead, and no prerequisites (auth scope, whether the PR must be open, whether `number` is required). The agent must infer the usage context entirely from the purpose sentence.

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