Skip to main content
Glama
github-fetcher

github-fetcher

by KurvCygnus

GitHub ref comparison

github_compare_refs
Read-onlyIdempotent

Compare two branches, tags, or SHAs in a GitHub repository to get ahead/behind counts, total commits, and changed files with patches in one call.

Instructions

Compares two refs in one repository, one core call: ahead/behind counts, total commits, and the first 100 changed files with each patch capped at 4000 characters. Unknown refs surface the standard 404 error. Returns {status, ahead_by, behind_by, total_commits, files[{filename, status, additions, deletions, patch}], files_truncated?}.

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": "github_compare_refs"
  }
}

Input Schema

NameRequiredDescriptionDefault
baseYesBase ref (branch, tag or sha)
headYesHead ref (branch, tag or sha)
repoYesRepository in owner/name form
freshNoBypass the local cache

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A3.9/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, open-world, non-destructive behavior, and the description adds genuinely new behavioral facts: results are capped at the first 100 changed files, each patch is truncated at 4000 characters, and a files_truncated flag signals truncation. It also documents the failure mode for unknown refs (404), which annotations do not cover.

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?

Two tight sentences: the first front-loads purpose, scope, and the truncation caps; the second covers error behavior and return shape. The inline return-type listing is dense but earns its place given there is no output schema, and nothing is padded or repeated.

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 usefully spells out the response fields and the optional files_truncated marker, plus the 404 failure case. The only meaningful gap for a 4-parameter comparison tool is the absence of guidance about the fresh/cache parameter, which is left entirely to the schema.

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 base, head, repo, and fresh are already documented, and the description does not add format or constraint detail beyond them. The only added semantic is that invalid refs produce a 404, which concerns ref validity rather than parameter shape, so the baseline of 3 applies.

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 opens with a specific verb and resource: 'Compares two refs in one repository,' and immediately enumerates what the comparison yields (ahead/behind counts, total commits, changed files). That is enough for an agent to distinguish it from list-style siblings like github_branches or github_commits, though it never names github_compare_repos, the closest relative by name, so sibling differentiation is left implicit.

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?

Use is implied by the verb 'compares two refs' and the note that 'Unknown refs surface the standard 404 error,' which hints at valid inputs. But there is no explicit when-to-use guidance, no statement of when to prefer this over github_compare_repos, github_commits, or github_branches, and no prerequisites (e.g., visibility/auth) are mentioned.

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