Skip to main content
Glama

Get merge request file patch

get_merge_request_file_patch
Read-onlyIdempotent

Retrieve the patch for a specific file in a GitLab merge request by scanning paginated diffs, returning patch metadata and hunks.

Instructions

Find one exact changed path across paginated merge-request diffs and return its patch metadata and hunks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
projectYesGitLab project ID or full path such as group/project.
unidiffNo
max_pagesNo
merge_request_iidYesProject-scoped internal ID.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYesGitLab response normalized for model use.
Behavior4/5

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

Annotations already declare the operation read-only, idempotent, and non-destructive, lowering the burden on the description. The description adds useful behavioral context by mentioning pagination traversal, exact path matching, and the return of patch metadata and hunks. It does not contradict the annotations.

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, front-loaded sentence that efficiently states the operation, target, scope, and output. It contains no filler and every phrase adds meaning.

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 an output schema present and strong annotations, the description supplies the key operational details: exact path selection, pagination, and the patch/hunk return format. It does not cover missing-path or empty-result behavior, but for a focused lookup tool this gap is acceptable.

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 only 40%, so the description must compensate. It partially does by defining path as an 'exact changed path' and signaling max_pages via 'paginated,' but unidiff is left unexplained and the max_pages semantics are only implicit. The compensation is incomplete.

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 uses a specific verb ('find') and names the exact resource: a changed path within paginated merge-request diffs. 'One exact changed path' clearly distinguishes this from sibling tools like list_merge_request_diffs.

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

Usage Guidelines3/5

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

The description implies the tool is for targeted, exact-path lookups across paginated MR diffs, but it never explicitly states when to prefer it over alternatives such as list_merge_request_diffs or list_commit_diffs. No exclusions or alternative recommendations are provided.

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

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