Skip to main content
Glama

list_merge_request_notes

Retrieve comments and discussions from a specific merge request in GitLab to review feedback, track changes, and monitor collaboration on code changes.

Instructions

列出 Merge Request 的留言

Args: project_id: 專案 ID 或路徑 mr_iid: MR 的 IID page: 頁碼 per_page: 每頁筆數

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
mr_iidYes
pageNo
per_pageNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function in `server.py` that registers the `list_merge_request_notes` tool and calls the client implementation.
    def list_merge_request_notes(project_id: int | str, mr_iid: int,
                                 page: int = 1, per_page: int = 20) -> str:
        """列出 Merge Request 的留言
    
        Args:
            project_id: 專案 ID 或路徑
            mr_iid: MR 的 IID
            page: 頁碼
            per_page: 每頁筆數
        """
        try:
            client = get_client()
            notes = client.list_merge_request_notes(project_id, mr_iid, page=page, per_page=per_page)
    
            if not notes:
                return "此 MR 沒有留言"
    
            lines = [f"MR !{mr_iid} 的留言(共 {len(notes)} 則):\n"]
            for n in notes:
                system_tag = " [系統]" if n.get("system") else ""
                lines.append(
                    f"📝 #{n['id']}{system_tag}"
                    f"\n  作者: {n.get('author', {}).get('name', 'N/A')}"
                    f"\n  時間: {n.get('created_at', 'N/A')}"
                    f"\n  內容: {n.get('body', '')}\n"
                )
            return "\n".join(lines)
        except GitLabAPIError as e:
            return f"列出 MR 留言失敗: {str(e)}"
  • The underlying GitLab client method that performs the actual API request.
    def list_merge_request_notes(
        self,
        project_id: int | str,
        mr_iid: int,
        sort: str = "asc",
        page: int = 1,
        per_page: int = 20,
    ) -> list[dict]:
        """GET /projects/:id/merge_requests/:iid/notes"""
        pid = self._resolve_project_id(project_id)
        params = {"sort": sort, "page": page, "per_page": per_page}
        return self._get_json(
            f"/projects/{pid}/merge_requests/{mr_iid}/notes", params=params
        )
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool lists notes but doesn't disclose behavioral traits like whether it's read-only (implied by 'list'), authentication needs, rate limits, error conditions, or pagination details (beyond parameter names). The description adds minimal context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with a clear main sentence followed by a structured Args section. There's no wasted text, and information is front-loaded with the core purpose stated first. The bilingual presentation (Chinese description with some English terms) is efficient but doesn't hinder clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (4 parameters, 2 required), no annotations, and the presence of an output schema (which handles return values), the description is minimally adequate. It covers the basic purpose but lacks usage guidelines, detailed parameter semantics, and behavioral context. The output schema relieves some burden, but gaps remain for effective agent use.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It lists parameter names in the Args section but provides no semantic meaning beyond what's in the schema (e.g., 'project_id: 專案 ID 或路徑' translates to 'project ID or path', which is already clear from the schema title). It doesn't explain format expectations, constraints, or interactions between parameters like pagination behavior.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('列出' meaning 'list') and resource ('Merge Request 的留言' meaning 'Merge Request notes'), providing a specific verb+resource combination. It distinguishes this tool from siblings like 'create_merge_request_note' (which creates notes) and 'get_merge_request' (which retrieves MR metadata). However, it doesn't explicitly mention pagination behavior, which is a minor gap.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention related tools like 'get_merge_request' (which might include some notes) or 'create_merge_request_note' (for adding notes), nor does it specify prerequisites or contextual constraints. The agent must infer usage from the tool name alone.

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

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