Skip to main content
Glama

create_mr_discussion

Add a code-review comment to a specific line in a GitLab merge request diff. Provide the diff refs and target line to start a discussion on code changes.

Instructions

Create a code-review comment on a specific line in an MR's diff (a 'discussion' in GitLab terminology). Requires the diff_refs (base_sha, head_sha, start_sha) returned by get_mr_diff. Provide exactly one of new_line / old_line. dry_run=true by default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesProject ID
mr_iidYesMR IID
bodyYesComment body (Markdown)
file_pathYesFile path the comment targets (same value used for new_path and old_path)
base_shaYesbase_sha from get_mr_diff.diff_refs
head_shaYeshead_sha from get_mr_diff.diff_refs
start_shaYesstart_sha from get_mr_diff.diff_refs
new_lineNoLine number in the new file (post-change). Provide this for additions / context lines.
old_lineNoLine number in the old file (pre-change). Provide this for deletions.
dry_runNoDry run mode (default: true). When true, returns a preview of the action without executing it. Set to false only after user confirmation.
Behavior4/5

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

The description discloses that it creates a discussion (a write operation, consistent with readOnlyHint=false), requires specific SHA references, and highlights dry_run behavior for preview without execution. No contradictions with 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 concise (4 sentences) and front-loaded with the essential purpose. Every sentence adds necessary guidance without redundancy.

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 the complexity (10 parameters, 7 required) and no output schema, the description covers prerequisites, parameter constraints, and behavior. It could mention the return value briefly, but it's not essential.

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

Parameters5/5

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

Schema coverage is 100%, but the description adds significant value: it explains the exclusivity of new_line/old_line, clarifies file_path usage, and links SHA values to get_mr_diff. It also advises on dry_run usage with user confirmation.

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 creates a code-review comment on a specific line in an MR's diff, using the term 'discussion' consistent with GitLab terminology. It distinguishes from siblings like add_mr_note (general note) and resolve_mr_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?

The description specifies prerequisites (diff_refs from get_mr_diff), parameter constraints (exactly one of new_line/old_line), and default behavior (dry_run=true). While it doesn't explicitly exclude alternative tools, the context provided helps the agent decide when to use this tool.

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

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