Skip to main content
Glama

Upstream.codes

Compare refs

compare_refs
Read-only

Compare two branches, tags or commits: ahead/behind counts, commits and the file diff from base to head.

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": {
      "owner": "<owner>",
      "repo": "<repo>",
      "base": "<base>",
      "head": "<head>"
    },
    "name": "compare_refs"
  }
}

Input Schema

NameRequiredDescriptionDefault
baseYes
headYes
repoYesRepository slug.
ownerYesNamespace that owns the repository (user or organization handle).

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so safety is covered, and the description adds useful context by enumerating what is returned (ahead/behind counts, commits, file diff). It stops short of disclosing limits an agent would care about for a potentially large payload: diff truncation, commit pagination, or behavior when a ref does not exist. Given annotation coverage, a 3 is appropriate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single dense sentence that front-loads the operation and then the returned artifacts. No filler, no restatement of the title.

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?

For a four-required-parameter read tool with no output schema, the description covers the operation, the accepted ref types, the diff direction, and the return shape. The remaining gap is behavioral rather than semantic: no statement about diff size limits or pagination, which matters for a comparison that can span large histories.

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 50%: owner and repo are documented in-schema, but base and head are bare strings. The description compensates by stating that these accept branches, tags, or commits and that the diff runs base to head, which resolves both accepted value types and directionality that the schema leaves ambiguous.

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 gives a specific verb (compare) and resource domain (branches, tags, commits) and even names the return payload: ahead/behind counts, commits, and the base-to-head file diff. It is clearly distinguishable from list_commits or get_file_contents, though it does not explicitly contrast itself with the similarly scoped get_change_request_diff sibling.

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?

Usage is only implied by the object of the verb: an agent can infer this is the tool for diffing two arbitrary refs rather than a pull/merge request. There is no explicit when-to-use statement, no mention of prerequisites (e.g. refs must exist in the same repository), and no named alternative for PR-scoped diffs.

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