Skip to main content
Glama

get_commit_diff

Read-only

Retrieve the changes and diffs for a known commit using its SHA and project ID. View file modifications, optionally including the full diff, to review exactly what was altered.

Instructions

Get changes/diffs of a specific commit. Use this for a known resource or result; choose the corresponding list or search tool when you need to discover multiple resources. It is read-only and does not mutate GitLab data; missing resources, invalid identifiers, insufficient permission, and rate limits are returned as errors. When project_id or group_id is accepted, provide the numeric ID or complete URL-encoded path described by the schema; use required identifiers and pagination fields exactly as documented.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
shaYesThe commit hash or name of a repository branch or tag
full_diffNoWhether to return the full diff or only first page (default: false)
project_idYesProject ID or complete URL-encoded path to project
Install Server

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses error behavior: 'missing resources, invalid identifiers, insufficient permission, and rate limits are returned as errors.' It also reaffirms read-only status and adds context about pagination fields. This goes beyond the annotation by specifying failure modes, which is valuable for an agent.

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 compact: a purpose statement, a usage guideline, a behavioral/error note, and a parameter format note. It is front-loaded with the core action and no unnecessary fluff. Each sentence earns its place, though the group_id reference could be seen as extraneous, it doesn't bloat length.

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

Completeness4/5

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

For a read-only getter with no output schema, the description covers purpose, usage, error conditions, and parameter format. It doesn't describe the return shape, but that's not required when no output schema exists. The mention of pagination fields implies some control over result size. The group_id off-schema reference is a minor completeness gap, but overall it's sufficient.

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 parameters. The description adds a note about providing 'numeric ID or complete URL-encoded path' for project_id, which reinforces schema but adds little new meaning. It also mentions group_id, which is not in this schema, potentially confusing. Overall, marginal value beyond schema.

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

Purpose5/5

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

The description clearly states the tool's function: 'Get changes/diffs of a specific commit.' It uses a specific verb and resource, and differentiates from discovery tools by saying to use list/search tools for multiple resources. This distinguishes it from siblings like list_commits or get_branch_diffs.

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

Usage Guidelines5/5

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

Explicitly and concisely directs usage: 'Use this for a known resource or result; choose the corresponding list or search tool when you need to discover multiple resources.' This provides clear when-to-use and when-not-to-use guidance, though it doesn't name specific sibling tools, the principle is unambiguous.

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

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