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
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Project ID | |
| mr_iid | Yes | MR IID | |
| body | Yes | Comment body (Markdown) | |
| file_path | Yes | File path the comment targets (same value used for new_path and old_path) | |
| base_sha | Yes | base_sha from get_mr_diff.diff_refs | |
| head_sha | Yes | head_sha from get_mr_diff.diff_refs | |
| start_sha | Yes | start_sha from get_mr_diff.diff_refs | |
| new_line | No | Line number in the new file (post-change). Provide this for additions / context lines. | |
| old_line | No | Line number in the old file (pre-change). Provide this for deletions. | |
| dry_run | No | Dry run mode (default: true). When true, returns a preview of the action without executing it. Set to false only after user confirmation. |