Skip to content

Code Review Tools

Tools for the complete merge request review workflow — browsing MRs, viewing diffs, adding comments, and managing approvals.

Tools Overview

ToolTypePurpose
browse_merge_requestsQueryList, get details, view diffs, compare branches
browse_mr_discussionsQueryView discussion threads and draft notes
manage_merge_requestCommandCreate, update, merge, approve MRs
manage_mr_discussionCommandComments, threads, replies, suggestions
manage_draft_notesCommandBatch review with draft comments

browse_merge_requests

Find and inspect merge requests.

Actions

ActionDescription
listList merge requests with filtering
getGet single MR by IID or branch name
diffsGet file changes/diffs for an MR
compareCompare two branches or commits

Examples

json
{
  "action": "list",
  "project_id": "my-org/api",
  "state": "opened",
  "per_page": 20
}
json
{
  "action": "get",
  "project_id": "my-org/api",
  "merge_request_iid": "42",
  "per_page": 20
}
json
{
  "action": "diffs",
  "project_id": "my-org/api",
  "merge_request_iid": "42",
  "per_page": 100
}
json
{
  "action": "compare",
  "project_id": "my-org/api",
  "from": "main",
  "to": "feature/auth",
  "per_page": 20
}

Key Filters for list

ParameterDescription
stateopened, closed, merged, all
author_usernameFilter by MR author
reviewer_usernameFilter by assigned reviewer
assignee_usernameFilter by assignee
labelsFilter by labels (comma-separated or array)
milestoneFilter by milestone title
source_branchFilter by source branch
target_branchFilter by target branch
wipyes for drafts, no for ready
order_bycreated_at, updated_at, priority
scopecreated_by_me, assigned_to_me, all

manage_merge_request

Create and manage merge requests.

Actions

ActionDescription
createCreate a new merge request
updateUpdate an existing merge request
mergeMerge an approved merge request
approveApprove a merge request
unapproveRemove your approval from a merge request
get_approval_stateGet current approval status and rules

Examples

json
{
  "action": "create",
  "project_id": "my-org/api",
  "source_branch": "feature/auth",
  "target_branch": "main",
  "title": "feat: Add authentication",
  "description": "Implements JWT auth flow",
  "remove_source_branch": true,
  "reviewer_ids": ["42"]
}
json
{
  "action": "approve",
  "project_id": "my-org/api",
  "merge_request_iid": "42"
}
json
{
  "action": "merge",
  "project_id": "my-org/api",
  "merge_request_iid": "42",
  "squash": true,
  "should_remove_source_branch": true
}

manage_mr_discussion

Add comments, suggestions, and manage discussion threads.

Actions

ActionDescription
commentAdd a comment to an issue or merge request
threadStart a new discussion thread on an MR
replyReply to an existing discussion thread
updateUpdate an existing note/comment
apply_suggestionApply a single code suggestion from a review
apply_suggestionsBatch apply multiple code suggestions
resolveResolve or unresolve a discussion thread
suggestCreate a code suggestion on a diff line

Examples

json
{
  "action": "comment",
  "project_id": "my-org/api",
  "noteable_type": "merge_request",
  "noteable_id": "42",
  "body": "LGTM! Great work on the tests."
}
json
{
  "action": "suggest",
  "project_id": "my-org/api",
  "merge_request_iid": "42",
  "comment": "Use optional chaining here",
  "suggestion": "const name = user?.name ?? 'Unknown';",
  "position": {
    "base_sha": "abc123",
    "head_sha": "def456",
    "start_sha": "ghi789",
    "new_path": "src/auth.ts",
    "new_line": 15,
    "position_type": "text"
  }
}
json
{
  "action": "resolve",
  "project_id": "my-org/api",
  "merge_request_iid": "42",
  "discussion_id": "abc123",
  "resolved": true
}

manage_draft_notes

Prepare all review comments before publishing them at once.

Actions

ActionDescription
createCreate a new draft note
updateUpdate an existing draft note
publishPublish a single draft note
publish_allPublish all draft notes at once
deleteDelete a draft note

Workflow

  1. Create multiple draft notes as you review
  2. Review all your comments for consistency
  3. Publish all at once for a clean review experience

Released under the Apache 2.0 License.