Skip to main content
Glama

gitlab_compare_branches

Read-onlyIdempotent

Compare two GitLab branches to identify commits and changed files for release notes or tracking updates between versions.

Instructions

Compare two branches — returns up to 30 commits and the list of changed files.

Use for "what's in release/x.y vs master?" or for release-note drafting.

Examples: - "What's new in release/1.5 vs master" → source='release/1.5', target='master' - Don't use to fetch full diffs of an MR — use gitlab_get_merge_request_changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesSource branch/tag/SHA.
targetNoTarget branch (default 'master').master
project_pathNoGitLab project path (e.g. 'my-org/my-repo'). When omitted, the default from GITLAB_PROJECT_PATH env var is used.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYes
targetYes
commits_countYes
diffs_countYes
commitsYes
changed_filesYes
Behavior4/5

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

The description adds valuable behavioral context beyond annotations: it specifies the result limit ('returns up to 30 commits'), describes the output format ('list of changed files'), and provides concrete use cases. While annotations already cover safety (readOnlyHint=true, destructiveHint=false), the description enhances understanding of what the tool actually returns.

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 efficiently structured with zero waste: first sentence states purpose and output, second provides usage context, third gives concrete examples, and fourth clarifies alternatives. Every sentence earns its place and information is front-loaded appropriately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity, comprehensive annotations, complete schema coverage, and existence of an output schema, the description provides complete contextual understanding. It covers purpose, usage guidelines, behavioral details, and distinguishes from alternatives without needing to explain return values (handled by output 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?

With 100% schema description coverage, the schema already documents all parameters thoroughly. The description doesn't add significant parameter semantics beyond what's in the schema, though it provides example values in context. This meets the baseline expectation when schema coverage is complete.

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 states the tool's purpose with specific verbs ('compare two branches') and resources ('branches'), and explicitly distinguishes it from sibling tools like 'gitlab_get_merge_request_changes'. It provides concrete examples of use cases like release-note drafting.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool (for comparing branches to see what's new) and when not to use it (don't use for full MR diffs, use 'gitlab_get_merge_request_changes' instead). It includes practical examples and clear alternatives.

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/mshegolev/gitlab-ci-mcp'

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