Skip to main content
Glama
ffpy

GitLab MCP Code Review

by ffpy

resolve_merge_request_discussion

Resolve or unresolve discussions in GitLab merge requests to manage code review feedback and track issue resolution status.

Instructions

Resolve or unresolve a merge request discussion.

Args:
    project_id: The GitLab project ID or URL-encoded path
    merge_request_iid: The merge request IID (project-specific ID)
    discussion_id: The ID of the discussion
    resolved: True to resolve, False to unresolve
Returns:
    Dict containing the updated discussion information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
merge_request_iidYes
discussion_idYes
resolvedNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The @mcp.tool() decorated handler function that implements the resolve_merge_request_discussion tool. It fetches the GitLab project and merge request, gets the specific discussion, sets its resolved state, saves it, and returns the updated discussion as a dictionary.
    @mcp.tool()
    def resolve_merge_request_discussion(ctx: Context, project_id: str, merge_request_iid: str, discussion_id: str, resolved: bool = True) -> Dict[str, Any]:
        """
        Resolve or unresolve a merge request discussion.
        
        Args:
            project_id: The GitLab project ID or URL-encoded path
            merge_request_iid: The merge request IID (project-specific ID)
            discussion_id: The ID of the discussion
            resolved: True to resolve, False to unresolve
        Returns:
            Dict containing the updated discussion information
        """
        gl = ctx.request_context.lifespan_context
        project = gl.projects.get(project_id)
        mr = project.mergerequests.get(merge_request_iid)
        discussion = mr.discussions.get(discussion_id)
        
        discussion.resolved = resolved
        discussion.save()
        
        return discussion.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 for behavioral disclosure. It mentions the action ('resolve or unresolve') but lacks critical details: whether this requires specific permissions, if it's reversible, rate limits, or side effects. The return statement is vague ('updated discussion information'), leaving behavior unclear. This is inadequate for a mutation tool with zero annotation coverage.

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 well-structured and front-loaded with the core purpose, followed by parameter explanations and return info. It's efficient with minimal waste, though the return statement could be more specific. Every sentence adds value, making it appropriately concise for a 4-parameter tool.

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, mutation action) and no annotations, the description is partially complete. It covers the purpose and parameters well, and an output schema exists (not detailed in context), reducing the need to explain return values. However, it lacks behavioral context (e.g., permissions, reversibility) and usage guidelines, leaving gaps for an AI agent to operate effectively.

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

Parameters4/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 adds meaningful context: 'project_id' as 'GitLab project ID or URL-encoded path', 'merge_request_iid' as 'project-specific ID', 'discussion_id' as 'ID of the discussion', and 'resolved' as 'True to resolve, False to unresolve'. This clarifies each parameter's role beyond the schema's basic titles. However, it doesn't cover format details (e.g., IID format), keeping it from a perfect score.

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 tool's purpose: 'Resolve or unresolve a merge request discussion.' It specifies the verb ('resolve/unresolve') and resource ('merge request discussion'), making it easy to understand. However, it doesn't explicitly differentiate from sibling tools like 'delete_merge_request_discussion' or 'reply_to_merge_request_discussion', which prevents a perfect score.

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 prerequisites (e.g., needing an existing discussion), exclusions, or comparisons to siblings like 'delete_merge_request_discussion' for removal or 'add_merge_request_discussion' for creation. Usage is implied but not explicitly stated.

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