Skip to main content
Glama
martinsky999

MCP Git Server

by martinsky999

git_show

Display commit contents to review changes and metadata in Git repositories. Use this tool to examine specific revisions and understand modifications made.

Instructions

Shows the contents of a commit

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYes
revisionYes

Implementation Reference

  • The handler function implementing git_show tool logic: displays commit details (hash, author, date, message) and the diff against parent or from empty tree.
    def git_show(repo: git.Repo, revision: str) -> str:
        commit = repo.commit(revision)
        output = [
            f"Commit: {commit.hexsha}\n"
            f"Author: {commit.author}\n"
            f"Date: {commit.authored_datetime}\n"
            f"Message: {commit.message}\n"
        ]
        if commit.parents:
            parent = commit.parents[0]
            diff = parent.diff(commit, create_patch=True)
        else:
            diff = commit.diff(git.NULL_TREE, create_patch=True)
        for d in diff:
            output.append(f"\n--- {d.a_path}\n+++ {d.b_path}\n")
            output.append(d.diff.decode('utf-8'))
        return "".join(output)
  • Pydantic BaseModel defining the input schema for the git_show tool, requiring repo_path and revision.
    class GitShow(BaseModel):
        repo_path: str
        revision: str
  • Registration of the git_show tool (via GitTools.SHOW == 'git_show') in the list_tools handler, including schema.
    Tool(
        name=GitTools.SHOW,
        description="Shows the contents of a commit",
        inputSchema=GitShow.schema(),
    ),
  • Dispatch/calling logic in call_tool handler that invokes the git_show function with repo and revision argument.
    case GitTools.SHOW:
        result = git_show(repo, arguments["revision"])
        return [TextContent(
            type="text",
            text=result
        )]
  • Enum value in GitTools defining the tool name 'git_show' used in registration and dispatch.
    SHOW = "git_show"
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Shows' implies a read-only operation, but the description doesn't specify what exactly gets shown (full commit metadata, diff output, raw file contents), whether there are formatting options, or if there are any limitations (like large commits causing performance issues). It provides minimal behavioral context beyond the basic action.

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 extremely concise at just 5 words, with zero wasted language. It's front-loaded with the core functionality and contains no unnecessary elaboration. For a simple tool, this level of brevity is appropriate and efficient.

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?

Given 2 parameters with 0% schema coverage, no annotations, no output schema, and multiple similar sibling tools, the description is insufficiently complete. It doesn't explain what the tool returns (commit message, author, timestamp, diff, or raw content), how to interpret results, or how it differs from other git viewing tools. The minimal description leaves too many gaps for effective tool selection and use.

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

Parameters2/5

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

With 0% schema description coverage and 2 required parameters, the description adds no parameter information beyond what the schema provides. It doesn't explain what 'repo_path' should contain (absolute path, relative path, repository name) or what format 'revision' accepts (commit hash, branch name, tag). The description fails to compensate for the complete lack of schema documentation.

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 'Shows the contents of a commit' clearly states the tool's function with a specific verb ('shows') and resource ('contents of a commit'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like git_log (which shows commit history) or git_diff (which shows differences), leaving some ambiguity about when to use this specific tool versus alternatives.

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?

The description provides no guidance on when to use this tool versus alternatives. With siblings like git_log, git_diff, and git_status that also display git information, there's no indication whether this tool is for viewing raw commit data, file changes, or metadata. No context about prerequisites or typical use cases is mentioned.

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

Install Server

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/martinsky999/mcp-git-py'

If you have feedback or need assistance with the MCP directory API, please join our Discord server