Skip to main content
Glama

gitlab_compare_branches

Read-onlyIdempotent

Compare two GitLab branches to see up to 30 commits and changed files. Useful for release note drafting and understanding differences between branches.

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
Behavior5/5

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

Discloses limit of 30 commits and that it returns changed files. Annotations already indicate readOnly and idempotent; description adds behavioral detail without contradiction.

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?

Concise, front-loaded with purpose, then usage guidance and examples. No irrelevant content.

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?

Covers purpose, usage, exclusions, and behavioral limits. Output schema exists, so return format need not be explained. Complete for a comparison tool.

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 covers all 3 parameters with descriptions (100% coverage). Description adds only usage examples for source and target, not new semantic detail. Baseline 3 is appropriate.

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?

Clearly states it compares two branches and returns commits (up to 30) and changed files. Provides a concrete use case (release-note drafting) and differentiates from sibling gitlab_get_merge_request_changes.

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?

Explicitly tells when to use (comparing branches, release notes) and when not to use (full MR diffs, with alternative tool named). Includes examples with parameters.

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