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

TableJSON 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. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses critical runtime behavior: no truncation, pages capped at ~153600 bytes, the pagination contract (offset = nextOffset until null), that patch lines carry new-version line numbers, and that an oversized file yields an error together with baseSha and toSha. This is exactly the operational detail an agent cannot get from annotations or schema.

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?

One dense sentence front-loads the core purpose, then layers pagination and error semantics in the order an agent needs them. Every clause carries information, though the run-on structure makes it heavier to parse than a split would be.

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, the description carries the burden of explaining return shape, and it does so for pagination, line numbering and the oversized-file error case. Edge cases such as binary-content handling or a maximum page count are not covered, so it is strong but not exhaustive.

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 description coverage is already 100%, so 3 is the floor, but the description adds meaning the schema does not: how from/to interact (merge base vs straight), what lineNumbers controls in the output, and how offset is driven by nextOffset. The path, context and extensions parameters get no extra prose, which keeps it 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 specific verb and resource ('Returns the diff between two refs'), immediately distinguishing it from read-oriented siblings such as repo_history, repo_blame or repo_search. The scope is further pinned down by naming the default comparison basis (merge base of from and to, as in an MR).

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 concrete guidance on when to flip the straight flag: 'as in an MR' for the merge-base default versus 'a previous review's sha' for direct comparison. It does not name alternative sibling tools or state exclusions, but the usage context for the key mode switch is unambiguous.

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