Skip to main content
Glama

find_merge_base

Find the common ancestor commit between two Git refs and report ahead/behind counts to check branch divergence before merging or comparing histories. Returns mergeBaseSha, aheadBy, and behindBy.

Instructions

Finds the common ancestor commit (merge base) between two git refs and reports ahead/behind commit counts. Use to check branch divergence before merging or comparing histories. Returns mergeBaseSha, aheadBy, behindBy, and status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseYesBase branch, tag, or commit SHA.
headYesHead branch, tag, or commit SHA.
repoYesRepository name.
ownerYesRepository owner (organization or user).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. It implies a read-only query ('finds', 'reports') and enumerates the return fields, but never explicitly states it is side-effect-free, nor mentions auth, rate limits, or error behavior for invalid refs.

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?

Three compact sentences, front-loaded with the core operation and followed by usage and return values. Every sentence contributes, though the trailing return-field list slightly overlaps what a caller might infer.

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, enumerating mergeBaseSha/aheadBy/behindBy/status is genuinely useful return-value context. For a straightforward read-only query tool with fully documented params, this is nearly complete; only explicit read-only/error behavior is absent.

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%, with base/head/repo/owner all documented in the schema. The description adds no syntax or format detail (e.g. SHA vs branch vs tag nuances) beyond what the schema already conveys, so the baseline 3 holds.

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?

States a specific verb (finds) and resource (common ancestor commit / merge base between two refs), plus the extra ahead/behind reporting that distinguishes it from a pure ancestry check like is_ancestor. However, it never names the closest sibling (is_ancestor) explicitly, leaving differentiation to inference.

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

Usage Guidelines4/5

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

'Use to check branch divergence before merging or comparing histories' gives a clear when-to-use context. It does not name alternatives (e.g. is_ancestor) or state when NOT to use this tool, so it stops short of a 5.

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