Skip to main content
Glama

add_merge_request_line_comment

Add a line-specific comment to a merge request diff by specifying project, merge request, file path, line number, and commit SHAs. Enable precise code review feedback directly on the relevant line.

Instructions

Add a line-specific comment to a merge request diff.

Args: project_id: GitLab project ID mr_iid: Merge request IID file_path: Path to the file in the repository line_number: Line number in the new version of the file comment: Comment text to add base_sha: Base commit SHA (from diff) head_sha: Head commit SHA (from diff) start_sha: Start commit SHA (from diff) old_line: Line number in the old version (optional, for modified lines)

Returns: Confirmation message with comment details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mr_iidYes
commentYes
base_shaYes
head_shaYes
old_lineNo
file_pathYes
start_shaYes
project_idYes
line_numberYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations, the description must disclose behavior, but it only states the action and return value. It doesn't mention that this creates a new discussion, requires valid SHA values to anchor the comment, or the consequences of invalid parameters. The Returns section gives minimal info, but no side effects or requirements are described.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with a clear one-sentence purpose, followed by a structured Args list and Returns section. It's concise and each line earns its place, though it could potentially reference the schema instead of repeating parameter names.

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

Completeness2/5

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

For a tool with 9 parameters and no annotations, the description is insufficient. It doesn't explain the relationship between line_number and old_line, how to get the SHAs (e.g., from get_merge_request_diffs), or any error conditions. It also doesn't differentiate from add_merge_request_comment in usage context. The output schema exists but the description's return statement is vague.

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 has no descriptions (0% coverage), so the description's Args list adds some semantics: it explains file_path, line_number, and the SHA fields as 'from diff', and notes old_line is optional for modified lines. However, it doesn't explain how to obtain these values or what start_sha specifically represents beyond 'from diff', leaving some ambiguity.

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 states a clear action ('Add a line-specific comment') on a specific resource ('merge request diff'), distinguishing it from the sibling add_merge_request_comment which adds a general comment. The verb and resource are 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 Guidelines2/5

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

No explicit guidance on when to use this tool versus alternatives. It doesn't mention that for general comments one should use add_merge_request_comment, nor does it state prerequisites like obtaining SHA values from the diff or ensuring the line exists. The intended use is implied but not stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.