Skip to main content
Glama

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
NameRequiredDescriptionDefault
project_idNoProject ID or complete URL-encoded path to project
shaYesThe commit hash or name of a repository branch or tag
statsNoInclude commit stats

Implementation Reference

  • 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"),
    });
  • 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
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves commit details but doesn't mention what those details include, whether it's a read-only operation, potential error conditions, or authentication requirements. This leaves significant gaps for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It's appropriately sized for a straightforward retrieval tool and front-loaded with the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is minimally adequate but has clear gaps. It identifies the tool's purpose but lacks behavioral context, usage guidance, and output details, making it incomplete for fully informed use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description doesn't add any meaning beyond what's in the schema (e.g., it doesn't clarify parameter interactions or provide examples), which aligns with the baseline score of 3 when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('details of a specific commit'), making it immediately understandable. However, it doesn't differentiate from sibling tools like 'list_commits' or 'get_commit_diff', which would require explicit comparison to earn a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'list_commits' and 'get_commit_diff' available, there's no indication of whether this is for single-commit retrieval versus bulk operations or diff-focused queries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zereight/gitlab-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server