Skip to main content
Glama

gitlab_get_merge_request_notes

Retrieve and manage merge request comments on GitLab projects. Supports pagination, sorting by date, and customizable result length for efficient review of MR discussions and feedback.

Instructions

List merge request comments Returns: Array of notes/comments with content Use when: Reading MR discussions, reviews Pagination: Yes (default 10 per page) Sorting: By created_at or updated_at

Example response: [{ "id": 789, "body": "Great work! Just one suggestion...", "author": {"username": "reviewer"}, "created_at": "2024-01-15T10:30:00Z", "type": "DiffNote", "resolvable": true, "resolved": false }]

Related tools:

  • gitlab_get_merge_request_discussions: Threaded discussions

  • gitlab_add_merge_request_comment: Add comment

  • gitlab_resolve_discussion: Resolve threads

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_body_lengthNoMaximum length for text content Type: integer Range: 0-10000 (0 = unlimited) Default: 1000 Examples: - 0: Show full content (no truncation) - 500: Limit to 500 characters - 2000: Allow longer descriptions Note: Truncated text ends with '...'
mr_iidYesMerge request number (IID - Internal ID) Type: integer Format: Project-specific MR number (without !) Required: Yes Examples: - 456 (for MR !456) - 7890 (for MR !7890) How to find: Look at MR URL or title - URL: https://gitlab.com/group/project/-/merge_requests/456 → use 456 - Title: "Add new feature (!456)" → use 456 Note: This is NOT the global MR ID
order_byNoField to sort by Type: string (enum) Options vary by endpoint: - Commits: 'created_at', 'title' - Issues: 'created_at', 'updated_at', 'priority', 'due_date' - MRs: 'created_at', 'updated_at', 'title' Default: Usually 'created_at' Example: 'updated_at' to see recently modified items firstcreated_at
pageNoPage number for pagination Type: integer Range: ≥1 Default: 1 Example: 3 (to get the third page of results) Note: Use with per_page to navigate large result sets
per_pageNoNumber of results per page Type: integer Range: 1-100 Default: 20 Example: 50 (for faster browsing) Tip: Use smaller values (10-20) for detailed operations, larger (50-100) for listing
project_idNoProject identifier (auto-detected if not provided) Type: integer OR string Format: numeric ID or 'namespace/project' Optional: Yes - auto-detects from current git repository Examples: - 12345 (numeric ID) - 'gitlab-org/gitlab' (namespace/project path) - 'my-group/my-subgroup/my-project' (nested groups) Note: If in a git repo with GitLab remote, this can be omitted
sortNoSort direction Type: string (enum) Options: 'asc' | 'desc' Default: Varies by context (usually 'desc' for time-based) Examples: - 'asc': A→Z, oldest→newest, smallest→largest - 'desc': Z→A, newest→oldest, largest→smallestasc

Implementation Reference

  • The core handler function implementing the gitlab_get_merge_request_notes tool. Extracts required mr_iid, optional pagination and sorting parameters, auto-detects project_id if not provided, and calls the GitLabClient method to fetch MR notes.
    def handle_get_merge_request_notes(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> Dict[str, Any]: """Handle getting merge request notes""" project_id = require_project_id(client, arguments) mr_iid = require_argument(arguments, "mr_iid") per_page = get_argument(arguments, "per_page", SMALL_PAGE_SIZE) page = get_argument(arguments, "page", 1) sort = get_argument(arguments, "sort", "asc") order_by = get_argument(arguments, "order_by", "created_at") max_body_length = get_argument(arguments, "max_body_length", DEFAULT_MAX_BODY_LENGTH) return client.get_merge_request_notes( project_id, mr_iid, per_page, page, sort, order_by, max_body_length )
  • Registration of the tool handler in the TOOL_HANDLERS dictionary, mapping the tool name constant to its handler function.
    TOOL_GET_MR_NOTES: handle_get_merge_request_notes,
  • Constant defining the exact tool name string used for registration and references.
    TOOL_GET_MR_NOTES = "gitlab_get_merge_request_notes"

Other Tools

Related 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/Vijay-Duke/mcp-gitlab'

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