Skip to main content
Glama
abhishekbhakat

mcp-server-code-assist

git_show

Display git commit details including changes and metadata for specific revisions in a repository to review code history and modifications.

Instructions

Shows git commit details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYes
revisionYes

Implementation Reference

  • Core handler function that executes the git show command using the gitpython library, taking repo_path and revision as inputs.
    async def show(self, repo_path: str, revision: str | None = None, format_str: str | None = None) -> str:
        """Show various types of git objects.
    
        Args:
            repo_path: Path to git repository
            revision: Object to show (commit hash, tag, tree, etc.). Defaults to HEAD
            format_str: Optional format string for pretty-printing (e.g. 'oneline', 'short', 'medium', etc.)
    
        Returns:
            String output of git show command
        """
        repo = git.Repo(repo_path)
        args = []
        if format_str:
            args.extend([f"--format={format_str}"])
        if revision:
            args.append(revision)
        return repo.git.show(*args)
  • Pydantic BaseModel defining the input schema for the git_show tool, with repo_path and revision fields.
    class GitShow(BaseModel):
        repo_path: str
        revision: str
  • MCP tool registration in list_tools(), specifying name, description, and input schema for git_show.
    Tool(
        name=CodeAssistTools.GIT_SHOW,
        description="Shows git commit details",
        inputSchema=GitShow.model_json_schema(),
    ),
  • MCP server call_tool handler case that parses arguments, instantiates the GitShow model, and delegates to GitTools.show().
    case CodeAssistTools.GIT_SHOW:
        model = GitShow(repo_path=arguments["repo_path"], revision=arguments["commit"])
        result = await git_tools.show(model.repo_path, model.revision)
        return [TextContent(type="text", text=result)]
  • Enum definition for the git_show tool name in CodeAssistTools.
    GIT_SHOW = "git_show"

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/abhishekbhakat/mcp_server_code_assist'

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