Skip to main content
Glama

git_diff

Read-onlyIdempotent

Compare the current worktree against a specific commit while omitting protected file patches; optionally set a repository path that matches the server’s fixed repository.

Instructions

Compare worktree with a commit, omitting protected file patches. Omit repo_path to use the configured repository. Results and operations are restricted according to project policy.

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

Input Schema

NameRequiredDescriptionDefault
targetYes
repo_pathNoOptional repository root. Omit to use the server's fixed repository. An explicit path must identify that same repository.
context_linesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2026.10.19

TDQS

C2.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive behavior, and closed-world scope. The description adds useful behavioral context beyond annotations by noting that protected file patches are omitted and that results/operations are restricted by project policy, but these disclosures remain somewhat vague.

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 description is short and front-loads the core purpose. The repo_path and policy sentences are relevant, though the policy sentence is vague enough to be only marginally useful.

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?

With three parameters, only one required and low schema description coverage, the definition is not complete enough for reliable invocation. It leaves the required target and context_lines undefined, and there is no output schema to clarify return behavior.

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 only 33%, and the required target parameter and context_lines parameter have no descriptions in the schema. The description repeats repo_path guidance already present in the schema and does not explain what values target accepts or how context_lines affects the diff.

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 states a specific verb and resource: 'Compare worktree with a commit,' and adds the scoping detail that protected file patches are omitted. This distinguishes it implicitly from unstaged/staged diff siblings, but it does not name or explicitly differentiate against tools like git_diff_revisions or git_diff_unstaged.

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 only usage guidance is parameter-level: omit repo_path to use the configured repository. There is no guidance on when to use this tool versus git_diff_unstaged, git_diff_staged, or git_diff_revisions, and no explicit exclusions or prerequisites.

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