Skip to main content
Glama

gemini_pr_review

Review pull request or branch diffs with Gemini by auto-fetching Git changes and optionally adding full changed-file content for deeper context and focused feedback.

Instructions

Review a pull request or branch diff using Gemini. USE THIS TOOL WHEN: (1) You want to review all changes in a PR or feature branch before merging. (2) You need a thorough review of a large diff that would consume too many tokens. (3) You want to compare changes between two branches or commits. This tool automatically fetches the git diff and optionally collects the full content of changed files for deeper context. It differs from gemini_review: this tool is git-aware and fetches diffs automatically, while gemini_review requires you to pass in the diff or file content manually.

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_path": "<repo_path>"
    },
    "name": "gemini_pr_review"
  }
}

Input Schema

NameRequiredDescriptionDefault
baseNoBase branch or commit to compare against. Defaults to "main". Examples: "main", "develop", "HEAD~5", "abc1234".
headNoHead branch or commit to review. Defaults to "HEAD" (current branch). Examples: "feature/auth", "HEAD", "def5678".
modelNoOverride the default Gemini model. If omitted, uses the server default.
repo_pathYesAbsolute path to the git repository. REQUIRED — always provide the project root path.
review_focusNoWhat aspect to focus on. Examples: "security", "performance", "error handling", "API design", "backward compatibility". If omitted, performs a general-purpose review.
include_file_contentNoIf true, also sends the full content of changed files (not just the diff) for deeper context. Useful for complex refactors. Defaults to false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden, and it does disclose meaningful behavior: it automatically runs git to fetch the diff, can optionally pull full file content for deeper context, and is motivated by token cost on large diffs. What it omits is the output, and because no output schema exists, an agent still cannot tell whether it receives a review string, structured findings, or a summary. It also says nothing about model or credential requirements.

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?

It front-loads the purpose in one sentence, then enumerates use cases as a numbered list, then closes with a single comparative sentence against the sibling. Every sentence carries information; nothing repeats the name or title.

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?

For a six-parameter git-aware review tool with no annotations and no output schema, the description covers what it does mechanically and when to choose it, which is most of what an agent needs. The notable remaining gap is return shape and whether review output is structured or freeform, plus any Gemini model or API-key prerequisites.

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%, so the schema already documents repo_path, base, head, model, review_focus, and include_file_content, including defaults and examples. The description adds only a loose gloss on file content being collected 'for deeper context,' which slightly reinforces include_file_content but adds nothing for the other five parameters. Baseline 3 is appropriate when the schema does the work.

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 specific verb and resource: review a pull request or branch diff using Gemini. It then explicitly distinguishes itself from the sibling gemini_review by explaining that this tool is git-aware and auto-fetches diffs, letting an agent tell the two apart without inspecting either schema.

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

Usage Guidelines5/5

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

It supplies an explicit 'USE THIS TOOL WHEN' list with three concrete conditions (pre-merge PR review, large diffs that would blow the token budget, branch/commit comparison) and names the alternative, gemini_review, along with the condition that selects it. The routing decision is fully spelled out rather than inferred.

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