gitlab_get_branch_details
Retrieve detailed information about a specific branch in a GitLab project, including commit history and metadata, for integration with Jira workflows.
Instructions
Gets detailed information about a specific branch.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | The path of the GitLab project. | |
| branchName | Yes | The name of the branch. |
Implementation Reference
- src/gitlab.service.ts:636-642 (handler)The core handler function that calls the GitLab API to retrieve details for a specific branch in a project.async getBranchDetails(projectPath: string, branchName: string): Promise<any> { const encodedProjectPath = encodeURIComponent(projectPath); const encodedBranchName = encodeURIComponent(branchName); return this.callGitLabApi<any>( `projects/${encodedProjectPath}/repository/branches/${encodedBranchName}`, ); }
- src/index.ts:1937-1951 (registration)The registration and dispatch handler in the MCP server that calls the GitLabService.getBranchDetails method.case 'gitlab_get_branch_details': { if (!gitlabService) { throw new Error('GitLab service is not initialized.'); } const { projectPath, branchName } = args as { projectPath: string; branchName: string }; const result = await gitlabService.getBranchDetails(projectPath, branchName); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:809-826 (schema)The tool definition including name, description, and input schema for validation.{ name: 'gitlab_get_branch_details', description: 'Gets detailed information about a specific branch.', inputSchema: { type: 'object', properties: { projectPath: { type: 'string', description: 'The path of the GitLab project.', }, branchName: { type: 'string', description: 'The name of the branch.', }, }, required: ['projectPath', 'branchName'], }, },