Skip to main content
Glama

get_git_log_all_repos

Retrieve git commits from multiple repositories to track coding contributions for resume building, with time-based filtering options.

Instructions

Get git commits from all configured repositories, grouped by repo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sinceNoTime range for commits6 months ago

Implementation Reference

  • The main handler function that implements the get_git_log_all_repos tool. It iterates over all configured repositories, runs git log for the author since the specified time, groups the output by repository, counts commits, and returns formatted TextContent.
    async def get_git_log_all_repos(since: str) -> list[TextContent]:
        """Get git commits from all configured repositories."""
        if not REPO_DICT:
            return [TextContent(type="text", text="No repositories configured")]
        
        all_output = f"Git commits from all repositories ({since}):\n\n"
        all_output += "="*60 + "\n\n"
        
        total_commits = 0
        
        for repo_name, repo_path in REPO_DICT.items():
            try:
                cmd = [
                    "git", "log",
                    f"--author={AUTHOR_NAME}",
                    "--no-merges",
                    f"--since={since}",
                    "--pretty=format:%h - %s (%cr)"
                ]
                
                result = subprocess.run(
                    cmd,
                    cwd=repo_path,
                    capture_output=True,
                    text=True,
                    check=True
                )
                
                output = result.stdout.strip()
                commit_count = len(output.split('\n')) if output else 0
                total_commits += commit_count
                
                all_output += f"## {repo_name}\n"
                all_output += f"Path: {repo_path}\n"
                all_output += f"Commits: {commit_count}\n\n"
                
                if output:
                    all_output += output + "\n\n"
                else:
                    all_output += "No commits found\n\n"
                
                all_output += "-"*60 + "\n\n"
            
            except subprocess.CalledProcessError as e:
                all_output += f"## {repo_name}\n"
                all_output += f"Error: {e.stderr}\n\n"
                all_output += "-"*60 + "\n\n"
        
        all_output += f"Total commits across all repositories: {total_commits}"
        
        return [TextContent(type="text", text=all_output)]
  • Registers the get_git_log_all_repos tool in the MCP server's list_tools() function, including its name, description, and input schema.
    Tool(
        name="get_git_log_all_repos",
        description="Get git commits from all configured repositories, grouped by repo",
        inputSchema={
            "type": "object",
            "properties": {
                "since": {
                    "type": "string",
                    "description": "Time range for commits",
                    "default": "6 months ago"
                }
            }
        }
    ),
  • Dispatch logic in the call_tool handler that routes calls to the get_git_log_all_repos function.
    elif name == "get_git_log_all_repos":
        return await get_git_log_all_repos(arguments.get("since", "6 months ago"))
Behavior2/5

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

With no annotations, the description carries full burden but only states the basic action and grouping. It lacks critical behavioral details: whether this is a read-only operation, if it requires authentication, how it handles errors (e.g., unconfigured repos), rate limits, or output format (e.g., JSON structure). This is inadequate for a tool that likely queries multiple sources.

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 ('Get git commits') and adds necessary context ('from all configured repositories, grouped by repo'). There is no wasted wording, 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 the complexity of fetching data from multiple repositories and the lack of annotations and output schema, the description is insufficient. It doesn't explain what 'configured repositories' means, the output structure, error handling, or dependencies, leaving significant gaps for the agent to operate effectively.

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 schema description coverage is 100%, with the single parameter 'since' documented in the schema. The description adds no parameter-specific information beyond implying grouping by repo, which doesn't directly relate to the input parameter. This meets the baseline of 3 since the schema handles the parameter 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 clearly states the action ('Get git commits') and scope ('from all configured repositories, grouped by repo'), which is specific and distinguishes it from siblings like 'get_git_log' (likely single repo) and 'get_git_log_by_repo' (potentially different grouping). However, it doesn't explicitly contrast with all siblings (e.g., 'analyze_commits_impact'), keeping it from a perfect score.

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. It doesn't mention prerequisites (e.g., configured repositories), exclusions, or compare it to siblings like 'get_git_log' or 'list_repos', leaving the agent to infer usage from the name alone.

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