Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix
GitLabIssueSchema
so it accepts the string-array labels returned by GitLab’s Issues API, eliminating the “Expected object, received string” Zod error.Description
GitLab’s
POST /projects/:id/issues
endpoint returns labels as a simple string array unlessinclude_labels_details=true
is passed.GitLabIssueSchema
currently expects an array of objects, causing Zod to throw:This PR updates the schema to accept either a string or a full
GitLabLabelSchema
object:No runtime logic changes are required—the fix is limited to the schema definition.
Server Details
src/gitlab/index.ts
(schema definition only)Motivation and Context
The mismatch between GitLab’s default response and our Zod schema breaks
create_issue
, surfacing as an MCP-32603
error for any client supplyinglabels
.Aligning the schema with the real API removes this blocker for downstream tooling (e.g., AI agents that open issues with labels).
How Has This Been Tested?
create_issue
call with:include_labels_details=true
; full-object labels still parse successfully.Breaking Changes
None. The change is backward-compatible; it only relaxes validation.
Types of changes
Checklist
Additional context