workflow_review_mr_post_comment
Post an AI-generated review comment on a GitLab merge request. After preparing review context, use this tool to submit the final comment and optionally approve the MR.
Instructions
Two-step MR review workflow. Step 1: call with prepare_review_context=true to fetch review_prompt + diffs for LLM review. Step 2: let the LLM inspect that context, then call again with review_comment_body to post the final review comment (optional approval).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code_project_id | No | Code project ID. Omit this field unless the user explicitly provided a value. When omitted, the current runtime config value is used (WORKFLOW_CODE_PROJECT_ID overrides the built-in default when configured). If the runtime config is still unset, the tool returns a missing-parameter error. Do not infer or auto-generate this value. | |
| mr_iid | Yes | Merge request IID. | |
| review_comment_body | No | Step 2 of 2. Final review comment markdown body, generated after the LLM inspects prepared_review.review_prompt + prepared_review.diffs from the prepare step. | |
| prepare_review_context | No | Step 1 of 2. When true, do not post a comment. Return concise review prompt text plus MR diff context for an external LLM. After the LLM generates review_comment_body, call this tool again without prepare_review_context to post the comment. | |
| review_summary | No | Short review summary used when review_comment_body is missing. | |
| include_changes | No | Whether to include changed files list in generated review comment. | |
| include_existing_notes | No | Whether to load existing MR notes and include count in generated comment. | |
| approve | No | Whether to approve MR after posting review comment. | |
| sha | No | Optional expected MR HEAD SHA when approve=true. | |
| max_changed_files | No | Maximum number of changed files included in prepared review context. Default 20. | |
| max_diff_chars_per_file | No | Maximum diff characters returned per file in prepared review context. Default 12000. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the tool call succeeded. | |
| tool | Yes | Tool name. | |
| data | No | Review merge request and create comment workflow result. | |
| error_type | No | Error type when ok=false. | |
| message | No | Error message when ok=false. |