Skip to main content
Glama

Get project diff

get_diff
Read-onlyIdempotent

Review staged, uncommitted, or ref-to-ref Git changes via masked unified diff hunks with per-file status, added/removed counts, and secret/private-data redaction.

Instructions

Shows what changed: masked unified diff hunks for a Git scope. Use it to review staged, uncommitted or ref-to-ref changes; use get_file for whole files and search_project for text. Returns per-file status, added/removed counts and hunks with context, largest changes first, under the same secret and private-data redaction as file content, with complete|partial status within 50,000 characters. Key parameters: git_scope=changes|staged|diff:A..B (default changes), paths, include_patterns, context_lines=0..20.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathsNoNarrows selection to literal paths for existing project-relative files or directories; glob characters are ordinary.
git_scopeNoChooses the comparison: changes is HEAD to the working tree including untracked files, staged is HEAD to the index, and diff:<ref>..<ref> compares two commits.changes
context_linesNoUnchanged lines around each change; hunks whose context touches merge.
include_patternsNoNarrows with project-relative '/' globs: '*' and '?' stay in one segment, '**/' spans depths, and '{a,b}' alternates; matching is case-sensitive, while '!' and '[...]' are rejected.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv5.2.5

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description goes beyond them with substantive traits: secret and private-data redaction matching file content, a 50,000-character cap with complete|partial status, and largest-changes-first ordering. It does not say what happens when the cap is hit beyond the status flag, which keeps it just short of a 5.

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?

Front-loaded with the core purpose and the sibling routing in the first two sentences, then return shape, then parameters – a sensible order. The closing parameter recap is partly redundant with the schema and is the one passage that does not fully earn its space.

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

Completeness5/5

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

With no output schema, the description still specifies the return payload: per-file status, added/removed counts, context hunks, ordering, redaction and truncation status. Combined with full schema coverage and annotations, an agent has everything needed to call this correctly and interpret results.

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% and each parameter already carries a detailed definition, including path glob semantics and context merge behavior. The description's parameter recap (git_scope values, default changes, context_lines=0..20) largely restates the schema, adding little beyond a quick-reference summary, so the baseline of 3 applies.

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?

States a specific verb and resource ("Shows what changed: masked unified diff hunks for a Git scope") and immediately distinguishes itself from siblings by naming get_file and search_project as the tools for whole files and text search. An agent can identify the tool's role without reading the 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?

Explicitly enumerates the three use cases (staged, uncommitted, ref-to-ref changes) and routes competing needs to named alternatives: get_file for whole files, search_project for text. This is when-to-use plus when-to-use-something-else, exactly the guidance needed for selection.

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