Skip to content

GitLab MCP: False validation error when creating issues with labels - causes duplicate issues #215

@stevenmcastano

Description

@stevenmcastano

Problem

When using the GitLab MCP server through the Docker MCP Gateway, the create_issue tool returns a validation error when the labels parameter is provided, even though the issue is successfully created on GitLab with the
labels correctly applied.

Error message:

Failed to execute tool: calling "tools/call": Invalid arguments: labels.0: Expected object, received string, labels.1: Expected object, received string

Impact

This false error causes duplicate issues to be created when AI agents retry after receiving the error:

  1. First call with labels → Issue created successfully BUT returns validation error
  2. Agent sees error and retries without labels → Second duplicate issue created
  3. Result: Two issues created 5-10 seconds apart (one with labels, one without)

Steps to Reproduce

  1. Configure Docker MCP Gateway with GitLab server
  2. Call create_issue with labels parameter:
    {
      "project_id": "root/test-repo",
      "title": "Test Issue",
      "description": "Test description",
      "labels": ["bug", "enhancement"]
    }
    
  3. Observe validation error is returned
  4. Check GitLab - issue was created successfully with labels

Expected Behavior

• Issue should be created (✅ works)
• Labels should be applied (✅ works)
• Tool should return success, not validation error (❌ fails)

Current Behavior

• Issue is created ✅
• Labels are applied ✅
• Tool returns false validation error ❌
• This misleads AI agents into retrying and creating duplicates

Root Cause

The MCP gateway appears to be validating the response (or echoing back request parameters) incorrectly. The labels format ["bug", "test"] is correct for the GitLab API and works perfectly, but the gateway's parameter
validation fails after the successful API call.

Environment

• Docker MCP Gateway version: latest (as of Nov 1, 2025)
• GitLab version: Community Edition
• OpenCode.ai integration via ~/.config/opencode/opencode.jsonc

Workaround

AI agents can work around this by:

  1. Always including labels in the correct string array format
  2. Ignoring the validation error
  3. Never retrying after getting the error (trust it succeeded)

Suggested Fix

The gateway should either:

  1. Fix the validation to accept string arrays for labels, OR
  2. Remove the validation check after successful API response, OR
  3. Document the expected label format if it differs from GitLab API

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions