mark_mr_as_ready
Change a GitLab merge request from draft to ready for review by removing its draft status.
Instructions
Mark a merge request as ready (remove draft status, ready for review)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Project ID or path | |
| merge_request_iid | Yes | Merge request internal ID |
Implementation Reference
- src/handlers/merge-requests.ts:622-667 (handler)The main handler function that implements the mark_mr_as_ready tool logic: fetches the MR, checks for draft/WIP prefix in title, removes it if present by updating the MR title, or returns a message if already ready.async markMRAsReady(args: MarkMRAsReadyParams) { // First get the current MR to check its title const mr = (await this.client.get( `/projects/${encodeURIComponent(args.project_id)}/merge_requests/${ args.merge_request_iid }` )) as GitLabMergeRequest; // Check if it's a draft and remove the prefix let newTitle = mr.title; if (mr.title.startsWith("Draft: ")) { newTitle = mr.title.replace(/^Draft: /, ""); } else if (mr.title.startsWith("WIP: ")) { newTitle = mr.title.replace(/^WIP: /, ""); } else { return { content: [ { type: "text", text: JSON.stringify( { message: "Merge request is already marked as ready", ...mr }, null, 2 ), }, ], }; } // Update the title to remove the draft prefix const data = await this.client.put( `/projects/${encodeURIComponent(args.project_id)}/merge_requests/${ args.merge_request_iid }`, { title: newTitle } ); return { content: [ { type: "text", text: JSON.stringify(data, null, 2), }, ], }; }
- src/tools/merge-requests.ts:641-658 (registration)Tool registration definition including name, description, and input schema for the MCP listTools response.name: 'mark_mr_as_ready', description: 'Mark a merge request as ready (remove draft status, ready for review)', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, merge_request_iid: { type: 'number', description: 'Merge request internal ID', }, }, required: ['project_id', 'merge_request_iid'], }, },
- src/types.ts:548-551 (schema)TypeScript interface defining the input parameters for the markMRAsReady handler.export interface MarkMRAsReadyParams { project_id: string; merge_request_iid: number; }
- src/server.ts:251-254 (registration)Dispatch case in the main server tool call handler that routes the tool invocation to the merge request handler.case "mark_mr_as_ready": return await this.mergeRequestHandlers.markMRAsReady( args as unknown as MarkMRAsReadyParams );