get_mr_template
Retrieve a specific merge request description template from a GitLab project to standardize documentation and streamline code review processes.
Instructions
Get a specific merge request description template by name
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Project ID or path | |
| name | Yes | Template name (without .md extension) |
Implementation Reference
- src/handlers/merge-requests.ts:686-701 (handler)The core handler function for the get_mr_template tool. It fetches the specified merge request template from the GitLab project using the API endpoint `/projects/{project_id}/templates/merge_requests/{name}` and returns the content as a JSON-formatted text response in MCP format.async getMRTemplate(args: GetMRTemplateParams) { const data = await this.client.get( `/projects/${encodeURIComponent( args.project_id )}/templates/merge_requests/${encodeURIComponent(args.name)}` ); return { content: [ { type: "text", text: JSON.stringify(data, null, 2), }, ], }; }
- src/types.ts:557-560 (schema)TypeScript interface defining the input parameters for the get_mr_template handler: project_id (string) and name (string).export interface GetMRTemplateParams { project_id: string; name: string; }
- src/tools/merge-requests.ts:675-691 (registration)MCP tool registration defining the name, description, and JSON Schema for input validation of the get_mr_template tool.name: 'get_mr_template', description: 'Get a specific merge request description template by name', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, name: { type: 'string', description: 'Template name (without .md extension)', }, }, required: ['project_id', 'name'], }, },
- src/server.ts:259-262 (registration)Dispatch logic in the main MCP server switch statement that routes tool calls named 'get_mr_template' to the MergeRequestHandlers.getMRTemplate method.case "get_mr_template": return await this.mergeRequestHandlers.getMRTemplate( args as unknown as GetMRTemplateParams );