Skip to main content
Glama
igordev96
by igordev96

Read one commit

get_commit
Read-only

Read one GitLab commit: its sha, parents, author and committer dates, full message, and the changed files with git status letters and line counts. Optionally append the unified diff.

Instructions

Read one commit — its sha, parents, author and committer with dates, and full message — then the files it changed with git's status letter (A, M, D, R091 old -> new) and their line counts, or binary. rev accepts a full or abbreviated sha, or a branch or tag. patch: true appends the unified diff, capped by max_bytes. A merge commit reports merge="true" and no file list, because git shows no diff for a merge by default: compare a parent with the commit to see what it brought in. The result states the commit it resolved rev to and synced_at. Give either url — a GitLab /-/commit/<sha> link — or rev; the link's host must be GITLAB_HOST.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
revNoThe commit to read: a full or abbreviated sha, or a branch or tag name that resolves to one. Required unless `url` is given.
urlNoA GitLab commit link, e.g. 'https://gitlab.example.com/group/repo/-/commit/8297d0da'. Replaces rev; the host must be GITLAB_HOST.
patchNoAppend the commit's unified diff. Default false: metadata and the file list only.
projectNoGitLab project path, e.g. 'group/subgroup/repo'. Defaults to GITLAB_DEFAULT_PROJECT.
max_bytesNoByte cap for the patch when `patch` is set (default 200000). A cut patch is marked in the result.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.10.1

TDQS

A4.3/5.0
Behavior4/5

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

Annotations only declare readOnlyHint and openWorldHint, so the description adds real behavioral context: merge commits report merge="true" with no file list, patches are capped and marked when cut, and the result states the resolved commit and synced_at. No contradictions with the read-only annotation.

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?

Dense but front-loaded, leading with what the commit read returns before the parameter guidance and merge caveat. Every sentence carries information, though the run-on style packs several distinct ideas into long clauses.

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?

With no output schema, the description correctly carries the burden of describing the return shape (commit metadata, file list with status letters, merge marker, synced_at). It is nearly complete for the tool's complexity, with only minor gaps such as pagination or error behavior.

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

Parameters4/5

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

Schema coverage is 100% so the baseline is 3, but the description still adds meaning beyond the schema: rev accepts full/abbreviated sha or branch/tag, url must have a GITLAB_HOST host, and patch appends a unified diff capped by max_bytes with cut patches flagged.

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?

States a specific verb (read) and resource (one commit) and enumerates exactly what is returned: sha, parents, author/committer with dates, message, and changed files with status letters and line counts. This clearly differentiates it from list-oriented siblings like log and list_tree.

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?

Explains the url-vs-rev choice ("Give either `url` ... or `rev`") and points to the alternative for merges ("compare a parent with the commit to see what it brought in"). It names the sibling compare implicitly but does not spell out general when-not-to-use cases beyond merges.

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