Skip to main content
Glama

Compare Branches Tool

compare_branches_tool
Read-only

Compare two branches, tags, or commits in a GitLab project to identify differences between refs. Use it to review changes before merging or inspect divergence.

Instructions

Compare two branches, tags, or commits.

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": {
      "project_id": "<project_id>",
      "from_ref": "<from_ref>",
      "to_ref": "<to_ref>"
    },
    "name": "compare_branches_tool"
  }
}

Input Schema

NameRequiredDescriptionDefault
to_refYesHead branch/tag/commit
from_refYesBase branch/tag/commit
straightNoUse straight comparison instead of merge-base (default: false)
project_idYesProject ID or path

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.1

TDQS

B3.1/5.0
Behavior2/5

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

The readOnlyHint annotation already covers the safety profile, but the description adds no behavioral context beyond the operation itself. It does not explain comparison semantics such as merge-base versus straight comparison, nor does it mention any operational constraints. With annotations present, the bar is lower, but this description adds essentially no extra behavioral disclosure.

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?

The description is a single front-loaded sentence with no wasted words. It is appropriately sized, though its extreme brevity leaves it close to under-specification.

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?

The tool has full schema coverage, an output schema, and a readOnlyHint annotation, so most structured context is already supplied. The description is complete enough to support correct invocation, though it could do more to explain when the compare operation is appropriate and what kind of result it produces.

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 four parameters, including the straight flag, are documented in the schema. The description reinforces that from_ref and to_ref may be branches, tags, or commits, but adds no syntax or format details beyond what the schema provides. A baseline 3 is appropriate when the schema carries the parameter documentation.

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 states a specific verb and resource: "Compare two branches, tags, or commits." An agent can distinguish this from sibling retrieval/list tools because none of them perform a comparison. It stops short of naming a sibling or clarifying what the comparison returns, so it is clear but not maximally differentiating.

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 description gives no guidance on when to use this tool versus alternatives, no prerequisites, and no exclusions. It merely identifies the operation. Usage is only implied by the tool name and resource types.

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