Skip to main content
Glama

get_mr_diff

Retrieve merge request diff with old/new line numbers, enabling precise inline comments. Filter by file path or paginate through changes.

Instructions

Diff do merge request em texto, com o número de linha de cada lado impresso explicitamente (old=/new=). Use antes de comentar em linha: os números old= e new= que aparecem aqui são exatamente os que comment_on_mr_line espera. Prefixos: "add" = linha só no lado novo, "del" = linha só no antigo, "ctx" = linha inalterada (tem os dois números). Se a saída vier truncada, chame de novo com path="" para ver aquele arquivo inteiro. Não use para ler o arquivo completo do repositório — só mostra o que mudou no MR.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
iidYesO iid do MR — o número que aparece na URL. NÃO é o id global.
pageNoPágina de arquivos, começando em 1. Default 1.
pathNoCaminho de um arquivo para ver isolado (ex.: "src/auth/session.ts"). Use quando a saída vier truncada.
projectYesPath completo do projeto (ex.: "grupo/subgrupo/projeto") ou o id numérico.
per_pageNoArquivos por página. Default 10. Ignorado quando "path" é informado.
Behavior4/5

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

Without annotations, the description carries the full burden of behavioral disclosure. It reveals key output semantics: prefixes 'add', 'del', 'ctx' and the old=/new= line numbers. It also discloses truncation behavior and the path parameter as a recovery mechanism, plus an explicit scope boundary (only changes, not full files). It stops short of describing the overall file pagination structure, but the schema covers page/per_page, and the description's focus on output format is highly useful.

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 five sentences, each earning its place: purpose and output format, usage context, prefix legend, truncation handling, and negative scope. It is front-loaded with the tool's core purpose and avoids redundant elaboration. The structure is logical and efficient, with no wasted words.

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?

Given 5 parameters, no output schema, and no annotations, the description covers the essential operational context: what the diff looks like (prefixes, line numbers), when to use it, how to recover from truncation, and what it cannot do. It could be more explicit about page/per_page behavior, but the schema already documents those parameters, so the description's focus on output format and usage is sufficient for an agent to select and invoke it correctly.

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?

The schema fully describes all 5 parameters (100% coverage), so the baseline is 3. The description adds context for path usage in truncation scenarios and clarifies that old=/new= numbers are what comment_on_mr_line expects, but it does not add new parameter-level meaning beyond the schema descriptions. The schema already covers iid, page, per_page, project, and path sufficiently.

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 function: 'Diff do merge request em texto, com o número de linha de cada lado impresso explicitamente (old=/new=).' It specifies a concrete verb (diff) and resource (merge request), and the output format (text with line numbers). This distinguishes it from siblings like get_mr (metadata) and comment_on_mr_line (commenting), making its purpose unmistakable.

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 when-to-use guidance: 'Use antes de comentar em linha' and explains how the output feeds comment_on_mr_line. It also gives a clear when-not-to-use: 'Não use para ler o arquivo completo do repositório — só mostra o que mudou no MR.' Additionally, it instructs on handling truncation by calling again with path. This is comprehensive and actionable.

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

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