Skip to main content
Glama
igordev96
by igordev96

Compare two refs

compare
Read-only

Summarize changed files between two Git refs from their merge base, showing per-file status and line counts without returning patches.

Instructions

Summarise what changed on to since it split from from — git diff <merge-base> <to> — as one row per file: git's status letter (A, M, D, R091 old -> new) and ± counts, or binary. The merge_base is printed, so which diff ran is never hidden; merge_base: false asks for the raw two-dot diff instead, and when the two refs share no history the two-dot diff runs with merge_base="none". This never returns a patch — a branch diff is unbounded — so the file list is capped by max_files and a capped answer says so. Use diff_file for one file's patch, passing a printed merge_base as from for the branch view of it. path is a git pathspec, and it narrows rename detection with it: a rename can then appear as a delete and an add. Both refs are resolved before the diff and both commits are stated in the result, with synced_at.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesThe ref to compare to — whose changes are summarised, e.g. 'fix/PROJ-7608'.
fromYesThe ref to compare from — what the split is measured from, e.g. 'develop' or a commit sha.
pathNoA git pathspec to narrow the comparison, e.g. 'src/'. Note that it narrows rename detection too.
projectNoGitLab project path, e.g. 'group/subgroup/repo'. Defaults to GITLAB_DEFAULT_PROJECT.
max_filesNoMaximum changed files to list (default 100). Totals still cover every file; a capped answer says so.
merge_baseNoDiff from the merge base of the two refs (default true). Set false for the raw two-dot diff — 'what would applying this do'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.10.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, so safety is covered; the description adds non-obvious behaviour instead: it never returns a patch because branch diffs are unbounded, the file list is capped by `max_files` and a capped answer is labelled as such, the `merge_base` used is printed, and both resolved commits plus `synced_at` appear in the result. These are real operational traits an agent cannot get from the annotations.

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 operation and output format before the caveats, and essentially every sentence carries information. It is a dense single paragraph with several interleaved concerns (capping, rename narrowing, no-history case), which costs some scannability but no obvious 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?

There is no output schema, so the description must carry the return contract — and it does: per-file status letters (`A`/`M`/`D`/`R091 old -> new`), ± counts, `binary`, printed `merge_base`, resolved commits and `synced_at`. Combined with the cap semantics and sibling routing, an agent has everything needed to call and interpret this tool.

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 100%, so the baseline is 3; the description earns an extra point by explaining consequences the schema only hints at — that narrowing with `path` can turn a rename into a delete plus an add, and that a `merge_base="none"` result signals unrelated histories. The `merge_base` toggle is largely restated from the schema, keeping this short of a 5.

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 precise verb and resource — summarise what changed on `to` since it split from `from` — and pins down the exact git operation (`git diff <merge-base> <to>`) and output shape (one row per file with status letter and ± counts). It also differentiates itself from the sibling `diff_file`, so an agent can pick between them without opening either 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 routes the agent: use `diff_file` for a single file's patch, and pass a printed `merge_base` as `from` to get the branch view of it. It also states the conditions that change behaviour (`merge_base: false` for the raw two-dot diff, no shared history ⇒ two-dot with `merge_base="none"`), leaving nothing to inference.

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