Skip to main content
Glama
ffpy

GitLab MCP Code Review

by ffpy

get_project_merge_requests

Retrieve merge requests for a GitLab project to review changes, analyze diffs, and manage code review workflows. Filter by state and limit results.

Instructions

Get all merge requests for a project.

Args:
    project_id: The GitLab project ID or URL-encoded path
    state: Filter merge requests by state (all, opened, closed, merged, or locked)
    limit: Maximum number of merge requests to return
Returns:
    List of merge request objects

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
stateNoall
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function decorated with @mcp.tool(), which registers and implements the get_project_merge_requests tool. It retrieves a list of merge requests from a GitLab project specified by project_id, filtered by state (default 'all') and limited by the limit parameter (default 20), using the GitLab API via python-gitlab library.
    @mcp.tool()
    def get_project_merge_requests(ctx: Context, project_id: str, state: str = "all", limit: int = 20) -> List[Dict[str, Any]]:
        """
        Get all merge requests for a project.
        
        Args:
            project_id: The GitLab project ID or URL-encoded path
            state: Filter merge requests by state (all, opened, closed, merged, or locked)
            limit: Maximum number of merge requests to return
        Returns:
            List of merge request objects
        """
        gl = ctx.request_context.lifespan_context
        project = gl.projects.get(project_id)
        
        mrs = project.mergerequests.list(state=state, per_page=limit)
        
        return [mr.asdict() for mr in mrs]
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the return type ('List of merge request objects') but lacks critical details: authentication requirements, rate limits, pagination behavior (beyond the 'limit' param), error handling, or whether it's read-only (implied by 'Get' but not confirmed). The description is minimal and misses key operational context.

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 concise, using bullet-like sections ('Args:', 'Returns:') for clarity. Each sentence adds value: the purpose statement, parameter explanations, and return type. There's no redundant information, though it could be slightly more front-loaded by integrating key details into the opening sentence.

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 context: 3 parameters, 0% schema description coverage, no annotations, but an output schema exists (implying return values are documented elsewhere). The description covers purpose and parameters adequately but lacks behavioral context (e.g., auth, rate limits) and sibling differentiation. It's minimally viable for a read operation but incomplete for safe and effective use without additional structured data.

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?

The description adds meaningful semantics beyond the input schema, which has 0% description coverage. It explains 'project_id' as 'The GitLab project ID or URL-encoded path', clarifies 'state' with possible values ('all, opened, closed, merged, or locked'), and defines 'limit' as 'Maximum number of merge requests to return'. This compensates well for the schema's lack of descriptions, though it doesn't detail defaults (e.g., 'state' defaults to 'all', 'limit' to 20).

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: 'Get all merge requests for a project.' It specifies the verb ('Get') and resource ('merge requests for a project'), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'fetch_merge_request' (singular) or 'search_projects', which could retrieve similar data in different contexts.

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 sibling tools like 'fetch_merge_request' (for a single MR) or 'search_projects' (which might include MRs), nor does it specify prerequisites (e.g., authentication needs) or exclusions (e.g., when not to use it). Usage is implied by the purpose but not explicitly defined.

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