Skip to main content
Glama

repo_compare

Read-only

Returns the diff between two refs without truncation: by default from the merge base of from and to, as in an MR; straight compares with from directly (e.g. a previous review's sha). Patch lines carry new-version line numbers; pages are up to 153600 bytes (next page: offset = nextOffset until null), and a file that does not fit comes with error plus baseSha and toSha.

Input Schema

NameRequiredDescriptionDefault
toYesRef to compare: task branch, tag or sha.
fromNoBase: branch, tag or sha; defaults to the default branch.
pathNoDirectory prefix or file glob.
offsetNoPage offset: nextOffset of the previous response.
contextNoContext lines in the patch; default 3.
straightNoCompare with from directly, not with the merge base.
extensionsNoFile extensions without the dot.
lineNumbersNoNew-version line numbers; default true.
repositoryIDYesRepository ID.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Added
  4. Removed
  5. Added
  6. Removed
  7. Changed2 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / properties / offset / maximum
      Removed value: -9007199254740991
  8. Added
  9. Removed
  10. First observed

TDQS

A4/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnlyHint, destructiveHint=false), yet the description adds substantial operational detail: page size of 153600 bytes, next-page offset semantics terminating at null, new-version line numbering, and the error-plus-baseSha/toSha shape for oversized files. This is well beyond what the structured fields provide.

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, then layered with progressively finer detail (mode, line numbering, pagination, errors). It is dense, but each clause carries distinct operational information and little is redundant.

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?

With no output schema and nine parameters, the description does the heavy lifting for return values — patch lines, line numbering, pagination termination, and error shape are all covered. It is slightly thin on how path/extensions filtering affects returned content, but otherwise complete for calling the tool correctly.

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, but the description meaningfully extends several parameters: it clarifies from/to as refs with merge-base defaulting, explains straight's effect on the comparison base, describes the offset chaining to nextOffset, and states that line numbers are new-version. That is real added meaning over the schema text.

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?

States a concrete verb and resource ('Returns the diff between two refs') with the important nuance of merge-base vs straight comparison. It doesn't explicitly name which siblings it is not, but 'diff between two refs' is a unique resource among the repo_* siblings, so an agent can still distinguish it.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

It implies usage by contrasting default merge-base behavior ('as in an MR') with the straight mode ('e.g. a previous review's sha'), which hints at when each applies. However, it never says when to choose this tool over repo_history, repo_file, or repo_search, so guidance remains implied rather than explicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources