Skip to main content
Glama

approve_merge_request

Approve a GitLab merge request to merge code changes into the target branch after review. Use this tool to finalize code integration in your GitLab project workflow.

Instructions

核准 Merge Request

Args: project_id: 專案 ID 或路徑 mr_iid: MR 的 IID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
mr_iidYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler that receives the request and calls the GitLab client to approve a merge request.
    def approve_merge_request(project_id: int | str, mr_iid: int) -> str:
        """核准 Merge Request
    
        Args:
            project_id: 專案 ID 或路徑
            mr_iid: MR 的 IID
        """
        try:
            client = get_client()
            client.approve_merge_request(project_id, mr_iid)
            return f"✓ MR !{mr_iid} 已核准"
        except GitLabAPIError as e:
            return f"核准 MR 失敗: {str(e)}"
  • The underlying API client method that performs the actual HTTP POST request to GitLab to approve a merge request.
    def approve_merge_request(self, project_id: int | str, mr_iid: int) -> dict:
        """POST /projects/:id/merge_requests/:iid/approve"""
        pid = self._resolve_project_id(project_id)
        return self._post_json(f"/projects/{pid}/merge_requests/{mr_iid}/approve")
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'approve' implies a write operation, the description doesn't clarify what 'approve' actually does (e.g., adds approval, changes status), whether it's reversible, what permissions are required, or what happens on success/failure.

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 brief with a clear title-like statement followed by parameter explanations. The bilingual presentation (Chinese title, English parameter names) is slightly unconventional but doesn't significantly impact 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?

For a mutation tool with no annotations but with an output schema, the description provides minimal but functional coverage. It identifies the tool's purpose and parameters but lacks behavioral context, usage guidance, and doesn't leverage the output schema's existence to explain what the tool returns.

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

Parameters3/5

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

Schema description coverage is 0%, so the schema provides no parameter documentation. The description adds basic semantic meaning for both parameters ('project ID or path' and 'MR IID'), establishing what they represent. However, it doesn't provide format details, constraints, or examples.

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 ('approve') and resource ('Merge Request'), making the purpose immediately understandable. However, it doesn't differentiate this tool from similar tools like 'merge_merge_request' or 'update_merge_request' that might also affect merge request status.

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?

No guidance is provided about when to use this tool versus alternatives like 'merge_merge_request' or 'update_merge_request'. The description doesn't mention prerequisites (e.g., whether the user needs specific permissions) or contextual constraints.

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