Skip to main content
Glama

get_git_log

Retrieve recent Git commits by author to extract project contributions for CV/resume building, excluding merge commits.

Instructions

Get latest git commits by author from default repo (excludes merge commits)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sinceNoTime range for commits6 months ago

Implementation Reference

  • The handler function that runs 'git log' on the default repository for the specified author, excluding merges, since the given time, formats the output, and returns it as TextContent.
    async def get_git_log(since: str) -> list[TextContent]:
        """Get git commits by author from first/default repo."""
        # Get first repo (usually 'default' or first configured)
        if not REPO_DICT:
            return [TextContent(type="text", text="No repositories configured")]
        
        first_repo_name = list(REPO_DICT.keys())[0]
        first_repo_path = REPO_DICT[first_repo_name]
        
        try:
            cmd = [
                "git", "log",
                f"--author={AUTHOR_NAME}",
                "--no-merges",
                f"--since={since}",
                "--pretty=format:%h - %s (%cr)"
            ]
            
            result = subprocess.run(
                cmd,
                cwd=first_repo_path,
                capture_output=True,
                text=True,
                check=True
            )
            
            output = result.stdout.strip()
            repo_label = f"'{first_repo_name}'" if first_repo_name != "default" else "default repo"
            return [TextContent(
                type="text",
                text=f"Git commits from {repo_label}:\n\n{output if output else 'No commits found'}"
            )]
        
        except subprocess.CalledProcessError as e:
            return [TextContent(type="text", text=f"Git error: {e.stderr}")]
  • Registers the get_git_log tool with the MCP server in the list_tools handler, including name, description, and input schema.
    Tool(
        name="get_git_log",
        description="Get latest git commits by author from default repo (excludes merge commits)",
        inputSchema={
            "type": "object",
            "properties": {
                "since": {
                    "type": "string",
                    "description": "Time range for commits",
                    "default": "6 months ago"
                }
            }
        }
    ),
  • Input schema defining the 'since' parameter as a string with default '6 months ago'.
    inputSchema={
        "type": "object",
        "properties": {
            "since": {
                "type": "string",
                "description": "Time range for commits",
                "default": "6 months ago"
            }
        }
  • Dispatch logic in call_tool that invokes the get_git_log handler with the 'since' argument.
    if name == "get_git_log":
        return await get_git_log(arguments.get("since", "6 months ago"))
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that commits are filtered by author and excludes merge commits, which adds some context beyond basic functionality. However, it lacks details on permissions, rate limits, output format, or error handling, leaving significant gaps for a tool with no annotation coverage.

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 a single, efficient sentence that front-loads the core purpose and includes key constraints. Every word earns its place with no redundancy or wasted space, making it highly concise and well-structured.

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 no annotations, no output schema, and a simple parameter schema, the description is incomplete. It covers basic functionality but lacks crucial details like return format, error cases, or behavioral traits (e.g., pagination, auth needs). For a tool with zero structured coverage beyond inputs, this is inadequate, scoring 2.

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?

The input schema has 1 parameter with 100% description coverage, providing a baseline of 3. The tool description does not add any additional meaning or details about the 'since' parameter beyond what the schema already states, so it meets but does not exceed the minimum viable level.

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 clearly states the tool's function with a specific verb ('Get') and resource ('latest git commits'), specifying scope ('by author from default repo') and exclusions ('excludes merge commits'). It distinguishes from some siblings like 'get_git_log_all_repos' by focusing on a default repo, but doesn't explicitly differentiate from 'get_git_log_by_repo' or 'get_commit_details', keeping it at 4 instead of 5.

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

Usage Guidelines3/5

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

The description implies usage for retrieving commits filtered by author and excluding merges, but provides no explicit guidance on when to use this tool versus alternatives like 'get_git_log_all_repos' or 'get_git_log_by_repo'. It mentions 'default repo' which hints at context, but lacks clear when/when-not statements or named alternatives, resulting in a score of 3 for implied usage.

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/eyaab/cv-resume-builder-mcp'

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