Skip to main content
Glama

Get Commit

get_commit
Read-onlyIdempotent

Fetch commit metadata, author details, message, and unified git diffs for a specific commit SHA or reference. Output is token-optimized and truncated to conserve context.

Instructions

Get detailed commit metadata, author information, message, and unified git diffs for a specific commit SHA or reference. Eager daily driver tool for reviewing code modifications, patches, or investigating regressions. Output diffs are token-optimized and automatically truncated to max_diff_lines (default: 400 lines).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refYesCommit SHA, branch name, or tag reference to inspect
repoYesRepository name (e.g. 'Hello-World' or 'mcp-github')
ownerYesRepository owner (user or organization, e.g. 'octocat' or 'buggycode')
file_pathNoOptional file path filter: only include diff and stats for this single file
max_diff_linesYesMaximum unified diff lines to return across files to conserve LLM context tokens (default: 400)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, and non-destructive behavior, so the safety profile is covered. The description adds genuinely useful context beyond that: diffs are token-optimized and automatically truncated to max_diff_lines (default 400). It stops short of saying whether truncation is signaled in the output, which is the one open behavioral question.

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?

Three sentences, no redundancy, and the core capability is front-loaded ahead of the usage hint and the truncation caveat. Every sentence carries distinct information.

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 carries the return-value burden and does so (metadata, author, message, diffs). Annotations cover safety. The remaining gap is behavior under truncation for very large commits, but nothing essential for correct invocation is missing.

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; the description earns an extra point by explaining the intent behind max_diff_lines (context-token conservation) and reinforcing that ref accepts SHA, branch, or tag. It doesn't describe the optional file_path filter, but the schema covers that fully.

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 and resource ('Get detailed commit metadata... and unified git diffs') scoped by 'a specific commit SHA or reference'. This clearly separates it from siblings like get_file_contents and get_repository, which target files and repositories rather than a commit ref.

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?

Gives clear usage context ('reviewing code modifications, patches, or investigating regressions'), which tells the agent when this tool is appropriate. However, it names no alternatives or when-not conditions, so routing versus siblings such as get_file_contents is left to inference.

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