Skip to main content
Glama

Get diff

get_diff
Read-onlyIdempotent

Retrieve the unified diff between two commits, split per file. Defaults to pull-request semantics; output is capped, so fetch omitted files separately.

Instructions

Get the unified diff between two commits, split per file. Defaults to pull-request semantics (changes on head since it branched from base). Output is capped: files that don't fit have patchOmitted: "size_limit"; fetch them separately with paths.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseYesBase ref, e.g. `main` or a SHA.
headNoHead ref. Defaults to HEAD.HEAD
modeNo`merge-base` diffs from where head branched off base (what a pull request shows, like `base...head`). `direct` diffs the two commits as they are (`base..head`).merge-base
pathsNoOnly include these files or directories (literal paths, not globs).
maxBytesNoTotal patch budget in bytes. Can't exceed the server's limit.
contextLinesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseYes
headYes
filesYes
mergeBaseYes
truncatedYesTrue if any patch was omitted for size.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the safety profile is covered. The description adds genuinely new behavior: output is size-capped, omitted files are flagged with `patchOmitted: "size_limit"`, and they can be retrieved with `paths`. That is real disclosure beyond the structured fields, though server-side limit details remain implicit.

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?

Three dense sentences, front-loaded with the core action, then the default semantics, then the truncation escape hatch. No filler.

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?

An output schema exists, so return values need not be re-explained; nonetheless the description covers the partial-output edge case that matters most for correct invocation. Nothing an agent needs to call this correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 83%, so baseline is 3. The description adds cross-parameter meaning the schema doesn't: the `base`/`head` pair defaults to PR-style comparison, and `paths` is framed as the recovery mechanism for omitted files rather than just a filter.

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+resource ('Get the unified diff between two commits, split per file') and immediately clarifies scope with the pull-request default. This is clearly distinguishable from read_file, search_code, and 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?

Explains the default mode (PR semantics) and tells the agent what to do when output is truncated (fetch omitted files via `paths`). It stops short of naming sibling alternatives or stating when-not to use this tool, but the situational context is clear.

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

Deploy Server

Other Tools