Skip to main content
Glama

Compare two refs

repo_diff_compare
Read-onlyIdempotent

Compare two Git refs (base and head) in a CNB repository to retrieve the diff between them.

Instructions

Get the diff between two refs (base and head), e.g. base=main head=feature-x.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "repo": "<repo>",
      "base": "<base>",
      "head": "<head>"
    },
    "name": "repo_diff_compare"
  }
}

Input Schema

NameRequiredDescriptionDefault
baseYesBase ref
headYesHead ref
repoYesRepository path, e.g. "owner/repo" or "group/subgroup/repo"

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

C2.9/5.0
Behavior2/5

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

The annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=true, so the safety profile is fully covered by structured data. The description adds no behavioral context beyond restating the operation: nothing about output format (unified diff vs. file list), size limits or truncation on large diffs, or ref resolution behavior.

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?

A single front-loaded sentence with no filler. It is efficient, though its brevity edges toward under-specification rather than tightness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple required-params read tool with rich annotations and full schema coverage, the description is enough to invoke it correctly. However, with no output schema, an agent gets no hint about what the diff response looks like or how large diffs are handled.

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

Parameters3/5

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

Schema description coverage is 100%, so all three parameters are documented in the schema and the baseline is 3. The description's example ('base=main head=feature-x') mildly reinforces that refs may be branch names, but adds no syntax, default, or format detail beyond the schema.

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?

The description names a specific verb and resource ('Get the diff between two refs') and clarifies the two ref roles (base and head). It is clear on its own, though it does not distinguish itself from nearby siblings such as pr_files or repo_commit_get that also surface changes.

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

Usage Guidelines2/5

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

The only guidance is an example of ref values ('e.g. base=main head=feature-x'), which is parameter syntax rather than usage guidance. There is no statement of when to prefer this over pr_files or repo_commits_list, and no prerequisites or exclusions.

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