forked from zereight/gitlab-mcp
-
Notifications
You must be signed in to change notification settings - Fork 1
Array query params serialized as comma-separated string instead of key[] format #261
Copy link
Copy link
Closed
Labels
Description
Bug
buildQueryString() in src/utils/gitlab-api.ts calls String(value) on array parameters, converting ["failed", "success"] to the string "failed,success". GitLab Rails API expects scope[]=failed&scope[]=success.
Impact
Any tool passing array query params to REST API gets 400 Bad Request. Affected:
browse_pipelinesjobs action (job_scope)browse_pipelinestriggers action (trigger_scope)browse_membersactions (user_ids)browse_merge_requestslist action (approved_by_ids)- Any other array params passed through
toQuery()->buildQueryString()
Reproduction
browse_pipelines(action: "jobs", project_id: "123", pipeline_id: "456", job_scope: ["created","pending","running","failed","success","canceled","skipped"])
Returns: 400 Bad Request - scope does not have a valid value
Root Cause
registry.ts:queryOptions.scope = job_scope(array)toQuery(): passes array through unchangedbuildQueryString():String(["failed","success"])->"failed,success"- URL:
?scope=failed%2Csuccess(invalid)
Fix
buildQueryString()handles arrays viasearchParams.append(key[], item)(Rails convention)toQuery()return type updated to preserve arrays
Reactions are currently unavailable