forked from zereight/gitlab-mcp
-
Notifications
You must be signed in to change notification settings - Fork 1
fix: apply_suggestion uses wrong API endpoint causing 404 errors #115
Copy link
Copy link
Description
Problem
When using apply_suggestion or apply_suggestions actions in manage_mr_discussion tool, GitLab returns 404 errors even when the suggestion exists.
Error example:
{
"error_code": "NOT_FOUND",
"tool": "manage_mr_discussion",
"action": "apply_suggestion",
"http_status": 404,
"message": "Resource not found or you don't have access to it"
}Root Cause
We were using incorrect nested endpoints:
PUT /projects/:id/merge_requests/:iid/suggestions/:sid/applyPUT /projects/:id/merge_requests/:iid/suggestions/batch_apply
But GitLab Suggestions API uses global endpoints:
PUT /suggestions/:id/applyPUT /suggestions/batch_apply
Suggestion IDs are globally unique and don't require project/MR context in the URL.
Solution
Update the handler in src/entities/mrs/registry.ts to use the correct global endpoints.
References
- GitLab Suggestions API Documentation
- Reference implementation: gitlab-review-mcp
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels