Skip to main content
Glama
git MCP server

git MCP server

Official

git_diff

Read-onlyIdempotent

Shows differences between branches or commits, or across a revision range to review changes before merging.

Instructions

Shows differences between branches or commits, or across a revision range (main..feature, main...feature)

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>",
      "target": "<target>"
    },
    "name": "git_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
targetYes
repo_pathYes
context_linesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.0.0
    • changedInput schema / title
      Previous value: -"GitDiff"New value: +"diffArguments"
  2. Addedv1.0.0

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered. The description adds nothing beyond that about output format, size of diffs, or behavior on missing refs; with annotations carrying the safety burden, this is adequate but thin.

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 well-formed sentence with the core capability front-loaded and the revision-range syntax appended as a useful clarification. No filler, though the parenthetical could be tightened further.

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 three-parameter read-only inspection tool with no output schema, the description covers the essential purpose and target syntax. It leaves gaps on repo_path expectations, the meaning/effect of context_lines, and how this differs from staged/unstaged diff siblings, so an agent still needs to inspect the schema and guess at selection.

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 0%, so the description must compensate. It partially does: the 'main..feature' and 'main...feature' examples clarify the 'target' parameter's syntax and the two-dot/three-dot distinction, which the schema does not convey. However, 'repo_path' and 'context_lines' (including its default of 3) receive no explanation, leaving roughly a third of the parameters undocumented.

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?

Uses a specific verb ('Shows differences') plus resource ('branches or commits', revision ranges) and gives concrete target syntax examples, so the agent knows exactly what the tool returns conceptually. It does not explicitly distinguish itself from the sibling git_diff_staged and git_diff_unstaged, which is the only thing separating it from 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 Guidelines2/5

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

There is no statement of when to use this tool versus git_diff_staged, git_diff_unstaged, git_show, or git_log, all of which overlap in the diff/inspection space. The agent must infer the selection rule from the description alone.

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