Skip to main content
Glama

Get Commit Diff

gitlab_get_commit_diff
Read-onlyIdempotent

Retrieve a GitLab commit's diff by SHA, with optional project scoping and controls for pagination or full diff output.

Instructions

Get diff for one commit.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sha": "<sha>"
    },
    "name": "gitlab_get_commit_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
shaYes
pageNo
per_pageNo
full_diffNo
project_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.7.0
    • removedInput schema / properties / full_diff / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / full_diff / type
      Added value: +[
      +  "boolean",
      +  "null"
      +]
    • removedInput schema / properties / page / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / page / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedInput schema / properties / per_page / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / per_page / type
      Added value: +[
      +  "number",
      +  "null"
      +]
  2. First observedv1.6.1

TDQS

C2.4/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=true, so the safety profile is covered elsewhere. The description adds nothing beyond that — no note on pagination behavior, large-diff truncation, or how full_diff changes the response shape, which are the meaningful behavioral questions for this tool.

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

Conciseness3/5

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

The single sentence is front-loaded and free of filler, which is good, but its brevity here reflects under-specification rather than discipline. There is room for a short second sentence on pagination or full_diff without bloat.

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

Completeness2/5

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

With five parameters, no output schema, and zero schema description coverage, the description needed to carry substantial weight and does not. An agent knows only that it gets a diff for a commit, not how to paginate, how to scope by project, or what full_diff does.

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

Parameters1/5

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

Schema description coverage is 0% across five parameters, and the description only implicitly ties "one commit" to the required sha. It says nothing about page, per_page, full_diff, or project_id — notably leaving full_diff, which materially changes the output, completely unexplained.

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 names a specific verb ("Get diff") and a specific resource ("one commit"), so an agent can tell this returns patch content for a single commit rather than commit metadata. It does not explicitly distinguish itself from nearby tools like gitlab_get_commit or gitlab_get_merge_request_diffs, so it stops short of 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?

There is no guidance on when to use this versus gitlab_get_commit (metadata) or the merge-request diff variants, and no stated prerequisites such as needing the commit SHA to be reachable from a branch. The only implied context is that a commit exists.

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

Deploy Server

Other Tools