list_mr_templates
Retrieve available merge request description templates for a GitLab project to standardize documentation and streamline code review processes.
Instructions
List available merge request description templates in a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Project ID or path |
Implementation Reference
- src/handlers/merge-requests.ts:669-684 (handler)The core handler function that executes the list_mr_templates tool logic by fetching merge request templates from the GitLab API endpoint `/projects/{project_id}/templates/merge_requests` and returning a formatted MCP response with the JSON-stringified data.async listMRTemplates(args: ListMRTemplatesParams) { const data = await this.client.get( `/projects/${encodeURIComponent( args.project_id )}/templates/merge_requests` ); return { content: [ { type: "text", text: JSON.stringify(data, null, 2), }, ], }; }
- src/server.ts:255-258 (registration)Dispatches tool calls for 'list_mr_templates' to the corresponding handler method in the main server switch statement.case "list_mr_templates": return await this.mergeRequestHandlers.listMRTemplates( args as unknown as ListMRTemplatesParams );
- src/tools/merge-requests.ts:660-673 (schema)Defines the MCP tool metadata including name, description, and JSON input schema for 'list_mr_templates', part of the tools export array.name: 'list_mr_templates', description: 'List available merge request description templates in a project', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, }, required: ['project_id'], }, },
- src/types.ts:553-555 (schema)TypeScript type definition for the input parameters of the list_mr_templates handler.export interface ListMRTemplatesParams { project_id: string; }