Skip to main content
Glama
modelcontextprotocol

git MCP server

Official

git_diff

Read-onlyIdempotent

Compare branches or commits to reveal code changes in a Git repository, with optional context lines for review.

Instructions

Shows differences between branches or commits

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

C2.7/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=false, so safety is covered. The description adds nothing beyond that — no output format, no size/pagination caveats, no note that the working tree is untouched.

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 tight, front-loaded sentence with no filler. It is appropriately sized, though brevity here borders on under-specification rather than economy.

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

Completeness2/5

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

For a three-parameter tool with 0% schema coverage and no output schema, the description leaves key information missing: target syntax (branch vs commit range vs SHA), the meaning of context_lines, and the shape of the diff output.

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 description coverage is 0% across three parameters. The description only loosely gestures at the "target" parameter (branches or commits) and says nothing about repo_path or the context_lines default of 3, so it fails to compensate for the undocumented 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 and resource ("Shows differences") and scopes it to branches or commits, which partly separates it from the unstaged/staged diff siblings. However, it never names those siblings, so the agent must infer the distinction.

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?

The phrase "between branches or commits" hints at the comparison scope but gives no explicit when-to-use, when-not-to-use, or routing advice against git_diff_unstaged, git_diff_staged, git_show, or git_status.

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