get_commit
Retrieve detailed information about a specific GitLab commit, including its hash, project details, and optional statistics for tracking changes.
Instructions
Get details of a specific commit
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | No | Project ID or complete URL-encoded path to project | |
| sha | Yes | The commit hash or name of a repository branch or tag | |
| stats | No | Include commit stats |
Implementation Reference
- schemas.ts:1847-1852 (schema)Input schema for the get_commit tool, defining parameters project_id, sha, and optional stats.export const GetCommitSchema = z.object({ project_id: z.coerce.string().describe("Project ID or complete URL-encoded path to project"), sha: z.string().describe("The commit hash or name of a repository branch or tag"), stats: z.boolean().optional().describe("Include commit stats"), });
- schemas.ts:538-561 (schema)Output schema for commit data returned by the get_commit tool.export const GitLabCommitSchema = z.object({ id: z.string(), // Changed from sha to match GitLab API short_id: z.string(), // Added to match GitLab API title: z.string(), // Changed from message to match GitLab API author_name: z.string(), author_email: z.string(), authored_date: z.string(), committer_name: z.string(), committer_email: z.string(), committed_date: z.string(), created_at: z.string().optional(), // Add created_at field message: z.string().optional(), // Add full message field web_url: z.string(), // Changed from html_url to match GitLab API parent_ids: z.array(z.string()), // Changed from parents to match GitLab API stats: z .object({ additions: z.number().optional().nullable(), deletions: z.number().optional().nullable(), total: z.number().optional().nullable(), }) .optional(), // Only present when with_stats=true trailers: z.record(z.string()).optional().default({}), // Git trailers, may be empty object extended_trailers: z.record(z.array(z.string())).optional().default({}), // Extended trailers, may be empty object });