Skip to main content
Glama

get_commit

Read-only

Retrieve details for a specific GitLab commit using its project ID and commit hash or branch/tag name. Include commit stats or filter JSON with JMESPath.

Instructions

Get details of a specific commit. To find resources, use the matching list or search tool. Read-only; missing resources, denied access, and rate limits return errors. project_id/group_id take a numeric ID or URL-encoded path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
shaYesThe commit hash or name of a repository branch or tag
statsNoInclude commit stats
jmespathNoOptional JMESPath expression filtering the JSON result before return.
project_idYesProject ID or complete URL-encoded path to project

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.1.66
    • addedInput schema / properties / jmespath
      Added value: +{
      +  "description": "Optional JMESPath expression filtering the JSON result before return.",
      +  "type": "string"
      +}
  2. Changed1 schema field changedv2.1.62
    • changedInput schema / required
      Previous value: -[
      -  "sha",
      -  "project_id"
      -]New value: +[
      +  "project_id",
      +  "sha"
      +]
  3. Addedv2.1.45
  4. Removedv2.1.43
  5. Addedv2.1.18
  6. Removedv2.1.14
  7. Addedv2.1.11
  8. Removedv2.1.10
  9. Changed2 schema fields changedv2.1.9
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / required
      Previous value: -[
      -  "sha"
      -]New value: +[
      +  "sha",
      +  "project_id"
      +]
  10. First observedv1.0.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint, and the description reinforces read-only while adding genuinely new context: missing resources, denied access, and rate limits surface as errors. That error-surface disclosure is useful behavioral detail beyond the annotations.

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

Conciseness4/5

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

Three short, front-loaded sentences; the core purpose leads and the routing and error notes follow. The closing project_id/group_id sentence carries a stray group_id mention that doesn't apply here.

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?

There is no output schema, so the description carries the burden of explaining what 'details' contains, yet it never sketches the returned commit fields despite having stats and jmespath parameters that shape the payload. Safety and routing context is complete; return-value context is thin.

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 each of the four parameters is already documented. The added note that project_id takes a numeric ID or URL-encoded path largely restates the schema entry, and it even references 'group_id', which is not a parameter of this tool.

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?

States a specific verb and resource: 'Get details of a specific commit.' An agent can distinguish it from get_commit_diff and list_commits by the singular resource and detail framing, though it never names those siblings explicitly.

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

Usage Guidelines4/5

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

'To find resources, use the matching list or search tool' gives clear routing guidance toward list_commits/search_repositories. It stops short of naming the exact sibling or stating when this tool is the wrong choice.

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