Skip to main content
Glama

review_git_diff

Reviews staged, working-tree, or base-branch Git diffs and returns structured risk findings, summaries, and metrics, with an offline mock mode for credential-free local checks.

Instructions

Review a repository's git diff and return structured findings.

Args: repo_path: Path to the repository (any directory inside the work tree). mode: Diff source: "staged" (default), "working", or "base". base_ref: Branch or commit to diff against; required when mode="base". mock: Use the offline heuristic analyzer instead of calling the xAI API.

Returns: A JSON-serialisable report with summary, overall_risk, findings and metrics. Findings flagged in mock mode never came from the xAI API.

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": "review_git_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
mockNo
modeNostaged
base_refNo
repo_pathYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/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 does disclose a key trait: the tool calls an external xAI API by default, with an offline heuristic substitute via mock. It also warns that mock-mode findings never came from the xAI API, which prevents misreading results. It stops short of stating whether the operation is read-only, any size/latency limits, or authentication requirements for the API call.

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?

The purpose sentence is front-loaded and the Args/Returns blocks are easy to scan with zero filler. The Returns block partially restates what an output schema already conveys, though the mock-mode caveat inside it is worth keeping.

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 four-parameter tool with no annotations, the definition covers the essential gaps: parameter meanings, the external API dependency, and a fallback mode. An output schema exists so return structure needn't be spelled out. It lacks only a statement that the operation is non-mutating and any constraints on repo size or diff volume.

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 description coverage is 0%, so the description must do the work, and it documents all four parameters: repo_path accepts any directory inside the work tree, mode enumerates staged/working/base with a default, base_ref is conditionally required, and mock selects the offline analyzer. The mode values get only brief glosses (base in particular is thin), so meaning is added but not exhaustively.

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 opens with a specific verb+resource: review a repository's git diff and return structured findings, which tells an agent exactly what it gets back. It does not distinguish itself from the sibling list_changed_files, so an agent must infer that this tool goes further than listing changed files.

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

Usage Guidelines3/5

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

Usage context is implied rather than stated: an agent can infer this is for reviewing pending changes, and the conditional 'required when mode="base"' rule is a genuine usage constraint. There is no explicit when-to-use versus list_changed_files, nor any guidance on when mock mode is appropriate beyond the offline heuristic note.

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

Deploy Server

Other Tools