Skip to main content
Glama

git_compare_refs

Read-onlyIdempotent

Compare two Git refs to determine their merge base and ahead/behind counts, showing how they diverge.

Instructions

Resolve two refs and report merge base and ahead/behind counts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
leftYes
rightYes
repositoryIdYesID returned by git_list_repositories

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
outputYes
truncatedYes
Behavior3/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, covering the safety profile. The description adds that it 'resolves' refs and reports specific outputs, but it does not disclose potential error cases or details like whether refs must be fully qualified. Given the strong annotations, the description provides sufficient but not exceptional transparency.

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?

The description is a single sentence that front-loads the core action ('Resolve two refs') and the output ('report merge base and ahead/behind counts'). There is no redundant or filler text, so it earns high marks for conciseness.

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?

The tool is relatively simple, and the output schema likely defines return values, reducing the need for detailed return descriptions. However, the lack of directionality, ref format guidance, and usage context makes it incomplete for an agent deciding when to invoke this tool over siblings. It is adequate but not comprehensive.

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

Parameters2/5

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

Schema coverage is only 33% (only repositoryId has a description). The description identifies left and right as 'two refs', which adds some meaning, but it does not specify acceptable ref formats (e.g., branch names, SHAs) or the directionality of ahead/behind counts (which ref is the base). This is a significant gap given the low schema coverage.

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?

The description clearly specifies the tool's function: it resolves two refs and reports merge base and ahead/behind counts. This distinct purpose sets it apart from siblings like git_diff (content differences) or git_log (commit history), making it unambiguous.

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?

There is no guidance on when to use this tool versus alternatives. The description only states what it does, not the conditions under which it should be chosen, nor any exclusions or prerequisites (e.g., refs must exist in the repository).

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kazuki0529/git-readonly-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server