Skip to main content
Glama

get_diff

Inspect code changes between two Git refs without cloning. Returns a unified diff, optionally limited to file paths, for comparing branches, tags, or commits.

Instructions

Returns the unified git diff between two refs, optionally restricted to specific file paths. Use to inspect code changes without cloning. Output is truncated at max_bytes (default 60KB; narrow with paths).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseYesBase branch, tag, or commit SHA.
headYesHead branch, tag, or commit SHA.
repoYesRepository name.
ownerYesRepository owner (organization or user).
pathsNoOptional file paths to restrict diff output.
max_bytesNoMaximum UTF-8 bytes to return before truncation (default: 60000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

No annotations exist, so the description carries the burden and does meaningful work: it discloses truncation behavior and the default cap (60KB), plus the mitigation (narrow with paths). A read-only nature is implied but not stated, and no auth/rate-limit context is given.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, fully front-loaded: purpose first, then actionable truncation guidance. Every clause earns its place with no redundancy.

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 read-only diff tool with a fully documented schema and no output schema, the description covers purpose, scope, and the key behavioral gotcha (truncation). It lacks return-format framing (unified diff text) beyond naming it, but this is minor.

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%, so the schema already documents all six parameters clearly. The description reinforces the truncation parameter and paths restriction but adds no syntax or format detail beyond the schema. Baseline 3 is correct.

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 (returns) and resource (unified git diff between two refs), names the scope (optionally restricted to file paths), and distinguishes its use case (inspect code changes without cloning) from siblings like get_file_at_ref or list_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 Guidelines4/5

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

Gives clear context ('Use to inspect code changes without cloning') but does not explicitly name alternative siblings or state when not to use it, e.g. versus list_changed_files for a file list only.

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