Skip to main content
Glama
ffpy

GitLab MCP Code Review

by ffpy

unapprove_merge_request

Revoke approval from a GitLab merge request to prevent merging when changes require further review. Specify project and merge request IDs.

Instructions

Unapprove a merge request.

Args:
    project_id: The GitLab project ID or URL-encoded path
    merge_request_iid: The merge request IID (project-specific ID)
Returns:
    Dict containing the unapproval information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
merge_request_iidYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'unapprove_merge_request' tool. It is registered via the @mcp.tool() decorator. The function fetches the project and merge request using the GitLab client, attempts to unapprove the MR with mr.unapprove(), logs any errors, and returns the MR details.
    @mcp.tool()
    def unapprove_merge_request(ctx: Context, project_id: str, merge_request_iid: str) -> Dict[str, Any]:
        """
        Unapprove a merge request.
        
        Args:
            project_id: The GitLab project ID or URL-encoded path
            merge_request_iid: The merge request IID (project-specific ID)
        Returns:
            Dict containing the unapproval information
        """
        gl = ctx.request_context.lifespan_context
        project = gl.projects.get(project_id)
        mr = project.mergerequests.get(merge_request_iid)
        
        try:
            mr.unapprove()
        except Exception as e:
            logger.error(f"Failed to unapprove merge request {merge_request_iid}: {e}")
        
        return mr.asdict()
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action. It doesn't disclose behavioral traits such as required permissions, whether this action is reversible, rate limits, or what specific 'unapproval information' is returned. The mention of returning a dict is minimal and lacks detail.

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

Conciseness5/5

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

The description is appropriately sized and front-loaded, with the purpose stated first, followed by parameter and return sections. Every sentence adds value without redundancy, making it efficient and well-structured.

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 2 parameters with 0% schema coverage and an output schema exists, the description provides basic parameter semantics and mentions a return dict, which is adequate. However, for a mutation tool with no annotations, it lacks details on permissions, side effects, and error handling, making it minimally complete.

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 description must compensate. It lists both parameters with brief explanations, adding meaning beyond the schema's titles. However, it doesn't clarify format details (e.g., URL-encoded path examples) or IID specifics, leaving some gaps.

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 verb ('Unapprove') and resource ('a merge request'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'approve_merge_request' beyond the obvious opposite action, missing explicit comparison.

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 on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing approval first), context (e.g., role-based permissions), or when to choose this over other merge request operations like commenting or fetching.

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/ffpy/gitlab-mcp-code-review'

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