Skip to main content
Glama

Diff two commits or two package versions

code_diff
Read-only

Compares two exact identities of the same public GitHub repository (base and head refs, both resolved to commit shas) or npm package (base and head versions, both tarballs checked against the registry's sha512). Without path: the added, removed and changed files, decided by git blob id. With path: a unified diff of that file (Myers; minimal:false marks a large change answered as one replace hunk); identical blobs answer no hunks, a file that is not UTF-8 text answers binary:true with both blob ids and no hunks ("Binary files differ"), and a change region of more than 100000 lines is refused (diff_too_large). Pages with offset/limit (at most 1000 items and about 1 MB per page; truncated:true when the byte bound ended a page). A hunk larger than a page is split at line boundaries into consecutive hunks that apply in order; a single line larger than a page is refused (response_too_large) with both blob ids. Every answer, an error included, carries a pauhu-library-receipt/2 in structuredContent.receipt and as a trailing "receipt: {...}" text line; library_verify checks a receipt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseYesBase ref (repo) or version (package)
headYesHead ref (repo) or version (package)
pathNoOne file: answer its unified diff
repoNoGitHub repository as owner/name, e.g. nodejs/node. Give this or package.
limitNoFiles (summary) or hunks (path) per page (default 200, at most 1000)
offsetNo
packageNonpm package name, e.g. source-map-js or @scope/name. Give this or repo.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and openWorldHint; the description adds substantial behavior beyond that: binary blobs answer binary:true, non-UTF-8 refusal, diff_too_large >100000 lines, response_too_large for oversized single lines, hunk splitting at line boundaries, page sizing (~1MB, 1000 items, truncated:true), and a pauhu-library-receipt/2 on every response including errors.

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 compare/repo-vs-package statement, and nearly every sentence carries distinct operational information (modes, binary, size limits, paging, receipts). It is extremely dense and reads as one monolithic paragraph, which hurts scanability, but waste is minimal.

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?

For a 7-parameter, no-output-schema, high-complexity read tool, the description covers mode selection, error conditions, refusal cases, pagination, and the receipt contract an agent must know to consume or verify results. Nothing needed to invoke or interpret the call 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 high (86%, baseline 3), but the description adds mode-specific semantics the schema lacks: path returns a unified diff of one file with Myers algorithm and minimal:false large-change handling, and limit means files-per-page in summary mode vs hunks-per-page in path mode. This meaningfully extends the terse schema descriptions.

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 (compares) and resource (two exact identities of the same public GitHub repo or npm package, base/head resolved to shas/tarballs). It also articulates the two operating modes (summary vs single-file unified diff), so an agent can tell this apart from code_read/code_grep siblings without opening the schema.

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?

The description cleanly distinguishes the two modes via 'Without path' vs 'With path', which is genuine usage guidance, but it never says when to choose code_diff over code_read, code_grep, or source_fetch_fragment, nor any prerequisites. Usage is implied rather than routed to alternatives.

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