Skip to main content
Glama

Comment on MR code

gitlab_create_merge_request_thread

Start a review thread on a merge request, anchored to a specific code line using file path and diff references, or as a general discussion.

Instructions

Starts a review thread. With file_path + line + diff_refs it anchors to a specific line; without them it posts a general discussion. Get diff_refs from gitlab_get_merge_request.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesComment body
base_shaNoFrom the MR `diff_refs`
head_shaNo
new_lineNoLine number in the new file
old_lineNoLine number in the old file
file_pathNoPath to comment on; omit for a general comment
start_shaNo
project_idNoProject id or URL-encoded path, e.g. `42` or `group/subgroup/project`. Falls back to GITLAB_PROJECT_ID.
merge_request_iidYes
Behavior3/5

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

The description adds useful context about the two modes of operation (anchored vs general) and the need to obtain diff_refs beforehand. However, it doesn't disclose other behavioral aspects like permissions, notifications, or what exactly constitutes a review thread. Annotations are minimal (write but not destructive), so more disclosure would be beneficial.

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 three short sentences, front-loaded with the core purpose. Every sentence adds value, but the ambiguous 'line' and 'diff_refs' terms slightly reduce precision. Overall, it's efficient and well-structured.

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

Completeness3/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 output schema, the description is somewhat sparse. It mentions the key prerequisite (obtaining diff_refs) but doesn't explain return values, error cases, or how to set project_id (though the schema covers the fallback). It's adequate but could be more complete.

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 covers 67% of parameters with some descriptions, and the description adds meaning by explaining the role of file_path and line for anchoring. However, the term 'diff_refs' doesn't directly map to the actual sha fields (base_sha, head_sha, start_sha), and 'line' is ambiguous between new_line and old_line. This leaves confusion for the agent.

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 starts a review thread on MR code, with a specific verb and resource. It distinguishes between anchored and general discussions, which differentiates it from sibling tools like gitlab_create_note or gitlab_reply_to_discussion.

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?

It provides explicit conditions for when to anchor a thread (with file_path + line + diff_refs) versus posting a general discussion, and even references gitlab_get_merge_request for obtaining diff_refs. This is clear usage guidance, though it doesn't directly compare to all alternative tools.

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

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