Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gitlab): Invalid arguments error when using v4 API for gitlab.com #774

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

francovp
Copy link

@francovp francovp commented Mar 9, 2025

Description

Make merged property "optional" and diff_refs "nullable" in the GitLabMergeRequestSchema to align with GitLab V4 API response.

This fixes the error Invalid arguments: merged: Required, diff_refs: Expected object, received null when creating a merge request using create_merge_request tool.

Cursor example:
image

Server Details

  • Server: gitlab
  • Changes to: tools

Motivation and Context

The current version throws an error when parsing the API response when using the V4 API when creating a merge request on gitlab.com, and I need it to use the MCP server with my gitlab repository.

How Has This Been Tested?

Installed the Gitlab MCP Server with envar GITLAB_API_URL=https://gitlab.com/api/v4 on Cursor and asking the Cursor agent to create a Merge Request.

image

Breaking Changes

No

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Protocol Documentation
  • My changes follows MCP security best practices
  • I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

Additional context

Make 'merged' property optional and 'diff_refs' nullable in the `GitLabMergeRequestSchema` to align with GitLab V4 API specifications.
@francovp francovp force-pushed the fix-gitlab-mr-schema-for-v4-api branch from 4c86993 to 8fe9b47 Compare March 9, 2025 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant