Skip to main content
Glama

gitlab_list_merge_requests

Retrieve merge requests from a GitLab project based on scope and state. Use this to filter requests by creation, assignment, or status (opened, closed, locked, merged).

Instructions

List merge requests in a GitLab project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesThe ID or URL-encoded path of the project
scopeNoReturn merge requests for the specified scope (created_by_me, assigned_to_me, all)
stateNoReturn merge requests with specified state (opened, closed, locked, merged)

Implementation Reference

  • The handler function that implements the gitlab_list_merge_requests tool. It validates input, calls the GitLab API to list merge requests for the given project, and formats the response.
    export const listMergeRequests: ToolHandler = async (params, context) => {
      const { project_id, state, scope } = params.arguments || {};
      if (!project_id) {
        throw new McpError(ErrorCode.InvalidParams, 'project_id is required');
      }
      
      const response = await context.axiosInstance.get(
        `/projects/${encodeURIComponent(String(project_id))}/merge_requests`,
        { params: { state, scope } }
      );
      return formatResponse(response.data);
    };
  • The input schema definition for the gitlab_list_merge_requests tool, specifying parameters like project_id, state, and scope.
    {
      name: 'gitlab_list_merge_requests',
      description: 'List merge requests in a GitLab project',
      inputSchema: {
        type: 'object',
        properties: {
          project_id: {
            type: 'string',
            description: 'The ID or URL-encoded path of the project'
          },
          state: {
            type: 'string',
            description: 'Return merge requests with specified state (opened, closed, locked, merged)',
            enum: ['opened', 'closed', 'locked', 'merged']
          },
          scope: {
            type: 'string',
            description: 'Return merge requests for the specified scope (created_by_me, assigned_to_me, all)',
            enum: ['created_by_me', 'assigned_to_me', 'all']
          }
        },
        required: ['project_id']
      }
    },
  • Registration of the gitlab_list_merge_requests tool in the central tool registry, mapping the tool name to its handler function.
    gitlab_list_merge_requests: repoHandlers.listMergeRequests,
Behavior2/5

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

With no annotations provided, the description carries the full burden but offers minimal behavioral insight. It doesn't disclose whether this is a read-only operation, if it requires authentication, what the return format looks like (e.g., pagination, fields included), or any rate limits. The description is too basic for a tool with potential complexity.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, with zero wasted content.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't address behavioral aspects like read-only nature, authentication needs, or return format, which are crucial for an AI agent to use the tool effectively. The high schema coverage helps but doesn't compensate for missing context.

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?

The input schema has 100% description coverage, clearly documenting all parameters (project_id, scope, state) with enums and types. The description adds no additional parameter semantics beyond what's in the schema, so it meets the baseline score of 3 for high schema coverage.

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 ('List') and resource ('merge requests in a GitLab project'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'gitlab_list_issues' or 'gitlab_list_branches' beyond the resource type, missing explicit sibling distinction.

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. For example, it doesn't mention when to choose this over 'gitlab_get_merge_request' for a single MR or how it relates to other list tools like 'gitlab_list_issues'. The description lacks context or exclusions.

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

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

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