Skip to main content
Glama

comment_on_mr_line

Anchor a review comment to a precise line of a GitLab merge request diff. Retrieve line numbers from get_mr_diff to ensure the comment appears on the intended line.

Instructions

Cria uma thread de review ancorada numa linha específica do diff do merge request. Chame get_mr_diff antes: os números old=/new= de lá são exatamente o que esta tool espera, e ela valida localmente antes de postar. Para linha de contexto (prefixo "ctx"), passe side="context" com line = new= e context_old_line = old=; os dois são obrigatórios. Só suporta comentário em linha única — comentário multi-linha está fora de escopo neste MVP. Requer GITLAB_READ_ONLY=false e token com escopo api.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
iidYesO iid do MR — o número que aparece na URL. NÃO é o id global.
bodyYesTexto do comentário, em Markdown. Não pode ser vazio.
lineYesNúmero da linha. Para side="new" e side="context", é o número new= impresso por get_mr_diff. Para side="old", é o old=.
sideYesnew = linha adicionada (verde, prefixo "add" no get_mr_diff); old = linha removida (vermelha, prefixo "del"); context = linha não modificada (prefixo "ctx").
projectYesPath completo do projeto (ex.: "grupo/subgrupo/projeto") ou o id numérico.
file_pathYesCaminho do arquivo exatamente como aparece no cabeçalho "=== ... ===" de get_mr_diff.
context_old_lineNoObrigatório quando side="context": o número old= da mesma linha ctx no get_mr_diff. Comentário em linha de contexto exige os dois lados.
Behavior5/5

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

With no annotations, the description carries the full load. It discloses prerequisites (GITLAB_READ_ONLY=false, api token), explains local validation before posting, and details the exact line-number mapping behavior (new=, old=, context). It also highlights the limitation of single-line comments, which is important behavioral context beyond the schema.

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?

Three sentences, each dense with relevant information. The first sentence states the core purpose, the second explains the prerequisite and context-line special case, and the third covers limitations and permission requirements. No word is wasted, and critical details are front-loaded.

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?

The tool has 7 parameters, no output schema, and no annotations, but the description covers the purpose, prerequisites, parameter mapping, edge cases (context lines), and constraints. It fully equips an agent to invoke the tool correctly. The absence of return-value details is acceptable given the lack of an output schema and the focus on correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already has 100% parameter coverage, so the baseline is 3. The description adds value by explaining how 'line' corresponds to new= or old= depending on side, and that context_old_line is mandatory for side="context". It also references the get_mr_diff header format for file_path, which goes beyond the schema descriptions.

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: creating a review thread anchored to a specific diff line. It distinguishes itself from sibling tools like comment_on_mr and reply_to_mr_discussion by focusing on line-specific comments. The verb 'Cria' + resource 'thread de review' + scope 'ancorada numa linha específica do diff' is specific and unambiguous.

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?

The description explicitly instructs to call get_mr_diff beforehand and explains how to map old=/new= values. It also specifies when side="context" is required and clarifies the tool only supports single-line comments, implicitly excluding multi-line use cases. However, it does not explicitly mention using comment_on_mr for non-line-specific comments, though this is implied.

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